<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:posterous="http://posterous.com/help/rss/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>frank's blog and homepage</title>
    <link>http://frank.zinepal.com</link>
    <description>Most recent posts at frank's blog and homepage</description>
    <generator>posterous.com</generator>
    <link xmlns="http://www.w3.org/2005/Atom" type="application/json" href="http://posterous.com/api/sup_update#6ffa373e5" rel="http://api.friendfeed.com/2008/03#sup" />
    
    
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/franks-blog-and-homepage" /><feedburner:info uri="franks-blog-and-homepage" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://posterous.superfeedr.com/" /><item>
      <pubDate>Sun, 23 Jan 2011 15:53:00 -0800</pubDate>
      <title>Printing Directly to a Network Printer</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/74PBvBEf3W0/printing-directly-to-a-network-printer</link>
      <guid isPermaLink="false">http://frank.zinepal.com/printing-directly-to-a-network-printer</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Recently I had to print from a mobile Java application that was being developed for both BlackBerry and Android. Printing from Java SE on the desktop is quite easy by using either the&amp;nbsp;&lt;a href="http://java.sun.com/javase/technologies/desktop/printing" target="_blank"&gt;Java Print Service&lt;/a&gt;&amp;nbsp;API or the older &lt;a href="http://java.sun.com/developer/onlineTraining/Programming/JDCBook/render.html" target="_blank"&gt;java.awt.print&lt;/a&gt; API for printing Swing/AWT components. Unfortunately neither of these APIs is available in the mobile Java environments for BlackBerry or Android.&lt;/p&gt;
