[Solved] Improving a Javascript browser detection function

This is what I neded up with. I Corrected bugs in Opera and Safari version detections and added SeaMonkey. <!DOCTYPE html> <script type=”text/javascript”> function GetBrowser(){ var browser=””; var version=0; if (/SeaMonkey[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ version=new Number(RegExp.$1); browser=”SeaMonkey”;} else { if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ version=new Number(RegExp.$1); browser=”Mozilla FireFox”;} else { if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ version=new Number(RegExp.$1); browser=”Internet Explorer”;} else { if (/Opera/.test(navigator.userAgent)){ … Read more

[Solved] How to get row data of a html table in jquery?

It would be easier to answer if you had posted your html, but I’m guessing it looks something like this: <table id=”tblTest”> … <td> <!– this is the third td in #tblTest (#tblTest td:nth-child(3)) –> <a …>Edit</a> <a …>Delete</a> </td> </table> Your jQuery selector is looking for all -tags in the third element. The function … Read more

[Solved] how to use async and await on a method that is time comsuming [closed]

To be able to await MyTimeConsumingTask it must be declared to return a Task. public async Task<SimeType> MyTimeConsumingTask() Since you said it does some network IO, you can rewrite it using async NW IO methods and then await it as var MyResult = await MyTimeConsumingTask(MyClassProperty); But in your case the simplest approach seems to be … Read more

[Solved] data not showing with sno

The following should get what you’re asking for: INSERT INTO SOME_TABLE (SNO, USERID) VALUES ((SELECT NVL(MAX(SNO)+1, 1) FROM SOME_TABLE WHERE USERID = &userid), &userid); where &userid is your USERID value. SQLFiddle here 1 solved data not showing with sno

[Solved] Change version of APK

In targetSdkVersion Set maximum sdk version. if you set 21 than your application will work still 21 api. <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”21″ /> 2 solved Change version of APK

[Solved] Regex to match url not for certain file types

You need to use a lookbehind for that, try http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=;]*)?(?<!jpg)(?<!gif)(?<!doc)$ You need also the anchor $ at the end, it matches the end of the string, that is important to define clearly the point from where the lookbehind should look behind. See it here on Regexr 1 solved Regex to match url not for … Read more

[Solved] Javascript small calculator app giving nan result

Try this code snippet and remember casting to Integers or Floats with parseInt or parseFloat function mycalculator() { var a = parseInt(document.getElementById(“a”).innerHTML); var x = parseInt(document.getElementById(“odrasli”).value); var c = parseInt(document.getElementById(“c”).innerHTML); var y = parseInt(document.getElementById(“deca”).value); var aa = a * x; var cc = c * y; var p = aa + cc; var d = … Read more

[Solved] Mysql functions in zend 2

/* DB Adapter get and SQL object create */ $adapter = GlobalAdapterFeature::getStaticAdapter(); $sql = new \Zend\Db\Sql\Sql($adapter); /* Select object create */ $select = new \Zend\Db\Sql\Select(); $select->from(‘states’); $select->where->addPredicate( new \Zend\Db\Sql\Predicate\Expression( ‘TRIM(LOWER(state_name)) = ?’, ‘noida’ ) ); /* Select object convert to string and execute */ $queryString = $sql->getSqlStringForSqlObject($select); $result = $adapter->query($queryString, Adapter::QUERY_MODE_EXECUTE); 1 solved Mysql functions … Read more