24/01: The Danes are very strange
aka Oracle for the insane
I always ask myself when choosing a DB, can I install it while wearing a straight jacket?
27/09: Fake your way into Big Iron
12/09: Quines of the World Unite
"quoted and followed by itself is a quine." quoted and followed by itself is a quine.
This might be easier to read if it is written as Bob quoted and followed by itself is a quine. Letting Bob stand in for quoted and followed by itself is a quine.
Quines are named after Mr Quine, surprise, who was a logician and philosopher. He used the same sort of trick to recreate the liars paradox without using the word this. For completeness here it is:
"yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
On to the programming, here is quine in haskell:
main = putStrLn $ (\x -> x ++ show x)"main = putStrLn $ (\\x -> x ++ show x)"And here is one in python:
s="""print 's=""%s"";%s' %('"'+s+'"',s)""";print 's=""%s"";%s' %('"'+s+'"',s)
Worst abuse of quoting ever? Perhaps. I wrote it before I discovered repr (backticks) makes this a lot easier.
Once you get the hang of it quines are pretty easy to write. They basically need a way of quoting or escaping a string so code inside it will not be interpreted, and a way of outputting the quoted and unquoted string. For the record, locating and reading the source code from disk or something similar is usually not acceptable.
There is of course the infamous shortest quine in the world that was entered in the Obfuscated C Contest. It consisted of a completely empty file which when compiled, produces a program which outputs the source, i.e. nothing. This was deemed an abuse of the rules too hideous even for the Obfuscated C Contest, so they changed it so that the source must contain as least one byte. From the author: "While strictly speaking, smr.c is not a valid C program, it is not an invalid C program either!" Hmm, taking a look at the makefile he doesn't even call gcc on it, the empty file is just copied and made executable, so it will be interpreted as an empty shell script.
unzip [tab]will only complete zipped files. It also even knows how to tab complete "-" as an argument for most common commands. In case this seems like magic, it isn't, somebody painstakingly maintains a database of the valid arguments. These are all defined in /etc/bash_completion, all 9,000 lines of filename and argument specifications.
If programmable completion isn't already enabled, you can starting using by doing
shopt -s progcomp
But the problem is that sometimes it just isn't quite smart enough. I know what I'm doing, sometimes I really do want to open that random file in mplayer. Just because something ends in .part (thanks, firefox) doesn't mean it's out of bounds. So what to do when bash thinks it knows better than me?
- Avoid programmable completion for the current command.
To get default tab completion press
M-/
instead of[tab]
This completes filenames, which is what you want 90% of the time. To complete hostnames and usernames there are other key combinations, listed here - I want out altogether.
If you want to disable it forever put
shopt -u progcomp
in your .bashrc - I am root and never want my users to suffer this inconvience.
If it's enabled in /etc/profile, or /etc/bash.bashrc, then comment out the lines that look like:
if [ -f /etc/bash_completion ]; then
If it's not enabled in either of these places, then it could have been turned on in /etc/skel/.bashrc or /etc/skel/.bash_profile. Your users got a copy of each of these files when you made them an account. There isn't any easy way to turn it off.
. /etc/bash_completion
However, Amazon has cancelled the $4 orders for Lisp in Small Pieces, along with several other books which were also priced at $4. The guy from customer service I spoke to says they will be sending out mails telling people about this later today. They claim there were "pricing mistakes", (LISP is now priced at $94.40). Their pricing policy allows them to cancel any orders which haven't shipped and were incorrectly priced. So, no LISP for you!
I find the pricing mistake story suspect as I've seen how good amazon's monitoring software is at predicting orders. And something as anomalous as an obscure programming book outselling Harry Potter would have raised alarm bells long before they repriced it.
This pricing mistake also applies to a couple of other books that were selling for $4 around the same time:
Probability Theory : The Logic of Science by E. T. Jaynes, cancelled due to pricing mistake
Numerical Methods of Statistics by John F. Monahan, cancelled due to unavailability of stock.
Update Amazon has issused $10 vouchers to everyone who tried to order the $4 books. Apparently, some people who ordered a couple of months ago actually received the books.
27/04: x86 instruction breakdown
But let's see, is there actually a problem with this? We went forth and disassembled /bin in a few different machines. We used objdump, restricting it to only count the code in the text section. First let's look at debian x86:

We can see from this that add is not the most used instruction. But how does this differ from something like Gentoo, where everything is compiled from source, with optimizations and the appropriate -mcpu options.

