<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>pro hax in pro places</description><title>Nomadic Hax</title><generator>Tumblr (3.0; @prohax)</generator><link>http://prohax.org/</link><item><title>Automatically 'mounting' shared playlists in iTunes</title><description>&lt;p&gt;The ProHaxors are working on a sweet project called Dukejour, which is a more pro version of the railscamp jukebox, Duke. We’ll blog about it soon, but it uses iTunes sharing to discover all the available tracks on the network. Unfortunately, there’s no applescript API for iTunes to ‘mount’ a shared playlist. You can browse the libraries already mounted, but mounting was a manual process.&lt;/p&gt;

&lt;p&gt;So I schooled up a bit on applescript’s System Events, and using &lt;a href="http://rubyosa.rubyforge.org/"&gt;rubyosa&lt;/a&gt;, and using &lt;a href="http://prefabsoftware.com/uibrowser/"&gt;UI Browser&lt;/a&gt; was able to determine how to get the key information required - a list of all the rows down the left of the window.&lt;/p&gt;

&lt;p&gt;From there, the shared libraries can be found in between ‘SHARED’ and ‘PLAYLISTS’. I couldn’t get any click method to work but calling the AXShowMenu then sending the escape char works ok. If there’s a password or any other problem any dialog box is dismissed by pressing escape and space. &lt;a href="http://github.com/prohax/dukejour/blob/d371a00105a3b290f1e66db978ea709b846d3bc7/lib/tasks/discover.rake"&gt;And it works&lt;/a&gt;!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'rbosa'
itunes = OSA.app('iTunes')
itunes.activate

sys = OSA.app("System Events")
process = sys.processes.find { |p| p.name == "iTunes" }

rows = process.windows[0].splitter_groups[0].scroll_areas[0].outlines[0].rows
row_names = rows.map { |r| r.static_texts[0].name }
shared_index = row_names.index("SHARED")
if shared_index.nil?
  puts "No shared libraries available!"
else
  ((shared_index + 1)..(row_names.index("PLAYLISTS") - 1)).each { |r_index|
    puts "Adding library #{row_names[r_index]}"
    rows[r_index].actions.select { |a| a.name == "AXShowMenu" }.first.perform
    sleep(1)
    sys.key_code 53 # escape the right-click menu
    sleep(1)
    sys.key_code 53 # escape the password prompt, if it appeared
    sys.key_code 100 # dismiss an error dialog, e.g. 'too many connections', if it appeared
    sleep(1)
    puts "Done."
  }
end
&lt;/code&gt;&lt;/pre&gt;</description><link>http://prohax.org/post/109365634</link><guid>http://prohax.org/post/109365634</guid><pubDate>Mon, 18 May 2009 02:04:00 -0400</pubDate></item><item><title>By far the most pro location for hax yet!</title><description>&lt;img src="http://26.media.tumblr.com/Tw7ASzx2unf8hfrqK0wGVwBzo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;By far the most pro location for hax yet!&lt;/p&gt;</description><link>http://prohax.org/post/107103172</link><guid>http://prohax.org/post/107103172</guid><pubDate>Wed, 13 May 2009 03:07:16 -0400</pubDate></item><item><title>Bushax!</title><description>&lt;img src="http://28.media.tumblr.com/Tw7ASzx2unf87gxmgb753zqso1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Bushax!&lt;/p&gt;</description><link>http://prohax.org/post/107100718</link><guid>http://prohax.org/post/107100718</guid><pubDate>Wed, 13 May 2009 02:59:31 -0400</pubDate></item><item><title>Planehax!</title><description>&lt;img src="http://27.media.tumblr.com/Tw7ASzx2unf848nfWMWnB9QPo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Planehax!&lt;/p&gt;</description><link>http://prohax.org/post/107100189</link><guid>http://prohax.org/post/107100189</guid><pubDate>Wed, 13 May 2009 02:57:00 -0400</pubDate></item><item><title>Hax at Mr Beans, UQ.</title><description>&lt;img src="http://25.media.tumblr.com/Tw7ASzx2umv5k4o8JC5ys2M8o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Hax at Mr Beans, UQ.&lt;/p&gt;</description><link>http://prohax.org/post/101352586</link><guid>http://prohax.org/post/101352586</guid><pubDate>Wed, 29 Apr 2009 01:50:00 -0400</pubDate></item><item><title>Why Google App Engine + JVM changes everything</title><description>&lt;p&gt;It was just under 3 weeks ago, a few hours after the &lt;a href="http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html"&gt;announcement&lt;/a&gt;, &lt;a href="http://twitter.com/ben_h"&gt;@ben_h&lt;/a&gt; and I began &lt;a href="http://www.twitpic.com/309y6"&gt;drinking&lt;/a&gt;, and I became quite &lt;a href="http://twitter.com/glenmaddern/status/1477970972"&gt;contemplative&lt;/a&gt;. We’re attending the Brisbane once-off &lt;a href="http://groups.google.com/group/qjug/browse_thread/thread/871cc53788a933d3"&gt;GAE meetup&lt;/a&gt; tonight and so I thought I’d consolidate some thoughts here.&lt;/p&gt;