&lt;p /&gt;
&lt;div&gt;Instead I figured it should be possible to create the print data on my own and send it directly to a network printer. It turns out this was a bit trickier than I expected, so I decided to write this blog post about it. At the end of this post I also include some useful links to other reference material.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;div&gt;The first question I had was which port on the network printer to use. Port 9100 is the standard port for the "RAW" print protocol. This port appears to be used by all network printers. Many printers also support the Internet Printing Protocol on port 631.&amp;nbsp;Some printers even support the LPD printer protocol on port 515. The LPD protocol is quite old and is documented in&amp;nbsp;&lt;a href="http://tools.ietf.org/html/rfc1179" target="_blank"&gt;RFC 1179&lt;/a&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;I was a bit confused initially since in my research port 9100 was often referred to as the port for the "RAW" print protocol. It turns out there is no "protocol" here, it is indeed simply the raw print data that can be sent directly to this port and the printer will interpret it for printing. Therefore port 9100 is most likely what you want to use, unless you need some of the features provided by the other protocols. I decided to print directly to port 9100.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;The next question is, what "raw" print data should be sent to the printer? Printers expect print data in a Page Description Language (PDL). There are two common PDL languages in use today. One is PostScript from Adobe and the other is the Printer Command Language (PCL) from HP. There are also some other manufacturer specific languages such as UFRII from Canon, but they only work with printers from that manufacturer.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;PostScript has a lot of history and there are several Java libraries available for generating PostScript code. I was under the assumption that all network laser printers today support PostScript, so I started with that. The problem was that sending PostScript to our office printer resulted in it simply printing the PostScript source as plain text. Not good!&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;This led me to discover a third printer language that is in common use today: Printer Job Language (PJL) which was also developed by HP. PJL sits above languages like PostScript and PCL. It can be used to set printer parameters and then switch the printer into the desired page description language (usually either PostScript or PCL).&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;After discovering PJL I modified my prototype to first send some PJL commands to switch the printer into PostScript mode. Unfortunately this still did not work on any of the printers I tried. They either printed nothing at all or the PostScript code as plain text. After more research I discovered that in fact PostScript is not commonly supported. You usually have to purchase a printer add-on for PostScript support. So it turns out that in the end there is no way around using PCL. This is where the fun really started since PCL is quite cryptic and there are no existing PCL generation libraries for Java that I could find.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Next I am going to explain how to send a simple PJL/PCL print job directly to a network printer on port 9100.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;strong&gt;PJL Commands&lt;/strong&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;The first thing you need to send to the printer are some PJL commands.&amp;nbsp;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;All PJL commands start with an escape sequence:&amp;nbsp;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;%&amp;ndash;12345X&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Here &lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;&lt;/span&gt; is the code for the ESC key (decimal 27, hex 1B) and the others are regular ASCII characters.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;This escape sequence has to be included at the start of all PJL command sequences. After the escape sequence each PJL command appears as plain text and is terminated by CR-LF characters. Here are some basic PJL commands to switch the printer into PCL mode:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;%&amp;ndash;12345X@PJL JOB NAME = "My Print Job Name" &amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;@PJL ENTER LANGUAGE = PCL &amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Notice that there is no newline between the escape sequence and the first PJL command. This is intentional. Newlines only appear after the first PJL command. The PCL print data is sent directly after the ENTER LANGUAGE command.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;After sending the PCL print data the printer has to be switched back to PJL mode so that we can end the print job. This is done by again sending the PJL escape sequence followed by the end of job command:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;%&amp;ndash;12345X @PJL EOF &amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;%&amp;ndash;12345X&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Notice that the final thing we send is the PJL escape sequence one more time, without anything after it (no newlines).&amp;nbsp;Therefore a complete PJL command sequence would look like this:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;%&amp;ndash;12345X@PJL JOB NAME = "My Print Job Name" &amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;@PJL ENTER LANGUAGE = PCL &amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;PCL COMMANDS HERE&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&lt;span style="font-family: arial;"&gt; &lt;/span&gt;&lt;/span&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;%&amp;ndash;12345X @PJL EOF &amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;%&amp;ndash;12345X&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;That was pretty easy. PJL basically forms an envelope around PCL (or PostScript). There are a few other PJL commands, most importantly the SET command that is used to configure various printer options. This is not needed unless you want to switch the page size, change the number of copies, etc. More information can be found in the &lt;a href="http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13208/bpl13208.pdf" target="_blank"&gt;HP PJL Technical Reference Manual&lt;/a&gt;.&lt;/div&gt;
&lt;p /&gt;
&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;PCL Commands&lt;/strong&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;The trickier part is sending the print data in the form of PCL commands.&amp;nbsp;All PCL commands start with the &lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;&lt;/span&gt; character followed by the command identifier. Note that PCL commands are not terminated by newline characters. Any text that follows a PCL command is simply printed as text on the page, unless it is preceded by the &lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;&lt;/span&gt; character and recognized as another PCL command. Any newlines within the PCL commands are interpreted for printing.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;The first PCL command you have to know is the reset command:&amp;nbsp;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;E&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;In general this is the first command you send to reset the printer and start a new page. For example, to start a new page and print "Hello World" at the top of the page you would send this:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;EHello World&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Notice that there is no space between the PCL command and the "Hello World" text. It's not needed!&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;strong&gt;Moving Around The Page&lt;/strong&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Now, what if we want to print "Hello World" somewhere else on the page? In this case you can use the PCL move commands:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*p150X&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*p150Y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;Hello World&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;This moves 150 units along the X and Y axes respectively. Notice that no newline characters appear between the commands. I write out the text using newlines for readability, but they don't appear in the actual commands sent to the printer.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Since both move commands use the &lt;span style="font-family: courier new, monospace;"&gt;*p&lt;/span&gt; command prefix we can actually combine them into a single command, like this:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*p150x150Y&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Notice that the "x" is in lowercase. When commands with the same command prefix are combined, then only the last command suffix is spelled in uppercase. In this case "Y" is last, so it is spelled in uppercase and the "x" in-between is in lowercase.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;So far so good. Now you are probably wondering, what are the units that I am moving around with?&amp;nbsp;This depends on the printer defaults, but we can explicitly specify it using some handy PCL commands:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;&amp;amp;u150D&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*t150R&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;These two commands set the dots-per-inch (DPI) resolution of text and graphics operations respectively. In this case I am setting the resolution to 150 DPI. That means when I move 150 units I am moving 1 inch on the page along each axis. Nice!&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;strong&gt;Let's See Some Colors&lt;/strong&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Wouldn't it be nice to print in color? This requires a couple of PCL commands to be set up correctly. First we need to tell the printer to use the RGB color space:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*v6W&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;This selects the RGB color space with 8-bits per pixel. Next we need to specify the color we want to use:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*v255a0b0C&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Notice that there are three components to this command: red (a), green (b) and blue (c). In this case I am selecting the color red with no green or blue.&amp;nbsp;Finally I need to store the selected color in a color palette and select it for use:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*v0i0S&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;This command first assigns the color to palette index 0 (the i command) and then selects that palette (the S command).&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Very nice. If I were to write some text or draw something it would now come out in red. You can even combine all of these commands into a single command string since they all use the &lt;span style="font-family: courier new, monospace;"&gt;*v&lt;/span&gt; prefix:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*v6w255a0b0c0i0S&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Note that the "W" command to select the RGB color space is really only needed once and could be sent at the beginning right after the reset command. If you are printing a large document it can significantly reduce the document size to not include extra commands when not needed. That's also why you combine commands into one string, so you don't have to include the &lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;&lt;/span&gt; character all the time.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;strong&gt;Let's Draw Some Graphics&lt;/strong&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Now that we can draw text and use colors, how about some graphics? Here are the basic commands to fill a box on the page:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&amp;lt;ESC&amp;gt;*c300a150b5P&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;This fills a box 300 dots (2 inches) wide along the horizontal axis and 150 dots (1 inch) high along the vertical axis. The "5P" command at the end selects the current color palette. So in our case the box would be filled in red.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Using these commands you can also draw box outlines. You would simply fill very narrow boxes for each side of the box outline that you are drawing. The narrow box you are filling in effect becomes a line and four lines make ... another box! Makes sense, right?&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;strong&gt;Putting It All Together&lt;/strong&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;I've provided a quick overview of the most useful commands and how they all fit together. There are many more PCL commands to select font family, size, style, etc. and also draw boxes in different fill patterns. You can find a reference of all these commands in the &lt;a href="http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13210/bpl13210.pdf" target="_blank"&gt;HP PCL5 Technical Reference Manual&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;PCL includes a number of common fonts. If you want to use other font families you have to first upload them to the printer, which is something that I didn't need to do. It's also possible to upload bitmap images or TIFF images to the printer, again something that I didn't get in to. All of that is explained in the reference manual.&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Once I had enough experience with the basic PCL commands I put together a nice Java class similar to the "java.awt.Graphics" class. The constructor accepts an OutputStream as a parameter and the class will write all PCL commands to the output stream. It provides methods to start a new document, set the font/color, draw text, draw lines, etc.&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;/ul&gt;
&lt;div&gt;While it's pretty basic this class does everything I needed. I could draw text with different styles and also draw little line and bar graphs. I can't share the code for this here, but hopefully my post gives you enough ideas to implement it yourself.&lt;/div&gt;
&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;strong&gt;More Resources&lt;/strong&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;Here are a few more useful resources:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13208/bpl13208.pdf" target="_blank"&gt;HP PJL Technical Reference Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13210/bpl13210.pdf" target="_blank"&gt;HP PCL5 Technical Reference Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13212/bpl13212.pdf"&gt;HP PCL5 Color Technical Reference Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13205/bpl13205.pdf" target="_blank"&gt;HP PCL5 Technical Quick Reference Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.developersupport.canon.com/" target="_blank"&gt;Canon Developer Support&lt;/a&gt;&amp;nbsp;- very good free resource for working with Canon printers&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.pclreader.com" target="_blank"&gt;PCL Reader&lt;/a&gt; - a good PCL file viewer for Windows (better than wasting lots of paper)&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/printing-directly-to-a-network-printer"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/printing-directly-to-a-network-printer#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/74PBvBEf3W0" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/856670/blah.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YwIl4sOqAlH</posterous:profileUrl>
        <posterous:firstName>Frank</posterous:firstName>
        <posterous:lastName>Worsley</posterous:lastName>
        <posterous:nickName>fworsley</posterous:nickName>
        <posterous:displayName>Frank Worsley</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://frank.zinepal.com/printing-directly-to-a-network-printer</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 30 Nov 2010 19:36:09 -0800</pubDate>
      <title>Dinosauritis</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/yV0y3chPjKA/dinosauritis</link>
      <guid isPermaLink="false">http://frank.zinepal.com/dinosauritis</guid>
      <description>&lt;p&gt;
	I just wanted to give a quick shout out to my friend Patrick Tuckey who recently released his sweet new album of dinosaur rap music!&lt;p /&gt;&lt;div&gt;That&amp;#39;s right... dinosaur rap music. The album is called &lt;a href="http://unlikelee.com/album/dinosauritis"&gt;Dinosauritis&lt;/a&gt; and you can &lt;a href="http://unlikelee.com/album/dinosauritis"&gt;check it out here&lt;/a&gt;.&lt;/div&gt; &lt;p /&gt;&lt;div&gt;If you follow the link you can stream the entire album or download your very own copy in MP3 or FLAC format for a mere $3!&lt;/div&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/dinosauritis"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/dinosauritis#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/yV0y3chPjKA" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/856670/blah.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YwIl4sOqAlH</posterous:profileUrl>
        <posterous:firstName>Frank</posterous:firstName>
        <posterous:lastName>Worsley</posterous:lastName>
        <posterous:nickName>fworsley</posterous:nickName>
        <posterous:displayName>Frank Worsley</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://frank.zinepal.com/dinosauritis</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 24 Nov 2010 19:20:00 -0800</pubDate>
      <title>blog moved to Posterous</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/NOx2ogg8ntA/blog-moved-to-posterous</link>
      <guid isPermaLink="false">http://frank.zinepal.com/blog-moved-to-posterous</guid>
      <description>&lt;p&gt;
	&lt;p&gt;It's been a long time since I've written anything on here. Maybe that's because the blog was running on a really old Drupal 4.7 installation and I didn't feel like updating it. Last week I finally bit the bullet and migrated the blog to Posterous. I like Posterous because of their clean interface and easy to use e-mail posting capabilities. Their handling of post attachments is also really smart; organizing images into galleries, previewing PDFs using Scribd, etc.&lt;/p&gt;
