I wasn’t surprised that parseInt was slow, since I think it parses the number as a string, but the left shift being faster than Math.floor() was a bit more puzzling to me.
So I decided to make a JSPerf test to compare those three methods.
Read on for the full results
I got into a conversation at work today about whether or not Node.js might become as popular and as ubiquitous as Ruby on Rails has become, or if it’s just a fad.
At first I was like “It’s going to become the most used framework evar!” But then I thought about it a bit more and realized that this might not be the case.
I’ve been dealing with some unfortunate scroll performance issues at work lately, and to aid me in that task I’ve been using a handy CSS stress test bookmarklet made by Andy Edinborough. It works by iterating through all your classes and measuring the performance improvement you get from dropping them – thus helping you find out which classes are making your page scroll speed slow. It’s handy but the use case too constrained for my needs.
I wanted to be able to simply run a test anywhere on the page just for a single run, and I didn’t really care about the classes, since I was manually disabling styles and moving things around, unbinding event etc to find out where the biggest performance improvements could be had.
Felix Geisendörfer, one of the node.js contributers has released what can only be dubbed as the ultimate guide to writing node.js applications. He’s launched a site called nodeguide.com which has a beginner’s guide, a guide for how to convince your boss you should be using node (kind of funny, but sadly there are people who need this) and a style guide for standardization of indentation, naming, etc which should be taken with a grain of salt.
The Vodafone website in Iceland has just undergone a redesign. It was designed by the amazing web agency Kosmos & Kaos, which is also based in Iceland.
Like many before me, I’ve spent a good number of programming hours/days/weeks in the past trying to write my own regular expressions to do this. But I wouldn’t wish it on my worst enemy to do that ever again. The techniques for XSS are many and advanced and you’ll be fighting an uphill battle if you think you can “roll your own”.
I wanted to do it both on the client side as well as the serverside (node.js). After some wasted time googling around I posted a question on stack overflow and found out that there are a number of good libraries out there.
Ok, this is my first blog post here, so it probably sucks. If you value your time, don’t read this. When writing code these days, I keep running into these dilemmas. With the way the web and application development has been evolving, a greater part of the development and more importantly my time, goes into [...]