Page 41 of full list of posts


JavaScript for C# developers: callbacks (part II)

Last time, we wrote a map method for arrays (which I had to call mapp, so that we didn’t clash with the native version present in many browsers). To use the map method, you have to provide a callback function that would be called for every element in the array. […]

READ MORE

JavaScript for C# developers: callbacks (part I)

As I’ve said pretty much from the very start of this series: functions are objects. You can pass them around in variables, pass them into functions as parameters, return them from functions, the whole nine yards. When you pass a function into another where it will be called, it’s generally known as a callback. […]

READ MORE

PCPlus 292: The science of route planning

By March 2010, I was starting to move to a more “how it works” style of article to go along with changes in the magazine, rather than a “layman’s guide to algorithms” article which I’d traditionally done. This article on GPS systems (or sat-nav, if you’re in England) was my first real attempt at such an article: select some technology and explain its underpinnings for the lay audience. […]

READ MORE

PCPlus 291: Behind the minimax theorem

For February 2010’s issue, it was time for a more heavy-duty algorithm together with what my editor called a fun element. So, enter minimax and two-player zero-sum games. […]

READ MORE

PCPlus 290: Testing for randomness

A familiar topic for me for the January 2010 issue: testing a pseudo-random number generator’s (PRNG) output for randomness. I say familiar because I’ve talked about it before, most recently in my book. Well, OK that was 10 years ago, but still, the techniques don’t change. And it’s extremely fascinating, to boot. […]

READ MORE

Stupid wingnut emails...

American Idiot, On Broadway!photo © 2010 Bill Abbott | more info (via: Wylio)Long ago someone signed me up to get emails from this wacko right-winger. Her emails are unfailingly stupid/vapid, forwarded ad nauseam, written in deathless, breathless prose, and the all-caps multi-exclamation-marked topics are easily debunked by 5 seconds research on snopes.com. Consequently they are hilarious. […]

READ MORE

JavaScript: Using a constructor without new

In my previous blog post on the subject of constructor functions, I mentioned that there is a convention in JavaScript to name constructor functions with an initial capital letter and ordinary functions with an initial lowercase letter. This way, since the language doesn’t stop you from using a constructor as an ordinary function, there is at least some kind of “warning” that you may be using a constructor and therefore need to use new. […]

READ MORE

A JavaScript tip that’s jarring: remove falsy elements from array

Elijah Manor tweeted a link today for learnjs, a reader-supported site that provides tutorial videos on writing JavaScript. A pretty good resource to have to be sure, but there was one video there that brought me up short. […]

READ MORE

Spokeo: all kinds of awesome. Not.

My wife sent me an email today about Spokeo.com. This is a site that aggregates public information on the internet about individuals and then sells it. The site allows you to remove yourself if you want to. (In essence, search for yourself, find the page, copy the URL, and then click on the Privacy link at the bottom of the page. They send you an email with a remove link.) I removed her because of her job, but I decided to see what they had on me. […]

READ MORE

I have PCPlus Mail

I finally got round to reading the Christmas edition of PC Plus this evening and was pleasantly surprised to see that someone had written in about a recent article of mine: 10 mistakes every programmer makes. It’s going to be next year before I republish it here in this hallowed blog, but you can read it over at TechRadar.com right now. […]

READ MORE