Press "Enter" to skip to content

Category: Life: Work and Techy

Net: Shortest Valid Domain Names

For the system I’m building, I’m putting in a check for valid domain names (technically URI/URLs) and one of the checks is for the length of the domain name. So what is the shortest domain name around?

Well, I suspect in the uk it’s the British library at bl.uk [5 characters] and in the .com range I suspect it’s Paypal’s x.com [6 characters], but an article on Valleywag has just altered me to the fact that Google has one of the shortest Chinese domain names g.cn [4 characters] and Ulster Television has u.tv, but even those are beaten by both the Western Samoa top level domain name has a website making ws [2 characters] and the Vatican’s va [2 characters] – making them the shortest domain name I’m aware of.

Why have some of them got full stops at the end of the links ( such as http://ws. and http://va. ): it’s to stop your browser trying to “fix the links” and change them to http://ws.com and http://va.com which are different sites.

The answer to the question of “how short can a domain name be” is currently 2 characters (unless a top level domain is started with less than 2). A full web based URI/URL has a minimum length of 9 (4 for the protocol ‘http’, 3 for the protocol separation ‘://’ and then 2 for the domain/host name). Of course, you could also use the FTP protocol which brings it down to 8 or be pedantic and insist the shortest web orientated URL is http://va.:80/ at 14 characters.

See also top level domains with websites.

Google Transit Maps

Cool – I’ve been thinking about something like this for a couple of days ago, and Google has just announced nearly what I was thinking: a transit/transport map of London showing where the tubes/lines actually go so you can easily plot alternative routes from not being underground – see London’s map.

Now they just need the following options and they’ve saved me a development job:
* Distance between stations: yes, I can see Regent Street is an inch away from Great Portland Street by “the crow flies”, but I’ve still got to do the conversion using the manual scale. If I could just click on “Great Portland Street” and get a list of “Walking distance to nearby stations: Regent Street 0.5miles (10 minutes), Euston Square 1mile (20 minutes)” etc it’ll be brilliant.
* Alternative routing. I travel from Harrow on The Hill to Great Portland Street, so what are the routes I could take (Metropolitan Line from HOH to GPS, Metropolitan to Wembley Park then Jubilee to Baker Street then Metropolitan/Circle/Hammersmith to GPS, Walk to Harrow and Wealdstone and then catch overground to Euston…): perfect if a line or station is closed (as has happened with the Metropolitan and Great Portland Street several times this year. If it includes additional distance travelled/time needed, it’ll be perfect.

ClickCartPro: Extracting Sales Figures

If you want to get an idea of the stock you’ve sold using the ClickCartPro UK e-commerce software, then you may find the following SQL query useful. Run in phpMySQL to be able to export the data into a spreadsheet.

SELECT SUM(itemquan) as itemssold, count(*) AS timesordered, itemname, itemnum, itemopts, SUM(itemquan)/COUNT(*) AS average FROM `gbu0_orderitems` WHERE FROM_UNIXTIME(epochorder) BETWEEN ‘2007-01-01’ and ‘2008-12-31’ GROUP BY itemnum,itemopts ORDER BY itemssold DESC

What does this mean?
Well, “SUM(itemquan) AS itemssold” grabs the number of items sold, “count(*) AS timesordered” grabs the number of times that item has actually been ordered (as an order could be for 2 or more items), “itemname, itemnum, itemopts” grabs the items name, item number and the options ordered (handy for sizes), “SUM(itemquan)/COUNT(*) AS average” works out the average number of items per order, “FROM `gbu0_orderitems`” says to look at the order table (ok, I’m not distinguishing between cancelled, pending and completed orders at the moment), “FROM_UNIXTIME(epochorder) BETWEEN ‘2007-01-01’ and ‘2008-12-31′” says to only include orders placed between the 1st of January 2007 and the 31st of December 2008 and “GROUP BY itemnum,itemopts ORDER BY itemssold DESC” means group the items for the counts by the item number and options and then order everything by the number of times sold in decending order.