Posts

ios - UIScrollview not recognizing swipe from screen edge -

i have uiview containing uiscrollview . have set uiview header view of uitableview . uitableview 20px narrower screen have seit header view fit screen size. the problem having cant swipe uiscrollview coming in screens edge on both sides. start paging when touch inside of screen. is there way fix this? lot! just fix by self.automaticallyadjustsscrollviewinsets = no; put line in viewdidload method , create other controllers. it's working on ios 7 , latter.

c - Using 8-1 Multiplexer with atmega16 -

i trying use 8-1 multiplexer @ mega16 trying maximize input pins made program scan addresses of multiplexer , listen interrupt if interrupt happens program check address sent @ moment print string on lcd (and managed switch case) ... the problem is :: when interrupt happens in switch case , execute cases under 1 starts on ex : if pressed first button(first address) execute cases, if pressed second 1 execute it' case , third case ans on int main(void) { ////////////////////// setmusk(mcucr,isc01); /* when(isc01 =1 , isc00 =0 )the falling edge of int0 generates interrupt request. can use internal pull resistance*/ clearmusk(mcucr,isc00); /////////////////////// gicr = 0x40; clearmusk(sfior,pud); //enabling pull resistor ddrc = 0xff; lcd_init(); ddrc = 0xff; ddra = 0xff; ddrd = 0x00; lcd_send_command(clear_display_and_ram); lcd_display_string("program starting !!"); ...

c# - How to test if an object is disposed and GC'ed? -

i'm writing code delete object , wanted have unit test ensure object deleted. best way this? if gc work should not holding references how can test without reference? there no way test if object disposed in general case. weakreference thing looking for. can create weakreference part of test , after code has run this: weakreference wr = new weakreference(obj); gc.collect(); assert.istrue(!wr.isalive);

php symlinks not creating -

i trying create symlink target directory outside script root , link inside folder in script: if(!file_exists('properties')) { symlink('/hermes/bosnaweb03a/b1456/nf.comcan/public_html/properties' , __dir__.'/properties'); var_dump( file_exists('/hermes/bosnaweb03a/b1456/nf.comcan/public_html/properties')); var_dump( is_dir('/hermes/bosnaweb03a/b1456/nf.comcan/public_html/properties')); } both var_dumps return true. not creating symlink error no such file or directory. doing wrong here please you have permission error. try shell command ln -s /hermes/bosnaweb03a/b1456/nf.comcan/public_html/properties , {php_script_location}/properties' with same user running script. if can't create file, need run user have permission create file, or can change permissions on location more permissive.

java - Why does processing try-catch without any exception thrown not slow down the program at all? -

today realized appeared weird me: noticed when do try { dosomething(); } catch (exception e) { } it isn't slower @ if do dosomething(); so ran test , wrote down quick code prove saw, code loops on function called dosomething() lots of times, 1 time without , 1 time try-catch surrounding it. here's code if want test yourself: public class main { private static final long loops = 1000000l; public static final void main(string[] args) { system.out.println("loop without try catch: "+loopwithouttrycatch(loops)); system.out.println("loop try catch: "+loopwithtrycatch(loops)); } public static long loopwithouttrycatch(long loops) { long starttime = system.currenttimemillis(); (long = 0l; < loops; i++) { dosomething(); } return system.currenttimemillis()-starttime; } public static long loopwithtrycatch(long loops) { long starttime = system.currenttimemillis(); (long = 0l; < loops; i++) ...

PHP/Ajax not updating mysql -

i have code use insert data database , works fine im trying adapt update mysql row butitdoes not work. header <script type='text/javascript'> function bet_game(id) { var result = confirm ("do want update bet?"); if (result) { bet_games(id); } } function bet_games(id) { if (window.xmlhttprequest) xmlhttp=new xmlhttprequest(); else xmlhttp=new activexobject("microsoft.xmlhttp"); xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { if (xmlhttp.responsetext !="") { alert (xmlhttp.responsetext); document.getelementbyid(id).style.display="none"; return true; } } } gid = id.replace('tbl_',''); ml_team = document.getelementbyid('ml_team'+gid).value; ml_points = document.getelementbyid('ml_points'+gid).value; ou_team = document.getelementbyid('ou_team'+gid)...

asp.net - error in server when useing telerik:RadAsyncUpload for upload picture in my web site -

this code <telerik:radasyncupload runat="server" id="radasyncupload2" allowedfileextensions="jpg,jpeg,png,gif" onfileuploaded="radasyncupload2_fileuploaded" onclientvalidationfailed="validationfailed" skin="outlook" inputsize="30" temporaryfolder="" multiplefileselection="automatic"> <localization cancel="انصراف" remove="حذف" select="انتخاب" /> <filefilters> <telerik:filefilter description="*.jpg; *.jpeg; *.png; *.gif" extensions="jpg,jpeg,png,gif"></telerik:filefilter> </filefilters> </telerik:radasyncupload> in computer code run correct full permission folder in host string path = server.mappath("~/image/pic_news/"); but when uploading picture in host cannot upload picture . what should do? can please set allowedfileextensions prop...