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

<channel>
	<title>Structure in the flow &#187; programming</title>
	<atom:link href="http://www.fsavard.com/flow/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fsavard.com/flow</link>
	<description>Programming, personal knowledge management. Topics unstable.</description>
	<lastBuildDate>Sat, 10 Dec 2011 20:38:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Image stitching</title>
		<link>http://www.fsavard.com/flow/2011/06/image-stitching-assigment/</link>
		<comments>http://www.fsavard.com/flow/2011/06/image-stitching-assigment/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 16:00:58 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/flow/?p=646</guid>
		<description><![CDATA[As I said in the previous post, the first assignment in that computer vision course I took was to write an image stitching program. The basic idea is to take a series of pictures by rotating around the point where the camera is located. Then you find how each &#8220;maps&#8221; to the others and &#8220;stitch&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>As I said in the previous post, the first assignment in that computer vision course I took was to write an image stitching program. The basic idea is to take a series of pictures by rotating around the point where the camera is located. Then you find how each &#8220;maps&#8221; to the others and &#8220;stitch&#8221; them into a single coherent panorama.</p>
<p>At first I thought this couldn&#8217;t make sense for a first foray into CV algorithms and/or would take a gargantuan amount of time. Turns out only the second part was right, but mostly because I had to learn to use Mathematica and program in OpenCV along the way. And the hardest part was already done for us by either of these tools, anyway: finding correspondences between pictures.</p>
<p>The basic principle, as I said, is to find corresponding points between pictures. To do that you need to identify &#8220;keypoints&#8221;, basically points that look unique yet can be identified in another picture to find matches, even if in the other picture they&#8217;re slightly different. There&#8217;s a whole world of research on how to do that, but in our case it boiled down to either using SIFT or SURF features in Mathematica and OpenCV. Then some &#8220;distance&#8221; is used to find points that match between images. It measures how much the region around keypoints differ between potential matching points.</p>
<p>Once you&#8217;ve got these matches between pictures, supposing for the moment they&#8217;re all correct, if the pictures were taken &#8220;right&#8221; you can find a transform matrix H (an homography) such that, if x is the coordinate of a point in the first image, Hx gives the coordinate of the point in the second.</p>
<p>So, skipping some details about weeding out bad matches, what I did was find an homography between pairs of consecutive images, and bring everything back into the coordinates of the central image. Starting from these, say:</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-649" title="Thumbnails of pictures" src="http://www.fsavard.com/flow/wp-content/uploads/2011/06/gallery.png" alt="" width="508" height="480" /></p>
<p>I get this:</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-650" title="Original panorama" src="http://www.fsavard.com/flow/wp-content/uploads/2011/06/panorama_original_600.jpg" alt="" width="600" height="201" /></p>
<p>Cropping to keep only the central part:</p>
<p style="text-align: center;"><a href="http://www.fsavard.com/flow/wp-content/uploads/2011/06/panorama_cropped_fullsize.jpg"><img class="alignnone size-full wp-image-651" title="Only central part" src="http://www.fsavard.com/flow/wp-content/uploads/2011/06/panorama_cropped_600.jpg" alt="" width="600" height="120" /></a></p>
<p>Now I will concede my C program probably doesn&#8217;t have all the gizmos of other commercial options (notably if you look at the full size version above, you&#8217;ll see problems stemming from auto lighting on the camera), but hey, for a first assignment I was pretty impressed with the result. (And it turns out it was actually a pretty good first assignment, as those transformations and keypoint finding operations were fundamental for the rest of the course).</p>
<p>(As a last technical point: to filter out bad matches, we used RANSAC and other constraints on distances (in my case the first match must be much better than the second one).)</p>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=646" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2011/06/image-stitching-assigment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Computer vision project: overlaying 3D reconstruction from webcam on the original scene</title>
		<link>http://www.fsavard.com/flow/2011/06/computer-vision-course-project/</link>
		<comments>http://www.fsavard.com/flow/2011/06/computer-vision-course-project/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 18:08:10 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/flow/?p=638</guid>
		<description><![CDATA[I&#8217;ve been taking a few graduate courses at Université de Montréal in the past two years, but the last one, the computer vision course, was by far the one with the most &#8220;showable&#8221; (mighty Google says that&#8217;s a word) projects. I&#8217;ll be posting later on the first project, a basic image stitching app. For now, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been taking a few graduate courses at Université de Montréal in the past two years, but the last one, the computer vision course, was by far the one with the most &#8220;showable&#8221; (mighty Google says that&#8217;s a word) projects. I&#8217;ll be posting later on the first project, a basic image  stitching app. For now, I&#8217;ll just leave this here:</p>
<p><object style="height: 390px; width: 640px;"><param name="movie" value="http://www.youtube.com/v/moDzr2WTP68?version=3" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed type="application/x-shockwave-flash" width="640" height="390" src="http://www.youtube.com/v/moDzr2WTP68?version=3" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<p>It&#8217;s an example result from my term project. In a nutshell, skipping the technical:</p>
<ul>
<li> I take a couple of pictures with a camera for which I know some parameters, notably focal length;</li>
<li>In the scene there&#8217;s this augmented reality tag which helps me find out where the camera is in each pose;</li>
<li>I find corresponding points between images to create a (sparse) 3D point cloud of the object;</li>
<li>I then use MeshLab to get a mesh (I only have points, I need triangles) and then find some &#8220;good enough&#8221; textures for the triangles;</li>
<li>I then use the 3D model that comes out of all this and overlay it on the original scene, so the model ends up being &#8230; well where it should be in the first place.</li>
</ul>
<p>I wrote this using ARToolkit+ and OpenCV. Reprojecting onto the original image is done with OpenGL.</p>
<p>Some technical details for those who are into this kind of thing:</p>
<ul>
<li>I pre-calibrate the camera model with OpenCV calibration routines and a &#8220;chessboard&#8221;;</li>
<li>Getting the camera position from the detected tag is simply decomposing an homography between the tag plane and its image, which happened to be something we did for another course work;</li>
<li>I find corresponding points with SURF, and filter correspondences with epipolar line constraints found from camera poses, among other filters;</li>
<li>I first find correspondences between image pairs, and then merge them correspondences from all pairs using an algorithm I cooked up;</li>
<li>Finding a texture for each triangle involves finding a &#8220;good&#8221; image to project the triangle onto, then building a huge map of the textures for OpenGL from the extracted bits of the original images.</li>
</ul>
<p>I know the tracking&#8217;s pretty bad (I had to hack ARTookit+ which would return false positives at times) and the model is far from the reconstruction quality you&#8217;d get with less sparse techniques (another student in the course tackled reconstruction with structured light, for example, and had ~2 million points&#8230; I get ~2000), but hey, it (kinda) works and uses only a webcam (for the example shown above).</p>
<p>Maybe at some point I&#8217;ll get around to making the tracking smoother, at least. And to posting a more detailed demo of the app itself. It shows a bunch of fun stuff about the reconstruction process, like epipolar lines and camera positions for each pose.</p>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=638" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2011/06/computer-vision-course-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Small updates to Javascript speed reading app</title>
		<link>http://www.fsavard.com/flow/2010/04/small-updates-to-javascript-speed-reading-app/</link>
		<comments>http://www.fsavard.com/flow/2010/04/small-updates-to-javascript-speed-reading-app/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 13:45:38 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[reading]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/flow/?p=592</guid>
		<description><![CDATA[Just a note concerning two small new features I added to my Javascript speed reading (RSVP) app: You can now change the speed using your keyboard&#8217;s up/down arrows keys Text and background colors may now be selected using a color picker (based on JsColor) These were features some users asked for either on the blog [...]]]></description>
			<content:encoded><![CDATA[<p>Just a note concerning two small new features I added to my <a href="http://fsavard.com/code/speedread/">Javascript speed reading (RSVP) app</a>:</p>
<ul>
<li>You can now change the speed using your keyboard&#8217;s up/down arrows keys</li>
<li>Text and background colors may now be selected using a color picker (based on <a href="http://www.jscolor.com">JsColor</a>)</li>
</ul>
<p>These were features some users asked for either on the blog or in the comment form in the app. Thanks for the feedback!</p>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=592" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2010/04/small-updates-to-javascript-speed-reading-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Javascript memory game</title>
		<link>http://www.fsavard.com/flow/2010/02/simple-javascript-memory-game/</link>
		<comments>http://www.fsavard.com/flow/2010/02/simple-javascript-memory-game/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 18:24:53 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Clusterify]]></category>
		<category><![CDATA[pkm]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/flow/?p=582</guid>
		<description><![CDATA[Here&#8217;s a little memory game I just finished, using jQuery. It&#8217;s very bare bones, and I might add features to it, but it works, doesn&#8217;t have a bunch of ads floating around (like most do on the Web), and the board size can be changed (up to 60 total cards for the moment). For the [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a <a href="http://fsavard.com/code/pairsgame/">little memory game</a> I just finished, using jQuery. It&#8217;s very bare bones, and I might add features to it, but it works, doesn&#8217;t have a bunch of ads floating around (like most do on the Web), and the board size can be changed (up to 60 total cards for the moment).</p>
<p>For the context: when we launched <a href="http://clusterify.com/projects/">Clusterify</a>, one of the early projects I proposed was a <a href="http://clusterify.com/projects/list/fsavard/3/">simple &#8220;matching pairs&#8221; game</a>. Some almost-complete code I wrote up has been sitting on my computer ever since, just needing a few last fixes, and the addition of actual pictures. So I did those last fixes, adapted stock photos for it, and now <a href="http://fsavard.com/code/pairsgame/">here&#8217;s the game</a>.</p>
<h3>Changelog</h3>
<ul>
<li><strong>2010.02.22:</strong> as per a commenter&#8217;s (Jebadiah&#8217;s) suggestion, added a score and a timer. Also, images are now shuffled so the last ones (cats and birds) show up in the smaller grid.</li>
</ul>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=582" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2010/02/simple-javascript-memory-game/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Plyn: Yet another textfile-and-scripts based ToDo system</title>
		<link>http://www.fsavard.com/flow/2009/03/plyn-yet-another-textfile-and-scripts-based-todo-system/</link>
		<comments>http://www.fsavard.com/flow/2009/03/plyn-yet-another-textfile-and-scripts-based-todo-system/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 20:44:24 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[pim]]></category>
		<category><![CDATA[pkm]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/flow/?p=405</guid>
		<description><![CDATA[<strong>Warning</strong>: this post is
<ol>
	<li>out of the normal scope of this blog (it's about personal _information_ management, not personal _knowledge_ management).</li>
	<li><strong>mostly for geeks</strong>/programmers who will never be fully satisfied by any planning system, ever.</li>
</ol>
Over the years I've tried different ways of handling my<strong> ToDo, planning and work logging</strong>. This is my Xth iteration.]]></description>
			<content:encoded><![CDATA[<p><strong>Warning</strong>: this post is</p>
<ol>
<li>out of the normal scope of this blog (it&#8217;s about personal _information_ management, not personal _knowledge_ management).</li>
<li><strong>mostly for geeks</strong>/programmers who will never be fully satisfied by any planning system, ever.</li>
</ol>
<p>Over the years I&#8217;ve tried different ways of handling my<strong> ToDo, planning and work logging</strong>. This is my Xth iteration. I wonder if anyone but a programmer could use this, but hey, programmers are a non negligible fraction of society (which I happen to be part of)!</p>
<p>I&#8217;ve long wanted to create a program which would do <strong>precisely what I want in terms of planning</strong>, but was always put off by the &#8220;*knocks head on wall* the GUI is so long to code!&#8221; aspect. Well to hell with the GUI! Let&#8217;s deal with raw information, rarrr.</p>
<p>Err, sooo&#8230; <strong>Plyn</strong> (ie. this system) is inspired by <a href="http://ginatrapani.github.com/todo.txt-cli/">the todo.txt scripts of Gina Trapani</a> (LifeHacker author). Basically it allows you to have a very simple yet powerful todo.txt file, and the file is meant to be read directly (in contrast to other programs which use databases only the program can read). The difference is that my version:</p>
<ol>
<li>is written in <strong>Python</strong> (in contrast to Bash for Gina&#8217;s todo.txt)</li>
<li><strong>allows for hierarchy, empty lines, comment lines</strong>, etc. in the file, so the <strong>file can really be structured and read by itself</strong>, and a good deal of everyday tasks can be done without ever using the scripts</li>
<li>includes a <strong>work log aspect</strong>, ie. you can record how much time you spent on tasks to keep stats.</li>
<li>includes <strong>time estimates</strong>, but for the moment it&#8217;s not very developed.</li>
</ol>
<p>So I&#8217;d say it departs from the need to be simple, to be expandable and support other dimensions of planning&amp;logging.</p>
<p><strong>Google Code link for the project &amp; code: <a href="http://plyn.googlecode.com">http://plyn.googlecode.com</a></strong></p>
<p>The todo.txt format is pretty simple. Here&#8217;s an example of content:</p>
<pre>12 Elephant in refrigerator project ||| Yeah, I shouldn't try myself at humor.
	# Open refrigerator door
	# Put elephant in refrigerator
	# Close refrigerator door

	-- This line is just a comment</pre>
<p>A few observations:</p>
<ul>
<li>You see a <strong>task may be nested</strong> in another one (which you can see as a project), simply using tabs.</li>
<li>Each line begins either with an ID (number) or with #. The # is replaced by a proper ID by cleanchanges.py (more on this later).</li>
<li>The ID is followed by a title, then |||, which indicates the start of parameters/comments.</li>
<li>You can <strong>have blank lines, and comments lines (starting with &#8211;)</strong>.</li>
</ul>
<p>After the &#8216;|||&#8217; characters, you can place different <strong>parameters</strong>. In more detail, the format of a line is:</p>
<p>(INDENT) ID TITLE ||| {PRIORITY} &lt;MINUTES_DONE/MINUTES_TODO&gt; [START_DATETIME-ENDDATE_TIME] COMMENTS</p>
<p>As you can see, many more options may be specified (see the &#8220;format.txt&#8221; file for detailed information about each of these parameters), and of course this can be expanded (it all relies on a huge regex). But everything following ||| is optional.</p>
<p>So you can edit the todo.txt file manually, but there are, of course, <strong>helper scripts to automate </strong>certain tasks. The one you&#8217;d use the most is <strong>today.py</strong>. It gives you a list of all high-priority tasks, late/coming up tasks, and tasks awaiting feedback (&#8220;+feedback&#8221; tag in title). By editing the script you could add whatever other list you need.</p>
<p>You can also, of course, <strong>filter tasks by text using grep</strong>. So you could have <strong>tags</strong> or <strong>contexts</strong>, for example, if you&#8217;re into GTD.</p>
<p>The <strong>cleanchanges.py</strong> script will replace the # at the beginning of the line by an ID which can then be used to refer to the ToDo item in other scripts. cleanchanges.py will also transform dates, so you can write:</p>
<pre>-- Today is 2009/03/14
# Clean refrigerator ||| [-+15]</pre>
<p>and the item will be changed into</p>
<pre>15 Clean refrigerator ||| [-2009/03/29]</pre>
<p>ie. the date can be specified as the number of days in the future, which saves finger mana.</p>
<p>The work log is also simple. To say you&#8217;ve just spent the last 3 hours cleaning the refrigerator, you would do:</p>
<pre>./log.py 15 180 "Some comment to add to the log"</pre>
<p>(where 15 is the task ID and 180 is 3 hours expressed in minutes). This will add a line to the log.txt file, and will change the MINUTES_DONE field of the item in todo.txt.</p>
<p>Scripts are meant to be called from a command line you keep open somewhere in the scripts directory, so you can use autocompletion. Path for todo.txt and other files are configured in cfg.py.</p>
<p>And, of course, the whole thing can be extended as you please. My ultimate goal is to have a script with which I can truly estimate the free time I have, ie. to determine if I can engage in a new task or not.</p>
<p>If anyone ever uses this, be sure to let me know! I&#8217;m especially interested in hearing of other must-script-the-procrastination-away coders who expand this thing in whichever direction their urges take them.</p>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=405" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2009/03/plyn-yet-another-textfile-and-scripts-based-todo-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Altering a Django project to migrate from a simple ManyToMany relation to one with extra information</title>
		<link>http://www.fsavard.com/flow/2009/02/altering-a-django-project-to-migrate-from-a-simple-manytomany-relation-to-one-with-extra-information/</link>
		<comments>http://www.fsavard.com/flow/2009/02/altering-a-django-project-to-migrate-from-a-simple-manytomany-relation-to-one-with-extra-information/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 17:00:21 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Clusterify]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/blog/?p=40</guid>
		<description><![CDATA[There are still quite a few features which could be useful on Clusterify. One I thought could help in structuring projects is the concept of Roles: a way to let users joining a project specify which role they want to take in it. Now, most common tasks are made amazingly easy with Django. Changing models, [...]]]></description>
			<content:encoded><![CDATA[<p>There are still quite a few features which could be useful on Clusterify. One I thought could help in structuring projects is the <strong>concept of Roles</strong>: a way to let users joining a project specify which role they want to take in it.</p>
<p>Now, most common tasks are made amazingly easy with Django. <strong>Changing models</strong>, while probably common, <a href="http://code.djangoproject.com/wiki/SchemaEvolution">seems very <strong>tricky to automate right</strong></a>, though (and anyway would you trust the automation logic to make the right changes?). Yet there&#8217;s <a href="http://code.google.com/p/dmigrations/">dmigrations</a> which I need to try one day.</p>
<p>Back to the original problem: Roles. <strong>Formerly we had a ManyToManyField </strong>in the Project model linked to the User model for users joining a project. In the background, Django creates a table to hold the relationship named after the field (projects_project_joined_users).</p>
<p>The way to add <strong>extra information to a relationship</strong>, in the Django ORM, is with the <a href="http://docs.djangoproject.com/en/dev/topics/db/models/#intermediary-manytomany"><strong>&#8220;through&#8221; argument to the ManyToManyField</strong></a>, which lets you specify a model which will hold the relationship. In this case, we&#8217;d get:</p>
<pre>class Membership(models.Model):
    user = models.ForeignKey(User)
    project = models.ForeignKey(Project)
    role = models.CharField(max_length=120)
    approved = models.BooleanField(default=False)</pre>
<p>and in Project we now add the field:</p>
<pre>    members = models.ManyToManyField(User, through='Membership')</pre>
<p>This would create a table named projects_membership. It still doesn&#8217;t hold any data, though. Now I see <strong>two ways of making this change</strong> in the DB:</p>
<ul>
<li>Renaming or copying the old table holding the relationship, and ALTERing it until it looks like that new one.</li>
<li>Creating the new table (by looking at the output of <strong>sqlall</strong>) and filling it by copying over the data with a mapping of fields.</li>
</ul>
<p>I chose the later, which seemed more straightforward (and anyway I have other manual copying operations to perform). There&#8217;s an <strong>easy way to copy over the data, the <a href="http://dev.mysql.com/doc/refman/5.0/en/insert-select.html">INSERT &#8230; SELECT syntax</a></strong> in SQL. The old table was named projects_project_joined_users, so the syntax becomes:</p>
<pre>INSERT INTO projects_membership (user_id, project_id, role, approved)
    SELECT projects_project_joined_users.user_id, projects_project_joined_users.project_id, '', 1
    FROM projects_project_joined_users;</pre>
<p>Running this copied over the old data, and now the code may be updated. Note that I had <strong>first created the new table by checking the output of &#8220;sqlall&#8221;</strong> and running the relevant statements (CREATE TABLE, ALTERs for foreign key constraints, and index creation).</p>
<p>It&#8217;s now more complicated to handle the relationship this way, though, <strong>as one can&#8217;t use add() or remove() as before</strong>. Take a look<a href="http://docs.djangoproject.com/en/dev/topics/db/models/#intermediary-manytomany"> at the doc</a> for more info on this.</p>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=40" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2009/02/altering-a-django-project-to-migrate-from-a-simple-manytomany-relation-to-one-with-extra-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clusterify project: word cloud bookmarklet</title>
		<link>http://www.fsavard.com/flow/2009/02/clusterify-project-word-cloud-bookmarklet/</link>
		<comments>http://www.fsavard.com/flow/2009/02/clusterify-project-word-cloud-bookmarklet/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 01:27:29 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Clusterify]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/blog/?p=33</guid>
		<description><![CDATA[This is a separate post, but it&#8217;s another quick project I suggested, among the first batch I wrote as I brainstormed to get a little bit of content to get Clusterify going: a bookmarklet script to display a word cloud based on all the text in a page. The utility might be limited, but it [...]]]></description>
			<content:encoded><![CDATA[<p>This is a separate post, but it&#8217;s another quick project I suggested, among the first batch I wrote as I brainstormed to get a little bit of content to get Clusterify going: a <a href="http://clusterify.com/projects/list/fsavard/6/">bookmarklet script to display a word cloud based on all the text in a page</a>. The utility might be limited, but it was fun to code. Here&#8217;s <a href="http://fsavard.com/code/wordcloud.js">the source</a> (bookmarklet code is given in a comment) and here&#8217;s a screenshot of what it looks like:</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-34" src="http://www.fsavard.com/flow/wp-content/uploads/2009/02/wordcloud_tn.png" alt="" width="500" height="229" /></p>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=33" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2009/02/clusterify-project-word-cloud-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clusterify project: Delicious tags userscript</title>
		<link>http://www.fsavard.com/flow/2009/02/clusterify-project-delicious-tags-userscript/</link>
		<comments>http://www.fsavard.com/flow/2009/02/clusterify-project-delicious-tags-userscript/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 01:21:18 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Clusterify]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/blog/?p=31</guid>
		<description><![CDATA[I&#8217;m doing a few Clusterify projects, to test the site and concept at the same time. A very quick project suggested by member psytek concerned adding popular/recommended tags automatically on Delicious with a Greasemonkey script. Turns out it took me around 10 lines of code, gave me a good excuse to finally learn about XPath, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m doing a few Clusterify projects, to test the site and concept at the same time. A very quick <a href="http://clusterify.com/projects/list/psytek/17/">project suggested by member psytek</a> concerned adding popular/recommended tags automatically on Delicious with a Greasemonkey script. Turns out it took me around 10 lines of code, gave me a good excuse to finally learn about XPath, and it&#8217;s quite useful. <a href="http://userscripts.org/scripts/show/42818">Here&#8217;s the script</a> over at Userscripts.</p>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=31" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2009/02/clusterify-project-delicious-tags-userscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just launched Clusterify.com &#8212; small project meetups site for programmers</title>
		<link>http://www.fsavard.com/flow/2009/02/just-launched-clusterifycom-small-project-meetups-site-for-programmers/</link>
		<comments>http://www.fsavard.com/flow/2009/02/just-launched-clusterifycom-small-project-meetups-site-for-programmers/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 17:37:31 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Clusterify]]></category>
		<category><![CDATA[me]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/blog/?p=28</guid>
		<description><![CDATA[Here&#8217;s the project I&#8217;ve been working on for the past 3 weeks with another programmer named Aneesh: Clusterify.com . It&#8217;s a site on which you send project proposals, usually very short in time demand (2 hours is suggested), and through them you meet other programmers. I can&#8217;t spend too much time writing a two-volume novel [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the project I&#8217;ve been working on for the past 3 weeks with another programmer named Aneesh: <a href="http://www.clusterify.com">Clusterify.com</a> .</p>
<p>It&#8217;s a site on which you send project proposals, usually very short in time demand (2 hours is suggested), and through them you meet other programmers.</p>
<p>I can&#8217;t spend too much time writing a two-volume novel about it for the moment, as the launch is still ongoing, but here&#8217;s the <a href="http://news.ycombinator.com/item?id=485813">launch thread on Hacker News</a>.</p>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=28" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2009/02/just-launched-clusterifycom-small-project-meetups-site-for-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extension to jQuery autocomplete for multiple tag suggestion</title>
		<link>http://www.fsavard.com/flow/2009/02/extension-to-jquery-autocomplete-for-multiple-tag-suggestion/</link>
		<comments>http://www.fsavard.com/flow/2009/02/extension-to-jquery-autocomplete-for-multiple-tag-suggestion/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 19:25:27 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fsavard.com/blog/?p=25</guid>
		<description><![CDATA[The project I&#8217;m working on has fields that allow you to enter a series of tags. I wanted an autocomplete functionality for these, and looked at what&#8217;s already available using jQuery. I found the popular jq-autocomplete to be interesting, but it didn&#8217;t have the functionality out of the box. Yet it allowed for extension points [...]]]></description>
			<content:encoded><![CDATA[<p>The project I&#8217;m working on has fields that allow you to enter a series of tags. I wanted an autocomplete functionality for these, and looked at what&#8217;s already available using jQuery. I found the popular <a href="http://github.com/ozten/jquery-autocomplete/tree/master">jq-autocomplete</a> to be interesting, but it didn&#8217;t have the functionality out of the box. Yet it allowed for extension points in its options. I created custom functions to achieve the goal:</p>
<pre>function lastWord (str) {
	var words = str.split(" ");
	return words[words.length - 1];
}

function customTemplate(str) {
	return "&lt;li&gt;" + lastWord(str) + "&lt;/li&gt;";
}

function customTextInsert(str, original) {
	var firstWords = original.split(" ");
	firstWords[firstWords.length - 1] = str;
	var toReturn = firstWords.join(" ");
	return toReturn;
}

function customTextInsertBinder(input) {
	return function(str){ return customTextInsert(str, input.val()); }
}

function customTextMatch(typed) {
	return this.match(new RegExp(lastWord(typed)));
}</pre>
<p>Now, when I want to have a field autocompleted, I load the list of tags in a JavaScript array (here called &#8220;site_tags&#8221;), and I call:</p>
<pre>	$('#id_tags').autocomplete(
		{list: site_tags,
		match: customTextMatch,
		insertText: customTextInsertBinder($("#id_tags")),
		template: customTemplate});</pre>
 <img src="http://www.fsavard.com/flow/wp-content/plugins/feed-statistics.php?view=1&post_id=25" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.fsavard.com/flow/2009/02/extension-to-jquery-autocomplete-for-multiple-tag-suggestion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

