Yay, xkcd

17 October 2008

Makefile:
me:
	@true
a:
	@true
sandwich.:
	@[ -w /etc/shadow ] && echo "Okay." || echo "What? Make it yourself."

Shell:
$ make me a sandwich.
What? Make it yourself.

$ sudo make me a sandwich.
Okay.

From CLI-Apps. See also xkcd.

Firefox 3 World Record

30 May 2008

The Firefox team are going for a new world record — “Most Software Downloaded in 24 Hours.” The (currently beta) version 3 of their popular web browser is due to be launched in late June. Visit the Download Day 2008 page for the official date, and to make your pledge!

Dell & Linux

7 April 2008

I was never a big fan of Dell, mainly because it really annoyed me that they only shipped Windows with their machines. Reading The Microsoft File made it clearer, if no more acceptable; Microsoft bullied retailers to shipping tied processor–product bundles, effectively forcing other operating systems out of the market.

Dell redeemed themselves in my eyes when they announced that they would be offering Linux as an alternative, but it seems that’s not the whole story. To summarise the summary, it would appear that every time Dell offers some kind of alternative to Windows, there’s always something that means the Windows users get preferential treatment over everyone else… Now that doesn’t seem fair, does it?

Samba and Vista

4 February 2008

Vista’s lock-down strikes again…

In short, we have Samba v2.2.7a running here, and a new machine was just added running Vista, for some reason. It wouldn’t connect to our Samba shares, where my XP box had managed absolutely fine. The culprit? Vista’s security policies. Finally we found the fix:

  1. Open the Run command and type “secpol.msc”. Finding the Run command in Vista is fun in itself; we just used Windows Key + R.
  2. In the security policies dialogue, navigate to “Local Policies/Security Options”.
  3. Open the policy “Network Security: LAN Manager authentication level”.
  4. Change the option to “LM and NTLM — use NTLMv2 session security if negotiated”. Pre-3.0 Samba doesn’t support NTLMv2, hence the change from the default refusal.
Then, cry because you’ve “updated” to your shiny new operating system and you now have to search Google for “getting x to work in Vista” every time you want to install an application…

Enough Packaging?

24 September 2007

After some trouble with our Belkin router recently, we managed to get it replaced under the lifetime warranty — a very satisfying result! The router arrived today, and the packaging that brought it can only be described as overkill:

Is this a Russian router?

I’m all for my package arriving in good condition, and this extra padding certainly facilitates that, but was all that necessary? Oh well, it works!

Ooh, Vector Art

10 May 2007

Today I stumbled upon this vectorising tool, called textorizer, that converts images into SVG format. You can specify your own text and size, as well as playing around with the edge-finding sensitivity.

Here’s the result on the logo used on my RSS feeds:

Vectorised version of RSS logo, using the text “bux”, 1000 strokes, 100 threshold, and 800×600.

Obviously it works less well for full-depth images, but messing around with the threshold helps. Have fun!


MySQL Joys

8 May 2007

1NF teaches us that we should not store repeating groups in fields. Given that we have a table satisfying 1NF containing values as such:

person_id transaction_id
11
21
12
13

It is simple to select all people involved in a transaction, or all transactions attributed to one person. But how would we find out, say, those people who had been involved in both transaction 1 and transaction 2? It wasn’t clear to me, until now:

SELECT `person_id`
  FROM (
    SELECT `person_id`
      FROM `table`
      WHERE `transaction_id` IN (1, 2)
  )
  AS `people`
  GROUP BY `person_id`
  HAVING COUNT(`person_id`) = 2

The first SELECT returns all those people that have been in either of the two transactions. The second groups the people, and selects those that appear twice — in other words, those that were in both transactions. It looks so simple in hindsight!

This has interesting extensions — one could select people that have appeared in any number of an arbitrary list of transactions.

It is possible to avoid a second SELECT by using GROUP_CONCAT(), but that loses some of the functionality — as well as the elegance.

My Favourite Number

3 May 2007 | 3 comments

I love the Internet. I love how countless code monkey hours are wasted trying to stop the inevitable. I love how people actually think it’s possible to remove information from the Word Wide Web.

So back to my favourite number. Well, it’s not prime, and it’s not perfect, so it’s not really my favourite number, and in fact the prime factors aren’t really that interesting: 26 · 5 · 19 · 12043 · 216493 · 836256503069278983442067. It did make it onto Wikipedia, however, and it did crash Digg for a full ten minutes. The reason? It’s a lot more interesting when represented in hexadecimal:

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Just thought I’d let you know.

Gmail in Multiple Clients

30 April 2007

Gmail has always confused me that when opening POP emails from multiple clients, only those opened in that client show up. In other words, if you open up an email using client A, you can’t open it in client B — you have to view it in webmail.

Of course, there’s a workaround, provided in the help centre. The solution is to use your login as “recent:username@gmail.com”, rather than the usual “username@gmail.com”. This is apparently automatic on mobile devices, but I don’t see why it’s not the default…

Blog Accepts Media Network Commenting

20 April 2007

This blog now allows you to comment using your Media Network profile — just select “Media Network” as the login method and enter your user name and password. Your account must be activated to make a comment.

If your Media Network profile is associated with a tag profile, then your tag avatar and name will be shown, otherwise your forum avatar and user name will be displayed with the comment.