&lt;p&gt;In essence, Google App Engine is simply a hosting option, that is free to start with and priced once usage increases. It’s killer feature, though, is its &lt;a href="http://code.google.com/appengine/whyappengine.html"&gt;promise of scalability&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;You no longer need to worry about system administration, bringing up new instances of your application, sharding your database or buying machines. We take care of all the maintenance so you can focus on features for your users.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;If what they say is true&lt;/h2&gt;

&lt;p&gt;Then it’s the f***ing future, man. The argument is pretty simple. You either pay upfront for hosting that will only work until you become popular, or get hosting that &lt;em&gt;will&lt;/em&gt; work when you get popular, and is free until that happens.&lt;/p&gt;

&lt;p&gt;Nobody’s expecting this to be a panacea, though, however it doesn’t really need to be. The argument, as it stands, is strong enough to convince a lot of people that GAE should be their platform, which makes it the future, yes?&lt;/p&gt;

&lt;p&gt;Furthermore, because anyone can sign up a GAE account, you could clone a github repository of, say, a blog or forum, and deploy it within 2 minutes to yourapp.appspot.com. If you’d like to write the next phpBB, targetting GAE is going to be good idea.&lt;/p&gt;

&lt;h2&gt;Why JVM matters&lt;/h2&gt;

&lt;p&gt;Because while Python is pretty good, it’s still kind of a small player in webapp-land. Django looks promising, but I haven’t found someone to argue it as being greater than Rails. And while Rails is a monumental advance over the ‘old ways’, I can’t help feeling like the well-worn criticism that ‘Rails doesn’t scale’ is valid. Not necessarily in terms of performance, but in terms of system complexity and development team size.&lt;/p&gt;

&lt;p&gt;Java is hardly better. J2EE/Spring/Hibernate dominates the ‘enterprise’ web development world, but is too weighty for smaller players. Teams/apps big enough to already be writing J2EE apps are probably not the GAE’s target audience.&lt;/p&gt;

&lt;p&gt;Thankfully, Java is not the only language that runs on the JVM. There are much much more powerful languages, like Scala, that open up whole new worlds of possibility.&lt;/p&gt;

&lt;h2&gt;Is what they say true?&lt;/h2&gt;

&lt;p&gt;About scaling. Who knows, yet. It’s going to take a good amount of use before we get real-world use-cases that show up its flaws. The gridgain guys &lt;a href="http://gridgain.blogspot.com/2009/04/google-app-engine-where-does-if-fit.html"&gt;wrote about some of the limitations&lt;/a&gt;, but none of those points are a show-stopper. In any case, hooking the GAE webapp to a grid backend running somewhere else isn’t particularly difficult, if you have the need.&lt;/p&gt;

&lt;h2&gt;So what’s the future?&lt;/h2&gt;

&lt;p&gt;Scala on GAE. If someone can write a framework as pleasing to use as Rails, but more robust underneath, that targets GAE specifically, it could really take off in the next 2 - 3 years.&lt;/p&gt;

&lt;p&gt;There’s also a strong possibility that Rails running under JRuby using BigTable (so no ActiveRecord, as far as I can tell) may do it instead. &lt;a href="http://olabini.com/blog/2009/04/jruby-on-rails-on-google-app-engine/"&gt;Some progress&lt;/a&gt; has already been made.&lt;/p&gt;

&lt;h2&gt; &lt;/h2&gt;

&lt;p&gt;I’ve got more thoughts about what a new framework in Scala might look like, and how it compares to &lt;a href="http://liftweb.net/"&gt;Lift&lt;/a&gt;, but right now it’s time to go to the pub for the GAE meetup!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-&lt;/code&gt; &lt;a href="http://twitter.com/glenmaddern"&gt;@glenmaddern&lt;/a&gt;&lt;/p&gt;</description><link>http://prohax.org/post/101072272</link><guid>http://prohax.org/post/101072272</guid><pubDate>Mon, 27 Apr 2009 15:58:00 -0400</pubDate></item><item><title>Last night’s trainhax</title><description>&lt;img src="http://30.media.tumblr.com/Tw7ASzx2umu92nfvRCPLgEhso1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Last night’s trainhax&lt;/p&gt;</description><link>http://prohax.org/post/101072114</link><guid>http://prohax.org/post/101072114</guid><pubDate>Thu, 23 Apr 2009 14:02:00 -0400</pubDate></item><item><title>Yesterday arvo’s Cuban hax</title><description>&lt;img src="http://27.media.tumblr.com/Tw7ASzx2umu91hsrmXHlFlZ7o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Yesterday arvo’s &lt;a href="http://www.yourrestaurants.com.au/guide/paladar/"&gt;Cuban&lt;/a&gt; hax&lt;/p&gt;</description><link>http://prohax.org/post/101071865</link><guid>http://prohax.org/post/101071865</guid><pubDate>Thu, 23 Apr 2009 13:55:00 -0400</pubDate></item><item><title>HTML Documentation -&gt; PDF using RubyOSA</title><description>&lt;p&gt;So &lt;a href="http://rubyosa.rubyforge.org/"&gt;RubyOSA&lt;/a&gt; is my new hotness. It’s a bridge to the Apple Event Manager, and basically is an alternative to using AppleScript.&lt;/p&gt;

