Posts

javascript - Why does this Js code (using userAgents) not work on my iphone 4? -

sorry ask such vague question can't pinpoint why code works on pc , on android phone not iphone 4 safari or chrome? checked browser compatibility .includes , navigator.useragent , .getelementbyid .. missing? html: <p id="demo"></p> <button onclick="go()">click me</button> js: var devices = ["android","iphone","ipod","ipad","blackberry","chrome"]; var useragents = navigator.useragent; function detectdevice() { (var = 0; < devices.length; i++) { if (useragents.includes(devices[i])){ return devices[i]; } } } function go(){ var str = detectdevice(); document.getelementbyid("demo").innerhtml = str; } any appreciated.

sql - How can I normalize the capitalization of a group-by column? -

on sql server configured case-insensitive, group by can have interesting results when [n][var]char column not first group by column. essentially, looks whatever row encounters "first" (where "first" undefined in absence of order): wins grouping. example: select x.[day], x.[name], count(1) [count] ( select 1 [day], 'a' [name] union select 1, 'a' union select 2, 'a' union select 2, 'a' ) x group x.[day], x.[name] which returns, me: day name count ----------- ---- ----------- 1 2 2 2 using min(x.[name]) has no effect, since grouping happened. i can't add order by before group by , illegal; , adding order by after group by defines output order after grouping - still gives a , a . so: there sane way of doing capitalization @ least consistent groupings? (i'll leave day problem of being consistent separate runs) desired output, either: day nam...

ios - How to pay for something using my phone/sim credit? -

i developing iphone application( swift 2.0 ) targets metro bus system. person pay ticket using 2 ways: bank account phone credit i.e phone credit of user deducted every time pays ticket using phone credit. now, not sure how achieve #2 . how can make user pay ticket using phone credit. i new here, sorry ambiguities in question. hope understand want ask. i need ideas , clear explanations achieve #2 . thanks in advance answers.

android - Quickblox 2.6.1 webrtc: missing org.webrtc.videocapturerandroid$nativeobserver -

i getting missing class error when trying load libjingle_peerconnection_so.so. using quickblox 2.6.1 video webrtc. have idea whats going on? ##---------------begin: proguard configuration gson ---------- # gson uses generic type information stored in class file when working fields. proguard # removes such information default, configure keep of it. -keepattributes signature # using gson @expose annotation -keepattributes *annotation* # gson specific classes -keep class sun.misc.unsafe { *; } #-keep class com.google.gson.stream.** { *; } # application classes serialized/deserialized on gson -keep class com.quickblox.core.account.model.** { *; } ##---------------end: proguard configuration gson ---------- ##---------------begin: proguard configuration quickblox ---------- #quickblox core module -keep class com.quickblox.auth.parsers.** { *; } -keep class com.quickblox.auth.model.** { *; } -keep class com.quickblox.core.parser.** { *; } -keep class com.quickblox...

php - Print query in while loop, print some fields once, print some field many times -

i wonder how should if wanna print $sta , $stb once, print $test aslong find them in database, $sta , $stb unique key, there many $test in every sta , stb <?php //establish connection database $host = "*****"; $conn = *******; $query = " select * p100f left outer join ***** test **** p100sta = 1 , p100stb = 1 //execute query $queryexe = db2_exec($conn, $query) ; //fetch results while(db2_fetch_row($queryexe)) { $sta = db2_result($queryexe, 'p100sta'); $stb = db2_result($queryexe, 'p100stb'); $test = ****test****** print("<div class='text-center'> <h2>$sta , $stb</h2> <---------- 1 want print once $test <------------------- 1 want repeat aslong find them in database </div>"); now when have both in while loop printing this. $sta $stb $test $sta $stb $test $sta $stb $test $sta $stb ...

mysql - How to escape single-quote (apostrophe) in string using php -

Image
i have sql query this:- $stmt = $pdo->prepare( "select * `products_keywords` `product_type` = '" . $product_type . "' "); i don't know value in $product_type variable. now, getting men's shirt in $product_type variable causing syntax error in sql query. sure error due single quote in men's shirt value. how escape value according query? , how check if there single quote in $product_type variable , escape according query. in advance. the answer don't need to. proper way use pdo's prepare this: $stmt = $pdo->prepare( "select * `products_keywords` `product_type` = ?"); this whole point of using prepared statement. bind parameter follows: $stmt->bindparam(1, $product_type) proof, schema: create table `products_keywords` ( `id` int not null, `products_keywords` varchar(1000) not null, `product_type` varchar(100) not null ); insert `products_keywords` (`id`,`products_keyword...

java - Camel: xsl transformation doesn't indent xml -

i have started use camel spring boot , xsl new project. have following example: students.xml <?xml version="1.0" encoding="utf-8"?> <class> <student rollno="393"> <firstname>dinkar</firstname> <lastname>kad</lastname> <nickname>dinkar</nickname> <marks>85</marks> </student> <student rollno="493"> <firstname>vaneet</firstname> <lastname>gupta</lastname> <nickname>vinni</nickname> <marks>95</marks> </student> <student rollno="593"> <firstname>jasvir</firstname> <lastname>singh</lastname> <nickname>jazz</nickname> <marks>90</marks> </student> </class> which transformed following xsl(ignore comments;new xsl): students.xsl <?xml version=...