January 2006

Sarah Silverman: The Program

(in General on 2006/01/31)

http://www.cnn.com/2006/SHOWBIZ/TV/01/31/television.silverman.reut/index.html

Comedy Central said Monday it has ordered six episodes of a half-hour series starring Sarah Silverman. The show, tentatively titled “The Sarah Silverman Program,” is set to premiere in the summer.

Silverman would play a character — also named Sarah Silverman — whose absurd daily life will be told through an array of scripted comedic scenes and songs.

Comments Off

bash history expansion

(in General on 2006/01/30)

Some people use no history expansion, some people only use the most basic.

I’ve been getting heavy mileage out of “!?” recently…

!! evaluates to the last command
!word evaluates to the last command that started with “word”
^old^new evaluates to the most recent command but substitutes “new” for “old”
!?word evaluates to the last command that contained “word”
!?word:s/old/new/ evalutes to the last command that contained “word” and switches occurences of “old” with “new”.


fsck /dev/hda
# Oops gotta be root
sudo !!
# Gotta check another disk
^hda^hde

ls -1 /mnt/hda
# Forgot to mount it!
mount /mnt/hda && !ls

vi /mnt/hda1/apache/conf/httpd.conf
vi ~/notes/apache.txt
/mnt/hda1/apache/bin/apachectl -k start
# Oops, config is busted again
!?httpd.conf
!?start
# do stuff
!?start:s/start/stop/

Comments Off

Comedy Cellar in the village

(in General on 2006/01/30)

I do everything with my penis… play basketball, go skiing

“Watch out for that tree!”

Thanks, penis. I’m glad I had you out

Comments Off

Marjorie Triumphant

(in General on 2006/01/30)

Marjorie was able to come through with not one, but two, “Remember Frank White” t-shirts for me!

Comments Off

Reading at the airport

(in General on 2006/01/30)

My return flight from my birthday trip to see marjorie got delayed for a total of 2 hours, 20 minutes at a time.

Pretty frustrating.

The one saving grace was that one of my birthday gifts was a trilogy of novels (and by novels of course I mean “teen fiction”), so i was able to make a 275 page dent during my homeward bound trip.

Reading is just about the only thing I can do to fight the bizarro relativity at the airport that makes time drag on and on….

Comments Off

TheWurm

(in Pictures on 2006/01/23)

Comments (1)

SA Rasterbation thread

(in Pictures on 2006/01/22)

Comments Off

Free…

(in Pictures on 2006/01/21)

… cat

Comments Off

You do the joke…

(in General on 2006/01/21)

Previous research in adults showed that black smokers take in 30 per cent more nicotine per cigarette

Comments Off

Java, Linux, Locales and File.listFiles

(in Computing on 2006/01/19)

/* files for testcase:
    printf '\xE0' >> `printf sbcs-'\xE0'`.html
    printf '\xC3\xA0' >> `printf utf-'\xC3\xA0'`.html
*/

    File dir = new File ("/tmp/m5");
    File[] files = dir.listFiles ();
    Boolean ok = true;

    for (int i = 0; i < files.length; ++i)      {
        try{
               RandomAccessFile raf = new RandomAccessFile (files[i], "r");
     ...

Assuming no changes to the filesystem and no permissions issues, When can the RandomAccessFile throw a File Not Found exception?

There is no guarantee about the character set used in a unix filename — it could be from any single byte codpage, and it could be from something like UTF-8 — this would depend on the value of the LANG variable at the time the file was created, and the tool that created it.

If your current locale is UTF-8, and the filename is really encoded with some single byte character set, and theres a sequence that can’t be interpreted as UTF-8, the File Not Found will be thrown.

If your current locale is a 7-bit character set (LANG=C, LANG=POSIX, LANG=US-ASCII, or any LANG setting your /etc/locale.gen hasn’t generated) and the filename has 8-bit charactes in it, the File Not Found will be thrown.

These are both a symptom of some implicit conversion of the bytestream comprising the filename into a String in the “current” locale — a conversion rarely of any value.

As Bill Oreilly says… show me where I’m wrong

Comments Off