Archives for January 2016

January 2016 (9)
« Dec Feb »

Like this Archive Calendar widget? Download it here.

New option in JSLint for multiple var declarations

Yesterday evening as I was putting to bed a few changes to this blog’s JavaScript (that would provide fodder for my continuing series on functional JavaScript), I decided to update the version of JSLint I was using in Sublime Text. When I had done so, suddenly my JavaScript file produce a huge slew of warnings that had not been there before. Whaaaat? OK, first things first. If you are using the Sublime-JSLint package in Sublime Text, it’s a good idea to update it on a regular basis. There’s only...


Thinking functionally in JavaScript (part one)

Over the Christmas break, when traditionally things are a little quieter at work, I do a bit of research into topics that interest me and that might have some bearing on our future products. This year was no exception and I decided to investigate React , Facebook’s library (framework?) for building user interfaces for the web. It’s a fascinating library to be sure (and I’ll talk more on it in another post), but there was one paradigm it uses which I haven’t really talked about before: immutability...


Game on: jQuery each() vs. Array.prototype.forEach()

OK, so this afternoon I got bitten by an issue that has bitten a gazillion web developers (and will probably continue to bite more in the future). I’m talking about the syntax for the callback function that’s used for jQuery.each() versus that for JavaScript’s Array.prototype.forEach() . They are, dear reader, not the same . Let’s quickly show the difference. The callback for the jQuery.each() function should have calling syntax that looks like this:  function (index, element) whereas the one...


Developers and adblockers don’t mix

OK, call me dense. I had a problem: the new theme I have for this blog has cute little buttons for the social networks I belong to and use; they’re at the bottom of every page. Internally they use Font Awesome to deliver the individual icons. On my desktop browsers: no issue, they look great. On my iPhone? What. The. Heck. Although you can pretty easily scroll to the bottom of the page to look at them, here’s what they are supposed to look like, this from a desktop browser: Social buttons So, four...


My Volvo 1800S is on My Classic Car

As I’ve reported on the blog for my Volvo 1800S (aka 64SAINT), it’s being featured in episode 5 of season 20 of My Classic Car with Dennis Gage. The preview has just gone up on YouTube Even the video still features 64SAINT… The full episode will be available on YouTube after it’s aired on various car-related TV channels. So, later in February, I’m guessing. Now playing: The The - Perfect (from Soul Mining )...


New year? Check. New theme? Check.

Over the New Year break, I decided it was time for a change here on the Algorithms for the Masses blog. Not necessarily a full-blown New Year Resolution, more a general feeling that the current theme was old in the tooth, had accumulated a whole bunch of cruft (and how!), and it was time to chuck it in the bin of history. Time for something clean, and, horror, responsive. Having made the decision, it was time to go check out the themes on offer out there in the big wide world. ThemeForest is great...


Revisiting Heap’s Algorithm in JavaScript

Back in March last year I presented an implementation of Heap’s Algorithm – an algorithm devised to generate all permutations of a set of items – in JavaScript. The article was interesting to write because in doing so I had found a bug in the pseudo-code on the Wikipedia page for the algorithm , which led to a discussion with the main editor for the page on how to make it better. Fast forward to yesterday. That morning I listened to a presentation on programming in a functional style in C# . The...


JSLint and recursive functions in JavaScript

The one issue that’s weird about JavaScript that I’ve found is that it has no compiler: the first time you find a bug is when you run your code, not when you compile it. So, since I’m adamant about writing “good” JavaScript code as I write it, I’ve installed a couple of JSLint plug-ins, one for Visual Studio and one for Sublime Text . JSLint is Douglas Crockford’s linter for JavaScript and, although utterly (perhaps barmily?) strict in certain areas, is the one I’ve settled on for checking/validating...


First post with Open Live Writer

Just a very small post, this, to announce that I’m now using Open Live Writer (OLW) as my blogging tool. Maybe not all the time, at least for the next couple of weeks. You could say that I’m still experimenting with the plug-ins I have for Windows Live Writer (WLW), so no code snippet blocks yet or “Now Playing”. Those are to be tested and played around with some more before I really jump in with both feet and uninstall WLW. So, if you are reading this: I will have set it up correctly and this small...