Problems with the grammar

August 18, 2008

Found on a download page:

Problems with the download please use this direct link or try another mirror.

At first glance, these words do suggest some kind of understandable concept. But it seems to be communicated by less of a sentence structure and more of a stream of consciousness technique. It’s really quite literary.

The GPS Made Me Do It

August 14, 2008

GPS devices have to be careful about how they phrase things, so they won’t get sued. People will do anything a GPS tells them – did you see that episode of The Office?

So, for example, if you need to do a U-turn, it will say “make a legal U-turn.” Problem is, that sounds a lot like “make illegal U-turn.” How specific do I have to be at following these directions anyway?

BBC: “What is this…’search engine’?”

August 14, 2008

The BBC clearly has no idea what a search engine is. Check out this excerpt from the article “Mozilla plans Luganda web search“:

Internet search engine Mozilla Firefox has launched a project in Uganda to translate its searches into the local Luganda language.

Firefox isn’t a search engine – it’s a web browser. So, then, what can this even mean? Are they creating a search engine? Are they adding features to translate search terms before sending them to another search engine?

Updated: the article has been updated to remove all references to search engines, presumably after receiving e-mails from everybody who read the article.

The Secret to Losing

August 13, 2008

Here’s some great spam I just received:

Here’s a great e-book..”The secrets to winning every single time in everything you do” By jim Edwards

…except capitalization.

Abolish the Run-On

August 13, 2008

From the Ron Paul Campaign for Liberty blog:

Yesterday Ron Paul endorsed Republican George Lilly, running in Colorado’s the 1st Congressional District, defeated Charles Crain for the right to take on six-term incumbent Denver Democrat Rep. Diana DeGette in the November general election.

If only Ron Paul’s minimalist views of government carried over into minimalist views of sentence structure. Amongst the violations: I’ve never seen a “the” used after a possessive before. It’s almost impossible to read the first clause without reading it as the main clause: “Ron Paul endorsed George Lilly.” That’s what happened, right? This probably could have been a whole paragraph. This is “the internets,” guys – we’re not killing trees here.

Branding or Typo? Part 1

August 13, 2008

This is the first in what’s likely to be a recurring category for Unintentional Genius – Branding or Typo? Creative names are a must for companies and products today, especially if you want to get a simple domain name. Changing the spelling of words is one way to do it. But some names make you wonder just how intentional the spelling change is…

Today’s winners:

  • Perficient – “experts in delivering business-driven technology solutions.” Not in spelling, though, apparently. I worked for them for a while, and now the word “proficient” actually sounds wrong to me. Dumbification complete.
  • Davisor Publishor – software to convert Word documents into PDFs. Maybe they should have checked with an “editer” before they picked this name. I’m not entirely sure that it’s not really a 1980’s robot.


August 13, 2008

Found on a random programming discussion board:

And frankly said, I don’t begrudge [sp?] any penny to a programmer who manages to correctly parse and decode any incarnation of the proprietary, badly (if at all) documented Word formats.

And *I* don’t begrudge any penny to a person who manages to correctly parse and decode any incarnation of that badly (if at all) written sentence. Seriously, dude, this is English, not Lisp. I read 18th century theology books, and *I* had trouble with that one.

xhtmlrenderer PDF Servlet Filter

August 12, 2008

I managed to get xhtmlrenderer working as a Servlet Filter, so that any HTML page you apply the filter to will be converted to PDF. Here are a few hints:

  • If you want to keep the XHTML in memory rather than writing it out to a file, then you’ll need an XML parser like Xerces to parse the XHTML into a DOM object before you can pass it to xhtmlrenderer. (iText has got to have some kind of XML parser it uses that you could probably use too, instead of including a separate library. I just didn’t take the time to figure it out.)
  • You’ll need something like a ByteArrayServletOutputStream to capture the JSP output in-memory so you can then convert it to PDF. Catalina has one.
  • If you have a table that spans multiple pages and you want to repeat the table header and footer on each page, use the custom CSS attribute “-fs-table-paginate: paginate;” on the table.
  • Be sure to pass xhtmlrenderer the URL of the page it’s rendering, so that it can access relative URLs to pull up external resources like images and CSS files.
  • I’m using JSPs as the templating solution, and I ran into some buffering issues where no content was written into the ServletOutputStream when I was applying the filter. A manual call to out.flush() at the end of the JSP works for now, but I’m looking for a better solution.

Java PDF Libraries

August 8, 2008

Looking today for a few OSS options for generating PDFs from Java. Here’s a quick summary of what I’ve found:

  • Apache FOP – generates PDFs from a library-specific XML document. You can use XSLT to translate your own XML into the library-specific XML.
  • iText – generates PDFs using API calls.
  • xhtmlrenderer (AKA Flying Saucer Project) – generates PDFs from HTML documents. You can use your regular templating engine to create the HTML, or even put the renderer in a servlet filter in order to PDFify JSP output. As a result, maintenance is easier than with the other frameworks, because you’re maintaining template files of the same kind as your webapp. HTML is going to be less flexible than native PDF commands, but there is a workaround for repeating table headers and footers on each page, for example.

A well-known library I don’t recommend is pd4ml – it also generates PDFs from HTML documents, but, if memory serves me correctly, it isn’t as feature rich as xhtmlrenderer, and it’s also commercial (non-free) software.