Posts

objective c - Call a function on a touch outside of the active UITextField -

objective c - Call a function on a touch outside of the active UITextField - how phone call custom function when user touches outside of uitextfield has keyboard focus? my goal phone call function textfield validation. i tried this: // dismiss keyboard - (void)touchesended: (nsset *)touches withevent: (uievent *)event { (uiview* view in self.view.subviews) { if ([view iskindofclass:[uitextfield class]]) { [view resignfirstresponder]; [self validationfornoofpassengers]; } } } validationfornoofpassengers method check validation. problem here when tap on other ui controls not phone call above method. above method called when touched outside on screen (but not on uicontrols). guidance? set view controller (or other object) text field's delegate. validation in -textfieldshouldendediting: or -textfielddidendediting: . objective-c ios focus uitextfield

jquery - Json with strange names -

jquery - Json with strange names - first sorry english i have problem json. assume next array in php $msg['keyone'] = "bla1"; $msg['key_two'] = "bla2"; $msg['key-three'] = "bla3"; i convert json json_encode($idioma); then load ajax / jquery successfully $.ajax({ type: "post", url: "somepage.php", contenttype: "application/json; charset=utf-8", datatype: "json", success: function(data) { alert(data.keyone); // ok (bla1) alert(data.key_two); // ok (bla2) alert(data.key-three); // error (obviously)!!!! }, }); exist way/syntax access "key-three". i can't rename keys, have maintain ugly names. thanks!! you can access data['key-three'] . jquery ajax json

python - phenny/jenni IRC bot programming -

python - phenny/jenni IRC bot programming - i'm checking them out, not @ understanding how i'd several things: how, after user joins channel, jenni sends him welcome message how write module in general why .block list nick or of .block commands fail (no output) also, memos carry on if jenbot goes offline? database? i don't have code on computer, seek this: jenni.write(['privmsg','target_nick'],"write message here") python chat irc bots

c# - Decimal to string conversion issues -

c# - Decimal to string conversion issues - possible duplicate: c# how remove 0 end of decimal value best way display decimal without trailing zeros in c# i have decimal variable has value 2.50 2.25 how can convert string can get 2.5 2.25 issue 2.50 must 2.5 in string. string.format("{0:0.##}", 2.50); you can convert string , string.trim('0'); trim trailing zeros off. c# decimal

jQuery: How to remove CSS class from both parent and its direct child? -

jQuery: How to remove CSS class from both parent and its direct child? - $("#menu-main > li").add("#menu-main > li > a").removeclass("hover").find("div").hide(); <ul id="menu-main"> <li class="hover"> <a class="hover" href="" title="">abc</a> <div> <ul> <li><a href="" title="">xyz</a><li> </ul> </div> </li> this works thought write improve please or must repeat "#menu-main > li" add() part? $("#menu-main > li").add("#menu-main > li > a").removeclass("hover") that works, alternatively can use $("#menu-main > li").children('a').andself().removeclass("hover") jquery

javascript - Should heavy variables go outside functions? -

javascript - Should heavy variables go outside functions? - i have function runs around 200 times. the function this: function getb(av,bol){ var bxes=[ ["11","12","13","21","22","23","31","32","33"], ["14","15","16","24","25","26","34","35","36"], ["17","18","19","27","28","29","37","38","39"], ["41","42","43","51","52","53","61","62","63"], ["44","45","46","54","55","56","64","65","66"], ["47","48","49","57","58","59","67","68","69"], ["71...

Blender 2.6.1 export to ogre -

Blender 2.6.1 export to ogre - i'm using blender v.2.6.1: there way export project (.blend) .mesh , .skeleton? i've tried download blenderexport , re-create script , subdirectories either ".blender/scripts", when open .blend, in file->export don't appear nil export in ogre files! blender includes export script lot of formats, need activate scripts in files -> preferences -> add-on menu. blender2ogre can export .scene, .mesh, .material, .skeleton. just follow installation steps , tutorials. blender ogre