Archives for December 2010

December 2010 (10)
SMTWTFS
« Nov Jan »
1234
567891011
12131415161718
19202122232425
262728293031

Like this Archive Calendar widget? Download it here.


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. I must admit this one was hard to get going. My esteemed editor at PC Plus (Alex Cox), sent me an email in July basically saying that for the 300th issue they were...

READ MORE

People of Colorado vs. Rabes, Erik Dean (continued)

Just over 3 years ago, I wrote a post about my wife Donna prosecuting a particularly nasty case of child pornography. The defendant, Erik Rabes, was charged with five counts: sexual assault on a child, sexual assault on a child by a person in a position of trust, two felony counts of sexual exploitation of a child, and a misdemeanor count of sexual exploitation of a child. It was the first ICAC (Internet Crimes Against Children) case that made it to trial in Colorado (usually the defendants in these...

READ MORE

JavaScript for C# developers: writing a library (part 4)

Last time, I’d completed the cookie code. Well, “completed” in the sense of written it, but I now have to think about testing it. The writers of jQuery use a testing library called QUnit for their testing, so that’s what I’ll do too. photo © 2006 David Bleasdale | more info (via: Wylio ) It’s constructed pretty much in the same manner as every unit testing library: there are tests, ways to group tests together, ways to compare actual to expected values, and so on. The set up though is a little bizarre...

READ MORE

PCPlus 289: Solve Sudoku

So, a bit of fun for the Christmas 2009 issue: solving Sudoku puzzles efficiently. Not if you’re a human, you understand, unless you’re the type of human who likes programming, but from the viewpoint of discussing algorithms for solving via computer. Because, once you’ve programmed how to solve a Sudoku puzzle, it’s pretty easy to then generate puzzles to solve. I started off with a brute force technique (that is, try every digit in every cell, all the time following the rules about no duplicates...

READ MORE

JavaScript for C# developers: writing a library (part 3)

Now that we created a rudimentary date library in part 2 , it’s time to move back to the cookie code. photo © 2010 Janet Hudson | more info (via: Wylio ) My plan, as I stated in part 1 , is to create an object with three methods: add , remove , and read . The first two of these methods require writing to the document.cookie string, so it seems to make sense to get that one out of the way first by making it a local (private) function that the public methods can call. I’ll also add a local variable...

READ MORE

PCPlus 288: The thinking behind neural networks

For the December 2009 issue I turned to the subject of perceptrons and neural networks. This one was very much written for the layman: I’ve never written a neural network in my life. However the article did grow out of some ideas I’d been having about writing iPhone apps that make better use of the phone’s other hardware such as the camera, rather than just the accelerometer. I’d been very struck by this article about writing an app that, from a photo of a Sudoku board, could work out the grid and...

READ MORE

JavaScript for C# developers: writing a library (part 2)

As I said last time, my first library object is going to be a cookie object. photo © 2007 Myscha Theriault | more info (via: Wylio ) The browser API for this is remarkably simple . There’s a string property of the document object called cookie . Read from it and you get a semicolon-separated list of name=value pairs as a string. Each name is the name of a cookie and the value is its value. Write to it with a specially formatted string (again semicolon-separated) and you add or update a single cookie...

READ MORE

PCPlus 287: Calculate degrees of separation

In a week when I completed writing my 50th article for PC Plus, it’s kind of fitting to also republish a hoot of an article that I really enjoyed researching. About Bacon numbers. Yes, it’s got Computer Science and it’s got Bacon. What more could any geek want? OK, it’s Bacon as in actor and not tasty porcine food, but at least the editors tossed in a gratuitous shot of some bacon on a fork. Betcha a bunch of PC Plus readers at least read the first few paragraphs... The Bacon number is the basis...

READ MORE

JavaScript for C# developers: writing a library (part 1)

From comments I received when I wrote my recent article over on my DevExpress ctodx blog, it seems there’s a need for people to understand how to write reusable code in the form of a library in JavaScript, and not fall into those nicely shaped C# potholes along the way. So I thought, let’s have a go. ( Update : I’ve made a couple of corrections to point out the files this code appears in.) Some ground rules first. The first is that I’m going to use jQuery . Although jQuery...

READ MORE

JavaScript for C# developers: some refactoring

I just published a blog post on my DevExpress ctodx blog about taking some non-idiomatic JavaScript code (actually from a DevExpress CodeCentral example program) and refactoring it to follow JavaScript best practices. Topics covered include: Minimizing the global namespace pollution Using triple-equals instead of double-equals for comparisons Function scoping Passing JSLint tests by using declaration-first Take a look ! Now playing: Nightmares On Wax - Morse (from Carboot Soul )...

READ MORE