&lt;p&gt;Unfortunately Posterous does not have direct import functionality for Drupal, but they do have an easy to use API. I threw together a quick PHP script that reads blog posts and comments from my old Drupal 4.7 blog and imports them into Posterous. I've attached the script to this post since it might be useful to someone else. One thing to note is that the script does not preserve post formatting, so you will have to reformat your posts once imported into Posterous. That's because Drupal does not store the filtered content in the database. I didn't have very many posts, so this wasn't a big deal, but if you are importing lots of posts then you probably want to modify the script to filter the content and add HTML formatting before sending it to Posterous.&lt;/p&gt;
&lt;p&gt;&lt;div class='p_embed p_file_embed'&gt;
&lt;a href="http://frank.zinepal.com/blog-moved-to-posterous"&gt;&lt;img alt="" src="http://posterous.com/images/filetypes/unknown.png" /&gt;&lt;/a&gt;
&lt;div class='p_embed_description'&gt;
&lt;strong&gt;import-drupal-to-posterous.php&lt;/strong&gt;
&lt;a href="http://getfile9.posterous.com/getfile/files.posterous.com/fworsley/Q1YN5CqhdLXsX29a1FHLzi6UmfF43yteZ1USNJg7BVN28XxU13GajonqGMTv/import-drupal-to-posterous.php"&gt;Download this file&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/blog-moved-to-posterous"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/blog-moved-to-posterous#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/NOx2ogg8ntA" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/856670/blah.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YwIl4sOqAlH</posterous:profileUrl>
        <posterous:firstName>Frank</posterous:firstName>
        <posterous:lastName>Worsley</posterous:lastName>
        <posterous:nickName>fworsley</posterous:nickName>
        <posterous:displayName>Frank Worsley</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://frank.zinepal.com/blog-moved-to-posterous</feedburner:origLink></item>
    <item>
      <pubDate>Fri, 22 May 2009 12:10:00 -0700</pubDate>
      <title>a better way to detect Java WebStart</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/12c8mKDiWmA/a-better-way-to-detect-java-webstart</link>
      <guid isPermaLink="false">http://frank.zinepal.com/a-better-way-to-detect-java-webstart</guid>
      <description>&lt;p&gt;
	&lt;p&gt;So, just as I wrote that I wouldn't be posting much in future, I thought I would quickly post this little tidbit. There are various ways described online that you can use to detect if a client has Java WebStart installed. The problem is all of them require you to mix in VBScript for Internet Explorer and then use Javascript for the other browsers. There is a way you can support Internet Explorer and still use only Javascript. Check it out:&lt;/p&gt;
