<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6485101416614940586</id><updated>2011-07-15T20:08:13.507+10:00</updated><category term='python android pil images fonts'/><category term='esx vmware backup tools sysadmin'/><category term='consumer'/><category term='processing kinettic scroller ui'/><category term='ups'/><category term='recall'/><category term='svg'/><category term='scrape'/><category term='python'/><category term='amazon'/><category term='books'/><category term='processing visual nagios'/><category term='vmware'/><category term='rss'/><category term='esx'/><category term='api'/><category term='graphviz'/><category term='powerchute'/><category term='apc'/><category term='ubiquity firefox extension search'/><category term='reader'/><category term='utilities software tools'/><title type='text'>babbaging</title><subtitle type='html'>tinkering around with computers</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-4327519677744998443</id><published>2010-09-01T15:25:00.001+10:00</published><updated>2010-09-01T15:28:06.081+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python android pil images fonts'/><title type='text'>Transparent Android icons</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I have an Android phone and I wanted to create some new icons.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Inspired by&amp;nbsp;various&amp;nbsp;Andoid themes on &lt;a href="http://forum.xda-developers.com/index.php"&gt;xda-developers&lt;/a&gt;, I wanted text only icons.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I started whipping up icons in Photoshop, but it was a pain to try new fonts (yes I know PS has scripting...).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So I created a python script to generate a series of icons and zip them up.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The script uses &lt;a href="http://www.pythonware.com/products/pil/"&gt;Python Image Library&lt;/a&gt;, to render&amp;nbsp;separate&amp;nbsp;transparent PNG files.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 10px; line-height: 10px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;from PIL import Image, ImageDraw, ImageFont&lt;br /&gt;import zipfile&lt;br /&gt;import os&lt;br /&gt;&lt;br /&gt;class iconpack:&lt;br /&gt;  def __init__(self, zipfsp, fontfsp, fontsize, height, width):&lt;br /&gt;    self.zip=zipfile.ZipFile(zipfsp, mode='w')  # create the zip file&lt;br /&gt;    self.fontfsp=fontfsp&lt;br /&gt;    self.fontsize=fontsize&lt;br /&gt;    self.h=height&lt;br /&gt;    self.w=width&lt;br /&gt;&lt;br /&gt;  def addicon(self,lines):&lt;br /&gt;    iconfsp=self.render(lines)&lt;br /&gt;    self.zip.write(iconfsp)  # add the icon tot he zip file&lt;br /&gt;    os.remove(iconfsp) # delete the remaining icon file&lt;br /&gt;    &lt;br /&gt;  def render(self, lines):&lt;br /&gt;    im =Image.new("RGBA",(self.w,self.h),(0,0,0,0))  # adjust the 4th zero to adjust transparency&lt;br /&gt;    draw = ImageDraw.Draw(im)&lt;br /&gt;    font = ImageFont.truetype(self.fontfsp,self.fontsize) # the font file needs to be accessible&lt;br /&gt;    y=0&lt;br /&gt;    for line in lines:&lt;br /&gt;      rendered_hw=font.getsize(line)  # figure out how wide the rendered text will be&lt;br /&gt;      x=im.size[0]/2-(rendered_hw[0]/2) # so we can centre it&lt;br /&gt;      draw.text((x,y), line, font=font)&lt;br /&gt;      y+=rendered_hw[1]-5   # adust the gap between the lines&lt;br /&gt;&lt;br /&gt;    # write image file&lt;br /&gt;    iconfsp=lines[0]+"_"+lines[1]+".png"&lt;br /&gt;    im.save(iconfsp, "png")&lt;br /&gt;    del im&lt;br /&gt;    return iconfsp&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;# II saw an iconpack on xda which used 46x81, on the shoulders of giants, etc&lt;br /&gt;&lt;br /&gt;# zipfile, font file, font size, width and height&lt;br /&gt;ip=iconpack('DroidSans.zip','DroidSans.ttf',23,46,81) &lt;br /&gt;ip.addicon(["Inter", "Webs"])&lt;br /&gt;ip.addicon(["My", "Email"])&lt;br /&gt;ip.addicon(["Work", "Email"])&lt;br /&gt;ip.addicon(["Snap", "Shot"])&lt;br /&gt;ip.addicon(["Pod", "Casts"])&lt;br /&gt;ip.addicon(["Audio", "Books"])&lt;br /&gt;ip.addicon(["The", "Mrs"])&lt;br /&gt;ip.addicon(["Bar", "Code"])&lt;br /&gt;ip.addicon(["Four", "Square"])&lt;br /&gt;ip.addicon(["SMS", ""])&lt;br /&gt;ip.addicon(["Maps", ""])&lt;br /&gt;ip.addicon(["Reddit", "is fun"])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here's hows the icons turned out. &amp;nbsp;I tried a few fonts from &lt;a href="http://www.fontspace.com/"&gt;FontSpace&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;, but settled on DroidSans.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_H3wgxK1ijgU/TH3jE2beUcI/AAAAAAAAAJ4/wFztTExtAgs/s1600/Android01b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_H3wgxK1ijgU/TH3jE2beUcI/AAAAAAAAAJ4/wFztTExtAgs/s320/Android01b.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-4327519677744998443?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/4327519677744998443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=4327519677744998443' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/4327519677744998443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/4327519677744998443'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2010/09/transparent-android-icons.html' title='Transparent Android icons'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_H3wgxK1ijgU/TH3jE2beUcI/AAAAAAAAAJ4/wFztTExtAgs/s72-c/Android01b.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-604739903304344128</id><published>2010-08-14T23:25:00.002+10:00</published><updated>2010-08-14T23:30:23.682+10:00</updated><title type='text'>Dear future self</title><content type='html'>I found myself involved in a project which uses Nagios and Splunk to monitor IT infrastructure, and needed to know how to pass syslog messages from a Debian box to Splunk.&lt;br /&gt;&lt;br /&gt;Of course I Googled, and to my surprise I found my own post in nagios-users, &lt;a href="http://thread.gmane.org/gmane.network.nagios.user/45718/focus=45735"&gt;from over 3 years ago&lt;/a&gt;&amp;nbsp;with exactly the same issue, albeit with older versions of the same software.&lt;br /&gt;&lt;br /&gt;It was a pretty weird experience, one the one hand I thought it was great that mailing lists are there to be leveraged, repeatedly, but at the same time I realise I didn't learn the solution the first time.&lt;br /&gt;I guess it a testement to Nagios, it's still a great product, still very&amp;nbsp;relevant.&lt;br /&gt;&lt;br /&gt;If we can just recall information it so easily, why bother learning it at all?&lt;br /&gt;Better to know how to search, than how to learn.&lt;br /&gt;&lt;br /&gt;There's value in making our information discoverable though, so&amp;nbsp;this is note to my future self :&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;To forward Nagios event messages via syslog to a splunk server, c&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;onfigure data in on the splunk server to accept data on port 514, UDP.&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;Edit the config of syslog on the Nagios host to forward the messages to the splunk server by adding this line...&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;user.* @ip.add.of.splunk&lt;/span&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-604739903304344128?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/604739903304344128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=604739903304344128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/604739903304344128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/604739903304344128'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2010/08/dear-future-self.html' title='Dear future self'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-2260843056346185877</id><published>2010-04-20T09:01:00.002+10:00</published><updated>2010-04-20T09:38:16.356+10:00</updated><title type='text'>Excel's short comings</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I used to be somewhat of an Excel fanboy.&lt;/div&gt;&lt;div&gt;Probably because I have found it to be entirely useful throughout my career (similarly I was a Lotus 1-2-3 fan too.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, the more I use Excel, and push it, the more I find what it cannot do.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here, listed in no particular order, are my top three Excel 2007 disappointments.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. No Median function in pivot tables.&lt;/div&gt;&lt;div&gt;This really is very frustrating, Median is a widely used function and would be entirely appropriate to include a pivot table summary function, yet it is not.&lt;/div&gt;&lt;div&gt;Sum, Count, Average, Max, Min, Product, Count Numbers, StdDev, StdDevP, Var and VarP are all included, but no Median.   &lt;a href="http://en.wikipedia.org/wiki/Microsoft_Excel#Microsoft_Windows"&gt;Excel is 23 years old&lt;/a&gt;, why has Median been left out?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Cannot record chart formatting macros.&lt;/div&gt;&lt;div&gt;You can in Excel 2003, but not in Excel 2007.&lt;/div&gt;&lt;div&gt;I used to frequently craft macros to make my charts look better and consistent and to reduce the chart formatting drudgery.  My old macros still largely work, so I can use Excel 2003 to make new macros, but come on, really this is the way forward?&lt;/div&gt;&lt;div&gt;To get some idea how annoying this is, create ten line charts, each with 4 series, in each series have 12 points of data.   Now add a red marker, point value, and series name to only the last data point of each series.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Perhaps this is a feature request, or perhaps I juts don;t know the trick, but when entering a formula, I would like to select a cell and be able to have it referenced as an Absolute Address.&lt;/div&gt;&lt;div&gt;In a long formula with a log of references, this would be a great time save.&lt;/div&gt;&lt;div&gt;I can't find it if it's an &lt;a href="http://office.microsoft.com/en-us/excel/HP052037811033.aspx"&gt;existing shortcut&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Excel is still a great product.   I use it daily and cannot find a better replacement.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-2260843056346185877?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/2260843056346185877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=2260843056346185877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/2260843056346185877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/2260843056346185877'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2010/04/excels-short-comings.html' title='Excel&apos;s short comings'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-75752020601582036</id><published>2008-12-30T13:11:00.010+11:00</published><updated>2008-12-30T16:33:50.244+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='processing kinettic scroller ui'/><title type='text'>Kinetic scrolling with Processing - part1</title><content type='html'>I've been toying with an idea for a timeline based project; it hasn't got much traction.&lt;br /&gt;I did give the interface some thought and decided to try and implement a kinetic scroller.&lt;br /&gt;&lt;br /&gt;It's pretty difficult to find a definitive explanation of Kinetic Scrolling or Flick Scrolling, but I think this pretty much sums it up:&lt;br /&gt;&lt;br /&gt;&lt;em style="color: rgb(153, 153, 153);"&gt;"Kinetic scrolling&lt;/em&gt;&lt;span style="color: rgb(153, 153, 153);"&gt; is the popular term to denote the scrolling of a long list with a bit of physics so that user feels like moving a wheel. Such a list view is then often referred as a &lt;/span&gt;&lt;em style="color: rgb(153, 153, 153);"&gt;flick list&lt;/em&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;, caused the scrolling involves some sort of flicking gestures. "&lt;/span&gt; [1]&lt;br /&gt;&lt;br /&gt;Apple have a tutorial showing how to use their implementation &lt;a href="http://support.apple.com/kb/HT1636"&gt;here&lt;/a&gt; [2]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The physics are an illusion, and the approach I used is simple.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Click and hold the background to drag.&lt;/li&gt;&lt;li&gt;When drag is released, note how far it moved since the last draw.&lt;/li&gt;&lt;li&gt;Use that distance as the speed (or energy) of the scroll.&lt;/li&gt;&lt;li&gt;Continue moving in the same direction, but start reducing the speed (decay).&lt;/li&gt;&lt;li&gt;When the speed slow below a threshold, stop the scrolling.&lt;/li&gt;&lt;/ul&gt;I made a demo using &lt;a href="http://processing.org/"&gt;Processing &lt;/a&gt;[3], click the image or &lt;a href="http://www.lostplot.com/processing/kscroll2/"&gt;here to start&lt;/a&gt;.&lt;br /&gt;The coloured bars are just for showing the movement clearly.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.lostplot.com/processing/kscroll2/"&gt;&lt;img style="cursor: pointer; width: 400px; height: 200px;" src="http://2.bp.blogspot.com/_H3wgxK1ijgU/SVmGQiOgDUI/AAAAAAAAADs/kOnQqFm8TLI/s400/kscroller.png" alt="" id="BLOGGER_PHOTO_ID_5285403256319642946" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[1] &lt;a href="http://labs.trolltech.com/blogs/2008/11/15/flick-list-or-kinetic-scrolling/"&gt;http://labs.trolltech.com/blogs/2008/11/15/flick-list-or-kinetic-scrolling/&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://support.apple.com/kb/HT1636"&gt;http://support.apple.com/kb/HT1636&lt;/a&gt;&lt;br /&gt;[3] &lt;a href="http://processing.org/"&gt;http://processing.org/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-75752020601582036?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/75752020601582036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=75752020601582036' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/75752020601582036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/75752020601582036'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2008/12/kinetic-scrolling-with-processing-part1.html' title='Kinetic scrolling with Processing - part1'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_H3wgxK1ijgU/SVmGQiOgDUI/AAAAAAAAADs/kOnQqFm8TLI/s72-c/kscroller.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-1924348168184113299</id><published>2008-09-07T12:35:00.003+10:00</published><updated>2008-09-07T12:51:43.349+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ubiquity firefox extension search'/><title type='text'>Ubiquity commands for openmoko searches</title><content type='html'>I've been trying out &lt;a href="https://wiki.mozilla.org/Labs/Ubiquity"&gt;Mozilla's Ubiquty&lt;/a&gt;, and I love it.&lt;br /&gt;I hope it gets support and flourishes to the point of being the norm for interacting with the web.&lt;br /&gt;&lt;br /&gt;My only gripe (so far) is I have to use it from within a browser, I wish was part of the wider OS, in the way &lt;a href="http://www.launchy.net/"&gt;Launchy&lt;/a&gt; is.&lt;br /&gt;&lt;br /&gt;Anyway, here's a couple of commands to search &lt;a href="http://lists.openmoko.org/mailman/listinfo/"&gt;Openmoko mailing lists&lt;/a&gt; and the Openmoko wiki.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;makeSearchCommand({&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   name: "OM",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   url: "http://openmoko.markmail.org/search/?q={QUERY}",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   icon: "http://wiki.openmoko.org/favicon.ico",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   description: "Searches &lt;a href="http://www.blogger.com/%27http://lists.openmoko.org/mailman/listinfo/%27"&gt;Openmoko Mailing Lists&lt;/a&gt; for matching words."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   });&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;makeSearchCommand({&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   name: "OMW",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   url: "http://wiki.openmoko.org/wiki/Special:Search?search={QUERY}",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   icon: "http://wiki.openmoko.org/favicon.ico",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   description: "Searches &lt;a href="http://www.blogger.com/%27http://wiki.openmoko.org/%27"&gt;Openmoko Wiki&lt;/a&gt; for matching words."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   });&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;To add them to Ubiquity, use the &lt;a href="chrome://ubiquity/content/editor.html"&gt;command editor&lt;/a&gt; (you'll need Ubiquity installed).&lt;br /&gt;Copy and paste the code and you good to go - real-time development, weird.&lt;br /&gt;&lt;br /&gt;To use, invoke Ubiq and enter either commands OM or OMW.&lt;br /&gt;&lt;br /&gt;Done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-1924348168184113299?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/1924348168184113299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=1924348168184113299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/1924348168184113299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/1924348168184113299'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2008/09/ubiquity-commands-for-openmoko-searches.html' title='Ubiquity commands for openmoko searches'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-6735196019333075806</id><published>2008-06-29T23:24:00.008+10:00</published><updated>2008-06-30T00:10:22.914+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='processing visual nagios'/><title type='text'>Processing Nagios Status Data - part 1</title><content type='html'>&lt;a href="http://bp0.blogger.com/_H3wgxK1ijgU/SGeTDgZd5WI/AAAAAAAAACU/-CNrmkEoeBc/s1600-h/graph5screen.jpg"&gt;&lt;/a&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;I've been tinkering with &lt;a href="http://processing.org/"&gt;Processing&lt;/a&gt; of late, and having a lot of fun with it.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;After finding the awsome &lt;a href="http://www.cs.princeton.edu/~traer/physics/"&gt;traer physics library&lt;/a&gt; and &lt;a href="http://www.cricketschirping.com/weblog/?p=966"&gt;Sean McCullough's&lt;/a&gt; implementation of force directed graph layout, I thought I would see if could visualise the status data from &lt;a href="http://www.nagios.org/"&gt;Nagios&lt;/a&gt; (..is an Open Source host, service and network monitoring program).&lt;/div&gt;&lt;br /&gt;Essentially, after defining hosts (devices) and services (stuff the hosts provide), Nagios will monitor their performance. &lt;div&gt;&lt;/div&gt;&lt;div&gt;I wrote a utility to extract the data I wanted from Nagios, and output an xml file.&lt;/div&gt;&lt;div&gt;I have plans to extend that as a seperate project - &lt;a href="http://code.google.com/p/nagiosity/"&gt;Nagiosity&lt;/a&gt;. The processing app uses the xml to constructs a graph. It's a bit rough, but I liked the result anyway.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The bigger circles are the hosts, the smaller circles are the servcies.&lt;/div&gt;&lt;div&gt;The more transparent the colour the older the status data.&lt;/div&gt;&lt;div&gt;Green is good, red is bad, the rest are somewhere in between.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The graph layout it's force directed, and uses an inverse gravity model; bigger mass repells.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;We can use this property to create an intresting effect.&lt;/div&gt;&lt;div&gt;As the status data updates (every 10 secs) we adjust the mass slightly, and the graph reconfigures accordingly.&lt;/div&gt;&lt;div&gt;For failing services, or old data, we increase the mass, and they migrate to the edge of the screen. Click the image below and run the app, it's quite a neat organic effect.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;a href="http://www.lostplot.com:89/processing/graph5/applet/index.html"&gt;&lt;img id="BLOGGER_PHOTO_ID_5217300577503828546" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp2.blogger.com/_H3wgxK1ijgU/SGeTO5iOWkI/AAAAAAAAACc/hcDsoKOumRM/s400/graph5screen.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-6735196019333075806?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/6735196019333075806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=6735196019333075806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/6735196019333075806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/6735196019333075806'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2008/06/processing-nagios-status-data-part-1.html' title='Processing Nagios Status Data - part 1'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_H3wgxK1ijgU/SGeTO5iOWkI/AAAAAAAAACc/hcDsoKOumRM/s72-c/graph5screen.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-4019301299145239154</id><published>2008-04-09T13:09:00.003+10:00</published><updated>2008-04-09T13:20:43.000+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='esx vmware backup tools sysadmin'/><title type='text'>Error creating gateway</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;If you use &lt;a href="http://www.vmware.com/products/vi/esx/"&gt;ESX&lt;/a&gt; from &lt;a href="http://www.vmware.com/"&gt;Vmware&lt;/a&gt;, you may also use &lt;/span&gt;&lt;strong style="font-family: trebuchet ms; font-weight: normal;"&gt;&lt;a href="http://www.vizioncore.com/vRangerPro.html"&gt;vRanger Pro&lt;/a&gt; from &lt;/strong&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;a href="http://www.blogger.com/www.vizioncore.com"&gt;Vizioncore&lt;/a&gt; to backup VMs.  Consider doing so, it's great.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;If you are already and you start getting backup failures, with '&lt;span style="font-weight: bold;"&gt;Error creating gateway&lt;/span&gt;' in the log, check to see if someone has changed the root password on the ESX hosts.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;If the password has changed, you need to go into &lt;span style="font-weight: bold; color: rgb(0, 102, 0);font-family:courier new;" &gt;Configuration/VMware Hosts/&lt;host&gt;/Modify Host&lt;/host&gt;&lt;/span&gt; and update the password, for each vmware host.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;I speant a good few of hours figuring that out.  :(&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-4019301299145239154?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/4019301299145239154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=4019301299145239154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/4019301299145239154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/4019301299145239154'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2008/04/error-creating-gateway.html' title='Error creating gateway'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-6542148501449470548</id><published>2008-02-02T22:51:00.000+11:00</published><updated>2008-02-02T23:03:03.840+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='utilities software tools'/><title type='text'>Teracopy</title><content type='html'>Every so often a nice little utility comes a long, and it makes stop and wonder why the OS vendors didn't include it as part of the OS.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codesector.com/teracopy.php"&gt;Teracopy&lt;/a&gt; is a small windows utility from &lt;a href="http://www.codesector.com/index.php"&gt;Code Sector&lt;/a&gt; which replaces the tediously slow native file copying process.&lt;br /&gt;&lt;br /&gt;Essentially it provides file copy queues.&lt;br /&gt;&lt;br /&gt;Find the file you want to copy, right click use the context menu to use Teracopy, Copy to.. etc, start the copy process. &lt;br /&gt;&lt;br /&gt;Want to copy another file to the same place?&lt;br /&gt;Just drag it to the existing copy dialog and it will be added to the queue.&lt;br /&gt;So simple and intuitive.&lt;br /&gt;&lt;br /&gt;I love it. and it will be part of my essential installs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-6542148501449470548?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/6542148501449470548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=6542148501449470548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/6542148501449470548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/6542148501449470548'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2008/02/teracopy.html' title='Teracopy'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-449107175617451392</id><published>2007-07-04T00:05:00.000+10:00</published><updated>2007-07-04T23:54:14.127+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='consumer'/><category scheme='http://www.blogger.com/atom/ns#' term='scrape'/><category scheme='http://www.blogger.com/atom/ns#' term='rss'/><category scheme='http://www.blogger.com/atom/ns#' term='recall'/><title type='text'>Australian product recalls feed</title><content type='html'>I'm a subscriber of &lt;a href="http://www.choice.com.au"&gt;Choice magazine (Australia)&lt;/a&gt; and a supporter of their campaigns.&lt;br /&gt;Towards the back of each issue there is a couple of pages listing product recalls.   I typically scan through them, but there's a lot and the format is not great.&lt;br /&gt;&lt;br /&gt;The same information is provided online by the Australian government, &lt;a href="http://www.recalls.gov.au/"&gt;here&lt;/a&gt;.&lt;br /&gt;It's not the most attractive website, but it probably supports every browser and let's face it how slick does it need to be?&lt;br /&gt;&lt;br /&gt;If the style doesn't date it, the lack of RSS does, and that's what I was after, a low volume feed.&lt;br /&gt;I emailed the address on the contact page, but I haven't heard back, so I though I'd just scrape the pages for data and fabricate my own feed.&lt;br /&gt;&lt;br /&gt;I tried using &lt;a href="http://www.feed43.com/"&gt;feed43.com&lt;/a&gt;, a service specifically designed to scape content from html to produce rss feeds.   However, there's no facility to pull content from multiple sources, so &lt;a href="http://feed43.com/australinproductrecalls30day.xml"&gt;the feed it produced&lt;/a&gt; was not much more than a teaser,  no good for my offline reader.&lt;br /&gt;&lt;br /&gt;I decided to write my own, using python.&lt;br /&gt;A quick &lt;a href="http://www.google.com.au/search?q=python+rss+generator&amp;ie=utf-8&amp;amp;amp;amp;amp;oe=utf-8&amp;aq=t&amp;amp;rls=org.mozilla:en-GB:official&amp;amp;client=firefox-a"&gt;Google for a python module&lt;/a&gt; located &lt;a href="http://www.dalkescientific.com/Python/PyRSS2Gen.html"&gt;PyRSS2Gen&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Essentially, this the the processes :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download the web page with a list of product recall in the last 30 days.&lt;/li&gt;&lt;li&gt;Locate and extract the individual recalls using regular expresions.&lt;/li&gt;&lt;li&gt;Download each recalled item's information page.&lt;/li&gt;&lt;li&gt;Extract the details of the recall.&lt;/li&gt;&lt;li&gt;Construct an RSS feed from the scraped content.&lt;/li&gt;&lt;/ol&gt;Here's the &lt;a href="http://www.lostplot.com/recall/recall.py"&gt;code&lt;/a&gt;, and the resulting &lt;a href="http://www.lostplot.com/recall/recall_last30days.xml"&gt;rss feed&lt;/a&gt;.&lt;br /&gt;A cron job runs every day, and updates the feed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-449107175617451392?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/449107175617451392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=449107175617451392' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/449107175617451392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/449107175617451392'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2007/07/australian-product-recalls-feed.html' title='Australian product recalls feed'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-1674600651002952318</id><published>2007-04-26T21:59:00.000+10:00</published><updated>2007-04-26T23:38:29.435+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reader'/><category scheme='http://www.blogger.com/atom/ns#' term='books'/><title type='text'>What is a book ?</title><content type='html'>&lt;span style="" lang="EN-AU"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="" lang="EN-AU"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://images.amazon.com/images/P/1857988418.01.MZZZZZZZ.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 76px; height: 139px;" src="http://images.amazon.com/images/P/1857988418.01.MZZZZZZZ.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;First I saw the cover of an old novel pop up on my &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.librarything.com/"&gt;LibraryThing&lt;/a&gt;&lt;span style="font-family:arial;"&gt; collection and then, a post about &lt;/span&gt;&lt;a style="font-family: arial;" href="http://digitalhistoryhacks.blogspot.com/2007/04/luddism-is-luxury-you-cant-afford.html"&gt;Ludditism &lt;/a&gt;&lt;span style="font-family:arial;"&gt;on Digital History Hacks reminded me of the same novel, and today a post titled &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.treehugger.com/files/2007/04/biooptic_organi.php"&gt;Bio-Optic Organized Knowledge Review&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, reminded me of it again.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The novel, &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.amazon.com/exec/obidos/ASIN/1857988418/ref=nosim/librarythin08-20"&gt;Days&lt;/a&gt;&lt;span style="font-family:arial;"&gt; by &lt;a href="http://www.jameslovegrove.com/index.htm"&gt;James Lovegrove&lt;/a&gt; is an old favorite of mine, and a significant section of the plot revolves around an escalating conflict between a book shop and a computer shop.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;What  sticks in my mind is this lovely  piece about books, spoken by Miss Dalloway the Luddite bookshop manager.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"  style="font-family:arial;"&gt;&lt;span style="" lang="EN-AU"&gt;&lt;blockquote  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;"A book.  As a source of easily retrievable information, portable, needing no peripheral&lt;/span&gt;&lt;span style="font-size:100%;"&gt; support systems, instantly accessible to anyone on the planet old enough to read and turn a page, a book is without peer.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;A book does not come with an instruction manual.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;A book is not subject to constant software upgrades.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;A book is not technologically outmoded after five years. A book will never ‘go wrong’ and have to be repaired by a trained (and expensive) technician.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;A book cannot be accidentally erased at the touch of a button or have it’s contents corrupted by magnetic fields.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;Is it possible to think of a object on this earth more  – horrible term –  &lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="font-size:100%;"&gt;user-friendly than a book?"&lt;/span&gt;&lt;/blockquote&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:arial;"&gt;  That was written in 1997, when computers were outmoded in five years.  (yeah right)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I've long since been waiting for the arrival of &lt;a href="http://www.eink.com/"&gt;e-ink&lt;/a&gt;, I have wanted a good ebook reader for years and &lt;a href="http://www.37signals.com/svn/posts/351-mini-review-sony-reader"&gt;this post on Signal vs Noise&lt;/a&gt;, gives an encouraging review of the &lt;a href="http://www.sonystyle.com/is-bin/_wbr+target=_bla.k_INTERSHOP.enfinity/eCS/Store/en/-/USD/SY_DisplayProductInformation-Start?ProductSKU=PRS500U2&amp;Dept=audio&amp;amp;CategoryName=pa_portablereader"&gt;Sony Reader PRS-500 &lt;/a&gt;(&lt;a href="http://news.sel.sony.com/images/converted/2006/55/33/185533.jpg"&gt;massive image&lt;/a&gt;), encouraging enough for me to look around this room for something to sell.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Books they be changing.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-1674600651002952318?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/1674600651002952318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=1674600651002952318' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/1674600651002952318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/1674600651002952318'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2007/04/what-is-book.html' title='What is a book ?'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-4831831321505837001</id><published>2007-04-22T09:05:00.000+10:00</published><updated>2007-04-22T18:39:08.965+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svg'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='amazon'/><title type='text'>Python, Amazon, graphs, oh my! : Part 3</title><content type='html'>&lt;span style="font-family:arial;"&gt;In previous posts &lt;/span&gt;&lt;a style="font-family: arial;" href="http://babbaging.blogspot.com/2007/04/python-amazon-graphs-oh-my.html"&gt;here&lt;/a&gt;&lt;span style="font-family:arial;"&gt; and &lt;/span&gt;&lt;a style="font-family: arial;" href="http://babbaging.blogspot.com/2007/04/python-amazon-graphs-oh-my-part-2.html"&gt;here&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, I looked at a reading list on &lt;/span&gt;&lt;a style="font-family: arial;" href="http://digitalhistoryhacks.blogspot.com/2007/01/readings-for-field-in-digital-history.html"&gt;Digital History Hacks&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, and examined the liked between the books and suggested new book, using &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.google.com.au/search?q=amazon+api"&gt;Amazon's API&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I wrote my scripts with the idea of looking at some other reading lists, one such list is from the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.longnow.org/"&gt;Long Now Foundation&lt;/a&gt;&lt;span style="font-family:arial;"&gt; (&lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.longnow.org/shop/books/"&gt;list&lt;/a&gt;&lt;span style="font-family:arial;"&gt;).  Read about the foundation &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.longnow.org/about/"&gt;here&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, and listen to their superb seminar series &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.longnow.org/projects/seminars/"&gt;here&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The majority of the code work has been done, we can take the original script (&lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/scrape1.py"&gt;scrape1.py&lt;/a&gt;&lt;span style="font-family:arial;"&gt;) and tweak it for the new list.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;All that's required is the new source of data (&lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.longnow.org/shop/books/"&gt;URL&lt;/a&gt;&lt;span style="font-family:arial;"&gt;), an appropriate regular expression pattern to identify the ASINs and a new prefix to keen the results separate from previous tinkerings.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Here are the changes...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote  style="color: rgb(51, 102, 255);font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;#the page we want to scrape&lt;br /&gt;URL='http://www.longnow.org/shop/books/'&lt;br /&gt;&lt;br /&gt;# the pattern we want to look for&lt;br /&gt;PAT="ASIN\/([0-9]+[X]*)"&lt;br /&gt;&lt;br /&gt;# the prefix for the filename&lt;br /&gt;filename='ln'&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:arial;"&gt;This produces an new pickle of ASINs, and the file name is usefully prefixed, ln_asins.pik.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Now all we have to do is alter the filename prefix in &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/graph4.py"&gt;graph4.py&lt;/a&gt;&lt;span style="font-family:arial;"&gt; and that will produce the following &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my3/ln_graph4.svg"&gt;SVG&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, bitmap below.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: arial;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_H3wgxK1ijgU/RiqhCgC3QbI/AAAAAAAAAAk/iJapCDLVPM4/s1600-h/ln_graph4.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_H3wgxK1ijgU/RiqhCgC3QbI/AAAAAAAAAAk/iJapCDLVPM4/s400/ln_graph4.jpg" alt="" id="BLOGGER_PHOTO_ID_5056030596010557874" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;I though the list would be more connected, and I was initially surprised how few connections there are.  On reflection, the Long Now covers a broad range of subjects and the connection between them &lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;is &lt;/span&gt;&lt;span style="font-family:arial;"&gt;the foundation.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Still we can still search through Amazon's similar product suggestion and see what recommendations we can offer.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Change prefix in graph5.py and amazon offers up 280 items, we'll use any suggestion with more than a third of the connections of the more connected original.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;here's the results. (&lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my3/ln_graph5.svg"&gt;SVG&lt;/a&gt;&lt;span style="font-family:arial;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: arial;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my3/ln_graph5.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my3/ln_graph5.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;Well, there's plenty going on here, too much maybe.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The neat and tidy cluster in the top right is by the historian and author &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Daniel_J._Boorstin"&gt;Daniel J. Boorstin&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;There's another cluster where three titles, previous unconnected, become connected.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;So if you're interested in these...&lt;/span&gt;&lt;br /&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;&lt;span class="sans"&gt;When Good Companies Do Bad Things: Responsibility and Risk in an Age of Globalization&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sans"&gt;Built to Last: Successful Habits of Visionary Companies (Hardcover) &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sans"&gt;Guns, Germs, and Steel: The Fates of Human Societies (Paperback)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="sans"  style="font-family:arial;"&gt;...the consider these...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;&lt;span class="sans"&gt;The World Is Flat [Updated and Expanded]: A Brief History of the Twenty-first Century (Hardcover) &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sans"&gt;Good to Great and the Social Sectors: A Monograph to Accompany Good to Great (Paperback) &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sans"&gt;Blink: The Power of Thinking Without Thinking (Paperback) &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sans"&gt;The Tipping Point: How Little Things Can Make a Big Difference (Paperback) &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;span class="sans"  style="font-family:arial;"&gt;&lt;/span&gt;&lt;span class="sans"  style="font-family:arial;"&gt;&lt;br /&gt;The large node is actually a duplicate of another title but an alternate format.&lt;br /&gt;Perhaps a future version will include some dupe checking, &lt;a href="http://www.librarything.com/api"&gt;LibraryThing's API&lt;/a&gt; provides for matching ISBNs and titles.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-4831831321505837001?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/4831831321505837001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=4831831321505837001' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/4831831321505837001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/4831831321505837001'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2007/04/python-amazon-graphs-oh-my-part-3.html' title='Python, Amazon, graphs, oh my! : Part 3'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_H3wgxK1ijgU/RiqhCgC3QbI/AAAAAAAAAAk/iJapCDLVPM4/s72-c/ln_graph4.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-7821649069975974833</id><published>2007-04-17T21:36:00.000+10:00</published><updated>2007-04-19T23:21:44.853+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphviz'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='amazon'/><title type='text'>Python, Amazon, graphs, oh my! : Part 2</title><content type='html'>&lt;span style="font-family:arial;"&gt;In this &lt;a href="http://babbaging.blogspot.com/2007/04/python-amazon-graphs-oh-my.html"&gt;post &lt;/a&gt;we looked at Digital History Hack's proposed reading list and visualised it using using Graphviz's SVG output.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Now lets finish what was started and add in the book titles which are considered considered similar by Amazon.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;From the original list, Amazon suggest nearly 780 titles, that's clearly not useful.&lt;br /&gt;I've chosen to limit to those which have at least a third of the number of the most connected.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The new books added as new nodes and have a double circle node shapes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The Long Tail: Why the Future of Business Is Selling Less of More&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Wikinomics: How Mass Collaboration Changes Everything&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Everyware: The Dawning Age of Ubiquitous Computing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The Victorian Internet&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Heres the code &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/graph5.py"&gt;graph5.py&lt;/a&gt;&lt;span style="font-family:arial;"&gt; and the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://10.0.0.191/dhh_graph5.svg"&gt;SVG&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, bitmap below.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: arial;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph5.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph5.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-7821649069975974833?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/7821649069975974833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=7821649069975974833' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/7821649069975974833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/7821649069975974833'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2007/04/python-amazon-graphs-oh-my-part-2.html' title='Python, Amazon, graphs, oh my! : Part 2'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-3447608843754669239</id><published>2007-04-14T14:42:00.000+10:00</published><updated>2007-04-17T21:17:49.852+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svg'/><category scheme='http://www.blogger.com/atom/ns#' term='api'/><category scheme='http://www.blogger.com/atom/ns#' term='graphviz'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='amazon'/><title type='text'>Python, Amazon, graphs, oh my!</title><content type='html'>&lt;span style="font-family:arial;"&gt;I'm a regular reader of William J Turkel's blog, &lt;a href="http://digitalhistoryhacks.blogspot.com/"&gt;Digital History Hacks&lt;/a&gt;.&lt;br /&gt;His recent posts (&lt;a href="http://digitalhistoryhacks.blogspot.com/2007/01/exploratory-bibliography.html"&gt;here&lt;/a&gt; and &lt;a href="http://digitalhistoryhacks.blogspot.com/2007/01/exploratory-bibliography-2.html"&gt;here&lt;/a&gt;) about analysing his course's &lt;a href="http://digitalhistoryhacks.blogspot.com/2007/01/readings-for-field-in-digital-history.html"&gt;reading list&lt;/a&gt; inspired some tinkering of my own.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;In William's first post on the subject, he uses the ASIN (&lt;a href="http://en.wikipedia.org/wiki/Amazon_Standard_Identification_Number"&gt;Amazon Standard Identification Number&lt;/a&gt;) from each of the books in his reading list and Amazon's API to request a list of similar books.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;This generates a list of paired ASIN, up to 10 pairs per original title.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:arial;"&gt;Original Title ASIN 1, Similar Title ASIN 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Original Title ASIN 1, Similar Title ASIN 2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Original Title ASIN 1, Similar Title ASIN 3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Original Title ASIN 2, Similar Title ASIN 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Original Title ASIN 2, Similar Title ASIN 2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Original Title ASIN 2, Similar Title ASIN 3&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;And as William shows these pairs can be used to construct a graph, which can be used to visualise the degree of connectivity of the reading list.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;My code uses parts of Williams's so if it looks familiar, that's why.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;First scrape the ASIN from the webpage, my version of this script is here &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/scrape1.py"&gt;scrape1.py&lt;/a&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;So we have our list of paired ASIN, so let's query amazon and get some similar titles.&lt;br /&gt;You'll need to get your own &lt;a href="https://aws-portal.amazon.com/gp/aws/developer/registration/index.html"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;Amazon Web Service ID&lt;/a&gt; which is a trivial enough process.&lt;br /&gt;&lt;br /&gt;I have a couple of simple calls to help extract the data we want, in a module called &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/amazon.py"&gt;amazon.py&lt;/a&gt;.&lt;br /&gt;The&lt;span style="font-family:arial;"&gt; process is simple enough.&lt;/span&gt; &lt;/span&gt;&lt;ol style="font-family: arial;"&gt;&lt;li&gt;Load the pickled ASINs&lt;/li&gt;&lt;li&gt;Query Amazon&lt;/li&gt;&lt;li&gt;Compile a list of ASIN pairs&lt;/li&gt;&lt;li&gt;Pickle and save the list of pairs.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family:arial;"&gt;The code for that is here, &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/get_similar1.py"&gt;get_similar1.py&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I found this article, &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://wiki.python.org/moin/MiniDom"&gt;Python MiniDom&lt;/a&gt;, &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;useful when playing&lt;/span&gt; with the XML data returned by Amazon, and theres a &lt;/span&gt;&lt;span style="font-family:arial;"&gt; more comprehensive Amazon wrapper project for python, &lt;a href="http://pyaws.sourceforge.net/apidocs/index.html"&gt;pyAWS&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;OK, so now we have a list of pairs, we can start to play with &lt;a href="http://www.graphviz.org/"&gt;Graphviz&lt;/a&gt;.&lt;br /&gt;There's a lovely Python interface for Graphviz, &lt;a href="http://www.dkbza.org/pydot.html"&gt;pydot&lt;/a&gt; which I think is great.&lt;br /&gt;Basically using pydot, graphs, nodes and edges become objects and this make it very easy to use.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;Let's start by graphing all the original ASINs, and show links where they are similar to each other.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ol style="font-family: arial;"&gt;&lt;li&gt;Load the pickled ASINs&lt;/li&gt;&lt;li&gt;Load the pickled ASIN pairs&lt;/li&gt;&lt;li&gt;Create a graph object&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create a node object for ASIN and add to the graph&lt;/li&gt;&lt;li&gt;Create an edge object for each linked original ASIN&lt;/li&gt;&lt;li&gt;Save the graph&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family:arial;"&gt;Here's the code, &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/graph1.py"&gt;graph1.py&lt;/a&gt; , &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;and here the resulting graph.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 560px; height: 557px;" src="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph1.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;It's quite clear that many of these books are considered similar by amazon, and some stand out much more than others as hubs in a network.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;We can quantify that connectedness, and use the data to alter the graphs appearance.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;If we count he number of nodes which connect to or from other nodes, we can apply that to the font size, which is often done in &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Tag_cloud"&gt;tag clouds&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To do this is quite simple, we'll use a dictionary object to assign a value to each ASIN, and as we cycle through the pairs we'll increment the value.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Then, when we create the node, we'll set the font size.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;here's the code to calculate the weights:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:arial;font-size:85%;"  &gt;&lt;/span&gt;&lt;blockquote  style="font-family:arial;"&gt;&lt;span style="color: rgb(0, 153, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:courier new;" &gt;# for each ASIN associate a value&lt;br /&gt;weight={}&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:courier new;" &gt;for asin in asins:&lt;/span&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;    weight[asin]=0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# for each pair&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;for pair in pairs:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;    # only if they are one of the originals&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;    if pair[1] in asins: &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:arial;font-size:85%;"  &gt;   &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:arial;font-size:85%;"  &gt;   &lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;font-family:courier new;font-size:85%;"  &gt;         # increment the weight&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:arial;font-size:85%;"  &gt;   &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);font-family:arial;font-size:85%;"  &gt;   &lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;font-family:courier new;font-size:85%;"  &gt;        weight[pair[1]]+=1&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;weight[pair[0]]+=1&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(0, 153, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;and here is where that value is used, and while we're at it let's make the nodes circles.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;# add a node for each original title&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;for asin in asins:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    node=pydot.Node(asin, &lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;shape='circle', fontsize=8+weight[asin]&lt;/span&gt;) &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;g.add_node(node)&lt;/span&gt;  &lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;the new code, &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/graph2.py"&gt;graph2.py&lt;/a&gt; and the results...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 530px; height: 612px;" src="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph2.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;The larger circles make quite a difference, but for some reason my system does have the right fonts.   I think it still illustrates how by calculating and using the weight data we can make the over all picture clearer.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;At this point the jpg files are getting large, and the quality is not that great.&lt;/span&gt; &lt;span style="font-family:arial;"&gt;An alternative graphics format is Scalable Vector Graphics (SVG).  Read about it at &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.w3.org/Graphics/SVG/About"&gt;W3C&lt;/a&gt;&lt;span style="font-family:arial;"&gt; and at &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics"&gt;Wikipedia&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt; &lt;a style="font-family: arial;" href="http://www.mozilla.org/projects/svg/"&gt;Firefox has native support&lt;/a&gt;&lt;span style="font-family:arial;"&gt; for SVG and &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.adobe.com/svg/"&gt;Adobe&lt;/a&gt;&lt;span style="font-family:arial;"&gt; provide a viewer.&lt;br /&gt;&lt;br /&gt;This format will provide nice fonts and smooth lines and curves, and some other useful features, which we'll get to later.&lt;br /&gt;&lt;br /&gt;OK, let's use that weight value again, this time to add some color and view as an SVG.&lt;br /&gt;I have a helper module called &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/gradi.py"&gt;gradi.py&lt;/a&gt;, which has some functions which generate colour gradients, we can use this to calculate colours for our nodes.&lt;br /&gt;Starting with &lt;span style="color: rgb(255, 255, 51);"&gt;yellow &lt;/span&gt;for node with no connections, and &lt;span style="color: rgb(255, 0, 0);"&gt;red &lt;/span&gt;for those with the most, everything between we'll make &lt;span style="color: rgb(255, 153, 0);"&gt;orangish&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;First we define our colour range and gradient.&lt;br /&gt;&lt;blockquote  style="color: rgb(0, 153, 0);font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;loColor=gradi.HTMLColorToRGB('FFCC00')&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;&lt;br /&gt;hiColor=gradi.HTMLColorToRGB('FF0000')&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;&lt;br /&gt;colourgradient=1.0/max(weight.values())&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;Now when we define our node, we'll calculate the colour and fill the circle.&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: rgb(51, 102, 255);font-size:85%;" &gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;color=gradi.RGBToHTMLColor(gradi.RGBinterpolate(loColor,hiColor,colorgradient*weight[asin]))&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;node=pydot.Node(asin, shape='circle',&lt;span style="font-weight: bold;"&gt;style='filled', fillcolor=color, &lt;/span&gt;_ fontsize=8+weight[asin])&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;And then save as SVG&lt;br /&gt;&lt;blockquote  style="color: rgb(51, 102, 255);font-family:courier new;"&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;g.write(output_filename+'.svg',format='svg')&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Here the modified script, &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/graph3.py"&gt;graph3.py&lt;/a&gt; and the results, click the image or &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph3.svg"&gt;here&lt;/a&gt; for the SVG.&lt;br /&gt;I recommend this Firefox &lt;a href="http://www.treebuilder.de/zoomAndPan/index.htm"&gt;Zoom and Pan&lt;/a&gt; extension for SVG files.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph3.svg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_H3wgxK1ijgU/RiDgHywRl8I/AAAAAAAAAAc/yLmsGt3Pses/s400/dhh_graph3.jpg" alt="" id="BLOGGER_PHOTO_ID_5053285206397654978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I prefer the look of the SVG files and the format provides some useful features that bitmaps can't, for instance we can have Graphviz add http links from the nodes and edges, and include tooltips too.  Hovering over nodes will show the title, and clicking will open the Amazon product page.&lt;br /&gt;&lt;br /&gt;To add this functionality we just query Amazon for the title and include that data as a node attribute.&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;node.set_URL('http://www.amazon.com/gp/product/'+asin)&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;&lt;br /&gt;node.set_tooltip(amazon.getelement(amazon.AmazonAPI(asin),'Title'))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;Here the adjusted script, &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/graph4.py"&gt;graph4.py&lt;/a&gt; and a link the new interactive &lt;a href="http://www.lostplot.com/blogger/python-amazon-graphs-oh-my/dhh_graph4.svg"&gt;SVG&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I think this is a great improvement over a bitmap of product codes.&lt;br /&gt;In part two we'll add the titles which were suggested by Amazon.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-3447608843754669239?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/3447608843754669239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=3447608843754669239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/3447608843754669239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/3447608843754669239'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2007/04/python-amazon-graphs-oh-my.html' title='Python, Amazon, graphs, oh my!'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_H3wgxK1ijgU/RiDgHywRl8I/AAAAAAAAAAc/yLmsGt3Pses/s72-c/dhh_graph3.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6485101416614940586.post-1378411829171738997</id><published>2007-03-12T11:55:00.000+11:00</published><updated>2007-03-12T12:27:23.195+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powerchute'/><category scheme='http://www.blogger.com/atom/ns#' term='ups'/><category scheme='http://www.blogger.com/atom/ns#' term='apc'/><category scheme='http://www.blogger.com/atom/ns#' term='esx'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>PowerChute Network Shutdown agent for VMWare ESX v3.01</title><content type='html'>First things first, get the software and install it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Soft ware available here :&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: arial;" href="http://www.apcc.com/tools/download/index.cfm"&gt;http://www.apcc.com/tools/download/index.cfm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Installation guide available here:&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: arial;" href="http://sturgeon.apcc.com/techref.nsf/docID/30C4BC255BF56067802571D30050D963/$FILE/990-2838A-EN.htm#VMware"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;a name="VMware"&gt;&lt;/a&gt;&lt;/b&gt;&lt;a href="http://sturgeon.apcc.com/techref.nsf/docID/30C4BC255BF56067802571D30050D963/$FILE/990-2838A-EN.htm#Linux"&gt;&lt;span style="font-family:arial;"&gt;PowerChute Network Shutdown : Installation v.2.2.1 (www.apcc.com)&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;What isn't mentioned in the install notes, is that the esx firewall will not let your register the device with the UPS.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Open port 80&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;/usr/sbin/esxcfg-firewall -o 80,tcp,out,http&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now proceed with the install and then close the port.&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;/usr/sbin/esxcfg-firewall -c 80,tcp,out,http&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Ok, after this you should see the new client device listed in the UPS's management web pages.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Now if you leave this as is, you will carry on your busy life feeling you have a slightly less risk of something awful happening should there be a significant power failure.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Wrong.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The port used by the UPS to communicate the shut down event, is closed, your lovely ESX server will never know.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Open the port.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;/usr/sbin/esxcfg-firewall -o 3052,tcp,in,PowerChute&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Strictly speaking this not no APC's fault, but they could at least put a note, "Check port 3052 is not blocked!".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;There is no way to really simulate a Shutdown event for only one device, the agents are devout believers and will not ignore the command to shutdown.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The UPS signals each listed device and also broadcasts it too.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;You could shutdown the agent on all other devices and send a Shutdown signal from the management pages.    Don't for get to enable the agents after though.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Use &lt;a href="http://www.insecure.org/nmap/"&gt;nmap &lt;/a&gt;to test the port is open :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;nmap &lt;span style="font-style: italic;"&gt;host &lt;/span&gt;-p3052&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2007-03-12 12:19 EST&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Interesting ports on xxx.xxx.com  (nnn.nnn.nnn.nnn):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;PORT     STATE SERVICE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;3052/tcp open  PowerChute&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;MAC Address: hh:hh:hh:hh:hh:hh (VMWare)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;That's it, Good luck.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6485101416614940586-1378411829171738997?l=babbaging.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://babbaging.blogspot.com/feeds/1378411829171738997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6485101416614940586&amp;postID=1378411829171738997' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/1378411829171738997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6485101416614940586/posts/default/1378411829171738997'/><link rel='alternate' type='text/html' href='http://babbaging.blogspot.com/2007/03/powerchute-network-shutdown-agent-for.html' title='PowerChute Network Shutdown agent for VMWare ESX v3.01'/><author><name>Matt Joyce</name><uri>http://www.blogger.com/profile/13480624621698693756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_H3wgxK1ijgU/TGabwUWtgtI/AAAAAAAAAJI/U5KcNvAhJw0/s1600-R/8b4c4881fbc0495bb58f4bc7b59fd960.png'/></author><thr:total>6</thr:total></entry></feed>
