-
SQL Joins with On or Using
17 January 2012
Read moreI recently wrote a post about inner and outer joins, and a couple of people asked what the difference is between USING and ON.
-
Which Basket Should A Developer Put Their Eggs In?
10 January 2012
Read moreThe situation goes like this. Lots of excellent, capable people have great ideas for new software products. They are bootstrapping their venture, so they look for a developer who wants to give some time up front and receive a fair (let's assume fair) share of the rewards once the product …
-
Using lrnja.net Custom URL Shortener with Bit.ly
04 January 2012
Read moreI'm a big bit.ly fan and recently I registered a shorter URL to use for short links - and I went for lrnja.net. I sat down to configure my new domain with bit.ly, and it was very straightforward (I'd almost say "designer-proof"! /me ducks).
- First: register your domain …
-
The Tree Command
29 December 2011
Read moreToday I'm working on a little tutorial (about writing RESTful services, for this site) and I used the tree command to illustrate the file and directory layout of the project. I love this little command and use it frequently, but it isn't very well known so here's a quick example.
-
Tracking Your Domain with Bit.ly
23 December 2011
Read moreAs a blogger and lover of graphs, I am not sure how I hadn't already seen bit.ly's tracking domain feature. With this, you can register a domain and see reports on all of the URLs that are shortened with bit.ly which point through to that domain.
-
Inner vs Outer Joins on a Many-To-Many Relationship
20 December 2011
Read moreSomeone will probably tell me that this is an elementary-level topic, but I got some good questions regarding joins from my most recent ZCE class students, so I thought I'd put down the examples that I used to explain this to them. Being able to join with confidence is a key skill, because it means that you can refactor and normalise your data, without worrying about how hard something will be to retrieve.
-
Simple Regular Expressions by Example
08 December 2011
Read moreWhenever I ask a group of developers if they are familiar with regular expressions, I seem to get at least half the responses along the lines of "I've used them, but I don't like them". Call me a geek if you like, but I quite like regex; I think often it seems unfriendly because it's used inappropriately or just thrown into code with "here be dragons" type comments rather than documentation about what should match, and what shouldn't!
As with most things, it's pretty easy when you know how, so here's my one-step-at-a-time approach to regex (stolen from my ZCE preparation tutorial slides). Let's begin at the very beginning: regular expressions have delimiters, usually a slash character, and these contain a pattern that describes a string.
pattern
notes
/b[aeiou]t/
Matches "bat", "bet", "bit", "bot" and "but" Also matches "cricket bat", "bitter lemon"
-
Is This Marketing?
07 December 2011
Read moreLast year, someone asked me what I'd chosen for the company Christmas cards (I was relatively newly self-employed at the time). The idea of company Christmas cards had not even crossed my mind, but that conversation stayed with me and this winter, I picked a photo I took last winter, and uploaded it to moo.com, producing this:
-
Importing and Exporting MongoDB Databases
05 December 2011
Read moreI'm enjoying working with MongoDB but as with any new technology, it can take a little while to find your way around all the tools related to that stack. In particular, I found myself wondering how do I mysqldump for mongodb?
It should have come as no surprise that the command I wanted was called mongodump, really!
-
Explaining MySQL's EXPLAIN
24 November 2011
Read moreThe MySQL explain plan is a great tool to help developers and database administrators to improve the performance of specific queries happening against a database. It is very easy to use, but its output can be confusing, so I thought I'd show a very simple example.
-
POSTing JSON Data With PHP cURL
22 November 2011
Read moreI got this question the other day: how to send a POST request from PHP with correctly-formatted JSON data? I referred to the slides from my web services tutorial for the answer, and I thought I'd also put it here, with a bit of explanation. After all, publishing your slides is all very well, but if you didn't see the actual tutorial, I often think they aren't too useful.
-
Handling SQL Errors in PDO
16 November 2011
Read moreI love PHP's PDO (PHP Data Objects) extension; it gives a consistent, object-oriented interface to handling all kinds of relational database backends. One thing that annoys me is that the MySQL driver for PDO defaults to a silent error mode which can make SQL errors tricky to spot!