&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;function jwsInstalled() {     
      // For Internet Explorer.
      if (navigator.userAgent.indexOf('MSIE') &amp;gt; -1) {
          try {
              var jws = new ActiveXObject('JavaWebStart.isInstalled');
              return true;
          }
          catch (e) {
              return false;
          }
      }

      // Firefox is happy with &amp;quot;x-java-jnlp-file&amp;quot;. For Chrome and Safari
      // this does not work, instead I just check for &amp;quot;x-java-vm&amp;quot;.
      // If they have a recent JVM installed, then they usually also have
      // Java WebStart installed.
      return navigator.mimeTypes &amp;amp;&amp;amp;
             navigator.mimeTypes.length &amp;amp;&amp;amp;
                 (navigator.mimeTypes['application/x-java-jnlp-file'] != null ||
                  navigator.mimeTypes['application/x-java-vm'] != null);
}&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I use this to popup a little dialog and tell users to download a new JRE if Java WebStart is not installed. It works pretty well. And yes, it's 2009 and I'm still using Java WebStart ... although I do have a good reason for it. :-)&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/a-better-way-to-detect-java-webstart"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/a-better-way-to-detect-java-webstart#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/12c8mKDiWmA" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/a-better-way-to-detect-java-webstart</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 21 May 2009 15:28:51 -0700</pubDate>
      <title>no new posts lately</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/-bFuX1zZDo0/no-new-posts-lately</link>
      <guid isPermaLink="false">http://frank.zinepal.com/no-new-posts-lately</guid>
      <description>&lt;p&gt;
	I haven't added any new blog posts lately. I blog quite infrequently anyway, but now that I'm working on my &lt;a href="http://www.zinepal.com"&gt;zinepal.com&lt;/a&gt;  project all the blog posts are on the &lt;a href="http://www.zinepal.com/blog"&gt;zinepal.com blog&lt;/a&gt;. Check it out if you're interested in staying up to date with what I'm doing. I don't think I'll be posting on this site very much in the near future. You can also &lt;a href="http://www.twitter.com/zinepal"&gt;follow zinepal.com on Twitter&lt;/a&gt;.
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/no-new-posts-lately"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/no-new-posts-lately#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/-bFuX1zZDo0" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/no-new-posts-lately</feedburner:origLink></item>
    <item>
      <pubDate>Sun, 11 Jan 2009 21:18:00 -0800</pubDate>
      <title>zinepal.com short pitch</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/m73DAieHNYo/zinepalcom-short-pitch</link>
      <guid isPermaLink="false">http://frank.zinepal.com/zinepalcom-short-pitch</guid>
      <description>&lt;p&gt;
	&lt;p&gt;I have been lazy and haven't posted anything in a while. But, here is a cool &lt;a href="http://blip.tv/file/1651373"&gt;short video of me&lt;/a&gt; presenting a pitch for &lt;a href="http://www.zinepal.com"&gt;zinepal.com&lt;/a&gt; at the &lt;a href="http://www.momovan.com/"&gt;Mobile Monday Vancouver&lt;/a&gt; event in November 2008.&lt;/p&gt;
&lt;p&gt;The video was recorded and put together by &lt;a href="http://brucesharpe.blogspot.com"&gt;Bruce Sharpe&lt;/a&gt; from &lt;a href="http://www.singularsoftware.com"&gt;Singular Software&lt;/a&gt;. Thank you, Bruce!&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/zinepalcom-short-pitch"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/zinepalcom-short-pitch#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/m73DAieHNYo" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/zinepalcom-short-pitch</feedburner:origLink></item>
    <item>
      <pubDate>Sun, 02 Nov 2008 06:55:00 -0800</pubDate>
      <title>so it's called "printcasting"</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/QKpxgqhM3sA/so-its-called-printcasting</link>
      <guid isPermaLink="false">http://frank.zinepal.com/so-its-called-printcasting</guid>
      <description>&lt;p&gt;
	&lt;p&gt;I've been pretty busy lately and haven't worked on &lt;a href="http://www.zinepal.com"&gt;zinepal.com&lt;/a&gt; that much.&lt;/p&gt;
&lt;p&gt;Last week I also found out about the &lt;a href="http://www.newschallenge.org"&gt;Knight Foundation News Challenge&lt;/a&gt;. The Knight Foundation is a not-for-profit group that grants awards to new media and journalism projects through their News Challenge. Unfortunately the 2009 challenge closed on November 1st and I didn't have enough time to apply.&lt;/p&gt;
&lt;p&gt;Last year the &lt;a href="http://www.printcasting.com"&gt;printcasting.com&lt;/a&gt; project was awarded a &lt;a href="http://www.newschallenge.org/printcasting"&gt;significant grant&lt;/a&gt; through this challenge. The interesting thing is that their ideas are pretty much exactly the same things I am trying to achieve with zinepal.com. Now I really wish I had heard about this challenge sooner.&lt;/p&gt;
&lt;p&gt;But at least now I know what the whole concept behind zinepal.com is called: printcasting.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/so-its-called-printcasting"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/so-its-called-printcasting#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/QKpxgqhM3sA" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/so-its-called-printcasting</feedburner:origLink></item>
    <item>
      <pubDate>Fri, 19 Sep 2008 08:33:00 -0700</pubDate>
      <title>zinepal.com at Launch Party Vancouver</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/xnXS_QU9oQM/zinepalcom-at-launch-party-vancouver</link>
      <guid isPermaLink="false">http://frank.zinepal.com/zinepalcom-at-launch-party-vancouver</guid>
      <description>&lt;p&gt;
	&lt;p&gt;I demoed &lt;a href="http://www.zinepal.com"&gt;zinepal.com&lt;/a&gt; at &lt;a href="http://www.launchpartyhq.com"&gt;Launch Party Vancouver&lt;/a&gt; yesterday. Go to the &lt;a href="http://www.zinepal.com/blog"&gt;zinepal.com blog&lt;/a&gt; to read a bit more about it.&lt;/p&gt;
&lt;p&gt;I also submitted a zinepal.com video for their contest. &lt;a href="http://lpv5.launchpartyhq.com/entries"&gt;Go here&lt;/a&gt; to check it out and don't forget to vote for me.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/zinepalcom-at-launch-party-vancouver"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/zinepalcom-at-launch-party-vancouver#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/xnXS_QU9oQM" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/zinepalcom-at-launch-party-vancouver</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 05 Aug 2008 13:07:00 -0700</pubDate>
      <title>zinepal.com - create custom printable zines from any online content</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/C5viJN9QGQE/zinepalcom-create-custom-printable-zines-from</link>
      <guid isPermaLink="false">http://frank.zinepal.com/zinepalcom-create-custom-printable-zines-from</guid>
      <description>&lt;p&gt;
	&lt;p&gt;&lt;a href="http://www.zinepal.com"&gt;zinepal.com&lt;/a&gt; is my latest project that I've been working on for half a year now. Zinepal enables you to easily create custom printable zines from any online content. While it is primarily intended for blog content it will work with any web page that provides substantial text or image content that can be isolated and reformatted for printing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Idea&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;There are two main ideas that motivated me to work on zinepal.com. The first is to bridge the gap between online media and the traditional paper media. Zinepal enables bloggers to easily make their content available as a printable zine. When readers print the blog zine the content is now reaching a whole new audience. Readers in coffee shops, on the bus, in the park ... all the places the Internet either doesn't go or is inconvenient to use. I mean, who wants to read the newspaper on their iPhone? This can create a viral effect as readers leave behind copies of the blog zine and new readers pick it up. For example, you may find a blog zine from local blogs in your favorite coffee shop, providing you with great alternative content that is relevant to you.&lt;/p&gt;
