Entries from May 2006 ↓
May 30th, 2006 — general
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.
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.
May 30th, 2006 — general
May 22nd, 2006 — general
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.
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.
May 22nd, 2006 — general
May 18th, 2006 — general
May 9th, 2006 — general
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><xsd:complexType name="test">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType></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.
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:
<xsd:complexType name="test">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
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.
May 9th, 2006 — general
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.”
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."
May 7th, 2006 — general
May 3rd, 2006 — general
May 2nd, 2006 — general