<?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>Gigu's blog &#187; jquery</title>
	<atom:link href="http://blog.gigoo.org/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gigoo.org</link>
	<description>wEBbLOG</description>
	<lastBuildDate>Thu, 01 Jul 2010 22:59:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mixture of technology at Google App Engine (GAE)</title>
		<link>http://blog.gigoo.org/2010/02/10/mixture-of-technology-at-google-app-engine-gae/</link>
		<comments>http://blog.gigoo.org/2010/02/10/mixture-of-technology-at-google-app-engine-gae/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 01:45:53 +0000</pubDate>
		<dc:creator>Greg Gigon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[stuff]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[objectify]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.gigoo.org/?p=4867</guid>
		<description><![CDATA[For some time now I am developing my little hobby project. It is called F1Dashboard and it contains informations related to Formula 1 (my favorite motor-sport).

Since the site is quite stable now I will share with you some technologies and ideas I used.
Platform
F1Dashboard is build and deployed on Google App Engine (GAE). I started this [...]]]></description>
			<content:encoded><![CDATA[<p>For some time now I am developing my little hobby project. It is called <a title="F1 Dashboard" href="http://www.f1dashboard.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.f1dashboard.com');" target="_blank">F1Dashboard</a> and it contains informations related to Formula 1 (my favorite motor-sport).</p>
<p style="text-align: center;">
<div id="attachment_4870" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-4870" title="F1 Dashboard Logo" src="http://blog.gigoo.org/wp-content/uploads/2010/02/f1-dashboard-logo-300x74.jpg" alt="F1 Dashboard" width="300" height="74" /><p class="wp-caption-text">F1 Dashboard</p></div>
<p>Since the site is quite stable now I will share with you some technologies and ideas I used.</p>
<h1>Platform</h1>
<p><a title="F1 Dashboard" href="http://www.f1dashboard.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.f1dashboard.com');" target="_blank">F1Dashboard</a> is build and deployed on <a title="Google App Engine" href="http://appengine.google.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/appengine.google.com');" target="_blank">Google App Engine (GAE)</a>. I started this as an experiment and as a toy project just to learn something new.</p>
<p>GAE is not a new idea, it is another platform for <a title="Cloud computing" href="http://en.wikipedia.org/wiki/Cloud_computing" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">cloud computing</a>. Main difference from others is the Database model. GAE is using a thing called Data Store (<a title="Big Table" href="http://en.wikipedia.org/wiki/Big_table" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">Big Table</a>), which is not a normal relational database that anyone used to. There is no schema defined, and querying is impossible without indexing it before. It is something like a massive bag that could store stuff in.</p>
<p>GAE is offered as Python and <a title="Java" href="http://java.sun.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/java.sun.com');" target="_blank">Java</a>. The later was released long time after Python. It has limited version of JVM environment and a whole bunch of Google services to use. Lots of standard JDK types got repackaged by Google just to limit standard Java functionality, like spawning a Threads.</p>
<p>GAE offers standard Java servlets as web technology. This means that you could use some of the well established frameworks out there. I decided to create one myself of course <img src='http://blog.gigoo.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Something simple and not complicated.</p>
<h1>Language</h1>
<p>I choose <a title="Groovy Programming Language" href="http://groovy.codehaus.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/groovy.codehaus.org');" target="_blank">Groovy</a>, just because I wonted to learn another dynamic language and I liked the way Groovy did closures.</p>
<h1>Patterns</h1>
<p>The framework I did follows <a title="MVC pattern" href="http://en.wikipedia.org/wiki/Model–view–controller" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">MVC</a> pattern. It has single servlet entry. Every requested URL is parsed internally and resolved into Controller and Action. I&#8217;m using <a title="String Template" href="http://www.stringtemplate.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.stringtemplate.org');" target="_blank">String Template</a> as rendering engine for my views.</p>
<p>All database operations are entirely hidden behind Repositories, and I made it simple to switch from <a title="Objectify" href="http://code.google.com/p/objectify-appengine/" onclick="javascript:pageTracker._trackPageview('/outbound/article/code.google.com');" target="_blank">Objectify</a> to <a title="Data Nucleus" href="http://www.datanucleus.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.datanucleus.org');" target="_blank">Data Nucleus</a> to anything else that comes.</p>
<p>I choose Objectify for its simplicity. If you are starting with GAE I would very much recommend it.</p>
<h1>UI</h1>
<p>The design is simple and was done by fried of mine Mike from <a title="Rosslyn Digital" href="http://www.rosslyndigital.co.uk" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.rosslyndigital.co.uk');" target="_blank">Rosslyn Digital</a>.</p>
<p>I plugged in <a title="JQuery " href="http://jquery.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/jquery.org');" target="_blank">jQuery</a> <a title="JQuery tools" href="http://flowplayer.org/tools/index.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/flowplayer.org');" target="_blank">Tools</a> for Overlay effect. It also has a nice plugin for picture gallery.</p>
<p>I also added automatic <a title="F1Dashboard on Twitter" href="http://www.twitter.com/f1dashboard" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.twitter.com');" target="_blank">Twitter</a> updates for every message that is updated on a site.</p>
<h1>Updates</h1>
<p>Site is automatically harvesting for new content from various of Formula 1 related sites. There is also content from Twitter, YouTube and Flickr. It is utilizing <a title="GAE Cron" href="http://code.google.com/appengine/docs/java/config/cron.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/code.google.com');" target="_blank">GAE cron jobs</a> for that.</p>
<p>I&#8217;m trying to gather some ideas for what I can do with the site in near future. If you have an idea, drop me an email. You can also see latest updates on a site at <a title="Blog f1dashboard.com" href="http://blog.f1dashboard.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/blog.f1dashboard.com');" target="_blank">http://blog.f1dashboard.com</a></p>
<p>Cheers, Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gigoo.org/2010/02/10/mixture-of-technology-at-google-app-engine-gae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prototypal nature of JavaScript</title>
		<link>http://blog.gigoo.org/2009/04/01/prototypal-nature-of-javascript/</link>
		<comments>http://blog.gigoo.org/2009/04/01/prototypal-nature-of-javascript/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 03:15:10 +0000</pubDate>
		<dc:creator>Greg Gigon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[prototypes]]></category>

		<guid isPermaLink="false">http://blog.gigoo.org/2009/04/01/prototypal-nature-of-javascript/</guid>
		<description><![CDATA[Hated by many, loved by others. JavaScript is undeniably one of those troubled languages. The fact that it’s implementation and support is not compatible across different web browser makes it even worse and possibly hated by web developers. I would like to look closer into one of the JavaScript features, prototyping.
Some facts
JavaScript is object oriented [...]]]></description>
			<content:encoded><![CDATA[<p>Hated by many, loved by others. JavaScript is undeniably one of those troubled languages. The fact that it’s implementation and support is not compatible across different web browser makes it even worse and possibly hated by web developers. I would like to look closer into one of the JavaScript features, <strong>prototyping</strong>.</p>
<h2>Some facts</h2>
<p>JavaScript is object oriented language. It is “so much” object oriented that even Functions are first-class objects. It could be a surprise for a programmer (like myself) who used to classical object oriented approach, used in <strong>Java</strong> or <strong>C#</strong>.</p>
<p>It means that Functions can have properties, another functions, objects etc. Functions could be use to change state of the object or make calculations. They could also be used to create another <strong>Functions</strong> based on original.</p>
<h2>Classes and Prototypes</h2>
<p>Classical object oriented language is using types of object, or classes to describe it. In Prototypes one object is describing other, it is almost comparable to cloning.</p>
<p>To make it easier to understand I’d like to use this example:</p>
<ol>
<li>Using classical approach if I asks someone to make me another Aston Martin, I would be asked to get technical specs for it so it could be build it. </li>
<li>Using prototypal approach if I ask for Ferrari I will be asked to bring one so they can look at it and build it. </li>
</ol>
<p>I can define my object and if I need another copy of it I just use <strong><em>prototype</em></strong> to get the same one. In JavaScript world it also means that once I got a bunch of objects that have the same prototype, if I add new property to it I will be able to use it in all of them.</p>
<p>All objects have one common prototype that is <strong>Object </strong>prototype. Prototype for <strong>functions </strong>is <strong>Function </strong>prototype. One useful object method to determine if some object’s property is its own or inherited from its prototype is <strong>hasOwnProperty </strong>method.</p>
<h2>Few examples</h2>
<p>To create new Object in JavaScript we don’t need to describe it, just create it:</p>
<blockquote><p><strong><em>var myObject = { fooProperty: ‘some value’, barProperty: 2 };</em></strong></p>
</blockquote>
<p>Now if we would like another copy of it we could type something like this:</p>
<blockquote><p><strong><em>var Tmp = function(){};          <br />Tmp.prototype = myObject;           <br />var newObject = new Tmp();           <br /></em></strong></p>
</blockquote>
<p>You might wonder why is this necessary, looks messy and is not clear. Simple construction :</p>
<blockquote><p><strong>var newObject = {};        <br />newObject.prototype = myObject;</strong></p>
</blockquote>
<p>should work. The reason that it is not is because in first line you are creating the object. Once it’s created it’s got <strong>Object </strong>as prototype its prototype. Adding another prototype to it’s chain of prototypes will not automatically make it inherit all the properties of another prototype.</p>
<p>Adding new property to prototype could be done using this contruction:</p>
<blockquote><p><strong><em>var newObject = {};          <br />newObject.prototype.foo = “some text”;           <br />newObject.prototype.bar = function(){           <br />// do something           <br />}</em></strong></p>
</blockquote>
<h3>Multiple prototypes, chain of prototypes</h3>
<p>It is impossible to define multiple prototypes for an object.</p>
<blockquote><p><strong><em>var objectA = { foo: ‘blah’ };          <br />var objectB = { bar: ‘blah two’ };</em></strong></p>
<p><strong><em>var Tmp = function(){};          <br />Tmp.prototype = objectA;           <br />Tmp.prototype = objectB;           <br />var newObject = Tmp.new();</em></strong>       </p>
</blockquote>
<p>In here <strong><em>newObject </em></strong>will only inherit properties of a last assign prototype and it would be <strong>objectB.</strong></p>
<p>If you want to inherit multiple prototypes you have to get Function to help you.</p>
<blockquote><p><strong><em>function A(){          <br />&#160;&#160;&#160; this.foo = &#8216;blah&#8217;;           <br />};           <br /></em></strong><strong><em>function B(){          <br />&#160;&#160;&#160; this.bar = &#8216;another blah&#8217;;           <br />};           <br /></em></strong><strong><em>B.prototype = new A();          <br /></em></strong><strong><em>var c = new B();</em></strong></p>
</blockquote>
<h3>Little help from jQuery</h3>
<p><a title="jQuery" href="http://jquery.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/jquery.com');" target="_blank">jQuery</a> has a method that helps us to extend one object with some properties from another. Here how you can use it:</p>
<blockquote><p><strong><em>function A(){          <br />&#160;&#160; this.foo = &#8217;some text&#8217;;           <br />}           <br /></em></strong><strong><em>var anotherObject = { bar: 2 };          <br />$.extend(A.prototype, anotherObject);</em></strong></p>
</blockquote>
<p>&#160;</p>
<p>Cheers, Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gigoo.org/2009/04/01/prototypal-nature-of-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