&lt;p&gt;The other idea behind Zinepal is to cater to another group of Internet users. Currently you could broadly classify Internet users as content creators and content consumers. Content creators are the bloggers that regularly write on their blog. The consumers are the readers of blog content and other Internet news outlets. As a creator I may frequently write blog content that is not interesting to a larger audience. The consumers are now faced with the task of sorting through many blogs to find the small nuggets of content they are interested in. For example, some of my friends have hundreds of blogs in their feed readers and have to sort through all the uninteresting content to find the good stuff.&lt;/p&gt;
&lt;p&gt;This is where the new group of Internet users comes in: the editors. As opposed to sites driven by popular opinion such as Digg or Reddit, the editors focus on their specific topics of interest and create zines based on this. As a reader I can then follow the zines of the editors I trust. I now have a human filter that does all the work of sorting through blogs for me. The advantage to the editors is the ability to gain recognition and readership for their custom zines, the same way good bloggers gain readership for their blog.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Technical Challenges&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The biggest technical challenge for Zinepal was coming up with the technology to reliably extract and reformat content from all the different blogs and websites on the Internet. This was required due to the fact that most RSS or Atom feeds only include snippets of content in the feed. I've spent most of my time so far working on this technology and getting it to the point where it works reasonably well. It's still not perfect and I can think of a few more important enhancements to make, but at least for a start I think it is good enough.&lt;/p&gt;
&lt;p&gt;Instead lately I have been focusing on the website part of Zinepal to enable users to actually start using the technology. So please, go ahead and &lt;a&gt;visit zinepal.com to give it a try!&lt;/a&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/zinepalcom-create-custom-printable-zines-from"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/zinepalcom-create-custom-printable-zines-from#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/C5viJN9QGQE" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/zinepalcom-create-custom-printable-zines-from</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 30 Jul 2008 23:42:00 -0700</pubDate>
      <title>File Type Manager source code</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/Vat-QbEi6TE/file-type-manager-source-code</link>
      <guid isPermaLink="false">http://frank.zinepal.com/file-type-manager-source-code</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Due to the renewed popularity of File Type Manager (mainly because of Windows Vista) I've decided to make the source code available. Maybe somebody else feels like working on this program some more. Keep in mind that I wrote this when in high school and just learning how to program, so it probably isn't the greatest code. Also it's written in Visual Basic 6. Ugh.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="http://members.shaw.ca/fworsley/ftm201_src.zip"&gt;File Type Manager 2.0.1 Source Code&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Note that I've licensed it under the LGPL. It includes an ActiveX control that displays the file types, so you could re-use that somewhere else if you wanted to.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/file-type-manager-source-code"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/file-type-manager-source-code#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/Vat-QbEi6TE" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/file-type-manager-source-code</feedburner:origLink></item>
    <item>
      <pubDate>Sat, 10 May 2008 12:08:00 -0700</pubDate>
      <title>Web Comics</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/sb29O7R92vY/web-comics</link>
      <guid isPermaLink="false">http://frank.zinepal.com/web-comics</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Two people in my life have started publishing their own web comics.The first one is my dad, who is publishing his &lt;a href="http://www.neatstep.com"&gt;Neatstep&lt;/a&gt; comic. He's actually been doing this for over a year now and he keeps refining and redrawing the cartoons. That's because he's a perfectionist ... and he wants them to be perfect. Either way, you can already check them out online at &lt;a href="http://www.neatstep.com"&gt;neatstep.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The other person is my former roommate Pat who is working on his &lt;a href="http://www.terriblereality.com"&gt;Terrible Reality&lt;/a&gt; comic. He also started that a while ago, but then he went to Peru for a few months and stopped. But now he is back. I'm going to have to take credit for coming up with the phrase "Terrible Reality" that he is now using as the name for his cartoon. Maybe one day he will add a comic that explains the origin ...&lt;/p&gt;
&lt;p&gt;Anyway, this is kind of funny since the two comics are both based on the life experiences of the writers, but they could not be any more different. You should check them out, they are both quite awesome.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/web-comics"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/web-comics#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/sb29O7R92vY" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/web-comics</feedburner:origLink></item>
    <item>
      <pubDate>Sun, 25 Nov 2007 13:22:00 -0800</pubDate>
      <title>Working Part-Time, Moving, Starting Web 2.0 Project</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/sWeHhqtX6lg/working-part-time-moving-starting-web-20-proj</link>
      <guid isPermaLink="false">http://frank.zinepal.com/working-part-time-moving-starting-web-20-proj</guid>
      <description>&lt;p&gt;
	&lt;p&gt;I thought I would write a quick blog entry to update everyone on the latest happenings...&lt;/p&gt;
