Posts

How to detect a smartphone through JavaScript/CSS? -

i've seen around web best way make responsive design use css @media queries. not seem practical solution many phones identify screen , have many pixels desktop monitors (i.e. iphone 6 plus 1080x1920 , android phones have larger sizes). if said min-width: 800px; desktop design, many smartphones use rules. one workaround use navigator.useragent in javascript detect mobile devices, i've heard not compatible. is there 'best' way determine if user on mobile device (preferably javascript or css)? if add code page head , width of viewport won't the actual number of pixels, instead compareable pixel density of 96dpi: <meta name="viewport" content="width=device-width"/> this results css width of 320 pixels on smartphones though actual resolutions higher.

ios - Is there a CocoaPods Library for Parse? -

i downloaded open source project via cocoapods modifying , i'm trying add parse framework seems can not access framework within open source file located in pods directory. have included parse framework in own project directory can access parse framework within files located in project directory there's error when try access within open source file...so wondering if there cocoapods version of parse. i typed in parse in cocoapods search website can find parseui. i don't know why don't see listed, do: pod 'parse'

php - Codeigniter redirect non-www to www preventing form submission -

issue codeigniter redirection in .htaccess file. redirection code below: rewriteengine on rewritecond %{http_host} . rewritecond %{http_host} !^www\.domainname\.net [nc] rewriterule ^(.*) http://www.domainname.net/$1 [r=301,nc,l] rewritecond %{request_uri} ^/system.* rewriterule ^(.*)$ index.php?/$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.+)$ index.php?/$1 [l] this seems work correctly noticed forms submission stopped working because of redirection. ideas please? use #redirect www rewriteengine on rewritecond %{http_host} ^[^.]+\.[^.]+$ rewritecond %{https}s ^on(s)| rewriterule ^ http%1://www.%{http_host}%{request_uri} [l,r=301]

how to access json array of objects using foreach loop in javascript and jade -

i using foreach loop show data of jason array take 5 iterations show data want show data in single iteration. how can so? here jade file code. each item in data td a.three(href='') |#{item} in first iteration item contains :"youtube#searchlistresponse". in second iteration item contains : " \"bdc7vthym9nfosqm1_koyhtjtew/0mx1aovxl6jrpz_tgqxlq_yhgwi\"". in third iteration item contains :"caiqaa". i want access id or thumbnail in first iteration returns error. how can access in first iteration using above jade code? possible or not? here link of jason array ( https://gist.github.com/paulomcnally/620b76a9afe81f56e8c9 ) you have parse array first using json.parse(json["items"]) access data if want specific index json_array[0]["id"] or json_array[0]["snippet"]["thumbnails"]

c - Is writing 3 instructions separated by comma `,` undefined behaviour? -

i think saw somewhere writing more 1 instruction separated comma , undefined behavior. so following code generate undefined behavior? for (i=0, j=3, k=1; i<3 && j<9 && k<5; i++, j++, k++) { printf("%d %d %d\n", i, j, k); } because there 3 instructions separated comma , : i++, j++, k++ writing more 1 instruction separated comma , undefined behaviour. nope, it's not general case. in case, i++, j++, k++ valid. fwiw, per c11 , chapter §6.5.17, comma operator (emphasis mine) the left operand of comma operator evaluated void expression; there sequence point between evaluation , of right operand. right operand evaluated; [...] [note]: might have got confused seeing along line of printf("%d %d %d", i++, ++i, i); kind of statement, note, there , not comma operator altogether (rather, separator supplied arguments) , sequencing not happen. so, kind of statements are ub. again, referri...

translation - Magento 1.9.1.0 - Can't find sign in (log in) text in language files -

i translating magento 1.9.1.0 not able find log in text in language files located @ app/locale/nl_nl same goes "zip/postal code" have used notepad++ search on files, no hits. has translation downloaded or there other way change text? thanks! this translate located in db. can translate them enabling "translate inline" via admin end: system -> developer -> translate inline (for desire store). when enabled them, can add translate via site user end (click on book @ text). if don't see book - clean cache. after changed - clean cache.

android - avoid a replaced fragment from calling the previous when screen is rotated -

hey guys im trying make activity has 1 framelayout changed when item in drawer selected, problem when rotate screen fragment replaced goes previous fragment. ex. opened app , shows me fragment try select fragment drawer fragment b when try rotate while im on fragment b goes fragment a. here code. @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); initviews(); passedfragment = this.getintent().getextras().getstring("fragmentclass"); if(savedinstancestate != null){ getsupportfragmentmanager().findfragmentbytag(fragment_tag); } switch (passedfragment){ case "com.serverus.oom.fragments.fragmentagency": fragmentclass = fragmentagency.class; menuitemreserve = mmenu.finditem(r.id.agency_menu_item); break; cas...