Still getting client-error-document-format-not-supported ?

October
5th
2008

I’ve wanted to set up a shared printer in my office where I run mixed boxes (both windows and linux), in particular I wanted to allow a windows box to print to a printer attached to a linux box.

Guess what? Error! Error! The document was in the queue but the printer kept idling.

CUPS “error_log” showed

Print-Job client-error-document-format-not-supported: Unsupported format ‘application/octet-stream’!

If you search that message you’ll find thousands of people telling you to uncomment two lines in CUPS configuration (even thou with recent Ubuntu it shouldn’t be necessary).
Problem is: that’s not enough!

The solution came reading this post in the ubuntuforums.

It seems that having the right driver on both boxes fools CUPS.
As I wanted the right driver on the linux box (it is its only local printer), I told windows to use a rawer one, “MS Publisher Imagesetter”, and that did the job.

printer_small.png

IFS 2008-08-24: Cobra

August
26th
2008

I’ve found and proposed a solution for a bug in the Cobra Toolkit, a HTML parser with a Javascript engine attached.

New category: Improving Free Software

August
26th
2008

I divide free software people this way:

  • almost everybody can proudly say to be a free/open source software user
  • most of us develop software with free software
  • some of us participate to free software development
  • and a tiny small group of coders does the hard work

I stick on the first and second groups.
On time to time, I release a new free software, taking part in the last group, at least for a few lines of code.
More often I’m part of the third group, by submitting bugs and (sometimes) patches.
I’ve decided to list those patches here, since somehow they give a feeling on how, why and when I do what I say to do to friends and colleagues asking me about linux and the rest.
And by the way, that improves my curriculum.

JRecordBind - (un)marshalling host files

August
1st
2008

I’ve just received the approval email for my latest java tool: JRecordBind.

If you are familiar with JAXB, JRecordBind is just the same (from a functional point of view) but it targets host files, a.k.a. “fixed length text files“.

If you are not familiar with (un)marshalling tools, let me present you JRecordBind.

When you need to import some fixed length file, you usually have an extensive documentation about which field is where. Something like

  • from char 1 to 20 there are name and surname, filled with spaces
  • from 21 to 28 the birthdate in the format YYYYMMDD

and so on.

Speaking XML, this is the XSD, the definition of the structure of the data file, with the types of each field.

JRecordBind needs you to write this definition into a “.properties” file.
The RecordBeanGenerator will then create a java bean suitable for storing each line of the data file.
The Marshaller object will transform this bean into a text line: that’s useful when you need to export data.
The Unmarshaller will do the contrary, that’s transforming every single line into a bean: useful when you need to import data.

JRecordBind allows the developer to focus of the varying part of such import procedures: how to spread imported data into a database. JRecordBind will care about reading/parsing/validating.

JRecordBind is still in the incubator since I plan to add multiline support (beans defined in multiple lines) and multibean support (different types of beans defined in different lines)

Nonetheless, it’s quite fast: on my pentium-m, unit tests have unmashalled 100.000 lines in 5 seconds.

If you want to blame me for this tiny little piece of code, drop me an email at federico _Oo_ fissore.org

A final note

I must admit that JRecordBind is currently compiled with Java 6. But it could be easily ported to Java 1.4. Do you think I should? My ego says “Noo! Java 1.4 is dead. Long live Java 1.4!” but since host files are old, maybe old 1.4 software could benefit of this tool.
Uhmm, I’m at a crossroad.

Areaserver non funziona bene

July
13th
2008

Se state avendo problemi, se non vi rispondono, se vi bloccano, non siete soli.

Ora mi attivo per avere la mia macchina in housing…

(ps: il titolo รจ un eufemismo)

Should I change my eating habits?

July
12th
2008

Well, at least I don’t eat fast food crap…

Encyclopedia page on Berlusconi

July
8th
2008

Maybe you have heard about the USA gaffe about Berlusconi: at the 34th G8 summit, held in Japan, the USA press kit described our prime minister as

one of the most controversial leaders in the history of a country known for governmental corruption and vice

adding that he

is regarded by many as a political dilettante who gained his high office only through use of his considerable influence on the national media

Well, if that’s true, the Encyclopedia page from which these definitions come will soon be modified. By the way, we are not new to such things.

So let’s save it in an unmodifiable form (thanks to Abduction!)

Oh no, not again

June
26th
2008

For the benefit of our nation and of search engines: today’s editorial comment from the Financial Times says in english what less than half Italians think.

In the meanwhile, WALL-E is coming to tidy up Naples.

Gentoo: bad for the environmentalist, good for the developer

June
15th
2008

Gentoo is a source based distro: usually, every software you need will be downloaded in source code form and compiled right on your box.
This opens up a whole set of optimizations, making Gentoo usually a bit faster than other distros, as it is more specialized and can take advantage of your own CPU instruction sets (think about MMX, SSE and 3DNow!).

These optimizations make some guy see Gentoo as an environment friendly distro: software is optimized, therefore less energy is required to accomplish the same task.

But even the less intuitive can understand that having a computer stuck at 100%, compiling for hours, it’s not really good for the environment.

Nonetheless, I still use Gentoo and I suggest using it to my coworkers. To me Gentoo is the perfect distro for every developer as it helps you understanding your box (and even the differences with other’s boxes, if you start contributing your ebuilds)
Understanding the main tool you (as a developer) use, will make you more efficient: you’ll start having answers to others questions, because you have seen your installation growing up, step by step.

That’s my point in using Gentoo: my box is in the palm of my hand. I know almost anything of it. I usually know why things happen, on the contrary of my coworkers, that waste time and productivity finding workarounds to things they don’t know.

Something that reflects the quality of their job, as they produce software that sometimes misbehaves.

If you want to be a good developer, start understanding your box now. Whatever operating system you use, shit is unlikely to happen: everything happens for a reason. If you think your OS makes it hard to understand, try another.

Juggling rhythm and motion

June
4th
2008

I’ve just watched this beautiful video on TED.
If your eyes will closely follow the things he uses, you’ll be amazed by the 3D shapes he’s drawing in the air.
And you’ll learn something about learning, maybe recalling some old feeling.
Don’t want to anticipate, just sit and watch it