&lt;p&gt;First off, since November 1st I'm only working part-time at &lt;a href="http://www.genologics.com"&gt;GenoLogics&lt;/a&gt;. I'm spending two days a week working on a personal project. I came up with (what I think is) a really good idea for a Web 2.0 project. So I've cast away the chains of J2EE and I'm working with &lt;a href="http://www.php.net"&gt;PHP&lt;/a&gt; and &lt;a href="http://www.drupal.org"&gt;Drupal&lt;/a&gt; to create a nice Web 2.0 site. Yes, it will have all that AJAX goodness that the modern geek (user) is accustomed to.&lt;/p&gt;
&lt;p&gt;Why PHP/Drupal you ask? Well, I did look into Ruby on Rails and also some Python frameworks. The thing is that I know PHP/Drupal very well, so I can be productive very quickly. At this point I just didn't want to invest the time to learn a new framework. Also, Ruby on Rails just didn't really turn me on, although granted I spent very little time looking at it. The thing is with Drupal I get so much infrastructure that is already provided for me: security, comments, user profiles, theming, page generation, etc. I'm not sure why I would want to use Rails and roll it all for myself. Having the support of a large Drupal user community backing up your infrastructure is also a big plus.&lt;/p&gt;
&lt;p&gt;Anyway, the next thing is that I'm moving to Vancouver on December 1st. I'm getting a little bored in Victoria and also I think that the technology scene in Vancouver will be better. I'm looking forward to check out the Drupal and PHP user groups. Finding a place to live in Vancouver was pretty tough, but in the end I found a nice 1 bedroom in Kitsilano. So I guess I'm all set. :-)&lt;/p&gt;
&lt;p&gt;On another note: &lt;a href="http://www.genologics.com/company/careers.php"&gt;GenoLogics is hiring&lt;/a&gt;. You should apply. It's a good place.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/working-part-time-moving-starting-web-20-proj"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/working-part-time-moving-starting-web-20-proj#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/sWeHhqtX6lg" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/working-part-time-moving-starting-web-20-proj</feedburner:origLink></item>
    <item>
      <pubDate>Mon, 24 Sep 2007 21:43:00 -0700</pubDate>
      <title>Open a File in the Default Application using the Windows Command Line (without JDIC)</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/ftx7DtA3I2w/open-a-file-in-the-default-application-using</link>
      <guid isPermaLink="false">http://frank.zinepal.com/open-a-file-in-the-default-application-using</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Quite a few people have asked me about this in the past. If you have a file how can you open it in the default associated application without querying the registry or using some other Windows API? Or if you program in Java how can you do it without using JDIC?&lt;/p&gt;
&lt;p&gt;The easiest way to do this is using the "start" command. For example to open the file "readme.txt" in the default text editor you would do this:&lt;/p&gt;
&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;C:\&amp;gt;start readme.txt&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;You can also use start to open folders or follow shortcuts:&lt;/p&gt;
&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;C:\&amp;gt;start &amp;quot;My Shortcut&amp;quot;    &amp;lt;-- note that you don't need .lnk at the end&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This will open the target of the "My Shortcut" shortcut. If the shortcut points to a folder it will open a Windows Explorer window for it, if the shortcut points to a document it will open it in the default application and if the shortcut is for a program it will launch the program.&lt;/p&gt;
&lt;p&gt;The trick is that "start" isn't an executable. It is a built-in command of the Windows command line interpreter "cmd.exe". In Java (and other languages) if you try to create a process using the "start" command this will fail -- since there is no "start.exe" executable in the system.&lt;/p&gt;
&lt;p&gt;Instread you have to invoke "start" through the "cmd.exe" interpreter. This can be done using the /C flag:&lt;/p&gt;
&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;cmd /c &amp;quot;start readme.txt&amp;quot;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This can be run successfully in Java using Runtime.exec() or a ProcessBuilder. Simply calling "start" directly would fail. Note that this limitation is also true for many other Windows commands. If something fails to invoke you should always try running it using "cmd /c".&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/open-a-file-in-the-default-application-using"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/open-a-file-in-the-default-application-using#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/ftx7DtA3I2w" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/open-a-file-in-the-default-application-using</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 14 Aug 2007 22:37:00 -0700</pubDate>
      <title>JBossMQ JMS over HTTP performance gotchas</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/Y550RNkSWzs/jbossmq-jms-over-http-performance-gotchas</link>
      <guid isPermaLink="false">http://frank.zinepal.com/jbossmq-jms-over-http-performance-gotchas</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Here's a lesson I learned recently: Don't use JMS over HTTP if you want to have anything close to high-throughput, at least not if you are using JBossMQ. This may also be the case for other providers, depending on their HTTP client implementation.&lt;/p&gt;
&lt;p&gt;And here's why: When a JMS over HTTP client is subscribed to a JMS destination it is actually polling the server. It will connect, receive a message, close the connection, reconnect, get the next message, etc. That's because HTTP doesn't have persistent connections or server-client callbacks the way a binary protocol might have. The client needs to reconnect to the server with a new HTTP request every time it wants to check for messages.&lt;/p&gt;
&lt;p&gt;If you are receiving a lot of messages this will result in very frequent HTTP requests [1]. This causes memory and threading problems on the server as it spins up new threads to handle the requests.&lt;/p&gt;
&lt;p&gt;In my case this is made worse by the fact that the client will very frequently close an existing JMS consumer and create a new consumer with a different JMS selector. What happens in this case is that the new consumer will use a new outgoing port for its HTTP connection [2]. As the client rapidly creates new consumers and makes connections it will use up more and more ports. Windows is slow in cleaning up relinquished ports, so under heavy load when receiving a lot of messages and creating new consumers the client will eventually fail to connect when all ports are used up [3]. Making so many frequent HTTP connections on the client also causes memory and threading issues.&lt;/p&gt;
&lt;p&gt;Luckily this issue is easily addressed by switching to a different JMS protocol. By using the JBossMQ UIL2 protocol only a single port and persistent connection is used for JMS. This allows the client to rapidly receive messages and create/close consumers without problems.&lt;/p&gt;
&lt;p&gt;I thought this was an interesting problem since initially the implications of using JMS over HTTP weren't clear to me. The original idea of going over HTTP was to avoid opening an additional port on the server.&lt;/p&gt;
&lt;p&gt;Notes:&lt;/p&gt;
&lt;p&gt;[1] It is possible to set a property that will cause the client to wait before reconnecting to get the next message. However, this is not desirable if you want the client to process messages as quickly as possible.&lt;/p&gt;
&lt;p&gt;[2] Using a new outgoing port may happen even if you're receiving messages using the same consumer, without closing/creating new consumers. I didn't test that case.&lt;/p&gt;
&lt;p&gt;[3] On Windows the port limit can be increased to work around this part of the problem: &lt;a href="http://support.microsoft.com/kb/196271/EN-US/"&gt;KB196271&lt;/a&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/jbossmq-jms-over-http-performance-gotchas"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/jbossmq-jms-over-http-performance-gotchas#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/Y550RNkSWzs" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/jbossmq-jms-over-http-performance-gotchas</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 07 Aug 2007 22:32:35 -0700</pubDate>
      <title>More Pictures</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/ZQX2bfQ_US4/more-pictures</link>
      <guid isPermaLink="false">http://frank.zinepal.com/more-pictures</guid>
      <description>&lt;p&gt;
	I was productive over the long weekend and finally got the last set of travel pictures online:

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007NhaTrang"&gt;Nha Trang, Vietnam&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007HoChiMinhCity"&gt;Ho Chi Minh City, Vietnam&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007MekongDelta"&gt;Mekong Delta, Vietnam&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007PhenomPhen"&gt;Phenom Phen, Cambodia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007SiemReapAngkorWat"&gt;Siem Reap (Angkor Wat), Cambodia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007Thailand"&gt;Ko Phi Phi and Ton Sai Beach, Thailand&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/more-pictures"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/more-pictures#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/ZQX2bfQ_US4" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/more-pictures</feedburner:origLink></item>
    <item>
      <pubDate>Mon, 23 Jul 2007 23:32:00 -0700</pubDate>
      <title>Backpacking with Diabetes</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/765HyW9zVEs/backpacking-with-diabetes</link>
      <guid isPermaLink="false">http://frank.zinepal.com/backpacking-with-diabetes</guid>
      <description>&lt;p&gt;
	&lt;p&gt;A lot of people have asked me about my experiences backpacking in Asia being a Type 1 Diabetic. I thought I would write this blog entry about it since others might find it useful too.&lt;/p&gt;
