Posts

Showing posts from February, 2013

c# - Key value pair as a param in a console app -

is there easy way allow collection of key/value pairs (both strings) command line parameters console app? if mean having commandline looking this: c:> yourprogram.exe /switch1:value1 /switch2:value2 ... this can parsed on startup looking this: private static void main(string[] args) { regex cmdregex = new regex(@"/(?<name>.+?):(?<val>.+)"); dictionary<string, string> cmdargs = new dictionary<string, string>(); foreach (string s in args) { match m = cmdregex.match(s); if (m.success) { cmdargs.add(m.groups[1].value, m.groups[2].value); } } } you can lookups in cmdargs dictionary. not sure if that's want though. //daniel

git - Workflow strategies for mitigating merge conflicts from topic branches -

i'm right on cusp of selling git higher-ups. they're listening talk it, anyway. there's 1 thing i'm unsure of, , i'd see how people deal this. question comes fundamental understanding further apart pair of branches allowed get, harder merge. i'm considering proposing simple workflow: have master (release) branch, development branch, , topic branches off of that. different developers working on separate topic branches, pulling , pushing topic branches central repo feel have working code. periodically, when asked developer, maintainer (in our organization person has title "technical lead") merges feature branch development branch, that's put on staging server , tested, , once feature test complete, it's merged master , pushed production. here's question. should devs merge topic branches periodically? doing ensure they'll merge dev cleanly (or @ least catches conflicts before can out of hand). thing know manager going dislike is, t

GIT XCODE4 - Authentication Error -

i getting authentication error when tryinh conect remote repository. pretty sure username , password correct. error , xcode hangs. please let me know if have suggestions. thanks in config, can try mentioning username , password along url, if have not done already https://username:password@github.com/...

node.js - Has anyone implemented a git clone or interface library using nodejs? -

i'm looking implementation of git accessible nodejs - such beast exist? looks there several options using git node: gift: simple node.js wrapper git cli api based on grit ( npm / github ) node-git: node.js git implementation modeled on grit ( npm / github ) nodegit: libgit2 asynchronous native bindings ( npm / github ) node-git: thin wrapper around command-line git command ( github )

delphi - ESC/P programming! -

why need use because printers using tprinter prints weird hieroglyph @ beginning of printable area. my problem if send commands, nothing happens. esc e (#27 #69) - sending escape sequence didn't work expected. removed first letter , rest of string made bold. eg. hello -> ello . after changed esc e esc (#27 #69 #27), worked fine. example managed figure out, but... trying select character table "esc t n" (#27 #116 n), make "õäöü" work. command doesn't work. nothing happens! , command supported esc/p, esc/p 2 , 9-pin esc/p, should work fine. manual can found here . if has ever needed use esc/p commands maybe 1 can shed light how work them! thanks in advance! edit: in previous post asked more or less same question though answers how did send commands printer. (i'll change question there according answers!) i accepted ken's answer, because claimed way transferred commands wasn't best , got work escape command. problem after t

asp.net - DropDownList BackColor In IE -

how change dropdownlist backcolor in ie?in firefox paints correctly whole dropdown,but in ie there remains white color in border of dropdown you may try following tags: <html> <title>select test</title> <style type="text/css"> ..foo { background: black; color:white; } ..bar { background: transparent; color: red;} </style> <select style="background:yellow; color: red;"> <option style="background:green;color:white;">abelone</option> <option class="foo">banana</option> <option class="bar">cantaloupe</option> </select> </html>

javascript - authenticating users / socket io -

i'm new this, i'm building game users need log in , can interact each other, or subset of other logged in users. my initial thought after login add them/their websocket client id array of logged in users , have manipulate know logged in or not. is normal way go doing sort of thing? thanks! depends on definition of "normal". ;-) typically server use provide mechanism manage "user state" including whether or not user has logged application. for example, node's 'express' library (and 'connect' express uses 'underneath') provides req.session object purpose can things like: // user login via post // assumes we're posting 2 values: username , password // urlencoded data app.post('/login',function(req,res){ var username=req.body['username']||'', password=req.body['password']||''; // check post data (username,password) // against list of allowed users

data binding - WPF Markup Not Seeing Type in a Different Namespace -

i'm sure noob question wpf databinding experience, noob. apologies ahead of time: i'm trying bind collection of objects (ienumerable) listbox shown below. problem when logentry type in same namespace (activitylog) "codebehind", can see object's properties rendered in listbox. however; when logentry type in different namespace (activitylog.classes) nothing shows in listbox. i've tried adding activitylog.classes namespace in xaml markup (xmlns:local="clr-namespace:activitylog.classes"), i'm sure there's additional step i'm missing. please help. namespace activitylog { public partial class logpage : window { public logpage() { initializecomponent(); list<logentry> lelist = new list<logentry>() { new logentry() { startdate=datetime.parse("2011-05-10 9:58:00"), activitydescription="three" + environment.newline},