Interesting, almost the same for the top few instructions. How close these ratios are to each other surprised us. One last thing that we did was looking at an amd64 box, running debian.

Given how close the other two graphs were, this is very dissimilar to them. With the reasons given above and the acquired data, we think we can safely say the previous blog was quite off in its counts.
We generated these just with: objdump --prefix-addresses -d /bin/*|grep "<"|cut --delimiter=" " -f 3|sort|uniq -c|sort -n followed by a bit of postprocessing.
Here's the data:
debian x86
gentoo x86
debian amd64
Note:
The shoddy graphs are generated using ploticus. It would be great if someone knew of a nicer way to generate them, the fact that some of the tags overlap is rather unpleasant.
Another note:
It was pointed out that maybe it isn't too clear what the striking differences between the x86 and the amd64 charts are. We guess that if you haven't looked at these at these while making them until you were entirely sick of them you might have some trouble readily noticing the differences.
So here's a list of major differences: a lot less moves (the extra registers surely helped here), a lot more xors, more pops than pushes on amd64, but more pushes than pops on x86 (the difference in calling convention probably accounts for this), more adds. There are others, though the above seemed to be the most interesting.
Not email, real mail. You know the kind with stamps, and ponies, and Kevin Costner.
ReachServices* allow you to look at your tax record and apply for refunds online. As anyone who has ever been the tax office in Cathedral St can testify, this would be pretty handy. However the catch is they have to confirm your PPS number, and they only way they seem to be able to do this is to send a validation code to your postal address. To avoid making things too inconvenient they will send you a reminder mail around the time the letter should have arrived prompting you to enter your code. The email also warns you that it will expire soon. 'Soon', when is 'soon'? What if I don't get the letter before the code expires? Will they send me another? Will they use exponential backoff or are all of us in the boglands doomed?
* Is that an aging Gary Lineker posing in their business clip art?
09/02: UnDaily WTF
#TODO:when we write a message to a CW, it should do the same as WLM, #try to open an SB, if the CAL answer is 207Come on people, is it so hard write 'chat window'?
There is also the most awesome error message I have ever seen. Admittedly, we can't blame this one on the amsn people as it's part of the MSN protocol.
713 {
status_log "CALReceived: 713 USER TOO ACTIVE\n" white
return 0
}
Bad user!
29/11: Address register indirect
It's 10am on a Wednesday morning, an unspeakable hour of the day. I only cover one lecture out of three during the week, so there should have been two lectures since I was here last week. Last week the prof gave a class on pointers, which was all well and good. But this week, 2 lectures later, he's still talking about pointers. He's even using the same lecture slides. I feel like I should just submit the same notes I took last week. Pointers really aren't that hard. Why do lecturers need to belabour them so much?
Kneecapping
Let's try not to make our sysadmins sound like homicidal maniacs.
"Some mainframes have models or versions that are configured to operate slower than the potential speed of their central processors. This is widely known as kneecapping, although IBM prefers the term capacity setting, or something similar."
From the Red Book
Parallel Sysplex
We have to make this sound insanely cool.
I guess the suggestion to call it a Mainframe Cluster didn't go down too well in the board meeting. However Parallel Sysplex has all the key features of an awesome tech name: it's made of a several other tech words merged together to give something which sounds cool and expensive but is completely meaningless. I mean, what is a Sysplex? Hmm, if Googlers work in a Googleplex, does that mean we keep our sysadmins in a Sysplex? I know I'd sure like to work somewhere with a name as cool as that.
26/08: What you can buy on ebay
You too can have your own traveller kid or animal slaughterer. Unfortunately if you follow the link there aren't any knackers for auction at the moment. Maybe later.
I was looking for Nithin on flickr, I wasn't aware he was available on ebay.
20/06: What am I doing?
Well, I'm working in Purdue University. My supervisor is a big scheme freak, so all my work will be in scheme. At the moment I'm writing benchmark programs for the Debian programming languages shootout using Stalin, which as well as being an agressive soviet dictator is also an agressively optimising scheme compiler. Allegedly it is faster than any other functional programming language implementation, so us interns are given the job of proving it. It's not expected to beat Intel cc, fortran or gcc, but should beat ocaml, mlton, haskell, etc.
When the rest of people from my group arrive I'm going to be working on some of source code repository thing, more will be explained later.