&lt;p&gt;For background info, I traveled to Hong Kong, Vietnam, Cambodia and Thailand for seven and a half weeks in total. I've previously also traveled for six weeks in Europe, two weeks in Egypt, and many other one to two week business trips throughout Europe and North America. While some of my trips were quite long, they were not anything like the 6 months or multi-year trips that many of the other people you meet on the road are taking.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Planning Ahead&lt;/strong&gt; - The first thing I do before going on a trip is to carefully plan how much insulin and how many test strips I will need. I prefer to always bring all my supplies with me. Even if going for a few months this really isn't a problem. At room temperature insulin will keep for around two months and most of the time on the road you will find fridges.&lt;/p&gt;
&lt;p&gt;I always plan for many test strips since I find I test more often on the road. This is mostly because life isn't as "regulated" as it would be at home and I'm less confident in my insulin doses. For my Asia trip - even with generous planning - my test strips just lasted to the end and I went to the pharmacy the first day back in Canada to get more. Therefore I really don't think you can bring too many test strips.&lt;/p&gt;
&lt;p&gt;For insulin I plan ahead using my normal daily dosages as a baseline. In general I always use less insulin when traveling, so this way I will end up with a comfortable surplus of insulin at the end of the trip. I suspect I use less insulin when traveling since I am much more active. Hot climates seem to result in me using even less insulin, possibly because of the influence of the sun, because I eat less when it is hot, or simply because I'm even more active in a sunny climate. Note that the reduced insulin usage is only for pleasure trips. For business related trips I find I use more insulin, probably because I eat too much restaurant food, sit in too many meetings, get less exercise and am more stressed. Yes, business travel really isn't that good for you.&lt;/p&gt;
&lt;p&gt;I also always bring a good supply of sugar tablets (Dextrosol) and energy bars (Clif Bars). These work very well when low on sugar. I recommend Clif Bars over other brands since they keep very well in all climates. They don't freeze solid when it's cold and don't melt when it is hot. Also, they generally taste quite good. Dextrosol tables are always good to have, although they tend to get soggy in humid climates.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Caring for your Supplies on the Road&lt;/strong&gt; - One of my main concerns going to hot places was keeping my insulin cool. However, I've never had a problem with this. Almost all hostels or guest houses I have stayed at had either a shared fridge or a fridge in the room. Especially in Asia it is very common for the guest houses to have a mini-fridge in the room. That means I can easily leave my insulin in the fridge during the day. Basically the only time your insulin isn't refrigerated is while you are traveling from one place to another. This means that even for longer trips it shouldn't be a problem bringing your insulin, since it will last a long time when refrigerated.&lt;/p&gt;
&lt;p&gt;I have also never had a problem with theft of any kind while on the road. This may just be lucky, but in general I think leaving your medical supplies in a shared fridge is fine. I don't think anyone would have any interest in stealing that. Still, for safety I do always keep one vial of each insulin type and extra test strips in my backpack. When I need to refill my pen I use a vial from the backpack and then replace it with a new one from the refrigerated supply. This ensures that even if my main supplies get lost or stolen I still have enough to last for at least a week.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Getting more Supplies on the Road&lt;/strong&gt; - This is an interesting problem I've never had to deal with. In general I would assume this is only a problem in the developing world. In developed countries you should be able to get whatever you need, although the expenses will probably be out of your pocket. Even in the developing world the pharmacies in the bigger cities seem to be well stocked, although they might not have the exact brand/type you are used to. For example, in Thailand I checked in a pharmacy in Samui and they had blood glucose meters and test strips, but only for one type of meter. Samui is a smaller town, so I bet in Bangkok I could have gotten what I wanted.&lt;/p&gt;
&lt;p&gt;I try to save the sugar tables and energy bars I bring along for emergency situations and use local food instead. Coca Cola seems to be readily available in even remote places. Carrying around a can/bottle of coke to use in low sugar situations is a very easy solution. Buying fruit at the market is always possible, but it doesn't keep very well in a backpack. Finally each country usually has some sort of local snack that you can buy at the markets. For example in Asia one can always find various nut-based snack bars that are held together by caramelized sugar. These keep very well and work great for snacking or when low on sugar.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What else to bring&lt;/strong&gt; - Bringing a dry bag is a good idea when spending time on or near the water. It's great for carrying the insulin pen, test kit and food, for example when kayaking or boating.&lt;/p&gt;
&lt;p&gt;Buying one storage bag for all supplies is a good idea. I bought a nice first aid kit bag at MEC and use it for all my test strips, insulin, needles, sugar tablets, etc. Then I can just take the whole bag and put it in the fridge or put it in my luggage. It holds everything together and keeps it organized.&lt;/p&gt;
&lt;p&gt;Also, make sure you bring a letter from your doctor explaining that you need your medical supplies in carry on luggage. Since 9/11 I've always carried one with me but have so far only needed it once: in Hong Kong before flying back to Vancouver.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/backpacking-with-diabetes"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/backpacking-with-diabetes#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/765HyW9zVEs" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/backpacking-with-diabetes</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 19 Jul 2007 00:05:05 -0700</pubDate>
      <title>Pictures</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/j1LwIYO6OwE/pictures</link>
      <guid isPermaLink="false">http://frank.zinepal.com/pictures</guid>
      <description>&lt;p&gt;
	I stopped being lazy and managed to put up the first half of my photos from the Asia trip:

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007HongKong"&gt;Hong Kong&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007HalongBayVietnam"&gt;Halong Bay, Vietnam&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007HanoiVietnam"&gt;Hanoi, Vietnam&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007HueVietnam"&gt;Hue, Vietnam&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://picasaweb.google.com/fworsley/Asia2007HoiAnVietnam"&gt;Hoi An, Vietnam&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/pictures"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/pictures#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/j1LwIYO6OwE" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/pictures</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 04 Jul 2007 12:48:00 -0700</pubDate>
      <title>Hong Kong and Home</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/pj2mm_pAhSk/hong-kong-and-home</link>
      <guid isPermaLink="false">http://frank.zinepal.com/hong-kong-and-home</guid>
      <description>&lt;p&gt;
	&lt;p&gt;I survived the Full Moon Party and made my way back to Hong Kong. The party was pretty cool, but not as crazy as I expected. I'm not really sure what I was expecting, but basically it is just like a giant club right on the beach. There's a bunch of different stages that play different kinds of music. Techno, club music, hip-hop, etc. It was definitely way more packed than the previous night with a couple thousand people on the beach. Boats were dropping off people directly on the beach coming from other islands and beaches. I was pretty tired from the previous night, so I ended up taking it pretty easy during the Full Moon Party. At least I got to take it all in. Overall the coolest part for me was from the first night when an awesome band played. It could have been Bob Marley himself up on stage.&lt;/p&gt;