sql - Inserting Millions of Rows from another table -

faster way insert rows table select statement , insert into? insert partymain select [permid] ,[isoptout] ,[updatedon] ,[fk_datasource] partymain with 6m rows taking > 4 minutes insert via select fastest way can think of insert data. might able make improvements in app work flow, however. i imagine have sort of button in app kicks off process. instead of doing insert when user tells app (im making assumption), can have process runs every x seconds transfer? or alternatively check every x seconds , if number of rows transfer greater y, run transfer...so in other words, dont wait until there 6 million rows. edit- options might database triggers .

iOS app: how to -

i have ios app idea since first app, 1 of can give me advice. the app stores posts of different categories. want there tab bars @ bottom navigate between categories. on each category should table view. , each tableviewcell stores post. think cells should custom view give user options vote up/down. these posts should drawn online database. any ideas appreciated! if new ios , developing in cocoa, should go through tutorial or 2 begin with. here few ones: http://www.youtube.com/watch?v=tz9mzb2fwhs http://planet-iphones.com/2009/04/27/how-to-make-iphone-apps-tutorial-1/ http://appsamuck.com/ http://www.icodeblog.com/category/tutorials/

php - Alternating table row background colors on a dynamic table -

i have table generated foreach loop. before loop, create $iteration = 0 . @ beginning of loop increments $iteration . then this: if($iteration % 2 == 0) { $greyrow = 'css grey row'; } i've 3 rows, @ max, test with, seems greys 2nd , 3rd row under current rule, rather second. perhaps need have else statement set other color on odd rows. not quite sure without seeing more of implementation. if ($iteration % 2 == 0) { $css = 'css grey row'; } else { $css = 'css white row'; }

objective c - How to reinitialize the view -

i have 1 view nstab, @ tabindex0 have buttons here hiding buttons when pressed on each one. @ last button hiding button , go tabindex1. in tabindex1 have button called return.when press button want go tabindex0 , display buttons is.i.e want reinitialize tabindex0. there no direct way reinitialize view, unless dealing case can remove entirely , recreate reloading nib file. in case, want call sethidden:no on of buttons. like: for (nsview *subview in [[[mytabview tabviewitematindex:0] view] subviews]) [subview sethidden:no];

xcode - How can I remove headers from my custom frameworks? -

i have mac cocoa application uses several custom frameworks. (apple calls them private , it’s frameworks distributed in app bundle application.) inside each framework there headers folder framework’s header files. these not needed inside resulting application bundle & i’d keep them private. use run script build phase following line: # remove headers our private frameworks find "${target_build_dir}" -name headers -print0 | xargs -0 rm -rf is way it, or there better one? more project structure: have 3 xcode projects nested in main project, these projects have private frameworks products. frameworks set target dependency main target. , last part of setup copy files build phase takes frameworks , copies them frameworks subfolder inside application bundle. (hope clear enough.) you have copy headers build phase in place framework. can: 1) remove it, 2) individually specify headers' visibility in ide, 3) or add/remove them copy headers phase i s

Insert into MySQL a huge number of rows, based on subquery... having trouble -

so, trying insert row of none, $country every country exists in table. it should like afghanistan, none albania, none andorra, none ... is, in addition provinces listed each country... this: | zambia | western | | zimbabwe | bulawayo | | zimbabwe | harare | | zimbabwe | manicaland | | zimbabwe | mashonaland central | | zimbabwe | mashonaland east | | zimbabwe | mashonaland west | | zimbabwe | masvingo | | zimbabwe | matabeleland north | | zimbabwe | matabelelan

firefox - javascript library to list files from local folder -

does 1 tell me, there possibility of loading files local folder in xul firefox using js. or how create dynamic menulist in xul firefox. thanks in advance. google -> http://xulbase.com/node/5 -> https://developer.mozilla.org/en/code_snippets/file_i%2f%2fo

OpenCV window always on top -

is there way set opencv window on top? , can remove minimize , close button window? thank you. you can use: cvgetwindowhandle() obtain widows handler. using regular windows api can like

Trigger after select -

i have sqlite3-database. there's table logs. these logs readed tool , writed text-file (or else) it. after this, logs can deleted. possible create trigger in sqlite3 after select, automaticly deletes logs? like this: create trigger after_select_x after select on x begin delete x id = selected.id; end; but doesn't work. thanks best regards there no such thing "trigger after select". check out trigger syntax reference . i suggest use wrapper function perform every select statement in application, , handle logs in function.

jquery - Reveal content by animating height (not hiding all content) -

