<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Peter Krantz &#187; Applications</title>
	<atom:link href="http://www.peterkrantz.com/category/applications/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peterkrantz.com</link>
	<description>A blog about technology, visualization, music and unmanned vehicle experiments</description>
	<lastBuildDate>Mon, 12 Jul 2010 14:47:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Rails vs Grails vs Django models</title>
		<link>http://www.peterkrantz.com/2009/rails-grails-django-models/</link>
		<comments>http://www.peterkrantz.com/2009/rails-grails-django-models/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:58:47 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[domain modeling]]></category>
		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=281</guid>
		<description><![CDATA[Coming back to Rails after being away from some time in Django land I discovered a huge difference in how Rails and Django treats your models...]]></description>
			<content:encoded><![CDATA[<p>Coming back to Rails after being away from some time in Django land I discovered a huge difference in how Rails, Grails and Django treats your models. In Django and Grails you can look at a model class and see all the properties it has:</p>
<pre class="brush: python;">
class Organization(models.Model):
    name = models.CharField(max_length=255)
    url = models.URLField(verify_exists=False)
    orgtype = models.ForeignKey(OrgType)
</pre>
<p>The same model class in Rails typically looks like this:</p>
<pre class="brush: ruby;">
class Organization &lt; ActiveRecord::Base
    belongs_to :OrgType
end
</pre>
<p>&#8230;and in Grails it is more specific like Django:</p>
<pre class="brush: groovy;">
class Organization {
  String name
  String url
  static belongsTo = OrgType
  OrgType orgtype
}
</pre>
<p>It took me a while to remember that in Rails, parts of the model design is actually stored in the database schema instead of in the Ruby code. Peculiar don&#8217;t you think, given that everything else in a Rails app is nicely declared in Ruby code? There are of course benefits to both approaches, but I have started adding comments in the Rails model classes to be able to remember what properties they have without peeking in the Db. Typically I have a number of half-baked projects on my laptop and from time to time I forget what they do and these comments help me remember.</p>
<p>Check out more examples here:</p>
<ul>
<li><a href="http://docs.djangoproject.com/en/dev/topics/db/models/#topics-db-models">Django models</a></li>
<li><a href="http://www.tutorialspoint.com/ruby-on-rails/rails-models.htm">Rails models</a></li>
<li><a href="https://www.ibm.com/developerworks/java/library/j-grails02128/">Grails models</a></li>
</ul>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.peterkrantz.com%2F2009%2Frails-grails-django-models%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" title="I like this" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:auto;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2009/rails-grails-django-models/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Building your own Twitter client with Fluid and jQuery</title>
		<link>http://www.peterkrantz.com/2008/twitter-client-with-fluid-and-jquery/</link>
		<comments>http://www.peterkrantz.com/2008/twitter-client-with-fluid-and-jquery/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 23:50:28 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Markup]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=169</guid>
		<description><![CDATA[Update: I have made some significant changes to Twoot and it now works well as my primary twitter client. Check out the TODO and README over at Github for more information on features etc. Like many before me, I was searching (unsuccessfully) for a decent twitter client. There are many, but most seem to be [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> I have made some significant changes to Twoot and it now works well as my primary twitter client. Check out the <a href="http://github.com/peterk/twoot/tree/master">TODO and README over at Github</a> for more information on features etc.</p>
<p>Like many before me, I was searching (unsuccessfully) for a decent twitter client. There are many, but most seem to be ad sponsored or based on a rather hefty framework like AIR (which by now, I guess, has been <a href="http://diveintomark.org/archives/2008/07/04/adobe-9">silently installed on my computer anyhow</a>).</p>
<p>Custom apps have major implications for usability so I decided to roll my own. I wanted to try out <a href="http://www.fluidapp.com/">Fluid</a>, the <a href="http://labs.mozilla.com/2007/10/prism/">Prism</a>-like app to contain web apps in their own process/window, to see if it is possible to build a complete open source ad-free twitter client in a single web page only using javascript and HTML.</p>
<p>So, I <a href="http://www.cuil.com/search?q=jquery%20twitter%20plugin&amp;sl=long">cuiled</a> for a <a href="http://jquery.com/">jQuery</a> twitter plugin but had to <a href="http://www.google.se/search?q=jquery+twitter+plugin">google</a> it to find it. Some minor modifications to the code by the fine folks at <a href="http://tweet.seaofclouds.com/">SeaOfClouds</a> and adding a method to post new status messages gave this native-looking OS X twitter client (HUD-style to the left, default style to the right and HUD avatars style below):</p>
<p><img style="float:left" src="http://www.peterkrantz.com/wp-content/uploads/2008/10/twoot-hud.png" alt="Twoot in HUD style" /></p>
<p><img src="http://www.peterkrantz.com/wp-content/uploads/2008/08/screenshot.gif" alt="Custom twitter client with Fluid and javascript" /></p>
<p><img src="http://www.peterkrantz.com/wp-content/uploads/2008/10/twoot-hud-black-avatars.jpg" alt="Twoot with avatars" /></p>
<p>Thank&#8217;s to the twitter json api it was trivial to query my own friend feed and display it in Safari. Then, I used Fluid to create a self contained OSX app that displays my static HTML page. Googling a <a href="http://www.iconarchive.com/show/dragon-soft-icons-by-artua/User-icon.html">nice application icon</a> makes it much better-looking in the taskbar. I decided to call it &#8220;Twoot&#8221;. Twoot consumes little memory and plays nice with embedded URLs (they open in a new Firefox tab).</p>
<p>Unfortunately, Fluid does not allow you to distribute the created app so you will have to roll your own by:</p>
<ol>
<li>Download and install <a href="http://fluidapp.com/">Fluid</a>.</li>
<li>Create a folder called &#8220;twoot&#8221; in your home directory.</li>
<li>Download the <a href="http://github.com/peterk/twoot/tree/master">twoot html, js and css files from github</a> and place in the twoot folder.</li>
<li><del>Edit twoot.js and set your twitter username and password.</del> (Enter credentials in the basic auth form when launching app the first time).</li>
<li>Open Fluid and create a new app by pointing to the twoot.htm file (e.g. file:///users/you/twoot/twoot.htm) and set a nice icon.</li>
<li>Save the app as &#8220;Twoot&#8221;.</li>
<li>Your new twitter client is ready! Run it and resize as required, set the window to floating, kill tabs etc. Change the twoot.css and html file to customize it further.</li>
</ol>
<p><strong>Simple API:s are wonderful for usability!</strong></p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.peterkrantz.com%2F2008%2Ftwitter-client-with-fluid-and-jquery%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" title="I like this" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:auto;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/twitter-client-with-fluid-and-jquery/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Quick site performance improvement</title>
		<link>http://www.peterkrantz.com/2008/quick-site-performance-improvemen/</link>
		<comments>http://www.peterkrantz.com/2008/quick-site-performance-improvemen/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 13:38:00 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=164</guid>
		<description><![CDATA[I have been playing with YSlow, Yahoo&#8217;s tool for web site profiling, for a while. If you haven&#8217;t tried YSlow (which is a Firefox addon to Firebug) I recommend you try it right away. Install the Firebug extension first and then add YSlow. It is amazing how much you can improve the percieved site speed [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing with <a href="http://developer.yahoo.com/yslow/">YSlow</a>, Yahoo&#8217;s tool for web site profiling, for a while. If you haven&#8217;t tried YSlow (which is a Firefox addon to Firebug) I recommend you try it right away. Install the <a href="http://getfirebug.com/">Firebug</a> extension first and then add YSlow.</p>
<p>It is amazing how much you can improve the percieved site speed by some minor changes to your htaccess file. This site runs WordPress and I was tempted to install the <a href="http://ocaoimh.ie/wp-super-cache/">WP-Super-Cache</a> plugin but was put off by some of the incompatibility issues that were reported with the latest version of WordPress and PHP safe mode. Until then I managed to lift my YSlow site score from grade F to grade C by:</p>
<p>1. <a href="http://developer.yahoo.com/performance/rules.html#etags">Removing ETag headers</a> by adding the following lines to my htaccess file (outside the wordpress-specific rewrite area):</p>
<pre>Header unset ETag
FileETag None</pre>
<p>2. <a href="http://developer.yahoo.com/performance/rules.html#expires">Setting a future expires header</a> for static files by adding this to htaccess:</p>
<pre>&lt;FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"&gt;
Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"
&lt;/FilesMatch&gt;</pre>
<p>If your app/blog uses some sort of dynamic generation of images you can modify the matching rule above for a more precise selection of files (e.g. only files in the templates folder).</p>
<p>Presto! Two simple additions to htaccess and cached access is down to two requests (of which one is Google&#8217;s javascript file for ads):</p>
<p><img class="size-full wp-image-165" title="site-speed" src="http://www.peterkrantz.com/wp-content/uploads/2008/07/site-speed.gif" alt="YSlow stats showing improved performance for this website." /></p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.peterkrantz.com%2F2008%2Fquick-site-performance-improvemen%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" title="I like this" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:auto;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/quick-site-performance-improvemen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
