212
I Use This!
Very Low Activity

News

Analyzed about 7 hours ago. based on code collected about 7 hours ago.
Posted almost 14 years ago by Brett Zamir
@Steve: Thanks! I've adapted the function within the experimental section as an attempt at replicating a PHP language feature (along with $_GET()).
Posted almost 14 years ago by Brad Ramsey
I don't understand why 2011-10-03 is not the same as 10/03/2011... so I patched the function after line 25: [CODE] match = strTmp.match(/^(\d{4})-(\d{2})-(\d{2})$/); if (match != null) { strTmp = match[2] + '/' + match[3] + '/' + match[1]; } [CODE] Worked for me.
Posted almost 14 years ago by PJ Brunet
@Steve Thanks, your function worked for me--reads cookies set with this function.
Posted almost 14 years ago by JaypeeHuda
Hello Everyone, The strpos() function is used to search for a character/text within a string. i.e. with the help of strpos() function you can search a specific character or specific text string. If match is found, strops() function will returns ... [More] character position of first match. If no match is found, it will return false (Nothing to display).............................. for more details please check out following link... http://mindstick.com/Articles/4550476c-822d-4506-b41f-edf5ec8228a7/?PHP%20String%20function thanks !!!! [Less]
Posted almost 14 years ago by Igor Tykhyy
Hi guys! Great function and awesome library. The function works well.. however: for some reason using the php pack method and this php.js pack method doesn't result in the same string. I've got this SHA1-String (it's the SHA1 code for "abcdef12"): ... [More] d253e3bd69ce1e7ce6074345fd5faa1a3c2e89ef . I use "H*" to pack this string - and I receive a result. However: according to my page I've got a few symbols in there which are not properly displayed (even on a page that uses utf-8). As for the php pack() method: it returns a bunch of ? along with a few recognizable letters. What I am trying to do is pack this SHA1-String using javascript and then transfer it to my servlet (I used php for testing purposes, I use Java MessageDigest with SHA-algorithm on my backend). But - compared to my servlet - the resulting Strings have slightly different chars (please see my screenshot: http://www.abload.de/img/little_wrong_packtuql.jpg), because it seems that the javascript pack() method creates an ISO-8859-1 string whereas MessageDigest creates an UTF-8 string. Does anyone happen to know what I might need to check/change in order for the awesome javascript pack()-method to produce utf-8 strings? (without the question marks) Thank you all in advance! [Less]
Posted almost 14 years ago by Koon
Thank you so mush !!
Posted almost 14 years ago by Ruslan
Thanks, article was really helpful.
Posted almost 14 years ago by Brent
As far as adding a thousands separator, I don't think it is currently in the sprintf function code above. However, this regex does it: s/\d{1,3}(?=(\d{3})+(?!\d))/$&,/g This javascript code (based on the regex) does it: function ... [More] thousands (a){ return a.replace (/\d{1,3}(?=(\d{3})+(?!\d))/g,"$&,"); } The only flaw is that it will happily keep adding commas every three characters to the right of the decimal point as well as to the left. So you have to apply it to only the integer side of the number. It works fine as-is for integers and, for example, currency (which only has max 2 decimal places). If you want to use another separator character than "," make the change in the second argument to a.replace. I can't quite see how to easily add this to the sprintf function (and also the usual flag to add the thousands separator is ', which is used for something else in the code above) but there is a start for anyone who like to do it. Regex source is from: http://remysharp.com/2007/10/19/thousand-separator-regex/ [Less]
Posted almost 14 years ago by Memo
Me salvo la vida xD This save my life xD
Posted almost 14 years ago by ZERONETA
var date = function( a, s ) { var d = isNaN( s *= 1000 ) ? new date() : new date( s ), f = d.getTime(); return ( '' a ).replace( /a|A|d|D|F|g|G|h|H|i|I|j|l|L|m|M|n|s|S|t|T|U|w|y|Y|z|Z/g, function( a ) { switch ( a ) { case 'a' : return ... [More] d.getHours() > 11 ? 'pm' : 'am'; case 'A' : return d.getHours() > 11 ? 'PM' : 'AM'; case 'd' : return ( '0' d.getDate() ).slice(-2); case 'D' : return [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ][ d.getDay() ]; case 'F' : return [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ][ d.getMonth() ]; case 'g' : return ( s = ( d.getHours() || 12 ) ) > 12 ? s - 12 : s; case 'G' : return d.getHours(); case 'h' : return ( '0' ( ( s = d.getHours() || 12 ) > 12 ? s - 12 : s ) ).slice(-2); case 'H' : return ( '0' d.getHours() ).slice(-2); case 'i' : return ( '0' d.getMinutes() ).slice(-2); case 'I' : return (function(){ d.setDate(1); d.setMonth(0); s = [ d.getTimezoneOffset() ]; d.setMonth(6); s[1] = d.getTimezoneOffset(); d.setTime( f ); return s[0] == s[1] ? 0 : 1; })(); case 'j' : return d.getDate(); case 'l' : return [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ][ d.getDay() ]; case 'L' : return ( s = d.getFullYear() ) % 4 == 0 && ( s % 100 != 0 || s % 400 == 0 ) ? 1 : 0; case 'm' : return ( '0' ( d.getMonth() 1 ) ).slice(-2); case 'M' : return [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ][ d.getMonth() ]; case 'n' : return d.getMonth() 1; case 's' : return ( '0' d.getSeconds() ).slice(-2); case 'S' : return [ 'th', 'st', 'nd', 'rd' ][ ( s = d.getDate() ) < 4 ? s : 0 ]; case 't' : return (function(){ d.setDate(32); s = 32 - d.getDate(); d.setTime( f ); return s; })(); case 'T' : return 'UTC'; case 'U' : return ( '' f ).slice( 0, -3 ); case 'w' : return d.getDay(); case 'y' : return ( '' d.getFullYear() ).slice(-2); case 'Y' : return d.getFullYear(); case 'z' : return (function(){ d.setMonth(0); return d.setTime( f - d.setDate(1) ) / 86400000; })(); default : return -d.getTimezoneOffset() * 60; }; } ); }; [Less]