Posts

python - determinating if the input is even or odd numbers -

hello trying write program in python asks user input set of numbers of 1's , 0's , want program tell me if have , number of zeros or odd number of zeros or no zero's @ all. help!! forstate = "start" curstate = "start" trans = "none" value = 0 print "former state....:", forstate print "transition....:", trans print "current state....", curstate while curstate != "you hav , number of zeros": trans = raw_input("input 1 or 0: ") if trans == "0" , value <2: value = value + 1 forstate = curstate elif trans == "1" , value < 2: value = value + 0 forstate = curstate curstate = str(value) + " zeros" if value >= 2: curstate = "you have , number of zeros" print "former state ...:", forstate print "transition .....:...

sql - Query in MySQL for string fields with a specific length -

how can make mysql query asking string fields in column have particular length? thanks! use length() checking length in bytes: select str sometable length(str) = 5; or char_length() checking length in number of characters (useful multi-byte strings): select str sometable char_length(str) = 5;

actionscript 3 - URL opening error in Flash CS4 -

i have script loads php page variables. there no problems when swf uploaded site when run locally, keep getting "error opening url" messages. i'm using absolute pathing , if paste url script using in browser, correct page opens. started happening after site changed servers. ideas problem be? thanks. the "error opening url" seems caused number of issues. have tried keep track of different solutions have used in past fix problem. ever time encounter "error opening url" solution different. 1 of these solutions helps you. i find following solutions on google. - make sure crossdomain policy setup correctly. - set bunch of variables security.allowdomain(domainhere) - change publishing setting flash file. - make sure connecting right url. here works me... usually. 1) make sure connecting right url. use full path, don't use relative links. also, copy , paste url in web browser see if connects. you can use flash.events.httpstatuseve...

web applications - How do Facebook and have these amazing features?

i'm interested in learning how these 2 things accomplished: facebook: when user logged in , sitting @ news feed, new items automatically show in news feed, red badges friend requests, messages, , notifications automatically appear, , instant messaging live. that's lot of database activity! on top of that, users have ability remotely end other sessions, of sessions have checking if they're still valid. many users, how work without killing servers? stack overflow: there 60+ badges on stack overflow based on wide variety of actions user does. seems extremely complicated check virtually of user's actions see if earned them badge or not. same question: many users, how work without killing servers? i appreciate guidance. planning: first step in process planning. facebook or stackoverflow cannot create badge today , 2 months down line, find problem. detailed planning done create category. can write long here, need tech; lets move ahead. object oriente...

iphone - How to insert UIImageView between two sections of UITableView? -

i have design in application have 4 sections in uitableview , need insert uiimageview , uilabel between sections of same table. possible same? kindly show me path.thank you. see these uitableviewdelegate methods: -(uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger) section -(uiview *)tableview:(uitableview *)tableview viewforfooterinsection:(nsinteger) section you may need enclose image view , label in iuview container , return container 1 of these methods. depends on , how you'd present them.

Php Mysql Stored Procedure IN OUT -

case: stored procedure looking like: drop procedure if exists `xoffercommon`.`getcdpc`;<br> delimiter $$<br> create procedure `xoffercommon`.`getcdpc` (in in_city_id int, out out_country_id int, out out_district_id int, out out_provence_id int, out out_city_id int)<br> begin<br> declare city_id int default in_city_id;<br> select t.id, d.id, p.id, c.id out_country_id, out_district_id, out_provence_id, out_city_id ((tblcity c inner join tblprovence p on c.tblprovence_id = p.id) inner join tbldistrict d on p.tbldistrict_id = d.id) inner join tblcountry t on -d.tblcountry_id = t.id c.id = city_id;<br> end$$<br> delimiter ;<br><br> <br>--------------------------------------------------- input: int referring in_city_id<br> output: 4 x int country district provence , city id's<br> ---------------------------------------------------<br> php: want tot call procedure , store 4 returned objects 4variables ...

django - where can i to download the "mod_wsgi.so" -

Image
i want deploy django site apache , cant find website download "mod_wsgi.so" file , i download modwsgi in http://code.google.com/p/modwsgi/ , cant find "mod_wsgi.so" too, this file : so can , thanks! if need precompiled windows version take @ at download page of site posted