i want to partially display list , when button clicked i'd change class of button , show full list using full height of div, when button clicked again i'd start initial reveal, not hide whole thing. html: <section id="newsletters"> <h4><a href="#rss"></a><span>related</span> button</h4> <nav> <ul> <li>1</li> <li>1</li> <li>1</li> <li>1</li> <li>1</li> </ul> </nav> <a class="hide" href="#">show / hide </a></section> jquery $('section#newsletters .hide').click(function() { $('section#newsletters nav').toggle(400); return false; }); you'll have create own toggler. simple , straight forward: var toggle = true, oldheight = 0; $('section#newsletters .hide')

flash - question about function and class names having similar name -

wouldn't there naming collision cause in case, function name , class name both named documentclass can explain in layman's terms cause i'm still newbie in flash as3 package com.identitymine.documentclass { import flash.display.movieclip; public class documentclass extends movieclip { public function documentclass() { } } } this constructor - called whenever create instance of class. think of this.. when say: var thing:myclass = new myclass(); you're: creating new instance of myclass. calling myclass() method. other languages use different methods, example define constructor of class in php use __construct() so: class myclass { public function __construct() { echo 'hello, exist now'; } } so creating instance of class so, output 'hello, exist now' onto page. <?php $thing = new myclass(); ?>

load - How to simulate streaming radio listeners? -

how simulate streaming radio listeners? have online radio setup streaming @ port 5672 , @ url domain.com:5672/radio.mp3 want test website/server/ram/bandwidth/load etc server how mp3 extension file? browsers dont work! i tried using webrunner, cannot ""listen"" mp3 ... tries download it! cannot open multiple winamp sessions ... 2000 listeners please let me know. , regards prad what call wget , have output /dev/null or nul on windows. here windows command line: wget.exe -o nul -q http://domain.com:5672/radio.mp3 i make shortcut , set run minimized. allows me smack enter few hundred times , watch listener counts. script specific number, i've found handy manually turn listener count. be sure have enough bandwidth test. in other words... need local server. also, fire 1 stream in winamp or vlc can hear/watch buffer drop. servers maintain connection, unable keep flow.

facebook login url from a c# application -

how can found out url pops facebook login page when want connect facebook c# application? can please tell me url , give me example? thx http://developers.facebook.com/docs/reference/dialogs/oauth/

c# - Installer not launching .NetFramework -

i using setup project install application.i have added .netframework 3.5 sp1 , windows installer 3.1 in prerequisites , selected "download prerequisites same location application". but when tried install installer goes microsoft website download .netframework. why not installing machines local copy? missing here? are including full .net 3.5 sp1 install (around 237mb) or 2.8mb bootstrapper. if using latter nature of bootstrapper. checks missing , goes microsoft download needed. see http://www.microsoft.com/downloads/en/details.aspx?familyid=d0e5dea7-ac26-4ad7-b68c-fe5076bba986 full install package.

.net - How can I load an Image from a file without keeping the file locked? -

