Posts

History.js vs. window.history for HTML5-only mode -

does history.js offer substantial advantages on html5's window.history nowadays? we're not interested in supporting/falling html4 hashbang urls. history.js doesn't support anchors in pushstate() , while window.history does. need feature if there no big reasons use history.js instead of native window.history in html5-only mode, we'd rather go latter. yes - on website say: provide cross-compatible experience html5 browsers (they implement html5 >history api little bit differently causing different behaviours , bugs - >history.js fixes ensuring experience expected / same / great throughout >the html5 browsers) those differences small, , googling wasn't enough find them - had in source code - seems main 1 fixing html5 functionality in safari. there 2 problems safari implementation - 1 history.back fails return hash state set location.hash susequently replaced history.replacestate. the second when busy safari fail apply state changes....

python - How to sort list within a list? -

this question has answer here: how sort list of lists specific index of inner list? 6 answers i want sort list based on first item such as: fruits = \ [['mango', 6, 5, 8.0], ['banana', 2.0, 5, 8.9, 7], ['pineapple', 4, 6.8, 9], ['apple', 3.9, 6, 7, 2]] to sorted out this: fruits = \ [['apple', 3.9, 6, 7, 2], ['banana', 2.0, 5, 8.9, 7], ['mango', 6, 5, 8.0], ['pineapple', 4, 6.8, 9]] i know have use sort() function don't know how use in right way produce outputs want. what problem exactly? sort() sorts first element. in [14]: fruits = [["mango", 6,5,8.0], ["banana", 2.0,5,8.9,7], ["pineapple", 4,6.8,9], ["apple", 3.9,6,7,2]] in [15]: fruits.sort() in [16]: fruits out[16]: [['apple', 3.9, 6, 7, 2], ...

sql - function that will only insert Monday-Friday? -

i've created function insert customer database, wondered if possible make except inserts on monday friday days @ how done in oracle sql? here code function running , works function create_customer( country in varchar2 ,first_name in varchar2 ,last_name in varchar2 ,birth_date in varchar2 ,customer_type in varchar2 ,address in varchar2 ) return varchar2 new_customer_id varchar2(8); begin select custid_seq.nextval new_customer_id dual; insert customer (customer_id, country, first_name, last_name, birth_date, customer_type, address) values (new_customer_id, country, first_name, last_name, birth_date, customer_type, address); total_customers := total_customers + 1; return (new_customer_id); end; anyone got idea how develop or if possible? thanks you want insert statement run on weekdays? if so, can check day of weeks using to_char(sysdate,'d') it returns numbers 1-7(sunday saturday). based on can decide whe...

internet explorer - jQuery and JSON vs IE - SCRIPT5007: Unable to get value of the property -

i'm struggling script working. it's simple ajax call retrieve data php returns json code. function refreshwindows(){ if(ajaxpull && ajaxpull.readystate != 4){ ajaxpull.abort(); } ajaxpull = $.ajax({ type: 'post', url: $path, data: { ajax: true, mode: 'update', to: math.round(currentdate.gettime() / 1000), from: math.round(previousdate.gettime() / 1000) }, datatype: "json", success: function (data) { alert(data); //that's debug $replies = data.updates; $.each($replies ,function(group,value) { if (value!=''){ $("#group"+group+" .content").append(value); $("#group"+group+" .content").stop().animate({ scrolltop: $("#group"+group+" .content")[0].scrollheight }, 800); if (!$("#group"+group+" .window").is(':vi...

unable to send email through PHP with POP3 -

i have completed writing php code in order send email pop3. every time being faced error [error] => connecting pop3 server raised php warning: [errno] => 2 [errstr] => fsockopen() [function.fsockopen]: unable connect pop3.yahoo.com:465 (a connection attempt failed ) smtp -> error: failed connect server: connection attempt failed because connected party did not respond after period of time, here code. <?php require_once('/class.phpmailer.php'); require_once('/class.pop3.php'); // required pop before smtp $pop = new pop3(); $pop->authorise('pop3.yahoo.com',465,10, 'arsalansherwani@yahoo.com', '******',1); $mail = new phpmailer(); $msg='name'; //$body = file_get_contents('contents.html'); //$body = eregi_replace("[\]",'',$body); $address='arsalanjawed619.com'; $mail->issmtp(); $mail->smtpdebug = 1; $mail->host = 'p...

html - How to use srcset image attribute? -

just came know srcset attribute. trying run without success. expect see @ least 1 image loading in when run on google chrome iphone or ipad nothing displayed. <img srcset="img1.png 1x low-bandwidth, img2.png 2x high-bandwidth"> according w3c , srcset attribute still in draft status. means not yet recommended use because specification can still change , web browsers not expected implement already. by way, note low-bandwidth , high-bandwidth not part of current draft. because it's hard find objective definition of "low" , "high" bandwidth still reasonable in ten years.

sql - How to find the difference between 2 rows -

table1 id no name value 001 grid1 rajan 200 001 grid2 rajan 300 002 grid1 mahesh 100 002 grid2 mahesh 200 003 grid1 jayan 200 003 grid2 jayan 50 i want find difference (grid1 - grid2) each id expected output id name value 001 rajan -100 002 mahesh -100 003 jayan 150 how make query above condition need query help select id, name, sum(case when no = 'grid1' value else value*(-1) end) table1 group id, name see sql fiddle demo