<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">

<channel>
<title>Hackszine: Software Engineering</title>
<link>http://www.hackszine.com/blog/archive/software_engineering/</link>
<description>O&apos;Reilly&apos;s Hacks Series reclaims the term &apos;hacking&apos; for the good guys--innovators who explore and experiment, unearth shortcuts, create useful tools, and come up with fun things to try on their own</description>
<language>en-us</language>
<copyright>Copyright 2008, O'Reilly Media, Inc.</copyright>
<lastBuildDate>Wed, 17 Sep 2008 20:36:01 -0800</lastBuildDate>
<pubDate>Tue, 23 Sep 2008 20:19:35 -0800</pubDate>
<generator>http://www.movabletype.org/?v=4.1</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<itunes:author>O'Reilly Media, Inc.</itunes:author>
<itunes:subtitle>Clever solutions to interesting problems.</itunes:subtitle>
<itunes:summary>Hackszine Podcast</itunes:summary>
<itunes:owner>
<itunes:email>webmaster@makezine.com</itunes:email>
</itunes:owner>
<category>Technology</category>
<itunes:category text="Technology">
</itunes:category>
<itunes:category text="Technology">
  <itunes:category text="Gadgets" />
</itunes:category>
<itunes:category text="Games &amp; Hobbies" >
</itunes:category>
<itunes:category text="Science">
</itunes:category>
<itunes:image href="http://makezine.com/images/hackszine/rss_icon.jpg" />
<itunes:explicit>no</itunes:explicit>


<item>
<title>Stanford Engineering Everywhere</title>
<itunes:summary><![CDATA[ Standford's Stanford's School of Engineering has released a number of Computer Science and Electrical Engineering courses online, in their entirety, called Standford Engineering Everywhere. The online program includes all course materials&mdash;notes, tests, and complete lecture recordings&mdash;free for students or...]]></itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="stanford_ee_20080917.jpg" src="http://www.hackszine.com/stanford_ee_20080917.jpg" width="600" height="217" class="mt-image-none" style="" /></span></p>

<p>Standford's Stanford's School of Engineering has released a number of Computer Science and Electrical Engineering courses online, in their entirety, called Standford Engineering Everywhere. The online program includes all course materials&mdash;notes, tests, and complete lecture recordings&mdash;free for students or educators to use under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.</p>

<blockquote>SEE users may pick and choose the materials that best meet their needs and interests. Want a refresher course on a particular programming concept? View a video lecture that covers the basics. Are you a programming novice? Spend several weeks viewing lectures, reading course materials and tackling class assignments. Test your knowledge by taking quizzes and exams.
</blockquote>

<p>As an example, here's the first lecture in the Machine Learning course, taught by Professor Andrew Ng:</p>

<p><object width="600" height="480"><param name="movie" value="http://www.youtube.com/v/UzxYlbK2c7E&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/UzxYlbK2c7E&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="600" height="480"></embed></object></p>

<p>The ten courses that are available cover a healthy range of topics. It's basically 3 or 4 semesters worth of EE and Comp Sci. education that you can brainload for free. Here's the current selection:</p>

<p><strong>Introduction to Computer Science</strong><br />
<ul><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111">Programming Methodology</a></li><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=11f4f422-5670-4b4c-889c-008262e09e4e">Programming Abstractions</a></li><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=2d712634-2bf1-4b55-9a3a-ca9d470755ee">Programming Paradigms</a></li></ul></p>

<p><strong>Artificial Intelligence</strong><br />
<ul><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=86cc8662-f6e4-43c3-a1be-b30d1d179743">Introduction to Robotics</a></li><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=63480b48-8819-4efd-8412-263f1a472f5a">Natural Language Processing</a></li><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=348ca38a-3a6d-4052-937d-cb017338d7b1">Machine Learning</a></li></ul></p>

<p><strong>Linear Systems and Optimization</strong><br />
<ul><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=84d174c2-d74f-493d-92ae-c3f45c0ee091">The Fourier Transform and its Applications</a></li><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=17005383-19c6-49ed-9497-2ba8bfcfe5f6">Introduction to Linear Dynamical Systems</a></li><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=2db7ced4-39d1-4fdb-90e8-364129597c87">Convex Optimization I</a></li><li><a href="http://see.stanford.edu/SEE/courseinfo.aspx?coll=523bbab2-dcc1-4b5a-b78f-4c9dc8c7cf7a">Convex Optimization II</a></li></ul></p>

<p>If you've ever wanted to go to Standford, but didn't have the time, money, or grades, here's your chance.</p>

<p><a href="http://see.stanford.edu/default.aspx">Stanford Engineering Everywhere</a> [via <a href="http://creativecommons.org/">Creative Commons</a>]</p>

<p><strong>Previously</strong><br />
<a href="http://www.hackszine.com/blog/archive/2007/12/lecturefox_free_university_lec.html">Lecturefox: free university lectures</a><br />
<a href="http://www.hackszine.com/blog/archive/2007/02/bootstrap_education.html">Bootstrap Education</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/09/stanford_engineering_everywher.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/09/stanford_engineering_everywher.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/09/stanford_engineering_everywher.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/09/stanford_engineering_everywher.html?CMP=OTC-7G2N43923558</guid>
<category>Education</category>
<pubDate>Wed, 17 Sep 2008 20:36:01 -0800</pubDate>

</item>

