<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:polywogsys</id>
  <title>Jumping on the Bandwagon</title>
  <subtitle>... because I'm too busy to write my own php blog</subtitle>
  <author>
    <name>polywogsys</name>
  </author>
  <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom"/>
  <updated>2008-05-09T00:26:33Z</updated>
  <lj:journal username="polywogsys" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://polywogsys.livejournal.com/data/atom" title="Jumping on the Bandwagon"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:212324</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/212324.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=212324"/>
    <title>HDTV and the Wii</title>
    <published>2008-05-08T18:05:46Z</published>
    <updated>2008-05-09T00:26:33Z</updated>
    <category term="wii"/>
    <category term="dtv2009"/>
    <content type="html">So yesterday I stopped at the Game Stop, E.B. Games, Target, and Best Buy for a Wii. No such luck. I got an HDTV converter instead with my &lt;a href="http://www.dtv2009.gov"&gt;http://www.dtv2009.gov&lt;/a&gt; coupon. The HDTV tuner could hardly tune anything in. I just barely got 17-1, and some weird lawyer infomercial channel. I needed an antenna for HDTV, the wire out the window is just not going to cut it.&lt;br /&gt;After lunch today I stopped in the Gallery at the Radio Shack to get a small set-top yagi for HDTV (apparently multipath affects the american version of HDTV more than the better European standard - no surprise there - big business money controlling the FCC again). Radio shack was swamped. I left.&lt;br /&gt;On a whim, and since I fear/hate/loath the gallery, I wanted to kill two birds with one stone...&lt;br /&gt;&lt;br /&gt;I did a random drop by for the Wii at Game Stop.&lt;br /&gt;I missed it by one hour!&lt;br /&gt;NO!&lt;br /&gt;NO!&lt;br /&gt;NO!&lt;br /&gt;&lt;br /&gt;Random drop by at E.B. Games.&lt;br /&gt;YES!&lt;br /&gt;YES!&lt;br /&gt;YES!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:212146</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/212146.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=212146"/>
    <title>gnome sucks</title>
    <published>2008-05-08T15:01:43Z</published>
    <updated>2008-05-08T15:01:43Z</updated>
    <category term="gnome"/>
    <category term="gtk"/>
    <content type="html">gnome file selector sucks ass!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:211824</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/211824.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=211824"/>
    <title>Using libchart as a cakephp vendor application</title>
    <published>2008-05-08T06:23:35Z</published>
    <updated>2008-05-08T06:23:35Z</updated>
    <category term="libchart"/>
    <category term="app::import"/>
    <category term="cakephp"/>
    <category term="vendor"/>
    <content type="html">First off, in cake 1.2, you vendor() is depreciated, so you'll have to use App::import('Vendor', ... ); A link on its usage can be found &amp;lt;a href="http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/"&amp;gt;http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/&amp;lt;/a&amp;gt;&lt;br /&gt;First off, we want to unpack libchart tarball, and put the libchart directory in &lt;i&gt;/app/webroot/vendors/&lt;/i&gt;.&lt;br /&gt;The basic steps for creating a graph are: &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create an action that will *just* fetch data&lt;/li&gt;&lt;li&gt;hand the data over in a predetermined fashion to the view. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Then the view will call a helper function which will do the actual graphing (libchart calls).&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;So for example, I created an action in my controller which displays a number of fruits. Important things to note are the first three lines, this turns off all verbose debugging, and default layouts which will get in the way of the PNG. The "predetermined" fashion is that my helper is going to accept a chart title, and an array of data in the form of x-labels =&amp;gt; y-vals.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;class FruitsController extends AppController {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var $helpers = array('Html', 'Form', 'Javascript', 'Graph');&lt;br /&gt;...&lt;br /&gt;&lt;/i&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function chartFruitTotals($id = null, $rndm = null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;layout = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;autoLayout = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Configure::write('debug', '0');&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // do some database stuff here to get data. I'll use a prefilled array&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chartData = array ('apples' =&amp;gt; 3, 'pears' =&amp;gt; 4, 'oranges =&amp;gt; '1', 'peaches' =&amp;gt; '2');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chartTitle = 'Fruit Totals';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chartData = $alertTotals;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;set(compact('chartTitle', 'chartData'));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;...&lt;br /&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The view is rather simple. Just call the GraphHelper's method which will do the charting.&lt;br /&gt;&lt;i&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $graph-&amp;gt;showChart($chartTitle, $chartData);&lt;br /&gt;?&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The helper method is where the magic will be. Since libchart.php in its own directory (two directories deep) we'll be using the following syntax: App::import('Vendor', 'libchart', array('file'=&amp;gt;'libchart'.DS.'classes'.DS.'libchart.php')); where DS is the directory separator. I just ended up copying a barchart demo file that came with libchart and just slightly modifying it. &lt;br /&gt;&lt;i&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; App::import('Vendor', 'libchart', array('file'=&amp;gt;'libchart'.DS.'classes'.DS.'libchart.php'));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class GraphHelper extends AppHelper {&lt;br /&gt;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function showChart($chartTitle, $chartData)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; header("Content-type: image/png");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chart = new HorizontalBarChart(300, 250);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $dataSet = new XYDataSet();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($chartData as $xLabel =&amp;gt; $yValue) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $dataSet-&amp;gt;addPoint(new Point($xLabel, $yValue));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chart-&amp;gt;setDataSet($dataSet);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chart-&amp;gt;getPlot()-&amp;gt;setGraphPadding(new Padding(5, 15, 15, 100));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chart-&amp;gt;getPlot()-&amp;gt;setLogoFileName(null); // get rid of the annoying logo&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chart-&amp;gt;setTitle($chartTitle);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $chart-&amp;gt;render();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;...&lt;br /&gt;?&amp;gt;&lt;/i&gt;&lt;br /&gt;Now, what that will do is spit out a raw PNG file to that particular view. If you would like the chart to appear as an &amp;lt;IMG&amp;gt; anywhere in your pages, you probably want to do a component or something similar that does the same as the helper and just $chart-&amp;gt;render($tmpfile) it out to "tempnam", or "tmpfile", and a wrapper in the img/ directory @readfile's the tmpfile/tempnam. To be safe, make sure any reads are escaped correctly. There are other ways to skin that cat, but at this point it's just plain ol' php.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:211580</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/211580.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=211580"/>
    <title>libchart, jpgraph</title>
    <published>2008-05-07T06:07:32Z</published>
    <updated>2008-05-07T06:07:32Z</updated>
    <category term="libchart"/>
    <category term="php"/>
    <category term="charts"/>
    <content type="html">So the documentation for artichow was in french, and I couldn't figure out how to make it plot horizontal bar graphs. UGH. But it looks like libchart, &lt;a href="http://naku.dohcrew.com/libchart/pages/introduction/sample2.php"&gt;can do exactly that.&lt;/a&gt;&lt;br /&gt;Nice.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:211363</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/211363.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=211363"/>
    <title>Aritchow Graphing</title>
    <published>2008-05-07T05:00:04Z</published>
    <updated>2008-05-07T06:05:52Z</updated>
    <category term="artichow"/>
    <category term="gd"/>
    <category term="php"/>
    <category term="charts"/>
    <content type="html">A PHP API to generate dynamic NICE LOOKING charts. This is GREAT! I've been looking for this FOREVER! Alas all the docs for it seems to be in french, but at least the API is in english. If I only had this when I started working on the older version of the kutzik project, I wouldn't have had to deal with GNUPlot, which, while functional, looks rather unprofessional. &lt;a href="http://www.artichow.org/"&gt;http://www.artichow.org/&lt;/a&gt;&lt;a href="http://www.artichow.org/"&gt;http://www.artichow.org/&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:210991</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/210991.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=210991"/>
    <title>Set::merge, Set::extract and further goodies</title>
    <published>2008-05-07T03:20:21Z</published>
    <updated>2008-05-07T03:20:21Z</updated>
    <category term="cakephp"/>
    <category term="set::extract"/>
    <category term="1.2"/>
    <content type="html">So, I found a couple of cool demos of the Set class (and this time I understand more of them).&lt;br /&gt;The best place to look at how the Set class works is in the 'set.test.php' test case. It's a bit more obvious than reading the source.&lt;br /&gt;In any case, check out this site for some nice demos: &lt;a href="http://debuggable.com/posts/cake-12s-set-class-eats-arrays-for-breakfast"&gt;http://debuggable.com/posts/cake-12s-set-class-eats-arrays-for-breakfast&lt;/a&gt;&lt;br /&gt;And also check out this site: &lt;a href="http://www.cakephp.nu/quick-tutorial-cakephp-set-class-part-1"&gt;http://www.cakephp.nu/quick-tutorial-cakephp-set-class-part-1&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:210818</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/210818.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=210818"/>
    <title>dtv2009 and the Wii</title>
    <published>2008-05-04T23:31:15Z</published>
    <updated>2008-05-04T23:33:37Z</updated>
    <category term="wii"/>
    <category term="dtv2009"/>
    <content type="html">So brad and i FINALLY decided that our birthday gifts to each other (considering that were 13 days apart) would be a dtv converter (with the $40 gov't coupon &lt;a href="http://www.dtv2009.gov"&gt;http://www.dtv2009.gov&lt;/a&gt; ) and a Wii. Brad wanted to wait until the next revision of the iphone before getting one so it'll prolly be his x-mas gift.&lt;br /&gt;So we biked down to the best buy and were tieing up, when this guy standing on the wall to the best buy, was talking on the phone. In effect he said that he was waiting for a wii. I start to slow down my bike tieing and start to listen while he's talking on the phone then stare, and eventually grin - from ear to ear. He notices that I am there for a wii, and starts doing the same. When he's done on the phone, he starts to explain that he and ... 30 other people, standing against the wall, whom I'd failed to notice, were waiting for a wii as well. It was some super special deal or something, but yet, they were all paying the same price. &lt;br /&gt;Brad ran inside to find out if they had any, and they were all "out". &lt;br /&gt;Gezus!&lt;br /&gt;We're not talking about the iPhone here, folks.. it's a freakiin' wii.&lt;br /&gt;The reason why we went in person, is because we decided (today) to finally buy one, and went straight away to get one. Honestly, if i knew i'd have to wait, I would have just ordered one on-line anyways. (Which is how I buy anything anymore, anyway.)&lt;br /&gt;And I never did get the digital to analog TV converter box, with my $40 gov't coupon. We decided that we just don't watch enough TV to justify trashing a perfectly good tv to buy a digital one. It'd be better on the environment to just get the converter.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:210482</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/210482.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=210482"/>
    <title>Duran Duran</title>
    <published>2008-05-02T11:45:01Z</published>
    <updated>2008-05-02T11:45:01Z</updated>
    <category term="music"/>
    <content type="html">So Duran Duran's gonna be at the Mann Center May 22nd. I would go except that you need a car to get up there! If you go on a bike or bus they might actually ask that you "leave your bag in the car". I don't think I'm ever going back. It would have to be someone I would REALLY REALLY REALLY REALLY want to see.&lt;br /&gt;Devo's going to be at Penns Landing at the end of June! :)&lt;br /&gt;Cut Copy (to which I have tickets) is going to be at Pure on May 10th.&lt;br /&gt;w00t!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:210405</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/210405.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=210405"/>
    <title>Converting multiple TIFFs to one small PDF</title>
    <published>2008-05-02T05:17:26Z</published>
    <updated>2008-05-02T05:34:10Z</updated>
    <category term="imagemagick"/>
    <category term="convert"/>
    <category term="png"/>
    <category term="tiff"/>
    <category term="pdf"/>
    <content type="html">OK. So I just spent the last two hours trying to figure this ImageMagick program out. I wanted it to do, relatively, the same thing that Gimp could do with the results being similar. &lt;br /&gt;&lt;br /&gt;Problem: I wanted to convert a bunch of TIFF files from our office copier/scanner (one tiff per page) into a self contained PDF.&lt;br /&gt;Complication: Using the straight through no options command "convert" from ImageMagick would produce really REALLY large PDF's - when it wouldn't crash from running out of memory.&lt;br /&gt;Requirement: It needed to be about 200 - 400k MAX and print out at the original size.&lt;br /&gt;&lt;br /&gt;So, I tried all of these options with image magick, and a lot of the time, I could "resize" the image, and it looks fine in EOG or The GIMP, but when I would write it out to ps or pdf it would produce an 8.5x11 page, but with the scanned image taking up 1/32 to 1/4 of the page.&lt;br /&gt;The following commands pretty much give me 200k - 500k sizes. The quality of the image (as you would expect) go from decent to pretty good. Since this is just a way of scanning paperwork, converting them to 1bit PDF would do too. The input files were 591k for page1.tif, and 237k for page2.tif with an original resolution of 600x600dpi.&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;Reduce the resolution to 200dpi, and resize it to 25%, THEN before spitting it out as a Postscript file, increase it back to its original 'print' size&lt;/dt&gt;&lt;dd&gt;convert page[12].tif \( -colorspace gray \) \( -resample 200x200 \) \( -resize 1275x1650 \) \( -resize 1700x2200 \) step3c.ps&lt;/dd&gt;&lt;dd&gt;ps2pdf step3c.ps&lt;/dd&gt;&lt;/dl&gt;You can leave out the middle "resizes" but my file size jumped at that point way too much. Leaving out the middle resize, and my file size went from 270k to 355k. Leaving out both resizes it was still at 355k, but the image quality was poorer. &lt;br /&gt;ps2pdf I noticed produced the smallest file size. In fact, using the built in ps2pdf the file size was twice as much!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:209994</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/209994.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=209994"/>
    <title>Juniper's SSL/VPN</title>
    <published>2008-05-01T15:00:16Z</published>
    <updated>2008-05-01T15:00:16Z</updated>
    <category term="juniper"/>
    <category term="ssl/vpn"/>
    <category term="stuff-i-cant-remember-dept"/>
    <category term="netscreen"/>
    <content type="html">There were problems with the SSL/VPN after upgrading to 6.0r4.2.1 where the user would visit a site with Active X components and it would not load the component. Changing the Web Caching policy for the affected site to "Unchanged" seemed to do the trick.&lt;br /&gt;&lt;br /&gt;   1. goto "Resource Policies" -&amp;gt; "Web" -&amp;gt; "Caching"&lt;br /&gt;   2. create a new policy for the affected website, in this case it was "foosite*:80,443/*"&lt;br /&gt;   3. action "Unchanged (do not add/modify caching headers)"</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:209773</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/209773.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=209773"/>
    <title>TIFF to PDF</title>
    <published>2008-04-29T16:34:31Z</published>
    <updated>2008-04-29T16:36:15Z</updated>
    <category term="ps2pdf"/>
    <category term="scanner"/>
    <category term="stuff-i-cant-remember-dept"/>
    <category term="tiff"/>
    <content type="html">So there's this new copier at work which can also scan documents. The documents it produces are in TIFF format (one per page scanned). Typically, I would want to get them into a format suitable for PDF'ing. The problem is that I hadn't figured out how to get multiple TIFF files into one file. There might be an easier way, but here goes. 
&lt;ol&gt;
&lt;li&gt;download the TIFF&lt;/li&gt;
&lt;li&gt;open it in the &lt;a href="http://www.gimp.org/"&gt;GIMP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Convert it to greyscale (or truecolor)&lt;/li&gt;
&lt;li&gt;Scale it down to 25% of the original size, set the DPI to 200&lt;/li&gt;
&lt;li&gt;Zoom to 100%&lt;/li&gt;
&lt;li&gt;Save as... filename.ps (postscript)&lt;/li&gt;
&lt;li&gt;In the dialog box that comes up, set the image size to 8.5x11, change the X and Y offset to 0.&lt;/li&gt;
&lt;li&gt;Rinse and repeat for each TIFF file&lt;/li&gt;
&lt;li&gt;cat each file in page order to a new file (cat *.ps &amp;gt; new_file.ps)&lt;/li&gt;
&lt;li&gt;Run ps2pdf on the new_file.ps&lt;/li&gt;
&lt;/ol&gt;
Now if I could only use ImageMagick to manipulate the TIFF file, then I could script the whole thing.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:209660</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/209660.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=209660"/>
    <title>Smiths Rule</title>
    <published>2008-04-29T14:49:04Z</published>
    <updated>2008-04-29T14:49:57Z</updated>
    <category term="music"/>
    <category term="the smiths"/>
    <content type="html">I have been listening to the Smiths all morning, I &lt;s&gt;forgot&lt;/s&gt; how good they were! Does this mean that they're no longer my favorite band?! Shock and horror!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:209192</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/209192.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=209192"/>
    <title>Joe Coffee Bar on PBS's NOW</title>
    <published>2008-04-24T15:35:13Z</published>
    <updated>2008-04-24T15:37:19Z</updated>
    <category term="joe coffee"/>
    <category term="pbs"/>
    <category term="healthcare"/>
    <category term="fair trade"/>
    <category term="now"/>
    <content type="html">Joe Coffee is on PBS's NOW (with David Broncaccio) &lt;a href="http://www.pbs.org/now/shows/416/index.html"&gt;http://www.pbs.org/now/shows/416/index.html&lt;/a&gt;&lt;br /&gt;You can watch it in its entirety online. There's even a cameo of me! Well not really a cameo if you call a blob in the background one.&lt;br /&gt;&lt;blockquote&gt;Health care costs in the Keystone State are 11 percent higher than the national average and rising twice as fast as the average wage. The state legislature is debating a plan backed by Governor Ed Rendell to provide benefits to hundreds of thousands of Pennsylvanians, but there's disagreement over who's going to foot the bill.&lt;/blockquote&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:209143</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/209143.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=209143"/>
    <title>polywogsys @ 2008-04-24T00:30:00</title>
    <published>2008-04-24T04:48:51Z</published>
    <updated>2008-04-24T04:48:51Z</updated>
    <category term="cakephp"/>
    <category term="paginator"/>
    <category term="paginate"/>
    <content type="html">OK, so I've been hunting all evening for something that's been in front of my face the entire time.&lt;br /&gt;All I wanted to do was paginate() the result of a specific query... THAT'S MY PROBLEM. I was asking the wrong question. I wanted to paginate the result of a particular condition.&lt;br /&gt;I went as far as creating the specific paginate query in the model (which is where complex paginate queries go, not the controller). Then I asked myself, if I can pass it a $condition, why can't I just do that in the controller with the default paginate().&lt;br /&gt;THEN IT HIT ME! $this-&amp;gt;paginate is a fancy kind of Model::findAll(). The same options you can give findAll() you can give to paginate(). &lt;br /&gt;OK, so...&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You can set some defaults to $this-&amp;gt;paginate() as a 'var' in the controller called 'paginate'. (See previous post) This will apply to all vanilla $this-&amp;gt;paginate() calls.&lt;/li&gt;&lt;li&gt;$this-&amp;gt;paginate() returns what $this-&amp;gt;Post-&amp;gt;findAll() would return. &lt;br /&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;It also accepts all options findAll() would accept.&lt;/li&gt;&lt;li&gt;Use it as you would findAll(): &lt;a href="http://book.cakephp.org/view/448/findall"&gt;http://book.cakephp.org/view/448/findall&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;Putting it all together, five hours ago, in my "non index action" all I needed to do was:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;                $conditions = array('Journal.incident_id' =&amp;gt; $incidentId);&lt;br /&gt;&lt;br /&gt;                // $journals = $this-&amp;gt;Journal-&amp;gt;findAll($conditions);&lt;br /&gt;                $journals = $this-&amp;gt;paginate($conditions);&lt;br /&gt;                $this-&amp;gt;set('journals', $journals);&lt;br /&gt;&lt;/pre&gt;You know, for all the time CakePHP is 'saving' me by auto-generating this code, it's taking back by lack of cohesive well written documentation. Does that mean I give up... ugh, dzang, no... when I 'get' it and it works... it REALLY WORKS! :)&lt;br /&gt;&lt;br /&gt;I just wish I had more time. I have to get this site done by May 15.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:208761</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/208761.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=208761"/>
    <title>$paginate fields</title>
    <published>2008-04-24T02:28:22Z</published>
    <updated>2008-04-24T04:30:42Z</updated>
    <category term="fields"/>
    <category term="cakephp"/>
    <category term="paginate"/>
    <content type="html">In cake 1.2 when setting the "displayable" fields of the model in question, use the related model's name.&lt;br /&gt;&lt;pre&gt;class JournalController extends AppController {&lt;br /&gt;...&lt;br /&gt;var $paginate = array(&lt;br /&gt;                'Journal' =&amp;gt; array(&lt;br /&gt;                        'limit' =&amp;gt; 25,&lt;br /&gt;                        'fields' =&amp;gt; array(&lt;br /&gt;                                'Journal.id',&lt;br /&gt;                                'Incident.id',&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Not 'Journal.incident_id'</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:208550</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/208550.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=208550"/>
    <title>Go RACHEL!! :)</title>
    <published>2008-04-18T19:58:22Z</published>
    <updated>2008-04-18T19:58:22Z</updated>
    <category term="rachel maddow"/>
    <content type="html">&lt;a href="http://www.huffingtonpost.com/2008/04/17/joe-scarborough-walks-off_n_97330.html"&gt;http://www.huffingtonpost.com/2008/04/17/joe-scarborough-walks-off_n_97330.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Did Joe Scarborough walk out of David Gregory's show "Race to the White House" Thursday night on MSNBC? It seems that way by the video below. Joe was a panelist on the show along with Air America's Rachel Maddow, CNBC's John Harwood and former Tennessee Congressman Harold Ford, Jr.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:207888</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/207888.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=207888"/>
    <title>Truecrypt 5.x Horrible</title>
    <published>2008-04-18T15:15:40Z</published>
    <updated>2008-04-18T15:15:40Z</updated>
    <category term="truecrypt"/>
    <content type="html">OK. So I tried to check out the new version of TrueCrypt for linux (5.1a)... plainly... it sucks. They forced a GUI using wxWidgets (which I've never gotten to work successfully for programs which need to be compiled, particularly wxPython). And that's just the "first" problem I've encountered. Apparently, lots of people hate the new version, and a lot of the features are stripped out of it.&lt;br /&gt;Someone who's spent more than three hours trying to get it to work posted the following on truecrypt's forums:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;   	&lt;br /&gt;PostPosted: 15 Mar 2008 Sat 00:15       	 [Link to This Post]    	 [Report to Admin]    	Reply with quote&lt;br /&gt;	&lt;br /&gt;Before I begin my review of Truecrypt 5.1, You should know that I am not new to encryption. I have been using truecrypt 4.3 first on windows and then on linux with good results. Everything I do on this machine is automatically encrypted after login. While truecrypt without a gui was difficult to use at first, as I learned the commands it actually became easier and more efficient to use. Always, I found it to be fast, responsive and seamless.&lt;br /&gt;&lt;br /&gt;Today, I installed truecrypt 5.1 on an older machine, to test it out. The experience has been so unforgivably horrible, that I have had to revert to 4.3 just to accomplish the most basic of tasks. I found myself writing a list of everything wrong with this version so as not to forget something.&lt;br /&gt;&lt;br /&gt;As a linux user, there is a lot to find attractive in version 5. For example, Mounted volumes appear in the side pane of Nautilus. The graphical user interface has been ported from windows. When selecting a drive to encrypt, the GUI will list the size of each partition preventing the horrible of mistake of typing /dev/sdb instead of /dev/sdc. However, if you don't want to use the GUI you will have to type truecrypt -t before every command. This quickly gets tiresome. If I wanted to launch the GUI, I wouldn't have typed $truecrypt in the command line, would I. This became so tiresome that I was forced to create a wrapper to prevent the damned little GUI windows from launching every time I did anything in the command line.&lt;br /&gt;&lt;br /&gt;If you are confused about any of the new features in truecrypt, don't expect to go to the man pages. What once existed in truecrypt 4.3 seems to have been erased. The 'Help' function doesn't work either. Other annoyances to add to the list: 1. The icon for truecrypt that appears in the sytem tray, disappears the moment you close the program. 2. Double clicking on a drive is supposed to open a file explorer window of the drive. It doesn't even fail, it just sits there doing nothing. 3. $truecrypt -d # doesn't appear to work anymore. 4. Even in text mode, you will have to dismiss more questions to accomplish basic tasks. 5. I couldn't mount unformatted volumes from the command line. (more on this in a bit)&lt;br /&gt;&lt;br /&gt;These annoyances are not the worst of it. The structure of truecrypt has been so fundamentally altered that I couldn't even do a relatively simple task: create an XFS encrypted volume on an external drive.&lt;br /&gt;&lt;br /&gt;After creating the encrypted volume, I attempted to load it so I could make the XFS filesystem. ( Why truecrypt can't give me this option when I first created the volume is a mystery to me. only the FAT filesystem is available) After typing in my long password, truecrypt refused to let me load it because the partition had no filesystem. Of course it doesn't! I haven't formatted it yet! Instead of letting me mount it anyway I had to type in the entire password again, but this time click the button more options and select "do not mount." Grr.&lt;br /&gt;&lt;br /&gt;I opened Gparted, my favorite disk formatting utility, but it seems truecrypt has changed the way it works. Instead of mount volumes on /dev/truecrypt? It now mounts them on /dev/loop? This means that truecrypt volumes don't show up in Gparted anymore. It also destroys all old scripts that I had built to work with truecrypt. "Okay", I thought, I'll just have to use the command line $mkfs -t xfs /dev/loop? This work for the first few innodes, but then stalled on 28/1100. "Stalled" is to weak a word, it completely FROZE the entire computer forcing me to do a hard reboot.&lt;br /&gt;&lt;br /&gt;Regardless, I pressed on. I created the XFS filesystem using a different computer that still had the GOOD truecrypt installed. Then, I mounted the volume with BAD truecrypt and attempted to copy some files. It was 60 MiB in when it completely FROZE the computer once again. I watched as the time remaining counter started count up. The message box was saying 400 HOURS estimated before I had enough and did a hard reboot again. It's as if the entire driver has been rewritten and the result is EPIC FAIL. This reminds me of the problems experienced by Windows Vista users.&lt;br /&gt;&lt;br /&gt;By this point, I had had enough. I reinstalled truecrypt 4.3 and did everything I mentioned earlier. The volume formatted flawlessly and the file copy only took a few minutes. Suffice it to say, I will not be going back anytime soon. The minor annoyances, I could have worked around for the easy use of the GUI. But to fail so completely at the most basic task. That is simply unforgivable.&lt;br /&gt;&lt;/blockquote&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:207707</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/207707.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=207707"/>
    <title>Audacious Plays Streamripper!</title>
    <published>2008-04-15T21:43:40Z</published>
    <updated>2008-04-15T21:43:40Z</updated>
    <category term="audacious"/>
    <category term="streamripper"/>
    <content type="html">So, I finally figured it out. I'll have to retract my bug, and post something to the mailing list about this. In the home directory there was a ~/.config/audacious directory. I rm -rf'd it and started audacious. Opened the local stream &lt;a href="http://127.0.0.1:8000"&gt;http://127.0.0.1:8000&lt;/a&gt; with streamripper running the relay stream, and everything worked!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:207416</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/207416.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=207416"/>
    <title>NYC</title>
    <published>2008-04-12T13:46:28Z</published>
    <updated>2008-04-12T13:47:49Z</updated>
    <content type="html">Welp, today I am going to NYC to eat out with my mom. It was her birthday yesterday. I can't wait to see her. It's been since Christmas!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:207247</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/207247.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=207247"/>
    <title>Cut Copy tickets</title>
    <published>2008-04-11T05:53:05Z</published>
    <updated>2008-04-11T05:53:05Z</updated>
    <content type="html">&lt;a href="http://www.igetrvng.musictoday.com/Igetrvng/calendar.aspx"&gt;http://www.igetrvng.musictoday.com/Igetrvng/calendar.aspx&lt;/a&gt;&lt;br /&gt;They're going to be at Pure on may 16th!!! w00t! I missed The Rapture at Pure, I am not gonna miss these guys.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:206883</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/206883.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=206883"/>
    <title>Ballmer Peak</title>
    <published>2008-04-10T14:37:36Z</published>
    <updated>2008-04-10T14:37:36Z</updated>
    <category term="xkcd"/>
    <category term="ballmer"/>
    <content type="html">&lt;a href="http://xkcd.com/323/"&gt;ROFL&lt;/a&gt;&lt;br /&gt;&lt;img src="http://imgs.xkcd.com/comics/ballmer_peak.png" /&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:206740</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/206740.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=206740"/>
    <title>replacing generateList()</title>
    <published>2008-04-10T01:14:43Z</published>
    <updated>2008-04-10T01:14:43Z</updated>
    <category term="set::combine"/>
    <category term="cakephp"/>
    <category term="generatelist"/>
    <content type="html">OK, so to get more detailed into this. From the controller you want to pass along the dropdown list, just do this. You have two models "Incident" and "User". User model contains "firstname" and "lastname" field, but you want them to show up as "firstname, lastname" when the select is automagically generated.:&lt;br /&gt;&lt;pre&gt;
class IncidentsController extends AppController { 
...
	function add() {
		...
		$users = $this-&amp;gt;Incident-&amp;gt;User-&amp;gt;find('all',
			array('fields' =&amp;gt; array('id','lastname','firstname')), 0);
		$users = Set::combine($users,
				'{n}.User.id', /* key */
				array('{0}, {1}', /* formatting, note the comma in the middle */
					'{n}.User.lastname','{n}.User.firstname')); /* mapping to the format */
		...
		$this-&amp;gt;set(compact('users', ... )); /* if it has just $this-&amp;gt;set('foo'); replace with compact */
	}
...
&lt;/pre&gt;&lt;br /&gt;Repeat those $users lines as often as you need to pass it to $this-&amp;gt;set(); however, I would create a local private function and call the private function.&lt;br /&gt;&lt;pre&gt;
...
        function __genUserList() {
                $users = $this-&amp;gt;Incident-&amp;gt;User-&amp;gt;find('all',
                        array('fields' =&amp;gt; array('id','lastname','firstname')), 0);
                $users = Set::combine($users,
                                '{n}.User.id',
                                array('{0}, {1}','{n}.User.lastname','{n}.User.firstname'));
                return $users;
        }
...
	function add() {
		...
		$users = $this-&amp;gt;__genUserList();
		$this-&amp;gt;set(compact('users', ... ));
	}
...
&lt;/pre&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:206478</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/206478.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=206478"/>
    <title>DeDupe Awk Script</title>
    <published>2008-04-08T21:13:31Z</published>
    <updated>2008-04-08T21:13:31Z</updated>
    <category term="awk"/>
    <category term="stuff-i-cant-remember-dept"/>
    <content type="html">A quick awk script that will check a field, if the field is unique (you'll have to 'sort' on that field first) it'll print out the entire line. Otherwise, it skips to the next line.&lt;br /&gt;&lt;pre&gt;
BEGIN{
        FS=",";
}
{
        if (OLDFD != $1) {
                print $0;
                OLDFD=$1
        }
}
&lt;/pre&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:206318</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/206318.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=206318"/>
    <title>cdpr.exe for Windows XP/Vista</title>
    <published>2008-04-04T20:31:44Z</published>
    <updated>2008-04-04T20:31:44Z</updated>
    <category term="cdpr"/>
    <content type="html">So I downloaded cygwin, gcc (etc), and the winpcap WPDPACK to compile an updated version of CDPR.exe to be used with WinPCAP 4.x. Basically, cdpr wasn't working any more because ethereal had downloaded an updated copy of winpcap. &lt;br /&gt;&lt;br /&gt;I downloaded the CDPR source, but they required that I use Visual Studio 6. Instead I used cygwin to compile the cdpr source. I was skeptical that it was going to work, but by god! It did work.&lt;br /&gt;&lt;br /&gt;The make file I ganked from the WinPCAP Developer pack and modified. The three steps for compiling it yourself:&lt;br /&gt;&lt;br /&gt;*) Pre-req: make sure you have GCC installed via &lt;a href="http://www.cygwin.com/setup.exe"&gt;cygwin (setup.exe)&lt;/a&gt; along with Make, and pretty much most the "Devel" category tools for compiling a simple c/c++ program. The gatech.lib mirror seems to be the quickest for me.&lt;br /&gt;&lt;br /&gt;1) download and expand the &lt;a href="http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip"&gt;winpcap developer pack&lt;/a&gt; into the source directory of CDPR. &lt;br /&gt;2) rename the directory wpdpack (all lower case)&lt;br /&gt;3) open a bash shell and navigate to this directory&lt;br /&gt;3) you can use the following makefile (call it GNUmakefile)&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;
PCAP_PATH = wpdpack/Lib 
CFLAGS = -O -mno-cygwin -I wpdpack/include
LIBS = -L ${PCAP_PATH} -lwpcap -lwsock32

all: cdpr

cdpr: cdpr.c cdprs.c conffile.c cdp.h cdpr.h
	gcc $(CFLAGS) cdpr.c cdprs.c conffile.c $(LIBS) -o cdpr.exe
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;5) Just type "make"&lt;br /&gt;6) Then you should just have a cdpr.exe in that directory. &lt;br /&gt;&lt;br /&gt;Though before you can use it on other computers, you need to make sure you have WinPCAP installed. It's a 500k download from their site. You need winpcap installer because the "silent" install version is the one that you have to pay for.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:polywogsys:205978</id>
    <link rel="alternate" type="text/html" href="http://polywogsys.livejournal.com/205978.html"/>
    <link rel="self" type="text/xml" href="http://polywogsys.livejournal.com/data/atom/?itemid=205978"/>
    <title>lost in translation</title>
    <published>2008-04-04T03:58:18Z</published>
    <updated>2008-04-04T03:58:18Z</updated>
    <category term="zorgopvolging"/>
    <category term="dutch"/>
    <content type="html">What the heck does "zorgopvolging" mean?! Babelfish doesn't know, and neither does Google translations.</content>
  </entry>
</feed>