i wish display image in picturebox, loading image file. file gets overwritten periodically though, can't keep file locked. started doing this: picturebox.image = image.fromfile( filename ); however, keeps file locked. tried read through stream: using (system.io.filestream fs = new system.io.filestream(filename, system.io.filemode.open, system.io.fileaccess.read)) { picturebox.image = image.fromstream(fs); } this doesn't lock file, does cause exception thrown later on; msdn indicates stream must kept open lifetime of image. (the exception includes message "a closed file may not read" or similar.) how can load image file, have no further references file? sorry answer own question, thought useful keep myself. the trick copy data file stream memory stream before loading image. file stream may closed safely. using (system.io.filestream fs = new system.io.filestream(filename, system.io.filemode.open, system.io.fileaccess.read)) { system.

php - JSON output in smarty template -

i have php file outputs json object . wanted display set of records of outputs display in smarty template . when echo json object , is showing like [{"fname":"kashmiri","lname":"medhi"},{"fname":"kangkan","lname":"hazarika"},{"fname":"ikram","lname":"hussain"}] in outside template . using jquery getjson() function . php file : foreach($res $a=>$v) { $arr['fname'] = $v->um_first_name; $arr['lname'] = $v->um_last_name; $data[] = $arr; } $json_obj = json_encode($data); echo $json_obj; the js file : $('document').ready(function() { $.getjson('http://localhost/basic_framework/index.php ?menu=search_22',callback); }); function callback(data) { $.each(data,function(i,fi) { var info ='';

java - glassfish server getting hang after sometime -

i facing new problem in glassfish server :( after server starts after sometime gets hang , stops processing requests following exceptions in server log [#|2011-05-08t17:44:34.027+0300|warning|sun-appserver2.1|javax.enterprise.system.stream.err|_threadid=17;_threadname=timer-18 ;_requestid=a47329c8-5efa-4e29-b90d-a5bda9c8f725;| java.util.logging.errormanager: 5: error in formatting logrecord|#] [#|2011-05-08t17:44:34.036+0300|warning|sun-appserver2.1|javax.enterprise.system.stream.err|_threadid=17;_threadname=timer-18 ;_requestid=a47329c8-5efa-4e29-b90d-a5bda9c8f725;| java.security.providerexception: implnextbytes() failed @ sun.security.pkcs11.p11securerandom.implnextbytes(p11securerandom.java:170) @ sun.security.pkcs11.p11securerandom.enginenextbytes(p11securerandom.java:117) @ java.security.securerandom.nextbytes(securerandom.java:413) @ java.util.uuid.randomuuid(uuid.java:161) @ com.sun.enterprise.admin.monitor.callflow.agentimpl$

c++ - Convert string to all uppercase leters with std::transform -

i'm using transform algorithm , std::toupper achieve this, can done in 1 line, ? transform(s.begin(), s.end(), ostream_iterator<string>(cout, "\n"),std::toupper); i error on this, have make unary function , call transform or can use adaptors ? use ostream_iterator<char> instead of ostream_iterator<string> : transform(s.begin(),s.end(),ostream_iterator<char>(cout,"\n"),std::toupper); std::transform transforms each character , pass output iterator. why type argument of output iterator should char instead of std::string . by way, each character printed on newline. want? if not, don't pass "\n" . -- note : may have use ::toupper instead of std::toupper . see these http://www.ideone.com/x6fb5 (each character on newline) http://www.ideone.com/rcekn (all characters on same line)

c# - dynamic query generated by stored procedure or function -

i have grid 4 columns i.e title, description, keyword, date in c#.net search button , textbox. when write title+description+keyword+date return related data clicking search button. if write keyword+date +keeping description , title null return related data grid. , on other combination's of 4 column. that is, it's searching fields in each column , combination changes dynamically i want stored procedure or function in sql server. suggestion?.. in advance you can create procedure 4 parameters (each options) , following sql create proc search( @title varchar(20) null, ... select * your_table (title = @title or @title null) etc. anyway, should parse input values each parameter. when pass null @title parameter condition (title = @title or @title null) true.

javascript - DOM - append in table -

how can add rows <tr> in table level(top/bottom/in between) using javascript/jquery ? $(html).insertbefore($('table tr').eq(index)); will insert html before tr index specified. a small demo

navigation - How do I stop people using the back browser button after they have left my site so they cannot return? -

i need safety feature - subject of site sensitive (domestic violence) - have safety area on site , if clicked person taken out of site 'safe' site. once have clicked area stop them coming nominated period of time - (say 1 hour) - if abuser came room escape site, , if hit button not obvious site looking at. ideas?? you capture button event , send user random "safe" url using like; window.onbeforeunload = function () { location.replace('http://www.bbc.co.uk'); return "this session expired , history altered."; } within function block set cookie called 'noreturn' whenever pages on site check redirect each time "safe" site next hour. there's decent article on aspects of controlling button , user's browser history here ;

encryption - Encrypted VoIP communication using the integrated Android 2.3 SIP stack -

i'm working on project have implement secure voip communication between android 2.3 (or higher) phones. connection established through kamailio server. the requirement sip api provided android (since version 2.3) used (if possible). i think biggest problem connection made classes in android.net.rtp package. these classes don't belong public api , therefore cannot extend these classes , make own changes them. now question: still somehow possible establish encrypted connection using srtp (or zrtp matter)? , if so, how should approach that? if not possible sip api android, alternative so? thank in advance! android.net.rtp public of android 3.1. if developing 3.1 or later can extend these, otherwise you'll need implement own.

c - segmentation fault while using fread and not able to read the data from the file -

here want copy data file enter_data , pass function insert(key,keys) segmentation fault , more on not able read data file here classifier structure, , packet_filter has structure of ip , udp in want enter src , dst ip adddress , src , dst port number struct classifier { int key_node; struct packet_filter pktfltr; struct classifier *next; }__attribute__((packed)); void addrule(struct classifier keys) { int key; file *fp; fp = fopen("enter_data","r"); fread(&keys, sizeof (struct classifier), 3, fp); insert(key,keys); fclose(fp); } file: enter_data key = 822; keys.key_node = 822; inet_aton("172.28.6.137", &(keys.pktfltr.ip.ip_src)); inet_aton("172.28.6.10",&(keys.pktfltr.ip.ip_dst)); keys.pktfltr.protocol.proto.uh_sport = ntohs(1032);

dynamic - Trying to create rule based static blocks in Magento -

so 1 of clients has request rule based static blocks on home page. page swap out several static blocks others based on perceived gender of person viewing site. data session user in, or data associated users account. basically, if user searches in specific set of categories (men's or women's categories) should swap static blocks out on home page, when user visits site again have more personalized experience. there default set of blocks if user new site. something (and excuse shabby php): if($categories = $user->getviewedcategories()){ foreach($categories $category){ switch($category){ case 14: //insert womens category id here echo $staticblockwomen break; case 16: //insert mens category id here echo $staticblockmen break; } } } else { echo $staticblockdefault } i know magento tracks users path through site, , know other elements in magento can have rul

MongoDB atomic update via 'merge' document -

i know can atomically update existing mongo document setting specific fields. following code it: var update = mongodb.driver.builders.update.set("insidelegmeasurement", 32.4); safemoderesult result = personcollection.update(query, update, updateflags.multi,safemode.true); however, can atomically update several fields passing in document want 'merge' existing doc? imagine have document follows: {"favcolor":"red","favfood":"pasta"} , want update existing doc these values. want this: var update = mongodb.driver.builders.update.merge({"favcolor":"red","favfood":"pasta"}); or even var update = mongodb.driver.builders.update.merge(myupdatebsondoc); where mybsondocument contains lots of fields don't want have 'unpack' doc merged original. is possible somehow? thanks found answer: //var snippetjson= '{title:"tin machine ii",brandnewfield:

iphone - Apple Match-O linker error: "_Main", Referance from; -

newbie here i cleaning of code deleting , moving around excess code had been playing around with, , got above error , have no clue went wronge or how fix it. not trying special app, few buttons, table view, navigation controller, , mfmailcomposeviewcontroller. p.s. help. leads, tips, tricks, cheats, , plain advise welcome. search project , verify have global function satisfying method signature: int main(int argc, char *argv[]) xcode template project add method in file named main.m usually under other sources group. if function exist, make sure file included in targets list of compile sources .

Windows posix sockets performance -

i looking information on windows network programming. how single executable cope 1000 connections. we use select() fd_isset etc on unix , works quick. on windows these apis poor. fd_set lots slower when working around this, windows lots slower hpux. i'm looking win32 api call can use instead of select() call doesnt require cpu/time. spend 50% of time (and cpu) in select(), on unix time spent in send() , recv(), expect. thanks neil you looking windows i/o completion ports . here's article sysinternals guys.

Need to pass an array in Java to javascript -

i using play framework 1.x. is there way pass array controller template javascript array? play automatically map parameters when post or javascript java. can use renderjson method pass object java javascript. use jquery map array. maybe if give context can little more. public static void getcontactstable() { list<contacts> contacts = contacts.findallorderbyinserted(); renderjson(contacts); } this mapped route. $.getjson("@{viewcontacts.getcontactstable()}", function(data) { var series = { data: [] }; $.each(data, function(index, item) { series.data.push([parseint(item.date), item.qty]); }); options.series.push(series); var chart = new highcharts.chart(options); }); this small example of highcharts chart i've done. here example of going other way , sending data rendered on page. public sta

How to use VI to search for lines less than a certain length? -

i know how use vi find lines longer number of characters: /\%>80v.\+ but how search lines shorter number of characters? use /^.\{,25}$/ to find lines shorter 25 characters.

swing - Create a plain message box that disappears after a few seconds in Java -

i wonder best approach make joptionpane style plain message box disappear after being displayed set amount of seconds. i thinking fire separate thread (which uses timer) main gui thread this, main gui can carry on processing other events etc. how make message box in separate thread disappear , terminate thread properly. thanks. edit: come following solutions posted below package util; import java.awt.borderlayout; import java.awt.dimension; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.swingconstants; import javax.swing.timer; public class disappearingmessage implements actionlistener { private final int one_second = 1000; private timer timer; private jframe frame; private jlabel msglabel; public disappearingmessage (string str, int seconds) { frame = new jframe ("test message"); msglabel = new jlabel (str, swingconstants.center); msglabel.setpre

c# - DevExpress Charts Question -

Image
is possible create chart (as shown on screenshot) in devexpress chart control? i have developed similiar, already. learned better use xtragrid instead of chart, pattern matrix. used customcell drawing feature draw colored bars according values in cell.

No declaration of the property 'pData' found in the interface-Objective C -

how declare array of characters functions has been defined inside class can use updated values. getting errors when defining char data[4096] in @synthesize definition. @interface a: nsobject { char data[4096]; } @property(nonatomic,retain)char data; @end @implementation @synthesize data @end i getting "no declaration of property 'pdata' found in interface" not sure why error, several things wrong in code: data instance variable , property have different types. property declaration should @property(nonatomic) char[4096] data; you must use retain attribute obj-c types properties, plain c-types use assign (or don't specify assign used default) exposing pointer char directly changes may not idea - better make property readonly , make special method change contents: @property(nonatomic, readonly) char[4096] data; - (void) changedata:...//some parameters here p.s. may consider using nsstring* (or nsmutablestring* ) instead of char[]?

Start creating websites by using Python -

i php guy. moving towards python. starting learn python. how install , start working it, , develop websites . got totally confused alternative implementations in download section of python site. can tell me "alternative implementations" means?. i mean like. create .php file in server , access browser http://abc.com/index.php wondering if can same python creating .py file , accessing browser http://abc.com/index.py ... ps: have corrected question. sorry bad way of asking question. if possible remove negative marking :( just disclaimer, interpret saying "run python in browser" "making website python." if want start writing web applications in python, can either use cgi or use 1 of many web app frameworks . python not php in sense can't embed in html. many of frameworks come development servers can use test web app (by looking @ in browser). a particularly python web framework django . i recommend do python tutorial befo

django days-of-week representation in model -

i have "jobs server" model i'm building. want include field save days of week job run on. in ui, user able have series of check boxes(one each day) can select. best way represent "days-of-week" data in mode? class job(models.model): name = models.charfield(max_length=32, unique=true) package = models.foreignkey(package) binary = models.foreignkey(binary) host = models.foreignkey(host) colo = models.foreignkey(location) group = models.foreignkey(group) type = models.foreignkey(type) start = models.timefield() end = models.timefield() days = ? if want checkbox each one, easiest thing create booleanfields each of them. if want store more complex value (eg. comma separated list or something), create own widget , play javascript, go route.

javascript - jQuery button to check all check boxes issue -

i have button checks checkboxes in div , un-checks. however if manually check 1 checkbox, hit check button , uncheck all, checkbox manually checked not become unchecked! any ideas? http://jsfiddle.net/hm5bu/1/ thats because jquery changed in 1.6 using attr instead of prop breaking it. try using prop instead updated fiddle: http://jsfiddle.net/hm5bu/2/ see question: .prop() vs .attr() more prop , attr in jquery 1.6

iphone - Why am I getting a "unrecognized selector" error when I click on a button? -

when click on of toobar buttons, : terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[addrecipientstableviewcontroller btnremoterecipients:]: unrecognized selector sent instance 0x4b87b10' header file @interface addrecipientstableviewcontroller : uitableviewcontroller { } -(ibaction) btnlocalrecipients; -(ibaction) btnremoterecipients; @end interface file #import "addrecipientstableviewcontroller.h" @implementation addrecipientstableviewcontroller -(ibaction) btnlocalrecipients{ } -(ibaction) btnremoterecipients{ } #pragma mark - #pragma mark view lifecycle - (void)viewdidload { [super viewdidload]; // uncomment following line display edit button in navigation bar view controller. // self.navigationitem.rightbarbuttonitem = self.editbuttonitem; } - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; self.navigationitem.title = @"add recipients&q

c# - What should I do to freeze parent's thread when custom MessageBox is launched? -

i've created custom messagebox using messageprompt coding4fun toolkit. problem occurs when run resetdata_click . expected after launching complexmessage.show rest of code inside resetdata_click stops executing while complexmessage open. occurred different. code executed @ once , doesn't matter user chose in complexmessage because if (complexmessage.result)... is executed. should make complexmessage act system.windos.messagebox ? means when messagebox called parent's thread waiting user's decision. private void resetdata_click(object sender, routedeventargs e) { complexmessage.show("you delete data", "are sure?", true); if (complexmessage.result) { datacontrol.datafilereset(); } } public class complexmessage { private static messageprompt messageprompt; private static bool messageresult; public static void show(strin

internet explorer 6 - jQuery UI Autocomplete - IE6 lockup -

before it, know, ie6 dead , smells it's dead. client has closed network, machines run ie6, 100% of user base :/ i'm using jquery ui , autocomplete widget, performs in firefox on ie6, small list of items (here 5, returned json item , description) it's locking browser when mouse on them. applying css seems may cause. $( "#searchtest" ).autocomplete({ source: function( request, response ) { $.ajax({ url: "index.pl", datatype: "json", data: { term: request.term }, success: function( data ) { response( $.map( data.items, function( item ) { return { label: item.id + ' - ' + item.label, value: item.id } })); } }); }, minlength: 2 }); i can kind of replicate problems in ie6 using online demos , albeit lesser extent, it's slow doesn't hang browser. if can make suggestions improving performance in ie6 i'd happy hear them. i'm using default style sheet themer

oop - added Children but objects not displaying in Flash -

i'm adding series of objects dynamically flash movie xml won't appear when run movie. have identical code adding objects in different swf works fine. have tested 8 ways sunday including ensuring added container child of main movieclip (tested display list), added stage (had listener added_to_stage) , position correct (displayed x,y values , compared them mousex & mousey values). in correct place in display list. still there no objects. class linked correctly, have movie clips in library. any ideas causing problem? feel i've checked everything. 'public class minimap extends movieclip { private var exploader:loadxml = new loadxml("experiences.xml",true); public var explist:xmllist; private var popcont:sprite = new sprite(); private var pop:popup; private var expcont:sprite = new sprite(); private var pnt:point; private var exp:experiences; public function minimap() { // requires mouseup mousedown (p

css syntax a:hover on element inside id and class -

i want apply same style to a, a:hover of elements residing inside id, class , element. what's valid , effective syntax? example: #leftmenu .shortcuts ul li a, a:hover { text-decoration: none; } regards, //t css isn't smart, you'll have explicitly write out first part, again. @sdleihssirhc noted, can omit li , ul elements assumed contain li s, selector still work: #leftmenu .shortcuts ul a, #leftmenu .shortcuts ul a:hover { text-decoration: none; } i'd consider giving ul id , condense css considerably: #lm_ul a, #lm_ul a:hover { text-decoration: none; }

design - Type signatures for a mutable Haskell Heap -

i want make in haskell mutable array based heap (the basic kind found everywhere else). there things don't initial approach, however: i use tuples represent heaps instead of proper data type i don't know how declare types using (too many type variables around), relying on type inference (and copying examples haskell wiki) my heap isn't polymorphic when using heap in f example function, have thread n s around. what best way abstract heap nice data type? feel solve of problems. buildheap max_n = arr <- newarray (1, max_n) 0 :: st s (starray s int int) return (0, arr) -- heap needs know array elements stored -- , how many elements has f n = --example use (n1, arr) <- buildheap n (n2, _) <- addheap (n1, arr) 1 (n3, _) <- addheap (n2, arr) 2 getelems arr main = print $ runst (f 3) you should wrap underlying representation in abstract data type, , provide smart constructors building , taking apart heap data s

c# - Json.NET + VerificationException Operation could destabilize the runtime -

i getting "operation destablize runtime exception". goggled quite bit, looks exception has conflicting assemblies being loaded @ runtime. so, here couple of things the same source code works in colleagues machine. i looked , searched each reference newtonsoft.json.dll , seems coming same assembly. (i think not problem working in other people machine). i using raven references newtonsoft, not being used on server side on client / silverlight side. compatible referencing same version of newtonsoft raven referencing to. now, problem might installed in machine that's affecting this. runtime / sp install etc. there way debug / figure out what's happening here. looked , searched newtonsoft.dll when app runs , gets right version in temporary asp.net files. ? any appreciated. don't want go through installing runtime. this exception can occur when have visual studio ultimate , intellitrace activated. try add newtonsoft.dll on intellitrace ignor

c++ - count specific number of elements -

for example, if have array of 5 inputted elements, how count how many times specific value entered if value has been established in variable. input: 4 4 4 1 2 if click defined 4 how count how many times click used in array? makes sense. thanks this how c style arrays. int i; int count = 0; for(i = 0; < arraysize; ++i) { if(array[i] == click) ++count; } arraysize size of statically allocated array, array array variable , click value looking for. in count count of variable saved.

Ruby on Rails - jQuery drag and drop sort order thrown off when too many items are added -

i'm building drag-and-drop list via jquery ui users can drag list of items (categories), , item dragged, whole thing serialized , passed 'sort' function in controller parameters/params[:category] index through each item , update it's position. sake of simplifying as possible try , hunt following bug out, manually setting string in javascript now. (my javascript, view , controller code @ end of post below). here's problem. 5 items, works beautifully. console outputs... started post "/categories/sort" 127.0.0.1 @ wed may 11 12:03:04 -0500 2011 processing categoriescontroller#sort parameters: {"category"=>{"1"=>{"id"=>"1"}, "2"=>{"id"=>"2"}, "3"=>{"id"=>"3"}, "4"=>{"id"=>"4"}, "5"=>{"id"=>"5"}}} category load (0.3ms) select "categories".* "

javascript - Knockout.js "select all" checkboxes -

i've started playing around knockout.js, , seems cool. have grid. grid has column checkbox @ top "select all" of elements, deselect. standard grid behavior. here's code far: javascript: // define "banner" class function banner(inventory, name, arttype, artsize) { return { isselected : ko.observable(false), inventory : ko.observable(inventory), name : ko.observable(name), arttype : ko.observable(arttype), artsize : ko.observable(artsize) }; } var viewmodel = { banners : ko.observablearray([new banner("network", "banner #1"), new banner("oo", "banner #2")]), addbanner : function() { this.banners.push(new banner("network", "banner")); }, selectall : function() { this.banners.isselected(true) } }; ko.applybindings(viewmodel); i'm binding "selectall" event checkbox this: <th>&l

java - How to make JTable click on unselected do a drag instead of a select -

if have jtable set table.setselectionmode(listselectionmodel.multiple_interval_selection) , click drag on row not selected, starts selecting multiple rows. don't want behavior. want if click on node, if it's not selected, start dragging it. we need multi select mode on, setting single select (which result in behavior want) not option. update: @ point, appears require type of ugly hack since logic in private method basictableui$handler.canstartdrag i found 1 possible solution. bracket mouse listeners can lie call iscellselected during canstartdrag call. subclass jtable (or in case, jxtreetable). in constructor call this: private void setupselectiondraghack() { // bracket other mouse listeners may inject our lie final mouselistener[] ls = getmouselisteners(); (final mouselistener l : ls) { removemouselistener(l); } addmouselistener(new mouseadapter() { @override public void mousepressed(final mouseevent e)

cvs - get latest directory contents in IntelliJ -

started using intellij , wanted know best way replace workspace directory contents latest ones cvs. whenever run update doesn't overwrite changes made looking option blindly overwrite. you want force checkout or force update , isn't intellij idea issue, as cvs behavior regardless of ide, or no ide.

cassandra - What is the proper way to add optional program arguments to a plist? -

this command line usage statement displayed near bottom of running cassandra wiki page. bin/cassandra [-f] [-h] [-p pidfile] below it, example of cassandra plist file mac os x 10.6.x. i’ve quoted example’s array of program arguments sake of brevity , clarity. ... <array> <string>/opt/local/bin/cassandra</string> <string>-h</string> </array> ... now, when comes adding optional [-p pidfile] arguments program arguments’ array, proper write string nodes as? <string>-p</string> <string>/usr/local/apache/cassandra/0.7.5/runtime/pid.txt</string> or as? <string>-p /usr/local/apache/cassandra/0.7.5/runtime/pid.txt</string> the former. latter should work if omit space, if cassandra uses compatible posix getopt() .

sql server 2008 - Sql reports with BI Studio (BIDS) , I want one Entry per Page -

imagine have 10 categories. each categories have many products. category categoryid(pk) categoryname categorydescription product productid(pk) categoryid(fk) productname productprice productdescription productnumber i have 1 page per category. on each page, want category name, category descripton. , in table, want product list. how can perform ?. thanks lot. first need query gives information want. saved dataset within report. simple select c.categoryname, c.categorydescription, p.productname, p.productprice, p.productdescription, p.productnumber category c join product p on --insert join criteria here... c.categoryid = p.categoryid name dataset products. next, drag table onto report. define dataset table dataset created above. create group within table, based on category primary key (categoryname? categoryid?). order group categoryname (if want alphabetical order). now in table can put category name & category descri

Running Java applications as a service - startup error captures? -

i'm in arduous process of trying upgrade couple of our servers use current version of application installed on , i've gotten bit stuck. i've gotten replaced , have narrowed issue down 1 .jar file. if use new version of specific file, can not service start, , using old version (and new version of every other file), runs fine. when try start service message: could not start <service> service on local computer. service did not return error. internal windows error or internal service error. i've looked in event viewer, , has these entries every time try start it: <service> has started could not find service start class <service> has failed start is there place else can might able give bit more information on why it's failing start? we using 'javaservice' utility create windows process. server running jboss. edit: have determined not issue sql database did of upgrades between versions. still can't start new .jar, , o

c# - i'm trying to insert to the data base but i have an error called overflow -

this code public static void changetable(string strsql, string filename) { oledbconnection c = makeconnection(filename); oledbcommand comm = new oledbcommand(); comm.commandtext = strsql; comm.connection = c; comm.executenonquery(); c.close(); } strsql = "insert h3rot(name,lastname,tlfon,nyad,email,brodcuts)" + " values( ' " + textbox1.text + "','" + textbox2.text + "'," + phone + "," + pel + ",'" + textbox5.text + "','" + dropdownlist1.text + " ')"; 1) code screaming out "sql injection" should really doing sanitize of textboxes. , should @ least using parameter markers instead of appending strings together. 2) you've exceeded size of 1 of columns in database.

objective c - CGRectGetWidth vs CGRect.size.width -

which better use? prefer cgrect.size.width cause looks nicer. but, colleague says cgrectgetwidth better. cgrectgetwidth/height normalize width or height before returning them. normalization checking if width or height negative, , negating make positive if so. answered here

c# - Silverlight. Cannot call javascript function -

i use sharepoint client api save item list. need call javascript function update html. cannot! page refreshed instead of function call! clientcontext.executequeryasync( (sender, args) => { system.windows.deployment.current.dispatcher.begininvoke( delegate() { stoploading(); htmlpage.window.invoke("updatehtmldetails", id, title, description); }); }, saverequestfailed); id = int, title= string, description= string why page refreshed intead of call javascript? function inside methods.js , registered: <sharepoint:scriptlink name="/_layouts/tv2/js/methods.js" runat="server" localizable="false"/> file presented on page 100%. found problem. enable out of browser on!