<item>
<title>Write a Hadoop MapReduce job in any programming language</title>
<itunes:summary>Hadoop is a Java-based distributed application and storage framework that&apos;s designed to run on thousands of commodity machines. You can think of it as an open source approximation of Google&apos;s search infrastructure. Yahoo!, in fact, runs many components of its...</itunes:summary>
<description>
<![CDATA[<p>Hadoop is a Java-based distributed application and storage framework that's designed to run on thousands of commodity machines. You can think of it as an open source approximation of Google's search infrastructure.  Yahoo!, in fact, runs many components of its search and ad products on Hadoop, and it's not too surprising that they are a major contributor to the project. </p>

<p>MapReduce is a method for writing software that can be parallelized across thousands of machines to process enormous amounts of data. For instance, let's say you want to count the number of referrals, by domain, in all the world's Apache server logs. Here's the gist of how you'd do it:</p>

<ol><li>Get all the world to upload their server logs to your gigantor distributed file system. You might automate and approximate this by having every web administrator add some javascript code to their site that causes their visitor's browsers to ping your own server, resulting in one giant log file of all the world's server logs. Your filesystem of choice is HDFS, the Hadoop Distributed Filesystem, which handles partitioning and replicating this enormous file between all of your cluster nodes.</li><li>Split the world's largest log file into tiny pieces, and have your thousands of cluster machines parse the pieces, looking for referrers. This is the "Map" phase. Each chunk is processed and the referrers found in that chunk are output back to the system, which stores the output keyed by the referrer hostname. The chunk assignments are optimized so that the cluster nodes will process chunks of data that happen to be stored on their local fragment of the distributed file system.</li><li>Finally, all the outputs from the Map phase are collated.  This is called the "Reduce" phase. The cluster nodes are assigned a hostname key that was created during the Map phase. All of the outputs for that key are read in by the node and counted. The node then outputs a single result which is the domain name of the referrer, and the total number of referrals that were produced from that referrer. This is done hundreds of thousands of times, once for each referrer domain, and distributed across the thousands of cluster nodes.</li></ol>

<p>At the end of this hypothetical MapReduce job, you're left with a concise list of each domain that's referred traffic, and a count of how many referrals it's given. What's cool about Hadoop and MapReduce is that it makes writing distributed applications like this surprisingly simple. The two functions to perform the example referrer parsing might only be about 20 lines of code. Hadoop takes care of the immense challenges of distributed storage and processing, letting you focus on your specific task.</p>

<p>Since Hadoop is written in Java, the natural way for you to create distributed jobs is to encapsulate your Map and Reduce functions into a java class. If you're not a Java junkie, though, don't worry, there's a job wrapper called HadoopStreaming which can communicate with any program you write with the usual STDIN and STDOUT. This lets you write your distributed job in Perl, Python or even a shell script! You create two programs, one for the mapper and one for the reducer, and HadoopStreaming handles uploading them to all of the cluster nodes and passing data to and from your programs.</p>

<p>If you want to play around with this, I really recommend a couple of howtos written by German hacker Michael G. Noll. He put together a walkthrough for getting Hadoop up and running on Ubuntu, and also a nice introduction to writing a MapReduce program using HadoopStreaming (with Python as an example).</p>

<p>Are any Hackszine readers using Hadoop? Let us know what you're doing and point us to more information in the comments.</p>

<p><a href="http://hadoop.apache.org/core/">Hadoop</a><br />
<a href="http://www.michael-noll.com/wiki/Running_Hadoop_On_Ubuntu_Linux_%28Multi-Node_Cluster%29">Running Hadoop On Ubuntu Linux</a><br />
<a href="http://www.michael-noll.com/wiki/Writing_An_Hadoop_MapReduce_Program_In_Python">Writing An Hadoop MapReduce Program In Python</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/09/write_a_hadoop_mapreduce_job_i.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/09/write_a_hadoop_mapreduce_job_i.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/09/write_a_hadoop_mapreduce_job_i.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/09/write_a_hadoop_mapreduce_job_i.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Sat, 06 Sep 2008 21:58:52 -0800</pubDate>

</item>

<item>
<title>Objective-J and Cappuccino released</title>
<itunes:summary> Hackszine reader Math Campbell writes: As promised when they released their demo application 280 Slides, 280 North, the startup that invented a whole new language (Objective-J) to run their Cocoa-like Javascript framework, Cappuccino on, has released both Objective-J and...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="cappucino_20080904.jpg" src="http://www.hackszine.com/cappucino_20080904.jpg" width="600" height="300" class="mt-image-none" style="" /></span></p>

<p>Hackszine reader Math Campbell writes:</p>

<blockquote>As promised when they released their demo application 280 Slides, 280 North, the startup that invented a whole new language (Objective-J) to run their Cocoa-like Javascript framework, Cappuccino on, has released both Objective-J and Cappuccino as open-source under the LGPL.  They're also providing documentation, tutorials and forums to help you master this new and exciting way of writing web-apps.</blockquote>

<p>This project came to my attention in June when 280 North released their web-based, Powerpoint-like presentation application, 280 Slides. The team has re-implemented a significant portion of the Cocoa API in Objective-J, so developers who are familiar with writing applications for Cocoa or GNUstep can easily port over their skill set, and possibly their applications, to the web.</p>

<p>Now I've got both iPhone and Cappuccino development giving me a reason to start kicking around a common development platform for web and mobile applications. Have any of you Hackszine readers started playing with Objective-J/Cappuccino? If so, what's been your experience so far? </p>

<p><a href="http://cappuccino.org/">Cappuccino: open source web application framework</a><br />
<a href="http://cappuccino.org/learn/tutorials/">Cappuccino tutorials</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/09/objectivej_and_cappuccino_rele.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/09/objectivej_and_cappuccino_rele.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/09/objectivej_and_cappuccino_rele.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/09/objectivej_and_cappuccino_rele.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Thu, 04 Sep 2008 20:26:38 -0800</pubDate>

</item>

<item>
<title>Google Chrome&apos;s comic-strip technical overview</title>
<itunes:summary> While I&apos;m waiting for the Mac version of Google&apos;s new web browser, wondering what complications this has in store for me as a web developer, I couldn&apos;t help but notice how many non-hackers I&apos;ve bumped into that could speak...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="chromedocs_20080902.jpg" src="http://www.hackszine.com/chromedocs_20080902.jpg" width="600" height="286" class="mt-image-none" style="" /></span></p>

<p>While I'm waiting for the Mac version of Google's new web browser, wondering what complications this has in store for me as a web developer, I couldn't help but notice how many non-hackers I've bumped into that could speak to the merits of processes versus threads or describe the benefits of Chrome's garbage collection model or security architecture. Two days ago, most of these folks wouldn't know a thread from the underside of their denims, but Scott McCloud's comic changed that. </p>

<p>So why is this a hack?  Well, the strip that announced Chrome's release nicely bridged the nerd gap and managed to communicate some fairly technical content to a non-technical, though otherwise savvy potential user base. It's not easy to get people's attention when talking about memory management. It's difficult to communicate an esoteric architecture decision, and to both explain the decision and demonstrate its importance while not boring your audience is even more challenging.</p>

<p>I'm not saying comics are the way to go for all future technical documentation, but there's something to be learned here in terms of expanding your audience without dumbing down the content.</p>

<p><a href="http://www.google.com/googlebooks/chrome/index.html">Google Chrome - Behind the Open Source Browser Project</a></p>

<p>Also worth noting: if you want to participate in the development of Chromium (the platform behind Google Chrome) you can download the source and communicate in the forums on the <a href="http://code.google.com/chromium/">Chromium project page</a>.</p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/09/google_chromes_comicstrip_tech.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/09/google_chromes_comicstrip_tech.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/09/google_chromes_comicstrip_tech.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/09/google_chromes_comicstrip_tech.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Tue, 02 Sep 2008 20:24:47 -0800</pubDate>

</item>

<item>
<title>Wii Physics</title>
<itunes:summary> Wii Physics is a clever little homebrew app. You use the Wiimote to rotate, size and place objects on a stage. Pulleys, ropes, gears and joints can be used to connect objects together, and when you press the play...</itunes:summary>
<description>
<![CDATA[<p><object width="600" height="475"><param name="movie" value="http://www.youtube.com/v/5YANSPDO3oU&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/5YANSPDO3oU&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="600" height="475"></embed></object></p>

<p>Wii Physics is a clever little homebrew app. You use the Wiimote to rotate, size and place objects on a stage. Pulleys, ropes, gears and joints can be used to connect objects together, and when you press the play button, a 2D physics system is  turned on, causing the objects to fall and interact with each other.</p>

<p>You can download this for free and run it from the Homebrew Channel. If you're ambitious, you can also download the source, add new features, or base a new game off of it. It's written using libwiisprite, a library you'll want to check out if you're thinking of doing any 2D game dev for the Wii.</p>

<p><a href="http://code.google.com/p/wiiphysics/">Wii Physics</a><br />
<a href="http://feesh.braingravy.co.uk/libwiisprite/">libwiisprite</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/wii_physics.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/wii_physics.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/wii_physics.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/wii_physics.html?CMP=OTC-7G2N43923558</guid>
<category>Gaming</category>
<pubDate>Mon, 25 Aug 2008 19:38:04 -0800</pubDate>

</item>

<item>
<title>The smallest program ever</title>
<itunes:summary>Brian Raiter wrote an article many years ago in which he documented his quest to make the smallest possible Linux ELF executable, a stripped-down program that returns the answer to life, the universe, and everything. While the standard gcc-compiled version...</itunes:summary>
<description>
<![CDATA[<p>Brian Raiter wrote an article many years ago in which he documented his quest to make the smallest possible Linux ELF executable, a stripped-down program that returns the answer to life, the universe, and everything.</p>

<p>While the standard gcc-compiled version of the application nets out at 3998 bytes, Brian discovered that the smallest possible size for an ELF executable that will still run correctly is 45 bytes:</p>

<blockquote>This forty-five-byte file is less than one-eighth the size of the smallest ELF executable we could create using the standard tools, and is less than one-fiftieth the size of the smallest file we could create using pure C code. We have stripped everything out of the file that we could, and put to dual purpose most of what we couldn't.

<p>Of course, half of the values in this file violate some part of the ELF standard, and it's a wonder than Linux will even consent to sneeze on it, much less give it a process ID. This is not the sort of program to which one would normally be willing to confess authorship.</blockquote><br />
 <br />
It's not an easy process creating the smallest possible program. To get there, you need to dissect the inner workings of the operating system and the ELF file format, which is really what the article is about. If you've ever wondered about the mysterious events that happen before main() and after return(), here's your chance to take the red pill.</p>

<p><a href="http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html">A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/the_smallest_program_ever.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/the_smallest_program_ever.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/the_smallest_program_ever.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/the_smallest_program_ever.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Fri, 22 Aug 2008 17:55:00 -0800</pubDate>

</item>

<item>
<title>Ken Schwaber on Scrum</title>
<itunes:summary> Scrum is a collection of tools for agile software development and project management. It helps to focus small software development teams into delivering a complete, tested, and quality product by breaking the development into small iterative chunks with a...</itunes:summary>
<description>
<![CDATA[<p><embed id="VideoPlayback" style="width:600px;height:478px" allowFullScreen="true" src="http://video.google.com/googleplayer.swf?docid=-7230144396191025011&hl=en&fs=true" type="application/x-shockwave-flash"> </embed></p>

<p>Scrum is a collection of tools for agile software development and project management. It helps to focus small software development teams into delivering a complete, tested, and quality product by breaking the development into small iterative chunks with a concrete output. Scrum doesn't necessarily help a team produce code faster, but it allows a team to find out very early in the process whether the development goals will be completed in the planned timeline.</p>

<p>Ken Schwaber, one of the developers of the Agile process and a major Scrum evangelist, presented Scrum to a group at Google.  This video is a must watch for anyone involved in software development, whether you're a programmer or a project manager. In addition to introducing the management concept, he gives some insight into what makes a project fail (and how to know right away when it's going to), how to deliver on a tightened deadline without sacrificing quality (hint: half the features, not half baked), and why "core" functionality in a product tends to become unmanageable after 5 major development initiatives.</p>

<p><a href="http://video.google.com/videoplay?docid=-7230144396191025011&hl=en">Google Tech Talks: Scrum et al.</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/ken_schwaber_on_scrum.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/ken_schwaber_on_scrum.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/ken_schwaber_on_scrum.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/ken_schwaber_on_scrum.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Thu, 07 Aug 2008 20:55:35 -0800</pubDate>

</item>

<item>
<title>Memcached and high performance MySQL</title>
<itunes:summary>Memcached is a distributed object caching system that was originally developed to improve the performance of LiveJournal and has subsequently been used as a scaling strategy for a number of high-load sites. It serves as a large, extremely fast hash...</itunes:summary>
<description>
<![CDATA[<p>Memcached is a distributed object caching system that was originally developed to improve the performance of LiveJournal and has subsequently been used as a scaling strategy for a number of high-load sites. It serves as a large, extremely fast hash table that can be spread across many servers and accessed simultaneously from multiple processes. It's designed to be used for almost any back-end caching need, and for high performance web applications, it's a great complement to a database like MySQL.</p>

<p>In a typical environment, a web developer might employ a combination of process level caching and the built-in MySQL query caching to eke out that extra bit of performance from an application. The problem is that in-process caching is limited to the web process running on a single server. In a load-balanced configuration, each server is maintaining its own cache, limiting the efficiency and available size of the cache. Similarly, MySQL's query cache is limited to the server that the MySQL process is running on. The query cache is also limited in that it can only cache row results. With memcached you can set up a number cache servers which can store any type of serialized object and this data can be shared by all of the loadbalanced web servers. Cool, no?</p>

<p>To set up a memcached server, you simple download the daemon and run it with a few parameters. From the memcached web site:</p>

<blockquote>First, you start up the memcached daemon on as many spare machines as you have. The daemon has no configuration file, just a few command line options, only 3 or 4 of which you'll likely use:

<p><code># ./memcached -d -m 2048 -l 10.0.0.40 -p 11211</code></p>

<p>This starts memcached up as a daemon, using 2GB of memory, and listening on IP 10.0.0.40, port 11211. Because a 32-bit process can only address 4GB of virtual memory (usually significantly less, depending on your operating system), if you have a 32-bit server with 4-64GB of memory using PAE you can just run multiple processes on the machine, each using 2 or 3GB of memory.</blockquote></p>

<p>It's about as simple as it gets. There's no real configuration. No authentication. It's just a gigantor hash table. Obviously, you'd set this up on a private, non-addressable network.  From there, the work of querying and updating the cache is completely up to the application designer. You are afforded the basic functions of set, get, and delete. Here's a simple example in PHP:</p>

<blockquote>$memcache = new Memcache;
$memcache-&gt;addServer('10.0.0.40', 11211);
$memcache-&gt;addServer('10.0.0.41', 11211);

<p>$value= "Data to cache";</p>

<p>$memcache-&gt;set('thekey', $value, 60);<br />
echo "Caching for 60 seconds: $value &lt;br&gt;\n";</p>

<p>$retrieved = $memcache-&gt;get('thekey');<br />
echo "Retrieved: $retrieved &lt;br&gt;\n";</blockquote></p>

<p>The PHP library takes care of the dirty work of serializing any value you pass to the cache, so you can send and retrieve arrays or even complete data objects. </p>

<p>In your application's data layer, instead of immediately hitting the database, you can now query memcached first. If the item is found, there's no need to hit the database and assemble the data object. If the key is not found, you select the relevant data from the database and store the derived object in the cache. Similarly, you update the cache whenever your data object is altered and updated in the database. Assuming your API is structured well, only a few edits need to be made to dramatically alter the scalability and performance of your application.</p>

<p>I've linked to a few resources below where you can find more information on using memcached in your application. In addition to the documentation on the memcached web site, Todd Hoff has compiled a list of articles on memcached and summarized several memcached performance techniques. It's a pretty versatile tool. For those of you who've used memcached, give us a holler in the comments and share your tips and tricks.</p>

<p><a href="http://www.danga.com/memcached/">Memcached</a><br />
<a href="http://highscalability.com/bunch-great-strategies-using-memcached-and-mysql-better-together">Strategies for Using Memcached and MySQL Better Together</a><br />
<a href="http://download.tangent.org/talks/Memcached%20Study.pdf">Memcached and MySQL tutorial (PDF)</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/memcached_and_high_performance.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/memcached_and_high_performance.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/memcached_and_high_performance.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/memcached_and_high_performance.html?CMP=OTC-7G2N43923558</guid>
<category>MySQL</category>
<pubDate>Wed, 06 Aug 2008 22:37:40 -0800</pubDate>
<enclosure url="http://download.tangent.org/talks/Memcached%20Study.pdf" length="1223754" type="application/pdf" />
</item>

<item>
<title>DJBDNS, DNS exploits, Bernstein, Schneier, and security by design</title>
<itunes:summary>If you haven&apos;t been living under a rock, you&apos;ve probably heard of the DNS vulnerability that Dan Kaminsky announced about a half year ago. The plan was that Kaminsky would be working with DNS server vendors to provide a patch,...</itunes:summary>
<description>
<![CDATA[<p>If you haven't been living under a rock, you've probably heard of the DNS vulnerability that Dan Kaminsky announced about a half year ago. The plan was that Kaminsky would be working with DNS server vendors to provide a patch, giving ample time for administrators to upgrade before the details of the exploit were released later this year. Unfortunately the exploit was leaked prematurely, causing a general freak-out mode amongst people that administer DNS systems.</p>

<p>When I read the article on Slashdot, the "all name servers should be patched as soon as possible" quote dropped a bit of scare on me too. What about my sad little DNS server? I envisioned spending an evening working through a time consuming process of patching and reconfiguring things that I haven't had to touch in years. Much to my pleasant surprise, djbdns, D. J. Bernstein's DNS server, was not vulnerable. My decision to use djbdns a number of years ago was primarily due to his vocal philosophy of engineering  security by design instead of by response.</p>

<p>Bruce Schneier's analysis of things is spot on as usual. It's a solid case study for hygienic software engineering practices and the design of secure systems.</p>

<blockquote>The real lesson is that the patch treadmill doesn't work, and it hasn't for years. This cycle of finding security holes and rushing to patch them before the bad guys exploit those vulnerabilities is expensive, inefficient and incomplete. We need to design security into our systems right from the beginning. We need assurance. We need security engineers involved in system design. This process won't prevent every vulnerability, but it's much more secure -- and cheaper -- than the patch treadmill we're all on now.

<p><br />
What a security engineer brings to the problem is a particular mindset. He thinks about systems from a security perspective. It's not that he discovers all possible attacks before the bad guys do; it's more that he anticipates potential types of attacks, and defends against them even if he doesn't know their details. I see this all the time in good cryptographic designs. It's over-engineering based on intuition, but if the security engineer has good intuition, it generally works.</p>

<p>Kaminsky's vulnerability is a perfect example of this. Years ago, cryptographer Daniel J. Bernstein looked at DNS security and decided that Source Port Randomization was a smart design choice. That's exactly the work-around being rolled out now following Kaminsky's discovery. Bernstein didn't discover Kaminsky's attack; instead, he saw a general class of attacks and realized that this enhancement could protect against them. Consequently, the DNS program he wrote in 2000, djbdns, doesn't need to be patched; it's already immune to Kaminsky's attack.<br />
</blockquote></p>

<p>The djbdns server wasn't pre-installed on the Linux distro I based my poor old server on. DJB's deamontools package, which manages the startup and shutdown of the service, was annoying to deal with when every other application just uses a normal init rc script. The dns server configuration and setup was also unfamiliar to me, having previously only worked with BIND zone files.</p>

<p>There's one other thing that has really been different with djbdns than any other DNS server I've ever administered: I've never had to patch it. I've only had one other software experience like this, with the qmail mail transfer system. Qmail is also designed by Bernstein. Hmm.</p>

<p>If you're upgrading your DNS server anyway, maybe now is the time to start thinking about your alternatives.</p>

<p><a href="http://cr.yp.to/djbdns.html">Daniel J. Bernstein's djbdns server</a><br />
<a href="http://www.schneier.com/blog/archives/2008/07/the_dns_vulnera.html">Schneier - The DNS Vulnerability</a><br />
<a href="http://cr.yp.to/djbdns/forgery.html">DJB on DNS forgery</a><br />
<a href="http://it.slashdot.org/it/08/07/21/2212227.shtml">Slashdot - Kaminsky's DNS Attack Disclosed, Then Pulled</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/djbdns_dns_exploits_bernstein.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/djbdns_dns_exploits_bernstein.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/djbdns_dns_exploits_bernstein.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/djbdns_dns_exploits_bernstein.html?CMP=OTC-7G2N43923558</guid>
<category>Network Security</category>
<pubDate>Tue, 29 Jul 2008 20:52:33 -0800</pubDate>

</item>

<item>
<title>Cyber Security Awareness Week</title>
<itunes:summary> Dan Guido from the Information Systems and Internet Security Lab at the Polytechnic Institute of NYU wrote in about the Institute&apos;s 5th annual Cyber Security Awareness Week. If you&apos;re in high-school or a college undergraduate program, this is a...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="csaw_20080727.jpg" src="http://www.hackszine.com/csaw_20080727.jpg" width="500" height="562" class="mt-image-none" style="" /></span></p>

<p>Dan Guido from the Information Systems and Internet Security Lab at the Polytechnic Institute of NYU wrote in about the Institute's 5th annual Cyber Security Awareness Week. If you're in high-school or a college undergraduate program, this is a great opportunity to test your infosec skills against your peers, and hopefully earn a little prize money in the process.</p>

<blockquote>ISIS Lab is organizing NYU-Poly's 5th annual Cyber Security Awareness Week (CSAW) where students can compete and win prizes in a variety of information security challenges. There will be door prizes, raffles for participating, and bonus prizes for undergrad and high school participants. Qualified finalists will receive a travel scholarship to attend the awards ceremony in New York City.</blockquote>

<p>There are a number of events, including an application security "capture the flag" challenge, a security quiz which covers everything from cryptography to risk management, and a 5-day forensics puzzle. There's even an embedded systems challenge where teams are tasked with trying to find hardware and software bugs in a mock control system.</p>

<p>This looks like a lot of fun. Some of the contest materials become available at the beginning of September, so sign up soon if you're interested in participating.</p>

<p><a href="http://isis.poly.edu/csaw/">Cyber Security Awareness Week 2008</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/cyber_security_awareness_week.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/cyber_security_awareness_week.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/cyber_security_awareness_week.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/cyber_security_awareness_week.html?CMP=OTC-7G2N43923558</guid>
<category>Cryptography</category>
<pubDate>Sun, 27 Jul 2008 21:28:39 -0800</pubDate>

</item>

<item>
<title>MySQL performance tuning</title>
<itunes:summary> Jay Pipes, MySQL employee and co-author Pro MySQL, gave a great presentation to Google employees which covers a number of techniques for tuning performance on MySQL. His examples include debugging and analyzing problems as well as best practices for...</itunes:summary>
<description>
<![CDATA[<p><embed id="VideoPlayback" style="width:500px;height:405px" allowFullScreen="true" src="http://video.google.com/googleplayer.swf?docid=2524524540025172110&hl=en&fs=true" type="application/x-shockwave-flash"> </embed></p>

<p>Jay Pipes, MySQL employee and co-author Pro MySQL, gave a great presentation to Google employees which covers a number of techniques for tuning performance on MySQL. His examples include  debugging and analyzing problems as well as best practices for table and index design, query and join operations, and server variable adjustments. </p>

<p>It's a little over 40 minutes long, but incredibly informative, whether you're a casual querier or a power MySQL user. Though some of this stuff is MySQL (or MyISAM or InnoDB) specific, the majority of the content is essential material for the average database application developer.</p>

<p>If you don't have time to sit through it (shame on you) or you're looking to jump right to a specific topic, there's a nice time-coded dissection of the talk over at Peteris Krumins' blog. There's something so appropriate about adding a search index to a video about MySQL optimization.</p>

<p><a href="http://video.google.com/videoplay?docid=2524524540025172110">Performance Tuning Best Practices for MySQL</a><br />
<a href="http://www.catonmat.net/blog/performance-tuning-best-practices-for-mysql/">Video Index</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/mysql_performance_tuning.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/mysql_performance_tuning.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/mysql_performance_tuning.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/mysql_performance_tuning.html?CMP=OTC-7G2N43923558</guid>
<category>MySQL</category>
<pubDate>Sat, 26 Jul 2008 12:11:35 -0800</pubDate>

</item>

<item>
<title>When to denormalize</title>
<itunes:summary>There&apos;s been a bit of a database religious war on Dare Obasanjo and Jeff Atwood&apos;s blogs, all on the subject of database normalization: when to normalize, when not to, and the performance and data integrity issues that underly the decision....</itunes:summary>
<description>
<![CDATA[<p>There's been a bit of a database religious war on Dare Obasanjo and Jeff Atwood's blogs, all on the subject of database normalization: when to normalize, when not to, and the performance and data integrity issues that underly the decision. </p>

<p>Here's the root of the argument. What we've all been taught regarding database design is irrelevant if the design can't deliver the necessary performance results. </p>

<p>The 3rd normal form helps to ensure that the relationships in your DB reflect reality, that you don't have duplicate data, that the zero to many relationships in your system can accommodate any potential scenario, and that space isn't wasted and reserved for data that isn't explicitly being used. The downside is that a single object within the system may span many tables and, as your dataset grows large, the joins and/or multiple selects required to extract entities from the system begins to impact the system's performance. </p>

<p>By denormalizing, you can compromise and pull some of those relationships back into the parent table. You might decide, for instance, that a user can have only 3 phone numbers, 1 work address, and 1 home address. In doing so, you've met the requirements of the common scenario and removed the need to join to separate address or contact number tables. This isn't an uncommon compromise. Just look at the contacts table in your average cell phone to see it in action.</p>

<p>Jeff writes:<br />
<blockquote>Both solutions have their pros and cons. So let me put the question to you: which is better -- a normalized database, or a denormalized database?</p>

<p>Trick question! The answer is that it doesn't matter! Until you have millions and millions of rows of data, that is. Everything is fast for small n.</blockquote></p>

<p>So for large n, what's the solution? In my personal experience, you can usually have it both ways. </p>

<p>Design your database to 3NF from the beginning to ensure data integrity and to allow room for growth, additional relationships, and the sanity of future querying and indexing. Only when you find there are performance problems do you need to think about optimizing. Usually this can be accomplished through smarter querying. When it cannot, you derive a denormalized data set from the normalized source. This can be as simple as an extra field in the parent table that derives sort information on inserts, or it can be a full-blown object cache table that's updated from the official source at some regular interval or when an important even occurs. </p>

<p>Read the discussions and share your comments. To me, the big takeaway is that there's no one solution that will fit every real world problem. Ultimately, your final design has to reflect the unique needs of the problem that is being solved.</p>

<p><a href="http://www.25hoursaday.com/weblog/CommentView.aspx?guid=cc0e740c-a828-4b9d-b244-4ee96e2fad4b">When Not to Normalize your SQL Database</a><br />
<a href="http://www.codinghorror.com/blog/archives/001152.html">Maybe Normalizing Isn't Normal</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/when_to_denormalize.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/when_to_denormalize.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/when_to_denormalize.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/when_to_denormalize.html?CMP=OTC-7G2N43923558</guid>
<category>Data</category>
<pubDate>Tue, 15 Jul 2008 20:47:42 -0800</pubDate>

</item>

<item>
<title>Reverse autocomplete</title>
<itunes:summary>Traditional autocomplete is such a powerful tool that it&apos;s managed to work its way into most desktop and a significant number of web applications. Type a URL into your browser, and the address bar will offer suggestions for all of...</itunes:summary>
<description>
<![CDATA[<p>Traditional autocomplete is such a powerful tool that it's managed to work its way into most desktop and a significant number of web applications. Type a URL into your browser, and the address bar will offer suggestions for all of the URLs in your browsing history that begin with the text that precedes your cursor. Autocomplete works well, but it could be better.</p>

<p>László Kozma brought up a problem that tends to crop up in a number of scenarios: if you move the cursor back to correct or change part of the entry string, traditional autocomplete completely ignores any context to the right of the cursor. In some applications, this means everything to the right of the cursor is ignored and overwritten instead of being part of the search. In Safari, if you type anything between "www." and ".com", autocomplete fails entirely, offering no results unless you clear out everything to the right of the cursor.</p>

<p>One solution, which László termed "reverse autocomplete", is to split the string at the cursor position and attempt to find matches for both anything <em>after</em> the first half and <em>before</em> the second half. Any matches that show up in both sets are the final autocomplete suggestions. The result is that if I type in "www.h|.com" (where my cursor position is represented by the "|" character) the smarter autocomplete might return "www.hackszine.com" as a suggestion but omit from telling me about "www.h-is-aitch.org".</p>

<p>You can take it one step further and also match against the beginning and ends of the entire string. This solves a really common problem that I run into regularly when searching through a large contact list, say the typical corporate email system. If you don't know the correct spelling of someone's name, or if you only can recall initials, you can fill in the parts you know. The system would be smart enough to turn "J|S" into "Jason Striegel" instead of forcing you to page through a huge list of J names.</p>

<p><a href="http://www.lkozma.net/autocomplete.html">Reverse autocomplete</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/reverse_autocomplete.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/reverse_autocomplete.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/reverse_autocomplete.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/reverse_autocomplete.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Fri, 11 Jul 2008 22:30:08 -0800</pubDate>

</item>

<item>
<title>Direct video manipulation interface</title>
<itunes:summary> Direct manipulation of video is one of the more uncanny HCI concepts I&apos;ve ever seen. Instead of manipulating time with a traditional scrubber bar, the user can drag objects in the video across their path of movement. Nothing in...</itunes:summary>
<description>
<![CDATA[<p><object width="500" height="405"><param name="movie" value="http://www.youtube.com/v/WcIy9O344bI&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/WcIy9O344bI&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="500" height="405"></embed></object></p>

<p>Direct manipulation of video is one of the more uncanny HCI concepts I've ever seen. Instead of manipulating time with a traditional scrubber bar, the user can drag objects in the video across their path of movement. Nothing in the video actually changes, but the perception is that you can directly manipulate the objects in the video stream by pulling them around through time.</p>

<p>There's a Windows application called DimP which implements this interface. When you hover over a movable object in the video, a light path appears that emphasizes the object's motion curve, which you can then move the object across. From the DimP website:</p>

<blockquote>So what's being manipulated, exactly? Both the video content (e.g., the things you see moving in the video) and the "tape head". When using DimP, the user directly manipulates the video content and indirectly manipulates the tape head. When using the seeker bar, the user directly manipulates the tape head and indirectly manipulates the video content.</blockquote>

<p><object width="500" height="405"><param name="movie" value="http://www.youtube.com/v/ib_g7F6WKAA&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/ib_g7F6WKAA&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="500" height="405"></embed></object></p>

<p>The video above describes how DimP works in a bit more detail, showing a few different video scenarios where direct manipulation really shines. It's intuitive and bizarre at the same time. If the universe is completely deterministic, I can't help but think this is what time travel must look like.</p>

<p><a href="http://www.aviz.fr/dimp/">DimP - A Direct Manipulation Video Player</a><br />
<a href="http://hci.rwth-aachen.de/dragon">DRAGON - Direct Manipulation Interface Demo for OS X</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/direct_video_manipulation_inte.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/direct_video_manipulation_inte.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/direct_video_manipulation_inte.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/direct_video_manipulation_inte.html?CMP=OTC-7G2N43923558</guid>
<category>Video</category>
<pubDate>Fri, 04 Jul 2008 12:04:12 -0800</pubDate>

</item>

<item>
<title>Objective-J and Cappuccino: Cocoa for the web</title>
<itunes:summary> There&apos;s a neat article over at Ars Technica that takes a look at 280 North&apos;s 3-person development team, their recent release of a keynote-like web application called 280 Slides, and the framework that they constructed to make the application....</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="objective-j_20080629.jpg" src="http://www.hackszine.com/objective-j_20080629.jpg" width="500" height="392" class="mt-image-none" style="" /></span></p>

<p>There's a neat article over at Ars Technica that takes a look at 280 North's 3-person development team, their recent release of a keynote-like web application called 280 Slides, and the framework that they constructed to make the application. Some time before 280 Slides was developed, the team created an Objective-C-like superset of the Javascript language called Objective-J which implements message passing and a Smalltalk-style syntax. Building on that, they re-implemented much of the Cocoa framework in Objective-J, allowing Cocoa-style applications to be developed that will run natively in the browser. </p>

<p>With Objective-J and Cappuccino, you don't create applications with a mixture of HTML, CSS and Javascript. Instead, apps are written entirely in Objective-J, following a development model that's similar to creating desktop applications for OS X. From the article:<br />
<blockquote>"Cappuccino is a re-implementation of Cocoa in Objective-J, which means we reimplemented AppKit, Foundation, CoreGraphics, and parts of CoreAnimation," Boucher told us. With it, developers familiar with desktop GUI applications can create a rich, desktop-like web app with the same relative ease Cocoa programmers can create a rich desktop app. "Coming from a background of desktop programming, and Cocoa in particular, we realized how much harder building a web application was. So we wanted to try to make things just a little bit easier."</blockquote></p>

<p>280 Slides stands on its own as a powerful web-based presentation tool. It's simplified when compared to its desktop cousins, but it does exactly what most people need in a presentation tool, and it can export to PPT for fine tuning and end-presentation use. The fact that its development inspired the creation of a new language as well as bringing a desktop application development framework to the web just blows my mind.</p>

<p>Objective-J will be released to the public soon as an open source project. On the one hand, I'm not sure if I'm comfortable moving away from the web development technologies I've grown accustomed to. On the other, it would be cool to work in a language that allows you to seamlessly port your applications between the desktop and the web. </p>

<p>If you have experience with both Cocoa and AJAX development, please share your thoughts in the comment area.</p>

<p><a href="http://arstechnica.com/journals/apple.ars/2008/06/26/cocoa-on-the-web-280-north-objective-j-and-cappuccino">Cocoa on the web: 280 North, Objective-J, and Cappuccino</a> [via <a href="http://developers.slashdot.org/developers/08/06/29/167232.shtml">Slashdot</a>]<br />
<a href="http://blog.280north.com/">280 North Blog</a><br />
<a href="http://280slides.com/">280 Slides</a><br />
<a href="http://objective-j.org/">Objective-J.org</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/objectivej_and_cappuccino_coco.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/objectivej_and_cappuccino_coco.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/06/objectivej_and_cappuccino_coco.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/06/objectivej_and_cappuccino_coco.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Sun, 29 Jun 2008 20:36:07 -0800</pubDate>

</item>

<item>
<title>Algorithm Geeks</title>
<itunes:summary>If you&apos;ve ever stumbled into a tricky coding or data representation problem, chances are good that someone has already figured it out. Usually the resolution is found by speaking with the Google, emailing your resident alpha-geek, or consulting Knuth&apos;s Art...</itunes:summary>
<description>
<![CDATA[<p>If you've ever stumbled into a tricky coding or data representation problem, chances are good that someone has already figured it out. Usually the resolution is found by speaking with the Google, emailing your resident alpha-geek, or consulting Knuth's Art of Computer Programming (you know, the 50 pound box set that's been waiting patiently on your shelf for exactly this moment).</p>

<p>I stumbled across a fourth option this afternoon: the Algorithm Geeks user group. It's an easy way to parallelize your problem, running it past the brains of hundreds of alphas from around the world. Even if you aren't seeking help, maybe there's a post or two in there that you can contribute to. My inner nerd is probably showing, but it's pretty fun just reading through the posts and weighing the different proposed solutions. </p>

<p>Hack on!</p>

<p><a href="http://groups.google.com/group/algogeeks">Algorithm Geeks Google Group</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/algorithm_geeks.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/algorithm_geeks.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/06/algorithm_geeks.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/06/algorithm_geeks.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Mon, 23 Jun 2008 20:40:02 -0800</pubDate>

</item>

<item>
<title>Code Kata: exercise for the software developer</title>
<itunes:summary>It&apos;s no news that practice is the only path to being truly great at something. The art of software development is no different. The demand for programmers the way it is, however, means that a lot of folks jump into...</itunes:summary>
<description>
<![CDATA[<p>It's no news that practice is the only path to being truly great at something. The art of software development is no different. The demand for programmers the way it is, however, means that a lot of folks jump into their careers head first with a certain level of formal subject knowledge, but very little practical experience. Likewise, even experienced developers are sometimes so busy that not enough time gets devoted to the practice of the craft. Dave Thomas recognized this problem and came up with a collection of short, defined practice exercises for software developers, the Code Kata:</p>

<blockquote>Code Kata is an attempt to bring this element of practice to software development. A kata is an exercise in karate where you repeat a form many, many times, making little improvements in each. The intent behind code kata is similar. Each is a short exercise (perhaps 30 minutes to an hour long). Some involve programming, and can be coded in many different ways. Some are open ended, and involve thinking about the issues behind programming. These are unlikely to have a single correct answer. I add a new kata every week or so. Invest some time in your craft and try them.</blockquote>

<p>Some of the example scenarios are expressed in Ruby, but aside from that they are language agnostic. What I like is that the exercises cover a wide breadth of scenarios, some of which I encounter daily in my work, and some only rarely. Even working through the problems and roughing out a solution in my head seems to be a useful tool for keeping the problem solving faculties sharp. Trying to solve problems like these involves no real deadlines or pressure, which is the necessary environment for devoting a little time regularly to focus on honing your skills.</p>

<p>Do you use any other resources for staying on top of your game? Let us know in the comments.</p>

<p><a href="http://codekata.pragprog.com/2007/01/code_kata_backg.html">Code Kata</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/code_kata_exercise_for_the_sof.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/code_kata_exercise_for_the_sof.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/code_kata_exercise_for_the_sof.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/code_kata_exercise_for_the_sof.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Mon, 26 May 2008 19:57:17 -0800</pubDate>

</item>

<item>
<title>Duff&apos;s Device: loop unrolling for interpreted languages</title>
<itunes:summary>In 1983, Tom Duff invented a really strange way to use the C language&apos;s switch and case statements for the in code &quot;unrolling&quot; optimization of large loops. As an example, he described a simple loop that copies an array to...</itunes:summary>
<description>
<![CDATA[<p>In 1983, Tom Duff invented a really strange way to use the C language's switch and case statements for the in code "unrolling" optimization of large loops. As an example, he described a simple loop that copies an array to an output register:</p>

<blockquote><pre>
	send(to, from, count)
	register short *to, *from;
	register count;
	{
		do
			*to = *from++;
		while(--count&gt;0);
	}
</pre></blockquote>

<p>On every iteration of the loop, in addition to the copy that is being performed, the count variable is decremented and a comparison is done against 0. Duff's Device allows you to achieve the same result, but with only an 8th of the overhead:</p>

<blockquote><pre>
	send(to, from, count)
	register short *to, *from;
	register count;
	{
		register n=(count+7)/8;
		switch(count%8){
		case 0:	do{	*to = *from++;
		case 7:		*to = *from++;
		case 6:		*to = *from++;
		case 5:		*to = *from++;
		case 4:		*to = *from++;
		case 3:		*to = *from++;
		case 2:		*to = *from++;
		case 1:		*to = *from++;
			}while(--n&gt;0);
		}
	}
</pre></blockquote>

<p>What happens is that the loop is unrolled 8 times, so each iteration of the loop runs the internal code 8 times over without the comparison. The genius of Duff's Device is that it takes advantage of the way the C switch/case structure works. The first time through, if the iterations don't divide evenly by 8, the loop code is executed enough times to equal the remainder of iterations/8. It's a little bizarre, because the "do" statement occurs within the switch, but there are "case" statements within the "do". Nevertheless, it's valid C.</p>

<p>Before someone cries foul, remember that this is only really suitable for speeding up the performance of inner loops when no suitable, better algorithm is available. If you code C, most modern compilers are smart enough to automatically optimize your code and unroll loops for you.</p>

<p>For interpreted languages like PHP or Javascript, however, you sometimes need to do a little optimization on your own if you want to squeeze out some extra performance. Luckily, both languages have a c-style switch statement.</p>

<p>Andy King wrote about a slightly altered version of this loop unrolling algorithm which ditches the switch statement and breaks the normal Duff's Device into two separate loops, one for the remainder and one for the unrolling. In Javascript, it performs a simple addition loop in only a third of the time of a normal for loop (testVal++ is the normal loop's interior):</p>

<blockquote><pre>
function duffFasterLoop8(iterations) {
  var testVal=0;	
  var n = iterations % 8;
  if (n&gt;0) {
    do 
    {
      testVal++;
    }
    while (--n); // n must be greater than 0 here
  }
    
  n = parseInt(iterations / 8);
  do 
  {
    testVal++;
    testVal++;
    testVal++;
    testVal++;
    testVal++;
    testVal++;
    testVal++;
    testVal++;
  }
  while (--n);
}
</pre></blockquote>

<p>It's not as syntactically clever as Duff's Device, but it's a good way to manually unroll an inner loop and get the best performance for your extra effort.</p>

<p><a href="http://www.lysator.liu.se/c/duffs-device.html">Duff's Device</a><br />
<a href="http://www.devwebpro.com/devwebpro-39-20030514OptimizingJavaScriptforExecutionSpeed.html">Andy King's Optimizing JavaScript For Execution Speed</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/duffs_device_loop_unrolling_fo.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/duffs_device_loop_unrolling_fo.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/duffs_device_loop_unrolling_fo.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/duffs_device_loop_unrolling_fo.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Tue, 20 May 2008 20:50:14 -0800</pubDate>

</item>

<item>
<title>Processing.js - visualization library for Javascript</title>
<itunes:summary> John Resig, of jQuery fame, released a port of the Processing visualization language for Javascript. Seriously, John is on fire: The first portion of the project was writing a parser to dynamically convert code written in the Processing language,...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="jsprocessing_20080509.jpg" src="http://www.hackszine.com/jsprocessing_20080509.jpg" width="500" height="149" class="mt-image-none" style="" /></span></p>

<p>John Resig, of jQuery fame, released a port of the Processing visualization language for Javascript.  Seriously, John is on fire:</p>

<blockquote>The first portion of the project was writing a parser to dynamically convert code written in the Processing language, to JavaScript. This involves a lot of gnarly regular expressions chewing up the code, spitting it out in a format that the browser understands.

<p>It works "fairly well" (in that it's able to handle anything that the processing.org web site throws at it) but I'm sure its total scope is limited (until a proper parser is involved). I felt bad about tackling this using regular expressions until I found out that the original Processing code base did it in the same manner (they now use a real parser, naturally).</blockquote></p>

<p>The full 2D API is implemented, with the exclusion of some features here and there between browsers (Firefox 3 is pretty full featured). You can interact with the Processing API directly from standard Javascript. This lets you make use of these drawing features by simply instantiating a Processing object, and then calling its various drawing methods.</p>

<p>Another capability is to write code natively in the Processing language. This allows you to make use of extended language features such as method overloading and classic inheritance, though it looks like type information is pretty much ignored.</p>

<p>John has many of the demos from processing.org working. Most of them are going to peg your CPU, but this is some seriously cool stuff to see working in a first release. </p>

<p>Javascript just got a lot more interesting.</p>

<p><a href="http://dev.jquery.com/~john/processing.js/">Processing.js</a><br />
<a href="http://processing.org/">Processing: open source data visualization language</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Fri, 09 May 2008 21:36:09 -0800</pubDate>

</item>

<item>
<title>DIY multi-touch on OS X</title>
<itunes:summary> Bridger Maxwell has been blogging his progress on creating a homebrew multi-touch platform in OS X. Prior to this, there&apos;s been a lot of activity around building multi-touch systems on Windows using the Touchlib library, but this is the...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="multitouchosx_20080508.jpg" src="http://www.hackszine.com/multitouchosx_20080508.jpg" width="500" height="125" class="mt-image-none" style="" /></span></p>

<p>Bridger Maxwell has been blogging his progress on creating a homebrew multi-touch platform in OS X. Prior to this, there's been a lot of activity around building multi-touch systems on Windows using the Touchlib library, but this is the first time I've seen a concerted effort on OS X.</p>

<p>The basic hardware is the same for both environments: LEDs surround a sheet of acrylic, causing a backscatter of IR when fingers are pressed to the screen. On the software side, though, the multi-touch interface is provided through Pawel Solyga's OpenTouch library. From the sounds of things, though, it's not super simple getting the interface messages from OpenTouch to your multi-touch enabled Cocoa apps:</p>

<blockquote>Both OpenTouch and TouchLib send the touch data to other applications by sending Tangible User Interface Object (TUIO) network messages. TUIO is a protocol that is designed for transmitting the state of multi-touch systems. TUIO is built upon another protocol, Open Sound Control (OSC). While libraries for receiving TUIO messages are available in a few languages such as C++ or Java, there was not a solution for Cocoa applications. My first step was to build a library for receiving TUIO messages in Cocoa.

<p>Because TUIO is built upon OSC, I looked for a library that could parse OSC messages. Unfortunately, I could not find one that would fill all my needs. WSOSC was a library that came close though. There were a few issues to work around (use NSData instead of NSString), but eventually I was able to use WSOSC to parse the OSC packets. When finished, my framework had the ability to parse TUIO messages and had a method to delegate the TUIOCursor objects it created to another application.</blockquote></p>

<p>From the  blog comments, it sounds like Bridger is planning on releasing this middle layer when it gets a little further along.  At the moment, though, he's released a demo comic viewing application that uses his multi-touch project framework. If you're interested in developing multi-touch apps for OS X, some of the discussions on Bridger's blog would be a good place to start.</p>

<p><a href="http://multitouch.fieryferret.com/">Bridger's Multi-Touch Blog</a><br />
<a href="http://code.google.com/p/opentouch/">OpenTouch Library</a></p>

<p>See also: <br />
<a href="http://www.hackszine.com/blog/archive/2007/07/make_your_own_multitouch_displ.html">Make your own multitouch displays and software apps</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/diy_multitouch_on_os_x.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/diy_multitouch_on_os_x.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/diy_multitouch_on_os_x.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/diy_multitouch_on_os_x.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Thu, 08 May 2008 20:43:12 -0800</pubDate>

</item>

<item>
<title>Scriptographer - Javascript for Illustrator</title>
<itunes:summary> My friend Barrett sent along a link today to an Illustrator scripting plugin called Scriptographer. I&apos;m sort of a slouch at Illustrator, so I had him give me the quick 411 and I must say, this is pretty cool....</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="scriptographer_20080423.jpg" src="http://www.hackszine.com/scriptographer_20080423.jpg" width="500" height="382" class="mt-image-none" style="" /></span></p>

<p>My friend Barrett sent along a link today to an Illustrator scripting plugin called Scriptographer. I'm sort of a slouch at Illustrator, so I had him give me the quick 411 and I must say, this is pretty cool. </p>

<p>If you're familiar with Javascript, Scriptographer will enable you to crank out little scripts that can generate illustrations procedurally. As an example, the bubbelbubbling script, show above, tuns your pen tool into a fountain of random bubbles that follow your drawing path. There are certain styles of artwork that could really lend themselves to a procedural drawing tool: fractals, patterns, random "particle" effects. These things would take forever to generate manually, but by defining the effect programatically, you can quickly experiment with your work in a more dynamic fashion, tweaking variables and fine-tuning your work as you go.</p>

<p>The project website also has a growing library of user-contributed scripts that are worth checking out. It's a good place to start for your own creations, or you may just find exactly what you're looking for, already crafted for you by another designer-coder.</p>

<p><a href="http://scriptographer.com/">Scriptographer</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/scriptographer_javascript_for.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/scriptographer_javascript_for.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/scriptographer_javascript_for.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/scriptographer_javascript_for.html?CMP=OTC-7G2N43923558</guid>
<category>Life</category>
<pubDate>Wed, 23 Apr 2008 21:11:31 -0800</pubDate>

</item>

<item>
<title>Encoding JPEGs client-side in AS3</title>
<itunes:summary>I&apos;ve been doing a bunch of Flash Actionscript 3 development lately at work, and one of my favorite features with the new drawing API is the ease and speed with which you can rasterize vector data and manipulate image bitmaps....</itunes:summary>
<description>
<![CDATA[<p>I've been doing a bunch of Flash Actionscript 3 development lately at work, and one of my favorite features with the new drawing API is the ease and speed with which you can rasterize vector data and manipulate image bitmaps. </p>

<p>What's killer is that Adobe's <a href="http://code.google.com/p/as3corelib/">as3corelib</a> addon library finally gives us some essential tools that have been sorely lacking, none the least of which is a client side JPEG encoder. With this, you can turn any drawable object like a sprite or a movieclip into a ByteArray holding the compressed JPEG data in just a few lines of code.  It's as simple as this:</p>

<blockquote><code>import com.adobe.images.JPGEncoder;

<p>var clipbmp:BitmapData = new BitmapData (aclip.width, aclip.height);<br />
clipbmp.draw(aclip);</p>

<p>var jpgEnc:JPGEncoder = new JPGEncoder(90);<br />
var jpgbytes:ByteArray = jpgEnc.encode(clipbmp);<br />
</code></blockquote></p>

<p>This turns the "aclip" sprite or movieclip into a rasterized, flattened, BitmapData object. The BitmapData is then run through the JPEG encoder with the quality setting of 90 and you're left with the raw JPEG-compressed image in a ByteArray object. The as3corelib also provides a PNG encoder, with which you can just use the static method <code>PNGEncoder.encode(clipbmp)</code>.</p>

<p>This is perfect for saving a capture of user-generated artwork to the server. Just set the data member of a URLRequest object to the ByteArray and post it. For more detailed information on how to put all the pieces together, <a href="http://henryjones.us/articles/using-the-as3-jpeg-encoder">Henry Jones</a> has a really thorough post of compressing JPEG data and pinging it off a server to force an image download. </p>

<p>Unfortunately, to trigger a JPEG download, you still need to post the image data up to a server script and have it echo it back to the browser. The difference now, though, is that you can do the compression on the client end, saving both server CPU time and the time to upload the image data. This means saving a large image is a few second process instead of taking a minute and a half.</p>

<p><a href="http://code.google.com/p/as3corelib/">Actionscript 3 Core Library (as3corelib)</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/encoding_jpegs_clientside_in_a.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/encoding_jpegs_clientside_in_a.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/encoding_jpegs_clientside_in_a.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/encoding_jpegs_clientside_in_a.html?CMP=OTC-7G2N43923558</guid>
<category>Flash</category>
<pubDate>Tue, 22 Apr 2008 22:03:58 -0800</pubDate>

</item>

<item>
<title>Relational database using jQuery and HTML tables</title>
<itunes:summary><![CDATA[Here's a novel use for the HTML &lt;TABLE&gt; tag: storing client side database tables. Nick Kallen came up with a slick hack that uses the jQuery syntax to perform simple selects and joins on HTML tables. By using CSS3 selectors,...]]></itunes:summary>
<description>
<![CDATA[<p>Here's a novel use for the HTML &lt;TABLE&gt; tag: storing client side database tables. Nick Kallen came up with a slick hack that uses the jQuery syntax to perform simple selects and joins on HTML tables. By using CSS3 selectors, you can easily target fields which match or contain your search terms, and Nick's jQuery-based API provides a simple query language, similar to a rudimentary SQL:</p>

<blockquote>
Today I was thinking aloud about <a href="http://research.microsoft.com/Users/luca/Slides/2003-11-132s2n2g2s20&amp;#40;Lisbon&amp;#41;.pdf">Tree Regular Expressions</a> and how they might make a nice query language for document databases like CouchDB. Someone pointed out that CSS3 selectors might make a great concrete syntax for this. One thing lead to another and I thought, why not build a relational database in HTML? So I did. I even got <strong>inner joins</strong> working.

<p>Let's start with a few tables:</p>

<pre><code>&lt;table class="users"&gt;
  &lt;tr&gt;
    &lt;td class="id"&gt;1&lt;/td&gt;
    &lt;td class="first_name"&gt;amy&lt;/td&gt;
    &lt;td class="last_name"&gt;bobamy&lt;/td&gt;
  &lt;/tr&gt; 
  ...
&lt;/table&gt;
&lt;table class="photos"&gt;
  &lt;tr&gt;
    &lt;td class="id"&gt;1&lt;/td&gt;
    &lt;td class="user_id"&gt;1&lt;/td&gt;
    &lt;td class="url"&gt;http://www.example.com/foo.png&lt;/td&gt;
  &lt;/tr&gt; 
&lt;/table&gt;
</code></pre>

<p>Now we can express some queries:</p>

<pre><code>$&#40;'.users'&#41;
  .where&#40;'.id:eq&#40;1&#41;'&#41;
  .select&#40;'*'&#41;
</code></pre>

<p>This is equivalent to <code>SELECT * FROM users WHERE id = 1</code></p>

<pre><code>$&#40;'.users'&#41;
  .where&#40;'.id:eq&#40;1&#41;'&#41;
  .select&#40;'.id, .name'&#41;
</code></pre>

<p>This is equivalent to <code>SELECT id, name FROM users WHERE id = 1</code><br />
</blockquote></p>

<p>How cool is that? Check out Nick's blog post for an example of text search and an inner join. The API in his jquery.db.js is quite straightforward and only about 50 lines of code. Adding a sort function shouldn't be too difficult. </p>

<p>I'm pretty much convinced now that jQuery is black magic.</p>

<p><br />
<a href="http://pivots.pivotallabs.com/users/nick/blog/articles/434-now-i-understand-what-they-mean-by-tabular-data-or-building-a-relational-database-using-jquery-and-lt-table-gt-tags-">Building a relational database using jQuery and &lt;TABLE&gt; tags</a><br />
<a href="http://github.com/nkallen/jquery-database/tree/master">Download the jquery.db.js library</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/relational_database_using_jque.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/relational_database_using_jque.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/relational_database_using_jque.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/relational_database_using_jque.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Tue, 08 Apr 2008 22:02:21 -0800</pubDate>

</item>

<item>
<title>Javascript marker clustering for Google Maps</title>
<itunes:summary> Everyone who works with large data sets in Google Maps has come across the problem of displaying a bunch of markers in a small area. Not just an eyesore, displaying anything more than a hundred marker icons at a...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="gmapcluster_20080407.jpg" src="http://www.hackszine.com/gmapcluster_20080407.jpg" width="500" height="309" class="mt-image-none" style="" /></span></p>

<p>Everyone who works with large data sets in Google Maps has come across the problem of displaying a bunch of markers in a small area. Not just an eyesore, displaying anything more than a hundred marker icons at a time can bog the browser down on a lot of platforms, Safari on PPC Macs delivering the most pain.</p>

<p>The solution is to cluster nearby markers into an aggregate marker when there are too many markers being displayed, or when markers are so close at a particular zoom level that they completely overlap. For extremely large datasets this is most efficiently done on the back-end, with successive AJAX calls refreshing the marker set from a PHP script that filters out the visible markers from the set.</p>

<p>You can also handle the clustering on the client side, using javascript to scan the entire set of locations and dynamically determine what's visible and what should be clustered. The downside is that you have to download the entire set and store it in the browser's memory, but unless you start getting well into tens of thousands of markers this isn't a big deal. The benefit to the client side method is that it's less complex, it lets you work around large result sets from back-end APIs that you can't control, and with ACME Labs' Clusterer javascript library it's extremely easy to code.</p>

<p>To use Clusterer, first download and include the Clusterer2.js file from the link below in your maps page. Then you need to instantiate a Clusterer object, passing your map object to its constructor:</p>

<blockquote><code>var clusterManager = new Clusterer(map);</code></blockquote>

<p>From there, you use it in place of the traditional MarkerManager or any addOverlay calls by calling the Clusterer's addMarker method.  It takes two parameters, the marker to add, and a text string that will be listed in the cluster's contents when it is clicked:</p>

<blockquote><code> clusterManager.AddMarker(marker, "Marker Description");</code></blockquote>

<p>The cluster manager will take care of all the dirty work, only displaying items when they are within your view, and dynamically clustering them appropriately when there are too many on the screen at once. When one of the clusters is clicked, it will display a list of the locations inside of it. Most of what you'd want to tweak, like the threshold at which to start clustering and the icon used for representing a cluster, are all adjustable through the API via some self-explanatory methods such as SetMaxVisibleMarkers(n) and SetIcon(icon).  Follow the link below for more information, or read the source for a few of the less-documented options.</p>

<p><a href="http://www.acme.com/javascript/#Clusterer">Clusterer documentation</a><br />
<a href="http://www.acme.com/javascript/Clusterer2.js">Clusterer source</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/javascript_marker_clustering_f.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/javascript_marker_clustering_f.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/javascript_marker_clustering_f.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/javascript_marker_clustering_f.html?CMP=OTC-7G2N43923558</guid>
<category>Google Maps</category>
<pubDate>Mon, 07 Apr 2008 21:56:59 -0800</pubDate>

</item>

<item>
<title>Practical fluid mechanics</title>
<itunes:summary> Mick West from Cowboy Programming posted a two part series to his blog titled Practical Fluid Dynamics. Originally written for Game Developer Magazine, it covers a number of clever (and down-to-earth) techniques for simulating the movement of fluids in...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="fluid_20080403.jpg" src="http://www.hackszine.com/fluid_20080403.jpg" width="500" height="273" class="mt-image-none" style="" /></span></p>

<p>Mick West from Cowboy Programming posted a two part series to his blog titled Practical Fluid Dynamics. Originally written for Game Developer Magazine, it covers a number of clever (and down-to-earth) techniques for simulating the movement of fluids in games and other software environments where real-time speed and visual authenticity matter most.</p>

<p>Special attention is paid to the simulation of particulate matter being carried around within a fluid volume&mdash;think effects like smoke, fire, and bubbles. I know I've seen a number of people using particle systems to do this sort of thing, but the methods Mick describes are all based on a grid model where you represent the system with a velocity field and a density field. Unlike a particle system, these fields represent a continuous fluid surface, allowing you to measure the density and velocity of the fluid at any location on the surface by interpolating the values from the nearest cells in the field array.</p>

<p><a href="http://cowboyprogramming.com/2008/04/01/practical-fluid-mechanics/">Practical Fluid Mechanics</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/practical_fluid_mechanics.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/practical_fluid_mechanics.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/practical_fluid_mechanics.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/practical_fluid_mechanics.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Thu, 03 Apr 2008 19:23:40 -0800</pubDate>

</item>

<item>
<title>From Nand to Tetris in 12 Steps</title>
<itunes:summary> Shimon Schocken gave a really interesting Google Tech Talk titled From Nand to Tetris in 12 Steps. In the video, he describes a course where students design a complete virtualized computer system from scratch, building from the humble nand...</itunes:summary>
<description>
<![CDATA[<p><embed style="width:500px; height:400px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=7654043762021156507&hl=en" flashvars=""> </embed></p>

<p>Shimon Schocken gave a really interesting Google Tech Talk titled From Nand to Tetris in 12 Steps. In the video, he describes a course where students design a complete virtualized computer system from scratch, building from the humble nand gate, to a functional cpu and memory architecture,  to compiler software and an operating system, all culminating in a simple game that runs on the virtual hardware.</p>

<blockquote>The hardware projects are done in a simple hardware description language and a hardware simulator supplied by us. The software projects (assembler, VM, and a compiler for a simple object-based language) can be done in any language, using the APIs and test programs supplied by us. We also build a mini-OS. The result is a GameBoy-like computer, simulated on the student's PC. We start the course (and this talk) by demonstrating some video games running on this computer, e.g. Tetris and Pong.

<p><br />
Building a working computer from Nand gates alone is a thrilling intellectual exercise. It demonstrates the supreme power of recursive ascent, and teaches the students that building computer systems is -- more than anything else -- a triumph of human reasoning.</blockquote></p>

<p>It looks like most of the course materials are available online. The necessary hardware emulator and simulator software is open source and available from Shimon's website.</p>

<p><a href="http://www1.idc.ac.il/tecscourse/">CS101 Digital Systems Construction</a><br />
<a href="http://video.google.com/videoplay?docid=7654043762021156507">Video - Building a Modern Computer from First Principles</a> [via <a href="http://www.slash7.com/articles/2008/3/19/f4t-in-the-educational-system">Slash7</a>]</p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/from_nand_to_tetris_in_12_step.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/from_nand_to_tetris_in_12_step.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/03/from_nand_to_tetris_in_12_step.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/03/from_nand_to_tetris_in_12_step.html?CMP=OTC-7G2N43923558</guid>
<category>Science</category>
<pubDate>Wed, 19 Mar 2008 21:02:56 -0800</pubDate>

</item>

<item>
<title>SketchUp has a Ruby API</title>
<itunes:summary> I guess it&apos;s been available for a few months, but I just noticed that there&apos;s a Ruby API for Google SketchUp. Looks like a cool tool for extending the building interface, integrating SketchUp entities with external software, and building...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="gsruby_20080310.jpg" src="http://www.hackszine.com/gsruby_20080310.jpg" width="500" height="302" class="mt-image-none" style="" /></span></p>

<p>I guess it's been available for a few months, but I just noticed that there's a Ruby API for Google SketchUp. Looks like a cool tool for extending the building interface, integrating SketchUp entities with external software, and building procedural stuff, like making terrain or stairs.</p>

<p>Here's a video of SketchUp developer Mark Limber talking about some of the possible ways to extend the software with the Ruby API.</p>

<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/QGvwLQQxuZs&rel=0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/QGvwLQQxuZs&rel=0" type="application/x-shockwave-flash" wmode="transparent" width="500" height="400"></embed></object></p>

<p>Google SketchUp Ruby API - <a href="http://code.google.com/apis/sketchup/">Link</a><br />
SketchUp API Blog - <a href="http://sketchupapi.blogspot.com/">Link</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/sketchup_has_a_ruby_api.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/sketchup_has_a_ruby_api.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/03/sketchup_has_a_ruby_api.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/03/sketchup_has_a_ruby_api.html?CMP=OTC-7G2N43923558</guid>
<category>Google Maps</category>
<pubDate>Mon, 10 Mar 2008 19:05:57 -0800</pubDate>

</item>

<item>
<title>Microsoft Excel 3D engine</title>
<itunes:summary> Peter Rakos wrote an article for Gamasutra today which demonstrates how to hack yourself a simple 3D engine by subverting an Excel worksheet. It&apos;s not going to win any FPS awards, but the fact that you can even get...</itunes:summary>
<description>
<![CDATA[<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/RV6uiZj0FHM&rel=0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/RV6uiZj0FHM&rel=0" type="application/x-shockwave-flash" wmode="transparent" width="500" height="400"></embed></object></p>

<p>Peter Rakos wrote an article for Gamasutra today which demonstrates how to hack yourself a simple 3D engine by subverting an Excel worksheet. It's not going to win any FPS awards, but the fact that you can even get Excel to draw raw shapes blows my mind. </p>

<p>In his demo, the worksheet is used to calculate values for all the polygon vertices and a very small macro loop draws the resulting mesh to the screen.</p>

<p>After downloading the source XLS, run the demo by hitting alt-F8 (option-F8 in Mac Excel). You'll find the code under the "Tools-&gt;Macro-&gt;Macros" menu.</p>

<p>Microsoft Excel: Revolutionary 3D Game Engine - <a href="http://www.gamasutra.com/view/feature/3563/microsoft_excel_revolutionary_3d_.php">Link</a><br />
Peter's Example 3D Excel files - <a href="http://gamasutra.com/images/RakosExcel.zip">Link</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/microsoft_excel_3d_engine.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/microsoft_excel_3d_engine.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/03/microsoft_excel_3d_engine.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/03/microsoft_excel_3d_engine.html?CMP=OTC-7G2N43923558</guid>
<category>Excel</category>
<pubDate>Thu, 06 Mar 2008 20:14:22 -0800</pubDate>

</item>

<item>
<title>Single character commenting</title>
<itunes:summary>It&apos;s a pretty common practice to comment and uncomment big chunks of code during the development and testing of software. Here&apos;s an odd little hack from the ajaxian blog that can make this a little easier for blocks that you&apos;re...</itunes:summary>
<description>
<![CDATA[<p>It's a pretty common practice to comment and uncomment big chunks of code during the development and testing of software.  Here's an odd little hack from the ajaxian blog that can make this a little easier for blocks that you're constantly flipping on and off during development.</p>

<p>For C style comments, the following will be commented out:<br />
<blockquote><code>/*<br />
if ( foo == bar )<br />
{<br />
&nbsp;&nbsp;dosomething();<br />
&nbsp;&nbsp;return();<br />
}<br />
// */</code></blockquote></p>

<p>And the addition of a single '/' will uncomment the block:<br />
<blockquote><code>//*<br />
if ( foo == bar )<br />
{<br />
&nbsp;&nbsp;dosomething();<br />
&nbsp;&nbsp;return();<br />
}<br />
// */</code></blockquote></p>

<p>In languages that don't have the single line comment, such as CSS, you can do the same thing with only the block level comments.<br />
Commented:<br />
<blockquote><code>/*/<br />
min-height:100px;<br />
/**/</code></blockquote><br />
Uncommented:<br />
<blockquote><code>/**/<br />
min-height:100px;<br />
/**/</code></blockquote></p>

<p>You are probably talking to your screen right now, saying, "hey Jason, that commenting trick is marginally useful at best." I can only respond by reminding you that every keystroke is a beautiful and unique snowflake that must be cherished and never wasted.</p>

<p>A neat commenting trick - <a href="http://ajaxian.com/archives/every-keystroke-is-a-prisoner-a-neat-commenting-trick">Link</a><br />
</p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/single_character_commenting.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/single_character_commenting.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/02/single_character_commenting.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/02/single_character_commenting.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Fri, 29 Feb 2008 17:42:32 -0800</pubDate>

</item>

<item>
<title>Extracting GTA3 art assets for use in your own game</title>
<itunes:summary> One of the most frustrating things about homebrew game development is that there&apos;s almost an insurmountable amount of work that needs to be done just to get something decent to display on a screen. You can roll your own...</itunes:summary>
<description>
<![CDATA[<p><img alt="mygta_20080210.jpg" src="http://www.hackszine.com/mygta_20080210.jpg" width="500" height="392" /></p>

<p>One of the most frustrating things about homebrew game development is that there's almost an insurmountable amount of work that needs to be done just to get something decent to display on a screen. You can roll your own complete graphics and physics engines and still have nothing to show for it if there are no art assets to load.</p>

<p>QuantumG's solution to the problem was to focus on developing the game engine using the model data from GTA3. Knowing that the art is already functional in another game allows you to focus on your code, and it's more fun when you can see the immediate results of your work.</p>

<p>The blog entry walks you through his experience with extracting and using the mesh, texture, city, and character data and making use of it with the OGRE graphics engine. If you've ever played around with making  a game before, but got discouraged for lack of art assets, this is really worth a read.</p>

<p>Using GTA3 art assets in OGRE - <a href="http://quantumg.blogspot.com/2007/03/almost-have-game-engine-here.html">Link</a><br />
OGRE 3D graphics engine - <a href="http://www.ogre3d.org/">Link</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/extracting_gta3_art_assets_for.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/extracting_gta3_art_assets_for.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/02/extracting_gta3_art_assets_for.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/02/extracting_gta3_art_assets_for.html?CMP=OTC-7G2N43923558</guid>
<category>Software Engineering</category>
<pubDate>Sun, 10 Feb 2008 20:18:55 -0800</pubDate>

</item>


</channel>
</rss>