Entries from May 2006 ↓

Converting a PDF to CMYK

Had to convert a PDF of a poster into CMYK colour format. I wasn’t sure whether PDF natively supports it but turns out it does as of version 1.2.

Thus I went in search of open source tools that would make this happen. I first checked out OpenOffice since I used OO Impress to create the poster. However in addition to not having options to export to a CMYK pdf, the new version has screwed up all the poster font layout.

I decided thay instead of screwing around with that, I’d attempt to convert my existing pdf directly. Enter PStill, which once set up correctly made my A1 poster CMYK… booyah!

./pstill -w 2384 -h 1684 -2 -c -c -c -g -i -p -t -v -m XimgAsCMYK -o poster-cmyk.pdf poster.pdf

(width and height parameters may need to be changed, the important option is -m XimgAsCMYK which says to convert to CMYK, the other options are from the default example that comes with pstill)

UPDATE: Turns out that printeries convert to CMYK before printing anyhow. The problem with my poster is that the particular range of colours it uses can’t all be adequately presented with process dye printing (or something like that). Next time I’m using CMYK colour from the start.

The perfect(ly designed) man

The perfect man

Useful debian package #1

As I’m sure I’ll come across many useful packages in debian that are useful, here is the first small but handy tool:

Package: tofrodos
Description: Converts DOS <-> Unix text files, alias tofromdos

DOS text files traditionally have CR/LF (carriage return/line feed) pairs as their new line delimiters while Unix text files traditionally have LFs (line feeds) to terminate each line.

Tofrodos comprises one program, “fromdos” alias “todos”, which converts text files to and from these formats. Use “fromdos” to convert DOS text files to the Unix format, and “todos” to convert Unix text files to the DOS format.

This functionality is also available via the dos2unix/unix2dos symlinks.

Homepage

Note: I’m aware that a simple regex such as s/\r// should convert to dos, but I tried using sed for that and it didn’t work. Enlighten me if you know why.

Tilde in Konsole when DEL is pressed

An annoying config error that has taken the last 3 hours to fix: When trying to delete with the DELETE or DEL key in one of Xterm, Gnome-terminal or Konsole I got the character deleted but also replaced with a tilde (~)

I ignored this for ages because the descriptions about consoles and keymapping all seemed rather tedious and had better things to do. But I’ve had a recent surge of enthusiasm to get things out of the way even if it takes me forever. Mainly because I need closure (somewhat like disgruntled ex-lovers sometimes need) so after spending hours on something I can least say I solved the problem! Instead of saying I wasted hours becoming frustrated.

The fix goes like this (note that alot of info was taken from here):

Run

$ bind -p | grep "delete-char"

:

"\C-h": backward-delete-char
"\C-?": backward-delete-char
"\C-d": delete-char
"\M-[3": delete-char
# delete-char-or-list (not bound)
# forward-backward-delete-char (not bound)

We can see that the entry for the delete code is there…(“\M-[3”: delete-char) however it isn’t complete. There is meant to be a tilde on the end. The reason I’m seeinga tilde when I delete is because readline scans only part of the DELETE ascii code leaving the tilde behind.

Solution?

 cat ""\\e[3~": delete-char" &gt;&gt; ~/.inputrc

Then restart terminal/session.

I have no idea how/why this is screwed up though. I think it happened after a debian upgrade and by default I don’t overwrite changed configuration files. One of my custom configurations were probably not compatible with a new dependent config…

Cuz I’ve been stalking you on MySpace

“OMG I love your new tattoo”
“Your so hot”
“OMG hi to you”
“OMG I’ve got 6700000 friends”

This is hilariously awesome.

26:30 in this mp3 mix

XML Schemas

While writing a schema for the xml documents my simulation model accepts as input, I came across a tricky situation. How to define an element that has an attribute, but which also has plain text content between it’s tags (rather than more elements or nothing).

Since I knew very little about schemas a couple of days ago, I found that all tutorials and examples completely missed this combination which I’m sure must be more common than made out.

Here is my solution:

<pre>&lt;xsd:complexType name="test"&gt;
 &lt;xsd:simpleContent&gt;
  &lt;xsd:extension base="xsd:string"&gt;
   &lt;xsd:attribute name="name" type="xsd:string"/&gt;
  &lt;/xsd:extension&gt;
 &lt;/xsd:simpleContent&gt;
&lt;/xsd:complexType&gt;</pre>

Attributes go within the extension tag, and you need simpleContent rather than complexContent. It makes load of sense, so I’m not complaining about the design. It was just very hard to find somewhere that explained it.

Listening to the hardcore channel.

I feel like such a teeny bopper. I’m listening to a hardcore mix of Avril Lavigne’s “Complicated” and actually enjoying it.

On the other hand they were playing a remix of 4Hero’s “Mr Kirk’s Nightmare” before, so that slightly redeems me (old skool means you are cool and poetic).

“Mr Kirk?”

Yes?

“Do you have a son named Robert…Robert Kirk aged 17?”

Yes!

“I’m sorry Mr Kirk, you better come down to the station house, your son is dead!”

Dead?! H-H-How??

“He died of an overdose…”

Oh-h

“You son is dead, dead, dead, dead, d-d-d-d-deaaaaaad.”

NIN concert with Bauhaus?

When did this get decided?

WHY WASN’T I INFORMED?

Windows sucks

After failing to activate my copy of Windows XP x64 I had to reinstall and will make sure I do activate it now <cough cough>. However, on installation I forgot about the lovely behaviour of Windows. “I’m going to overwrite your MBR without even telling you”. My response was “Fuck off and die” but in and of itself this isn’t very productive.

Instead there are a couple of options:
Doing a mock install or
Backing up the mbr, or using the install CD to access a command prompt

When will MS stop being arrogant and pushy?

Prediction: Never

Encyclopedae and Long Island Iced Tea

I’m glad I’m not the only child who had an obsession reading the Encyclopedia. So how about it? Hands up if you spent portions of your childhood reading the encyclopedia. I know I wanted to read through the entire set of the 1985 version of Encyclopedia Britannica.

Ok, so I gave up somewhere in A, but I remember reading about Aardvarks

Also, I was checking

fortune

for a new .sig file and was surprised with the following entry:

1/2 oz. gin
1/2 oz. vodka
1/2 oz. rum (preferably dark)
3/4 oz. tequilla
1/2 oz. triple sec
1/2 oz. orange juice
3/4 oz. sour mix
1/2 oz. cola
shake with ice and strain into frosted glass.
Long Island Iced Tea

Awesome 😀