212
I Use This!
Very Low Activity

News

Analyzed about 21 hours ago. based on code collected about 22 hours ago.
Posted about 13 years ago by Alex
Nice work so far; I have found just a little bug: If a line is exactly as long as str_length, the space will be carried to the next line and will cause an indentation of the following line.
Posted about 13 years ago by Weldan Jamili
//Require file_get_contents.js function is_readable(file) { var _file = file_get_contents(file); if (_file) { var _length1 = _file.replace("<h1>Object not found!</h1>", "LOL", _file); var _length2 = _file; ... [More] if (_length1.length === _length2.length) { return true; } return false; } } [Less]
Posted about 13 years ago by masharblem
Posted about 13 years ago by Pete
I think checking if cls is 'undefined' is reasonable, and if it is, then the function should also return false. if(typeof cls === 'undefined'){ return false; }
Posted about 13 years ago by Haider Abbas
Thanks a lot! Works just like PHP equivalent. Perfect work. Very helpful.
Posted about 13 years ago by Brett Zamir
@Anum: You mean it is giving you the string "[object Object]" as output, or you are expecting an object? This should be converting a properly serialized string into an object. If you are getting the string, do you have sample code?
Posted about 13 years ago by Brett Zamir
@Jaroslaw Czarniak: I have fixed this in Git. Hopefully we can keep this function (and all others) friendly to UTF8 which everyone should be using now anyways.
Posted about 13 years ago by Friv
Cool code. Many thanks!
Posted about 13 years ago by Matteo
I do not know if this can help, but I noticed this: date('Y-m-d', strtotime('2012-07-01 +7 DAY')) = 2012-07-11 --> wrong but date('Y-m-d', strtotime('+7 DAY', strtotime('2012-07-01'))) = 2012-07-08 --> correct
Posted about 13 years ago by Gryffyn
A couple people mentioned the .toFixed(precision) but I overlooked them because they didn't mention the specific problem I was having (or at least not with the keywords I was searching the page for). Basically I wanted to display money values in a ... [More] way that was consistent with how we usually write money values. With the round() function as it is today, 1.10 would return 1.1 even with precision of 2. I ended up not using the rounding function since I didn't need precision, just wanted to truncate after the second decimal but always show two decimals (which wasn't working when it had a zero on the end). If you're starting with a string, you can either do this: var fixed = new Number(somestring); alert(fixed.toFixed(2)); Or you can do: var fixed = parseFloat(somestring); alert(fixed.toFixed(2)); Again, this was mostly mentioned but not in the context of money (dollar, etc) values and trailing zeros. [Less]