212
I Use This!
Very Low Activity

News

Analyzed 1 day ago. based on code collected 1 day ago.
Posted over 13 years ago by Brett Zamir
@danny morabito: This is not just checking whether a variable exists. In such a case "return this.window[const_name] !== undefined" would work. This is looking for a genuine constant which cannot be altered.
Posted over 13 years ago by danny morabito
sorry, but isn't simplier: return this.window[const_name] === undefined ? false: true; ?
Posted over 13 years ago by arrariamen
Posted over 13 years ago by Boris Fomin
function trim(str, charlist) { // Usage: string trim ( string str [, string charlist ] ) // Strip whitespace (or other characters) from the beginning and end of a string // str - the string that will be trimmed // charlist - optionally, the string ... [More] of stripped characters can also be specified // using the charlist parameter. Simply list all characters that // you want to be stripped. // * example 1: trim(' Hello World '); // * returns 1: 'Hello World' // * example 2: trim('Hello World', 'Hdle'); // * returns 2: 'o Wor' // * example 3: trim(16, 1); // * returns 3: Error('String expected as argument of trim function instead of: ' + str) // * example 4: trim('16', 1); // * returns 4: '16' // * example 5: trim('16', '1'); // * returns 5: '6' 'use strict'; var s = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000'; if (typeof (charlist) === 'string') { s = charlist; } if (typeof (str) === 'string') { while (((s.indexOf(str.charAt(0))) > -1) && (str !== '')) { str = str.substring(1); } while (((s.indexOf(str.charAt(str.length - 1))) > -1) && (str !== '')) { str = str.substring(0, str.length - 1); } return str; } else { throw new Error('String expected as argument of trim function instead of: ' + str); } }; [Less]
Posted over 13 years ago by T.Wild
This should be marked as having a dependency on array_filter (line 23) or be recoded.
Posted over 13 years ago by Vasil Vasilev
Here is another implementation of the array_diff I am using in a project. I prefer to use for (;;) arrays to make sure I am iterating only over values, and will skip prototyped array members etc. var array_diff = function(arr1) { var retArr ... [More] = [], arr1length, i, j, z, keyFound, argl = arguments.length, arr = []; pArr: for (i = 0, arr1length = arr1.length; i < arr1length; i++) { keyFound = false; for (j = 1; j < argl; j++) { arr = arguments[j]; for (var z = 0, arrLength = arr.length; z < arrLength; z++) { if (arr[z] === arr1[i]) { keyFound = true; continue pArr; } } if (keyFound) { continue; } } if ( ! keyFound) { retArr.push(arr1[i]); } } return retArr; }; [Less]
Posted over 13 years ago by Rajiva
Yesterday I got same problem : malformed URI sequence. I had try all of solution that you're shown, but no one solved my problem. Than, I try another way that I can do for fix the problem. I solved the problem with cutting half of tag value (string) ... [More] of my XML file with substr($string, 0, 3000). I think the browser & program can't handle and processing large string. Based on my experience, the program can work properly while the string contain maximal 3000 character. Is anyone have same experience with me? [Less]
Posted over 13 years ago by BeeGirll
Posted over 13 years ago by Nima
Thanks , grate job ;)
Posted over 13 years ago by Brett Zamir
To add clarification to my last post regarding your point, using PHP as a proxy will add EXTRA time if you have an Ajax-based application. And even regarding PHP's extra features, HTML5 apps nowadays are doing more of the things you can do on the ... [More] server (there may even be a standard way to run a proxy on the client-side in the future, with user permission, letting you build your own browser in HTML5). [Less]