<?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>Juixe Techknow &#187; Design</title>
	<atom:link href="http://juixe.com/techknow/index.php/category/techknow/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://juixe.com/techknow</link>
	<description>Break Coders Block!</description>
	<lastBuildDate>Mon, 23 Jan 2012 16:01:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Common Causes for Memory Leaks</title>
		<link>http://juixe.com/techknow/index.php/2011/10/18/common-causes-for-out-of-memory/</link>
		<comments>http://juixe.com/techknow/index.php/2011/10/18/common-causes-for-out-of-memory/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 16:01:38 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[flyweight]]></category>
		<category><![CDATA[heap]]></category>
		<category><![CDATA[memory leak]]></category>
		<category><![CDATA[outofmemory]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[singleton]]></category>
		<category><![CDATA[yourkit]]></category>

		<guid isPermaLink="false">http://juixe.com/techknow/?p=1461</guid>
		<description><![CDATA[You&#8217;ll always have to deal with memory issues, no matter the programming language. Even with the Java programming language, if the right precautions are not taken, you will have some sort of memory leaks, memory issue, out of memory exception, or heap size problem. I&#8217;ve seen two common types of memory issues in every application [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ll always have to deal with memory issues, no matter the programming language.  Even with the Java programming language, if the right precautions are not taken, you will have some sort of memory leaks, memory issue, out of memory exception, or heap size problem.  I&#8217;ve seen two common types of memory issues in every application I&#8217;ve worked on.  </p>
<p>A common source of memory leaks is global static singleton god object that collects or manages a lot of data, maybe a system cache, object lookup table, service locator, etc.  This type of singleton pattern will require other objects to register with it, add themselves to the global pool of objects, but if they are not properly removed, unregistered, when they are no longer needed you will see your memory usage increase over time.  I&#8217;ve seen this issue when using the callback or listener pattern and the listener object itself holds a lot of other data.  This sort of problem is usually relatively easy to identify with a profiler, it will usually be one of the largest objects in your system.</p>
<p>The other, more difficult memory leak to identify, is when you have hundreds of thousands of objects each taking up a reasonable amount of memory.  In this case, a single object instance will not take a lot of memory but collectedly the hundreds of thousands of objects can eat up a lot of memory.  Here are a few things you can think about when dealing with a small class that spawns thousand of objects…</p>
<p>If you have int types, see if you can change them to short or byte types.  Try subclassing if you have any number of properties that most often than not set or are null.  Think about lazy loading arrays, lists, and other objects references.  If there are many object instances of this class, and any portion of these instances are logically equivalent, think of using the <a href="http://en.wikipedia.org/wiki/Flyweight_pattern">flyweight pattern</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2011/10/18/common-causes-for-out-of-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chipotle Online Order System</title>
		<link>http://juixe.com/techknow/index.php/2011/03/18/chipotle-online-order-system/</link>
		<comments>http://juixe.com/techknow/index.php/2011/03/18/chipotle-online-order-system/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 01:24:25 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[TechKnow]]></category>
		<category><![CDATA[chipotle]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://juixe.com/techknow/?p=1329</guid>
		<description><![CDATA[I love me a good burrito, and although Chipotle is not my favorite burrito joint, they do have an online order system that makes ordering lunch for a team of hungry, and picky, developers simple. But while scheduling a pick up order for the entire team I felt more like a tester than a customer. [...]]]></description>
			<content:encoded><![CDATA[<p>I love me a good burrito, and although Chipotle is not my favorite burrito joint, they do have an online order system that makes ordering lunch for a team of hungry, and picky, developers simple.  But while scheduling a pick up order for the entire team I felt more like a tester than a customer.</p>
<p>Right on the first page after login in, I encountered infinite navigation loops.  At page where I was to order, there is a big red button that read “ORDER NOW.”  If you click this button, it reloads the current page you are already on.  After trying that trick for a few times I realized I had to select one of the four order methods: online, app, fax, or burritos by the box.</p>
<div id="attachment_1330" class="wp-caption aligncenter" style="width: 545px"><img src="http://juixe.com/techknow/wp-content/uploads/2011/03/order-535x363.png" alt="Order Now" title="Order Now" width="535" height="363" class="size-large wp-image-1330" /><p class="wp-caption-text">Order Now</p></div>
<p>I then had ‘issues’ adding invitees to my order.  Adding invitees is a three step process.  You have to add a list of email addresses in the text area, click ‘Add To Invitees’, this then does some AJAX magic and creates a set of check boxes for each invitee and you have to select all  before they are actually invited.  I can honestly say that I had to this this step a few times to get it right.  If done right, each invitee receives an email with a link to order their own meal.</p>
<div id="attachment_1331" class="wp-caption aligncenter" style="width: 545px"><img src="http://juixe.com/techknow/wp-content/uploads/2011/03/invitees-535x350.png" alt="Add Invitees" title="Add Invitees" width="535" height="350" class="size-large wp-image-1331" /><p class="wp-caption-text">Add Invitees</p></div>
<p>One large problem that a few folks had was that they didn’t order what they actually wanted.  Unbeknownst to several team members, Chipotle wants users to be explicit about each ingredient in a burrito.  A lot of team members just clicked on Chicken and didn’t realize that Chipotle would just give you a piece of tortilla with some chicken.  The burrito looked like it had some stunted growth issue, but worst was the faces of the folks that ordered such a mini-burrito.  One problem here is that the UI for ordering what goes inside the burrito is cluttered and goes against conventions of ordering a burrito in most taquerias.  This mistake happened to three developers, so I can deduce that it is a common error when ordering online from the Chipotle.</p>
<div id="attachment_1332" class="wp-caption aligncenter" style="width: 545px"><img src="http://juixe.com/techknow/wp-content/uploads/2011/03/build-535x371.png" alt="Burrito Builder" title="Burrito Builder" width="535" height="371" class="size-large wp-image-1332" /><p class="wp-caption-text">Burrito Builder</p></div>
<p>One final issue I encountered was with the pick up of the online order.  I didn’t realize or received a message from Chipotle that I had to log into the system after everyone had made their order and check out.  When the time came, I just showed up at my local Chipotle to pick up the food but to my surprised they had not received it because I forgot to check out.  Of course, I logged onto their website from my phone there was no way for me to see the recent history or pending order.  Lucky for me, I was able to reach an hungry developer in the office and asked him to log into their website from my computer and he was able to finalize the order.</p>
<p>In the end, a few folks didn’t get what they expected, the food was late, and I learned a valuable lesson.  Next time I’ll just fax the order in.</p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2011/03/18/chipotle-online-order-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Best Practices</title>
		<link>http://juixe.com/techknow/index.php/2008/08/19/database-best-practices/</link>
		<comments>http://juixe.com/techknow/index.php/2008/08/19/database-best-practices/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 05:50:07 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[TechKnow]]></category>

		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2008/08/19/database-best-practices/</guid>
		<description><![CDATA[Every production application I have been involved with has made use of a database. As a programmer, you don&#8217;t have to be a DBA, but just as with software development you need to adhere to a core set of database best practices. Below are a few of the best practices I try to follow. Use [...]]]></description>
			<content:encoded><![CDATA[<p>Every production application I have been involved with has made use of a database.  As a programmer, you don&#8217;t have to be a DBA, but just as with software development you need to adhere to a core set of database best practices.  Below are a few of the best practices I try to follow.</p>
<ul>
<li>Use a database modeling tool that is vendor neutral.</li>
<li>Decide upon a database naming convention, standardize it across your organization and be consistent in following through with it.  Always be consistent with the use of case and plural vs singular.</li>
<li>Have a similar naming between your table columns and object properties.</li>
<li>Try not to use system tables directly as they are not SQL standard and may change between releases.</li>
<li>Do not use SELECT * in your queries, explicitly write the required columns names in the select statement.</li>
<li>Always use a column list in your insert statements.  This helps in avoiding problems when the table structure changes, like adding or removing columns.</li>
<li>Try to avoid wildcard characters at the beginning of the word while searching using the LIKE keyword.</li>
<li>Use the more readable ANSI standard join clause instead of he told style join.</li>
<li>If you have a choice, do not store binary files in the database.  Instead store the path to the binary file in the database and store the file in the disk, preferably another disk drive.</li>
<li>Offload tasks like string manipulations, concatenations, row numbering, case conversions, type conversions, etc to the front-end application.</li>
<li>Store computed string manipulations, concatenation, case conversion, type conversions, etc in the database so you don&#8217;t have to waste CPU cycles recalculating.</li>
<li>Avoid leaking your database design details, such as primary keys.</li>
<li>Just like your code, be sure to comment your database design.</li>
<li>Use the bulk/multi insert statement.</li>
<li>Study the SQL execution plan prior to a major release.</li>
</ul>
<p>Again, as a software developer you don&#8217;t have to be a database tuning expert but you also can&#8217;t be excused for not following the above best practices.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/database" rel="tag">database</a>, <a href="http://technorati.com/tag/db" rel="tag"> db</a>, <a href="http://technorati.com/tag/sql" rel="tag"> sql</a>, <a href="http://technorati.com/tag/best+practices" rel="tag"> best practices</a>, <a href="http://technorati.com/tag/join" rel="tag"> join</a></p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2008/08/19/database-best-practices/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Microsoft DreamSpark</title>
		<link>http://juixe.com/techknow/index.php/2008/07/09/microsoft-dreamspark/</link>
		<comments>http://juixe.com/techknow/index.php/2008/07/09/microsoft-dreamspark/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 06:16:42 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[DotNET]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[TechKnow]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2008/07/09/microsoft-dreamspark/</guid>
		<description><![CDATA[Even thought I am a Windows user, I am no where near a Microsoft lackey but recently I learned that Microsoft is giving away a ton of professional grade software to students. Through the Microsoft DreamSpark program, students can get access to Visual Studio 2008 Professional, Windows Server 2003 Standard Edition, Microsoft Expression Studio, XNA [...]]]></description>
			<content:encoded><![CDATA[<p>Even thought I am a Windows user, I am no where near a Microsoft lackey but recently I learned that Microsoft is giving away a ton of professional grade software to students.  Through the <a href="https://downloads.channel8.msdn.com/">Microsoft DreamSpark</a> program, students can get access to Visual Studio 2008 Professional, Windows Server 2003 Standard Edition, Microsoft Expression Studio, XNA Studio, XNA Creators Club, SQL Server 2005, as well as other free software such as their express edition software.  That is well over $1,500 of free software.  I am typically not a Microsoft fanboy but I do have to give credit to Microsoft for making its development tools free of charge to students across the world.  Now I wish Adobe would do the same.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/microsft" rel="tag">microsft</a>, <a href="http://technorati.com/tag/dreamspark" rel="tag"> dreamspark</a>, <a href="http://technorati.com/tag/xna" rel="tag"> xna</a>, <a href="http://technorati.com/tag/visual+studio" rel="tag"> visual studio</a>, <a href="http://technorati.com/tag/windows" rel="tag"> windows</a>, <a href="http://technorati.com/tag/sql+server" rel="tag"> sql server</a>, <a href="http://technorati.com/tag/c%23" rel="tag"> c#</a>, <a href="http://technorati.com/tag/adobe" rel="tag"> adobe</a></p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2008/07/09/microsoft-dreamspark/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Favorite Programming Quotes 2007</title>
		<link>http://juixe.com/techknow/index.php/2007/12/03/favorite-programming-quotes-2007/</link>
		<comments>http://juixe.com/techknow/index.php/2007/12/03/favorite-programming-quotes-2007/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 16:08:42 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[TechKnow]]></category>

		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/12/03/favorite-programming-quotes-2007/</guid>
		<description><![CDATA[Here is a list of great programming quotes from my readings over the last year. It is interesting to note that most of my reading material this year has been from blogs. There are just a great amount of programmer bloggers writing a lot of informative tutorials on every programming language, paradigm shift, and framework [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a list of great programming quotes from my readings over the last year.  It is interesting to note that most of my reading material this year has been from blogs.  There are just a great amount of programmer bloggers writing a lot of informative tutorials on every programming language, paradigm shift, and framework under the sun.</p>
<blockquote><p>
in my experience, one of the most significant problems in software development is assuming.  If you assume a method will passed the right parameter value, the method will fail.<br />
&#8211; Paul M. Duvall<br />
<a href="http://www.amazon.com/exec/obidos/ASIN/0321336380">Continuous Integration</a>
</p></blockquote>
<blockquote><p>
Programming languages are like girlfriends: The new one is better because *you* are better.<br />
&#8211; Derek Sivers<br />
<a href="http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html">7 reasons I switched back to PHP after 2 years on Rails</a>
</p></blockquote>
<blockquote><p>
The sooner we start coding fewer frameworks and more programs the sooner we’ll become better programmers.<br />
&#8211; Warped Java Guy<br />
<a href="http://warpedjavaguy.wordpress.com/2007/08/08/elementary-java-solutions/">Elementary Java Solutions</a>
</p></blockquote>
<blockquote><p>
Starting a startup is hard, but having a 9 to 5 job is hard too, and in some ways a worse kind of hard.<br />
&#8211; Paul Graham<br />
<a href="http://www.paulgraham.com/webstartups.html">The Future of Web Startups</a>
</p></blockquote>
<blockquote><p>
In essence, let the market design the product.<br />
&#8211; Paul Graham<br />
<a href="http://www.paulgraham.com/webstartups.html">The Future of Web Startups</a>
</p></blockquote>
<blockquote><p>
A startup now can be just a pair of 22 year old guys.  A company like that can move much more easily than one with 10 people, half of whom have kids.<br />
&#8211; Paul Graham<br />
<a href="http://www.paulgraham.com/webstartups.html">The Future of Web Startups</a>
</p></blockquote>
<blockquote><p>
Startups almost never get it right the first time.  Much more commonly you launch something, and no one cares.  Don&#8217;t assume when this happens that you&#8217;ve failed.  That&#8217;s normal for startups.  But don&#8217;t sit around doing nothing.  Iterate.<br />
&#8211; Paul Graham<br />
<a href="http://www.paulgraham.com/die.html">How Not to Die</a>
</p></blockquote>
<blockquote><p>
The key to performance is elegance, not battalions of special cases.<br />
&#8211; Jon Bentley and Doug McIlroy
</p></blockquote>
<blockquote><p>
You’ll spend far more time babysitting old technologies than implementing new ones.<br />
&#8211; Jason Hiner<br />
<a href="http://blogs.techrepublic.com.com/hiner/?p=546">IT Dirty Secrets</a>
</p></blockquote>
<blockquote><p>
To Iterate is Human, to Recurse, Divine.<br />
&#8211; James O. Coplien
</p></blockquote>
<blockquote><p>
No one hates software more than software developers.<br />
&#8211; Jeff Atwood<br />
<a href="http://www.hanselman.com/blog/HanselminutesPodcast74JeffAtwoodOverclocksTheUltimatePC.aspx">Hanselminutes Podcast 74</a>
</p></blockquote>
<blockquote><p>
I was a C++ programmer before I started designing Ruby.  I programmed in C++ exclusively for two or three years.  And after two years of C++ programming, it still surprised me.<br />
&#8211; Matz<br />
<a href="http://www.artima.com/intv/rubyP.html">The Philosophy of Ruby</a>
</p></blockquote>
<blockquote><p>
Good architecture is necessary to give programs enough structure to be able to grow large without collapsing into a puddle of confusion.<br />
&#8211; Douglas Crockford<br />
<a href="http://javascript.crockford.com/style1.html">The Elements of JavaScript Style</a>
</p></blockquote>
<blockquote><p>
Programming is difficult.  At its core, it is about managing complexity.  Computer programs are the most complex things that humans make.  Quality is illusive and elusive.<br />
&#8211; Douglas Crockford<br />
<a href="http://javascript.crockford.com/style1.html">The Elements of JavaScript Style</a>
</p></blockquote>
<blockquote><p>
Code reuse is the Holy Grail of Software Engineering.<br />
&#8211; Douglas Crockford<br />
<a href="http://javascript.crockford.com/style1.html">The Elements of JavaScript Style</a>
</p></blockquote>
<blockquote><p>
The structure of software systems tend to reflect the structure of the organization that produce them.<br />
&#8211; Douglas Crockford<br />
<a href="http://javascript.crockford.com/style1.html">The Elements of JavaScript Style</a>
</p></blockquote>
<blockquote><p>
The definition of Hell is working with dates in Java, JDBC, and Oracle. Every single one of them screw it up.<br />
&#8211; Dick Wall<br />
<a href="http://www.juixe.com/techknow/index.php/2007/05/17/lunch-with-the-java-posse/">CommunityOne 2007: Lunch with the Java Posse</a>
</p></blockquote>
<blockquote><p>
Suppose you went back to Ada Lovelace and asked her the difference between a script and a program. She&#8217;d probably look at you funny, then say something like: Well, a script is what you give the actors, but a program is what you give the audience.<br />
&#8211; Larry Wall<br />
<a href="http://www.perl.com/pub/a/2007/12/06/soto-11.html">Programming is Hard, Let&#8217;s Go Scripting&#8230;</a>
</p></blockquote>
<blockquote><p>
I went to school to learn how to program software applications, which inevitably have bug defects.  There was no course at my university on testing, debugging, profiling, or optimization. These things you have to learn on your own, usually in a tight deadline.<br />
&#8211; Juixe TechKnow
</p></blockquote>
<blockquote><p>
To most Java developers, Ruby/Rails is like a mistress.  Ruby/Rails is young, new, and exciting; but eventually we go back to old faithful, dependable, and employable Java with some new tricks and idioms and we are the better programmer for it.<br />
&#8211; Juixe TechKnow
</p></blockquote>
<blockquote><p>
You might as well pay your customers 50K because they are just your QA.<br />
&#8211; Juixe TechKnow
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2007/12/03/favorite-programming-quotes-2007/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Unobtrusive JavaScript with Prototype and Behavior</title>
		<link>http://juixe.com/techknow/index.php/2007/05/02/unobtrusive-javascript-with-prototype-and-behavior/</link>
		<comments>http://juixe.com/techknow/index.php/2007/05/02/unobtrusive-javascript-with-prototype-and-behavior/#comments</comments>
		<pubDate>Thu, 03 May 2007 00:00:40 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML/XML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TechKnow]]></category>

		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/05/02/unobtrusive-javascript-with-prototype-and-behavior/</guid>
		<description><![CDATA[If you are familiar with web application development you may already be familiar with the Model-View-Controller (MVC) design pattern. The MVC pattern aims to separate your server side business logic from your presentation code from your data model. The by-product of web applications are the HTML, CSS, and JavaScript pages generated and delivered to the [...]]]></description>
			<content:encoded><![CDATA[<p>If you are familiar with web application development you may already be familiar with the <b>Model-View-Controller</b> (MVC) design pattern.  The MVC pattern aims to separate your server side business logic from your presentation code from your data model.  The by-product of web applications are the HTML, CSS, and JavaScript pages generated and delivered to the client browser.  Historically in the early Web 1.0 days, a web page&#8217;s content, style, and behavior would all be intertwined and glued tightly together in the HTML, do you remember the font tag?  Somewhere along the way to the Web 2.0 network, developers opted to remove the style attributes from the content by using Cascading Style Sheets (CSS) classes.</p>
<p>CSS allows you to create style classes whose concern is purely a way to describe the size, font, color, and look of whatever content that uses the class.</p>
<pre class="brush: css; title: ; notranslate">
.makeMeBeautiful {
  color: #00248F;
  text-decoration: underline;
  background-color: #FFFFFF;
  font-size: 1.1em;
}
</pre>
<p>To apply a CSS class on an HTML element you use the class attribute.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;makeMeBeautiful&quot;&gt;Hello, World&lt;/div&gt;
</pre>
<p>The idea behind <b>Unobtrusive JavaScript</b> (UJS) is to remove JavaScript events, such as onclick and onmouseover, from the content in the same fashion as the style attribute.  Unobtrusive JavaScript uses the class and id attribute of HTML tag elements to find and assign JavaScript events in a inconspicuous fashion, just as with CSS.</p>
<p>If you think of the HTML content as the Model, the CSS stylings as the View, and JavaScript behaviors as the Controller of MVC, then it makes perfect sense to remove all traces of style attributes and JavaScript events from the HTML.</p>
<h3>Unobtrusive JavaScript with Prototype</h3>
<p>Traditionally if you wanted to add a JavaScript onclick event to a HTML element you would do so by adding the onclick attribute.  Unobtrusive JavaScript recommends that you instead find the tag by the class or id attribute and assign the even programmatically.</p>
<pre class="brush: jscript; title: ; notranslate">
// Logic to execute when the end user
// clicks the element
function myOnClickFunction(elem) {
  alert(elem);
}

// Register the onclick event for all elements
// the given class name
window.onload = function() {
  // Find all elements that use that given CSS class
  var elements = document.getElementsByClassName(&quot;makeMeBeautiful&quot;);
  elements.each(
    function(e) {
      // Assign the onclick method to the element
      Event.observe(e, &quot;click&quot;, myOnClickFunction);
    }
  );
}
</pre>
<p>Note that the above JavaScript code works only when the <a href="http://www.prototypejs.org/">Prototype JavaScript</a> library is made available.</p>
<p>If your need to add Unobstrusive JavaScript events for a few tag elements and are already using Prototype then the above code will suffice.</p>
<h3>Unobtrusive JavaScript with Behavior</h3>
<p>For more restrictive selection process of the HTML elements to apply JavaScript events you can use the <a href="http://bennolan.com/behaviour/">Behavior JavaScript</a> library.  The Behavior JavaScript library is a lot easier and more powerful way to add behavior to HTML elements than Prototype.  With the Behavior library you define an associated hash map literal object thingie where the keys are CSS selectors and the value is an initializing JavaScript function.  In the initializing function you can add any onclick, onmouseover, onchange, onsubmit, onfocus, onblur, onwhatever event.</p>
<pre class="brush: jscript; title: ; notranslate">
var rules = {
  '.makeMeBeautiful' : function(elem){
    elem.onclick = function(){
      alert(elem);
    }
  }
};

Behaviour.register(rules);
</pre>
<p>The power of the Behavior library is that you can create the behavioral rules using CSS selectors to choose the tag elements for which to apply a given set of JavaScript functionality.  Both the Prototype and Behavior code shown up to this point will apply the JavaScript onclick behavior on all elements that use the given CSS class.  With the Behavior library you can use CSS selectors to restrict what elements to apply the behavior to.  For example, to apply the onclick behavior only for div elements you can use the following rule.</p>
<pre class="brush: jscript; title: ; notranslate">
var rules = {
  'div.makeMeBeautiful' : function(elem){
    // Your code here...
  }
};
</pre>
<p>The idea behind Unobtrusive JavaScript is to separate the HTML, CSS, and JavaScript according to responsibilities in a similar fashion as the MVC design pattern suggests.  UJS also helps in the maintenance of large sites and it allows for graceful degradation.</p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2007/05/02/unobtrusive-javascript-with-prototype-and-behavior/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Markup for the Semantic Web</title>
		<link>http://juixe.com/techknow/index.php/2007/05/01/markup-for-the-semantic-web/</link>
		<comments>http://juixe.com/techknow/index.php/2007/05/01/markup-for-the-semantic-web/#comments</comments>
		<pubDate>Tue, 01 May 2007 14:56:28 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML/XML]]></category>
		<category><![CDATA[TechKnow]]></category>

		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/05/01/markup-for-the-semantic-web/</guid>
		<description><![CDATA[A recent article, The Definitive Guide to Semantic Web Markup for Blogs, provided me with some new insight into how blog templates should be designed for optimal Search Engine Optimization (SEO). The advice is not restricted to blogs, but can be generalized for any web development. For my own benefit I will recap the key [...]]]></description>
			<content:encoded><![CDATA[<p>A recent article, <a href="http://www.pearsonified.com/2007/04/definitive-guide-to-semantic-markup.php">The Definitive Guide to Semantic Web Markup for Blogs</a>, provided me with some new insight into how blog templates should be designed for optimal <a href="http://www.juixe.com/techknow/index.php/2005/11/12/search-engine-optimization/">Search Engine Optimization</a> (SEO).  The advice is not restricted to blogs, but can be generalized for any web development.  For my own benefit I will recap the key points of that article.</p>
<p>Use the &lt;title&gt; tag for the title of the page or post, not the name of your site.  It is not recommend to concatenate the your site name with the title of the post.</p>
<p>Put post and article titles inside &lt;h1&gt; tags.</p>
<p>Use &lt;h2&gt; and other header tags for sub-headlines.</p>
<p>Don&#8217;t place your site name, logo, and or tagline in a &lt;h1&gt; tag.  Place your site information in a &lt;div&gt; tag instead.  Your sidebar menu headlines usually do not merit header tags such as &lt;h2&gt;.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/seo" rel="tag">seo</a>, <a href="http://technorati.com/tag/serp" rel="tag"> serp</a>, <a href="http://technorati.com/tag/design" rel="tag"> design</a>, <a href="http://technorati.com/tag/wordpress" rel="tag"> wordpress</a>, <a href="http://technorati.com/tag/template" rel="tag"> template</a>, <a href="http://technorati.com/tag/xhtml" rel="tag"> xhtml</a>, <a href="http://technorati.com/tag/semantic+web" rel="tag"> semantic web</a></p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2007/05/01/markup-for-the-semantic-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Future of Web Apps SF 2006 Conference Notes</title>
		<link>http://juixe.com/techknow/index.php/2006/12/28/the-future-of-web-apps-sf-2006-conference-notes/</link>
		<comments>http://juixe.com/techknow/index.php/2006/12/28/the-future-of-web-apps-sf-2006-conference-notes/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 17:40:44 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML/XML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TechKnow]]></category>

		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/12/28/the-future-of-web-apps-sf-2006-conference-notes/</guid>
		<description><![CDATA[Carson Workshops is working hard on the two day conference The Future of Web Apps in London. The summit is going to be held in London during February 20-21, 2007. I had the opportunity to attend the San Francisco, September 13-14 2006 conference for which I present the following notes&#8230; The Future of Web apps [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.carsonworkshops.com/summit/">Carson Workshops</a> is working hard on the two day conference The Future of Web Apps in London.  The summit is going to be held in London during February 20-21, 2007.  I had the opportunity to attend the San Francisco, September 13-14 2006 conference for which I present the following notes&#8230;  <a href="http://www.juixe.com/papers/fowa2006.pdf">The Future of Web apps conference notes</a> are available as a single PDF document for your convinience.</p>
<p><img id="image214" src="http://www.juixe.com/techknow/wp-content/uploads/2006/12/fowa.jpg" alt="Web 2.0" /></p>
<p><b>Wednesday, September 13</b><br />
<a href="http://www.juixe.com/techknow/index.php/2006/09/24/dick-hardt-the-emerging-age-of-who/">Dick Hardt &#8211; The Emerging Age of Who</a><br />
<a href="http://www.juixe.com/techknow/index.php/2006/09/24/kevin-rose-the-digg-story/">Kevin Rose &#8211; The Digg Story</a> &#8211; Kevin talks about design and scalability.<br />
<a href="http://www.juixe.com/techknow/index.php/2006/09/24/tom-coates-social-change-on-the-web/">Tom Coates &#8211; Social Change on the Web</a> &#8211; Tom talks about users motivation.<br />
<a href="http://www.juixe.com/techknow/index.php/2006/09/24/tantek-celik-best-practice-with-microformats/">Tantek Celik &#8211; Best Practice With Microformats</a> &#8211; Microformats are fun.<br />
<a href="http://www.juixe.com/techknow/index.php/2006/09/24/steve-olechowski-ten-things-you-didnt-know-about-rss/">Steve Olechowski &#8211; Ten Things You Didn&#8217;t Know About RSS</a><br />
<a href="http://www.juixe.com/techknow/index.php/2006/09/24/carl-sjogreen-how-we-built-google-calendar/">Carl Sjogreen &#8211; How We Built Google Calendar</a> &#8211; Six key insights in building Google Calendar.<br />
<a href="http://www.juixe.com/techknow/index.php/2006/09/24/mike-davidson-user-driven-content-is-it-working-2/">Mike Davidson &#8211; User-driven Content &#8211; Is it Working?</a><br />
<span id="more-215"></span><br />
<b>Thursday, September 14</b><br />
<a href="http://www.juixe.com/techknow/index.php/2006/11/13/michael-arrington-whats-next-for-web-applications/">Michael Arrington &#8211; What&#8217;s Next For Web Applications</a> &#8211; &#8220;Raising too much money and spending it is a bad thing.&#8221;<br />
<a href="http://www.juixe.com/techknow/index.php/2006/11/13/ted-rheingold-dogster/">Ted Rheingold &#8211; Dogster</a> &#8211; &#8220;Commenting is community.&#8221;<br />
<a href="http://www.juixe.com/techknow/index.php/2006/11/13/cal-henderson-taking-flickr-to-gama/">Cal Henderson &#8211; Taking Flickr to Gamma</a> &#8211; Cal Henderson of Flickr talks scalability and maintainability.<br />
<a href="http://www.juixe.com/techknow/index.php/2006/11/14/evan-williams-funding-and-selling-a-startup/">Evan Williams &#8211; Funding and Selling a Startup</a><br />
<a href="http://www.juixe.com/techknow/index.php/2006/11/14/ryan-carson-14-things-i-wish-i-had-known/">Ryan Carson &#8211; 14 Things I Wish I Had Known</a> &#8211; 14 things all web application developers should know.<br />
<a href="http://www.juixe.com/techknow/index.php/2006/11/15/jeff-veen-designing-better-web-app-interfaces/">Jeff Veen &#8211; Designing Better Web App Interfaces</a><br />
<a href="http://www.juixe.com/techknow/index.php/2006/11/15/matt-mullenweg-the-story-behind-wordpress/">Matt Mullenweg &#8211; The Story Behind WordPress</a> &#8211; Matt talks about plugins, users, and globalization.</p>
<p>Enjoy!</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/fowa" rel="tag">fowa</a>, <a href="http://technorati.com/tag/techcrunch" rel="tag"> techcrunch</a>, <a href="http://technorati.com/tag/web2.0" rel="tag"> web2.0</a>, <a href="http://technorati.com/tag/purple+cow" rel="tag"> purple cow</a>, <a href="http://technorati.com/tag/flickr" rel="tag"> flickr</a>, <a href="http://technorati.com/tag/yahoo" rel="tag"> yahoo</a>, <a href="http://technorati.com/tag/google" rel="tag"> google</a>, <a href="http://technorati.com/tag/webdesign" rel="tag"> webdesign</a>, <a href="http://technorati.com/tag/wordpress" rel="tag"> wordpress</a>, <a href="http://technorati.com/tag/ajax" rel="tag"> ajax</a>, <a href="http://technorati.com/tag/rss" rel="tag"> rss</a>, <a href="http://technorati.com/tag/microformats" rel="tag"> microformats</a></p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2006/12/28/the-future-of-web-apps-sf-2006-conference-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mike Davidson &#8211; User-driven Content &#8211; Is It Working?</title>
		<link>http://juixe.com/techknow/index.php/2006/09/24/mike-davidson-user-driven-content-is-it-working-2/</link>
		<comments>http://juixe.com/techknow/index.php/2006/09/24/mike-davidson-user-driven-content-is-it-working-2/#comments</comments>
		<pubDate>Mon, 25 Sep 2006 02:22:32 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TechKnow]]></category>

		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/09/24/mike-davidson-user-driven-content-is-it-working-2/</guid>
		<description><![CDATA[Mike is the founder and CEO of Newsvine. Mike&#8217;s presentation at CarsonWorkshops The Future of Web Apps conference dealt with user generated content. User generated content is not a new concept, it is just a new buzzword. Amazon is driven by user generated content, user can review reviewers. Amazon, Ebay, Epionions have been using user [...]]]></description>
			<content:encoded><![CDATA[<p>Mike is the founder and CEO of <a href="http://www.newsvine.com/">Newsvine</a>.  Mike&#8217;s presentation at CarsonWorkshops The Future of Web Apps conference dealt with user generated content.  User generated content is not a new concept, it is just a new buzzword.  Amazon is driven by user generated content, user can review reviewers.  Amazon, Ebay, Epionions have been using user genrated content for years, since web 1.0.  The current examples of user genereated web 2.0 sites are MySpace and <a href="http://www.juixe.com/techknow/index.php/2006/09/24/kevin-rose-the-digg-story/">Digg</a>.  During this conference I head MySpace be used as an example every hour, I head people say things like &#8220;I want to be the MySpace of gardening.&#8221;  I want to be the MySpace of fund of hedge fund software.</p>
<p>Mike said that &#8220;Delicious is a great way to extend your memory.&#8221;  I use it as a reading list, I bookmark what I haven&#8217;t read but want to.  YouTube is another often mentioned web 2.0 user generated content web application.  Mike also mentioned that &#8220;the interesting thing about Second Life, is that fake products are being sold for real money in a fake environment.  That is a market I am interested in being a part of.&#8221;<br />
<span id="more-171"></span><br />
Scaling was the unwritten theme of the conference.  Mike advised that social services need to scale.  He also recommended to not develop a social network for the sake of a building a social network.  People want to don&#8217;t want to join a network, they want to join something meaningful that also happens to be a social network.  Flickr is not just a social site, it is primarily a great way for user to organize their photos.  Some advice that I need to follow is to always leave comments turn on.</p>
<p>Mike mentioned the <a href="http://en.wikipedia.org/wiki/Dunbar's_number">Dunbar&#8217;s number</a>, which states that the ideal size of a group is roughly 150 people.  According to Wikipedia, Dunbar&#8217;s number is the &#8220;limit to the number of individuals with whom any one person can maintain stable relationships.&#8221;  It is at around this number that groups function best, where the users can get to know each other and hence care for each other a some level.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/user+content" rel="tag">user content</a>, <a href="http://technorati.com/tag/user+generated" rel="tag"> user generated</a>, <a href="http://technorati.com/tag/fowa" rel="tag"> fowa</a>, <a href="http://technorati.com/tag/dunbar%26%238217%3Bs+number" rel="tag"> dunbar&#8217;s number</a>, <a href="http://technorati.com/tag/newsvine" rel="tag"> newsvine</a></p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2006/09/24/mike-davidson-user-driven-content-is-it-working-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Carl Sjogreen &#8211; How We Built Google Calendar</title>
		<link>http://juixe.com/techknow/index.php/2006/09/24/carl-sjogreen-how-we-built-google-calendar/</link>
		<comments>http://juixe.com/techknow/index.php/2006/09/24/carl-sjogreen-how-we-built-google-calendar/#comments</comments>
		<pubDate>Mon, 25 Sep 2006 02:11:17 +0000</pubDate>
		<dc:creator>TechKnow</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TechKnow]]></category>

		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/09/24/carl-sjogreen-how-we-built-google-calendar/</guid>
		<description><![CDATA[Carl is the Product Manager of Google Calendar. During his presentation at The Future of Web Apps, Carl shed some light into the development process in place at Google on a typical project and his experience building a great web 2.0 application. Carl said that Google Calendar started as a &#8216;classic&#8217; Google product team, that [...]]]></description>
			<content:encoded><![CDATA[<p>Carl is the Product Manager of Google Calendar.  During his presentation at The Future of Web Apps, Carl shed some light into the development process in place at Google on a typical project and his experience building a great <b>web 2.0</b> application.  Carl said that Google Calendar started as a &#8216;classic&#8217; Google product team, that is 1 product manager and 3 engineers.  The original idea of a Google calendar system was conceived from customer feedback and internal need.  In design Google Calendar, Carl said that &#8220;being smart isn&#8217;t always best.&#8221;  Carl explained how they over engineered some usability features in the early Google Calendar version that they had to dumb down or simplify for the general public.</p>
<p>Carl also provided six key insights for your next product or company that I will now copy here verbatim.</p>
<p>The first insight is that easy is the most important feature.  Think Google Calendar QuickAdd, Google Maps single text field.  Google Maps has a single field as opposed to a whole address, city, state, zip code form.<br />
<span id="more-169"></span><br />
The second key is to know your real competition.  You always have a competitor no matter how innovative you are.  The real competition often is the pen and paper.  Do well what paper can&#8217;t, collaborate beyond the same room.</p>
<p>The third point presented by Carl is that visual design matters.</p>
<p>The fourth intuition which seems counterintuitive at first is to build products for people who don&#8217;t want to use them.  Carl reminded the audience that &#8220;not everyone who can benefit from your service actually wants to use it.&#8221;  Get your product in front of the applications people use every day &#8220;and then make it painless for people to start using your product without fully switching into a new way of doing things.&#8221;</p>
<p>The fifth insight provided by Carl was to time your launch properly.  Carl made it clear that, &#8220;you better not launch until you are really ready. &#8230; Launch early and often, but not too early&#8221;</p>
<p>Carl&#8217;s last key insight is &#8216;driving usage.&#8217;  By driving usage he meant to provide enough touch points into your web application via an open <a href="http://www.juixe.com/techknow/index.php/2006/05/20/api-design/">API</a>.  <a href="http://www.juixe.com/techknow/index.php/2006/09/24/tantek-celik-best-practice-with-microformats/">Tantek</a> also spoke about providing a simple to use API.  By driving usage he meant to let your application to spread to as many site as possible without having user come to your site, think social beyond tags.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/google" rel="tag">google</a>, <a href="http://technorati.com/tag/google+calendar" rel="tag"> google calendar</a>, <a href="http://technorati.com/tag/google+maps" rel="tag"> google maps</a>, <a href="http://technorati.com/tag/web2.0" rel="tag"> web2.0</a>, <a href="http://technorati.com/tag/ajax" rel="tag"> ajax</a>, <a href="http://technorati.com/tag/fowa" rel="tag"> fowa</a>, <a href="http://technorati.com/tag/api+design" rel="tag"> api design</a></p>
]]></content:encoded>
			<wfw:commentRss>http://juixe.com/techknow/index.php/2006/09/24/carl-sjogreen-how-we-built-google-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