&lt;p&gt;When I was working at &lt;a href="http://www.leapstream.com.au"&gt;Leapstream&lt;/a&gt;, we were looking for a platform for doing up some documentation for &lt;a href="http://boostalicious.org/"&gt;Boost&lt;/a&gt;, and one of the requirements is to have the generation of a PDF version, which is leading us down the likes of DocBook or LaTeX, but that’s not particularly exciting. Since 99% (or some other high number) of the use of the documentation would be as HTML, I’d prefer something that really looks good as HTML, so I’ve decided to experiment with &lt;a href="http://daringfireball.net/projects/markdown/"&gt;Markdown&lt;/a&gt; and &lt;a href="http://johnmacfarlane.net/pandoc/"&gt;Pandoc&lt;/a&gt;, and some CSS hackery, because I understand that world a lot better (still not well). But that’s a story for another post.&lt;/p&gt;

&lt;p&gt;The issue remains, if you are generating some nice HTML, how do you generate automatically a PDF equivalent, without losing all of your formatting, styling? I decided the best way would be to simply open the pages in a browser, let them fully render (including applying syntax highlighting with javascript), then print them to PDF. So far, the best way I could figure out to do that on my mac was using Safari and applescript, and I found &lt;a href="http://macscripter.net/viewtopic.php?pid=100479"&gt;this little tutorial&lt;/a&gt;, but then the idea of learning applescript to do things like define an arrray of the files I was interested in scared me. Well, not scared, just bothered me that I couldn’t &lt;a href="http://whytheluckystiff.net/articles/wearingRubySlippersToWork.html"&gt;wear my ruby slippers to work&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I found, RubyOSA, and I &lt;3ed it straight away. I mean, it says this on the home page:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;RubyOSA retrieves the scriptable definition of a given application and populates a new Ruby namespace with classes, methods, constants, enumerations, and all other elements described by the terminology.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s my code (a rake task). It depends on cups-pdf being installed and configured as the default. Also, it expects files to be dropped in ~/Downloads/cups-pdf, and only works on macs, and is flaky, sure, but omg hot!!:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;desc "Grab the html files and pdf-ize them through safari"
task :html_to_pdf =&gt; ['main.html', 'scalpel.html'] do
  require 'rbosa'
  run "rm ~/Desktop/cups-pdf/*", "Cleaning ~/Desktop/cups-pdf"
  app = OSA.app('Safari')
  files.each { |file|
    app.make OSA::Safari::Document, :with_properties =&gt; { :url =&gt; "file://localhost/Users/glen/work/boost-doc/#{file}.html" }
    sleep 1 while (app.do_javascript("document.readyState", app.documents[0]) != "complete")
    app.print app.documents[0], :print_dialog =&gt; false
    output_file = nil
    sleep 1 while (output_file = Dir[ENV["HOME"] + "/Desktop/cups-pdf/*"].first).nil?
    app.close app.documents[0]
    run "mv #{output_file} #{file}.html.pdf", "Moving file to #{file}.html.pdf"
    run "open #{file}.html.pdf", "Opening pdf"
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Pretty sweet, yes!&lt;/p&gt;

&lt;p&gt;-glen.&lt;/p&gt;</description><link>http://prohax.org/post/101071443</link><guid>http://prohax.org/post/101071443</guid><pubDate>Tue, 21 Apr 2009 23:28:00 -0400</pubDate></item><item><title>Later this afternoon hax at Barney’s. Amazing haus.</title><description>&lt;img src="http://25.media.tumblr.com/Tw7ASzx2umu8yttwgKkkoIkZo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Later this afternoon hax at Barney’s. Amazing haus.&lt;/p&gt;</description><link>http://prohax.org/post/101071268</link><guid>http://prohax.org/post/101071268</guid><pubDate>Tue, 21 Apr 2009 23:13:00 -0400</pubDate></item><item><title>Hax at @paul_okeeffe‘s place this afternoon. Pro deck. Pro hax.</title><description>&lt;img src="http://27.media.tumblr.com/Tw7ASzx2umu8vx9zZTXgmgHxo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Hax at &lt;a href="http://twitter.com/paul_okeeffe"&gt;@paul_okeeffe&lt;/a&gt;‘s place this afternoon. Pro deck. Pro hax.&lt;/p&gt;</description><link>http://prohax.org/post/101070566</link><guid>http://prohax.org/post/101070566</guid><pubDate>Tue, 21 Apr 2009 23:08:00 -0400</pubDate></item></channel></rss>