&lt;p&gt;The other cool thing was all the fire dancers on the beach. There had been fire dancers on Ton Sai Beach also, but the guys at the Full Moon Party were just over the top. It was unbelievable how fast they moved, tossing flaming sticks way up into the air and all sorts of other crazy moves. In general there was a lot of stuff with fire, such as: the flaming limbo stick, the giant burning skipping rope, the ring of fire, etc. It makes perfect sense if you think about it, get people drunk and let them play with fire. ;-)&lt;/p&gt;
&lt;p&gt;Anyway, after the party I had a day to recover then I flew to Hong Kong. I got there on July 1st which happened to be the 10 year anniversary of Hong Kong's return to China. I had no idea what was going on, but the friendly lady at the tourist info told me about the fire works that night. They were by far the biggest and longest fire works I've ever seen. It was almost ridiculous how long they went on, I think something like 45 minutes?? I'm not sure, but it was cool to see. There were thousands of people lining Nathan Street and the area around the art museum. I only got about half way down Nathan Street, so the fireworks were framed by skyscrapers on the left and right. It was pretty cool to catch this, especially since I had no idea about it before.&lt;/p&gt;
&lt;p&gt;Now I'm back in Victoria sitting in my parents living room. It's almost surreal to be back here. Everything in Canada is so clean and tidy and organized. And there is so much space and it's not all crowded with people. Wow! It's going to take a while to get used to this again. :-)&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/hong-kong-and-home"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/hong-kong-and-home#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/pj2mm_pAhSk" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/hong-kong-and-home</feedburner:origLink></item>
    <item>
      <pubDate>Fri, 29 Jun 2007 04:32:00 -0700</pubDate>
      <title>Full Moon Party</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/VSE3zQ3H4IM/full-moon-party</link>
      <guid isPermaLink="false">http://frank.zinepal.com/full-moon-party</guid>
      <description>&lt;p&gt;
	&lt;p&gt;I'm on Ko Phangan. The Full Moon Party is tonight. The pre-Full Moon Party was last night. Hence, I slept a lot today. :-)&lt;/p&gt;
&lt;p&gt;The beach is way smaller than I expected, but still lots of room to party. Anyway, don't feel like blogging much right now.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/full-moon-party"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/full-moon-party#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/VSE3zQ3H4IM" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/full-moon-party</feedburner:origLink></item>
    <item>
      <pubDate>Mon, 25 Jun 2007 23:54:00 -0700</pubDate>
      <title>Thai Cooking</title>
      <link>http://feedproxy.google.com/~r/franks-blog-and-homepage/~3/dpwX_x682jk/thai-cooking</link>
      <guid isPermaLink="false">http://frank.zinepal.com/thai-cooking</guid>
      <description>&lt;p&gt;
	&lt;p&gt;This morning I took a half-day Thai cooking class. It was good times and I learnt how to cook the different kinds of currys and other dishes. The class was in Ao Nang which is a town about 20 minutes by boat from Ton Sai beach. I'm going to spend the rest of the day here and check out the place, although it is not very big.&lt;/p&gt;
&lt;p&gt;Tomorrow afternoon I'm going to leave Ton Sai beach for the full moon party. A bunch of other people from the beach are coming along too, so it should be fun. It is definitely low season now. The weather is not as nice as before (more cloudy and rainy, but still not too bad) and we are down to around 15 people at the beach. With around eight of us leaving tomorrow it's going to get really quiet there.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://frank.zinepal.com/thai-cooking"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://frank.zinepal.com/thai-cooking#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/franks-blog-and-homepage/~4/dpwX_x682jk" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://frank.zinepal.com/thai-cooking</feedburner:origLink></item>
  </channel>
</rss>

