<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Saher El-Neklawy</title>
 <link href="http://saher.io/atom.xml" rel="self"/>
 <link href="http://saher.io/"/>
 <updated>2020-05-12T13:38:24+00:00</updated>
 <id>http://saher.io</id>
 <author>
   <name>Saher El-Neklawy</name>
   <email>saher.neklawy@gmail.com</email>
 </author>

 
 <entry>
   <title>DAGs - Pratical Applications</title>
   <link href="http://saher.io/2020/02/06/dags-in-practice/"/>
   <updated>2020-02-06T00:00:00+00:00</updated>
   <id>http://saher.io/2020/02/06/dags-in-practice</id>
   <content type="html">&lt;p&gt;A presentation I have on what are Directed Acyclic Graphs and their practical applications during the EgyptJS meetup.&lt;/p&gt;

&lt;p&gt;Checkout the slides on &lt;a href=&quot;https://www.slideshare.net/secret/ymFqePZTerRBtO&quot;&gt;Slideshare&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A Tale of Two Kitties</title>
   <link href="http://saher.io/2019/03/07/a-tale-of-two-kitties/"/>
   <updated>2019-03-07T00:00:00+00:00</updated>
   <id>http://saher.io/2019/03/07/a-tale-of-two-kitties</id>
   <content type="html">&lt;p&gt;The story of two office cats and how we optimized their feeding schedule.&lt;/p&gt;

&lt;p&gt;Read the full post on &lt;a href=&quot;https://medium.com/whizardry/a-tale-of-two-kitties-6fcaf5812c5a&quot;&gt;Medium&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Living on the Edge (Node)</title>
   <link href="http://saher.io/2019/01/07/living-on-the-edge-node/"/>
   <updated>2019-01-07T00:00:00+00:00</updated>
   <id>http://saher.io/2019/01/07/living-on-the-edge-node</id>
   <content type="html">&lt;p&gt;A tale of how using a Content Delivery Network is essential from day one for dynamic content.&lt;/p&gt;

&lt;p&gt;Read the full post on &lt;a href=&quot;https://medium.com/whizardry/living-on-the-edge-node-456a8e969860&quot;&gt;Medium&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Semi-Automated Text Cleaning in R</title>
   <link href="http://saher.io/2015/12/26/semi-automated-text-cleaning-in-r/"/>
   <updated>2015-12-26T00:00:00+00:00</updated>
   <id>http://saher.io/2015/12/26/semi-automated-text-cleaning-in-r</id>
   <content type="html">&lt;p&gt;Cleaning real life textual data is hard. Weather it’s convention inconsistencies, manual data entry mistakes, or a myriad of other reasons, reaching a consistent representation is essential. This is most pronounced when dealing with categorical variables (like city or job title) where an inconsistent representation would give rise to superfluous categories that do not exist in reality.&lt;/p&gt;

&lt;p&gt;Read the full post on &lt;a href=&quot;https://medium.com/optima-blog/semi-automated-text-cleaning-in-r-68054a9491da&quot;&gt;Medium&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Writing your own dplyr functions</title>
   <link href="http://saher.io/2015/12/18/writing-your-own-dyplyr-functions/"/>
   <updated>2015-12-18T00:00:00+00:00</updated>
   <id>http://saher.io/2015/12/18/writing-your-own-dyplyr-functions</id>
   <content type="html">&lt;p&gt;dplyr is awesome, like really awesome. The thing I like most about it is how readable it makes data processing code look. 
But how to write your own functions that make use of dpyrl convesions?&lt;/p&gt;

&lt;p&gt;Read the full post on &lt;a href=&quot;https://medium.com/optima-blog/writing-your-own-dplyr-functions-a1568720db0d&quot;&gt;Medium&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Intro to Server Monitoring</title>
   <link href="http://saher.io/2015/09/05/server-monitoring-talk/"/>
   <updated>2015-09-05T00:00:00+00:00</updated>
   <id>http://saher.io/2015/09/05/server-monitoring-talk</id>
   <content type="html">&lt;p&gt;On 29/8/2015 I presented an introductory session about server monitoring. This talk is part of the &lt;a href=&quot;http://www.meetup.com/Cairo-DevOps-Meetup/&quot;&gt;Cairo DevOps Meetup&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The content of this talk can be found in &lt;a href=&quot;https://github.com/saherneklawy/server-monitoring-talk&quot;&gt;this repo&lt;/a&gt;.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Intro to Spark Meetup Talk</title>
   <link href="http://saher.io/2015/08/29/spark-into-talk/"/>
   <updated>2015-08-29T00:00:00+00:00</updated>
   <id>http://saher.io/2015/08/29/spark-into-talk</id>
   <content type="html">&lt;p&gt;On 29/8/2015 I presented an introductory session to Apache Spark. This talk is part of the &lt;a href=&quot;http://www.meetup.com/Cairo-Data-Science-Meetup/&quot;&gt;Cairo Data Science Meetup&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The content of this talk can be found in &lt;a href=&quot;github.com/saherneklawy/spark-talk&quot;&gt;this repo&lt;/a&gt;.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Adding local latex packages to texlive in ubuntu</title>
   <link href="http://saher.io/latex/2011/02/19/adding-local-latex-packages-to-texlive-in-ubuntu/"/>
   <updated>2011-02-19T12:52:19+00:00</updated>
   <id>http://saher.io/latex/2011/02/19/adding-local-latex-packages-to-texlive-in-ubuntu</id>
   <content type="html">&lt;p&gt;When having custom packages to use for a document, you need to put them next your latex files when compiling. This causes problems when you need these packages for many documents. The solution is to add these packages to the latex installation. This can be done for the current user by creating a latex tree in the $HOME/texmf directory. The structure of this directory needs to follow the texmf-local described &lt;a href=&quot;http://en.wikibooks.org/wiki/LaTeX/Packages/Installing_Extra_Packages&quot;&gt;here&lt;/a&gt;. This directory is searched by default by the texlive installation.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Portable Meld on Windows</title>
   <link href="http://saher.io/opensource/2011/02/12/portable-meld-on-windows/"/>
   <updated>2011-02-12T13:51:14+00:00</updated>
   <id>http://saher.io/opensource/2011/02/12/portable-meld-on-windows</id>
   <content type="html">&lt;p&gt;Often I need to compare and merge files or folders together for changes between them. Gladly, many applications exist for such a task. This can come as using the &lt;a href=&quot;http://en.wikipedia.org/wiki/Diff&quot; target=&quot;_blank&quot;&gt;diff&lt;/a&gt; command line tool, sadly it is not visually pleasant. Therefore several visual interfaces to ease the comparison side by side. Examples of such are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.caffeinated.me.uk/kompare/&quot; target=&quot;_blank&quot;&gt;kompare&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://kdiff3.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;kdiff3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://meld.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;meld&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.scootersoftware.com/&quot; target=&quot;_blank&quot;&gt;beyond compare&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://winmerge.org/&quot; target=&quot;_blank&quot;&gt;winmerge&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A detailed comparison between the them and others can be found &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;. My personal favorite of these is &lt;a href=&quot;http://meld.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;meld&lt;/a&gt; (specially for folder comparison). On a Linux system, it is quite easy to set up, specially if it is deb bases because there is a package for it. A problem shows up when wanting to use &lt;a href=&quot;http://meld.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;meld&lt;/a&gt; in Windows. After some googling I found &lt;a href=&quot;http://live.gnome.org/Meld/Windows&quot;&gt;this guide&lt;/a&gt; showing how to install it for windows. Using this guide, I managed to get it to work, but I prefer a portable installation to take it anywhere.&lt;/p&gt;
&lt;p&gt;Following are the steps I followed to get a portable version of meld up and running. Take care that performing the steps need administrative rights, but it can run anywhere.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a directory to contain meld binaries and its dependencies. Let us reference to it as &amp;lt;meld install dir&amp;gt;&lt;/li&gt;
&lt;li&gt;Download &lt;a href=&quot;http://ftp.belnet.be/mirror/PortablePython/v1.1/PortablePython_1.1_py2.6.1.exe&quot;&gt;portable python 2.6&lt;/a&gt;, and install it under &amp;lt;meld install dir&amp;gt;\Python26&lt;/li&gt;
&lt;li&gt;Add the portable python installation to the registry. This is done by opening the portable python interpretor an running the script from &lt;a href=&quot;http://effbot.org/zone/python-register.htm&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download the GKT+ 2.2 run time all in one bundle from &lt;a href=&quot;http://www.gtk.org/download-windows.html&quot;&gt;here&lt;/a&gt;. Extract it to &amp;lt;meld install dir&amp;gt;\gtk+&lt;/li&gt;
&lt;li&gt;Download an install the latest PyGTK libraries. These are the &lt;a href=&quot;http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/&quot;&gt;PyGTK&lt;/a&gt;, &lt;a href=&quot;http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/&quot;&gt;PyCairo&lt;/a&gt;, and &lt;a href=&quot;http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/&quot;&gt;PyGObject&lt;/a&gt; modules. This will install to the correct python based on the registry entry from step 3.&lt;/li&gt;
&lt;li&gt;Download meld 1.5 from &lt;a href=&quot;http://ftp.gnome.org/pub/gnome/sources/meld/1.5/&quot;&gt;here&lt;/a&gt;. Extract it to &amp;lt;meld install dir&amp;gt;\meld-src&lt;/li&gt;
&lt;li&gt;Create a file &quot;&amp;lt;meld install dir&amp;gt;\start-meld.bat&quot;. The content of this file is:&lt;br /&gt;
[sourcecode language=&quot;bash&quot;]&lt;br /&gt;
@echo off&lt;br /&gt;
set PATH=%CD%\Python26\App;%CD%\gtk+\bin&lt;br /&gt;
python meld-src\bin\meld&lt;br /&gt;
[/sourcecode]&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And that is it, run start-meld.bat and enjoy :)&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A DRY KISS</title>
   <link href="http://saher.io/computer%20science/general/teaching/2010/10/29/a-dry-kiss/"/>
   <updated>2010-10-29T14:13:53+00:00</updated>
   <id>http://saher.io/computer%20science/general/teaching/2010/10/29/a-dry-kiss</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;Absolutely &lt;/strong&gt;Don't Repeat Yourself and Keep It Simple, Stupid! (A DRY KISS) .&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Don't_repeat_yourself&quot;&gt;DRY&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/KISS_principle&quot;&gt;KISS&lt;/a&gt; are common concepts between software developers, but are very difficult to follow. Specially when you start with some idea, run with it, and it starts to layer up in complexity. Without even recognizing it goes out of control. With each of there added layers, you might find yourself repeating things without even recognizing the fact.&lt;/p&gt;
&lt;p&gt;Drawing the very fine line between simplicity and and complexity is a very difficult task. It gets even more difficult without taking a step back to look at the big picture, the original aim, the purpose.&lt;/p&gt;
&lt;p&gt;This is why an external review of the matter by a 3rd party is often vital. It gives perspective that helps the general good. Such a review process is often excruciating, painful, and long. But in the end of day, without it there is no real gain.&lt;/p&gt;
&lt;p&gt;A a final note, I believe that A DRY KISS is something to try and follow in general.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Proposal: Hierarchical Unit Testing for less woes</title>
   <link href="http://saher.io/computer%20science/2010/10/02/hierarchical-unit-testing/"/>
   <updated>2010-10-02T15:54:29+00:00</updated>
   <id>http://saher.io/computer%20science/2010/10/02/hierarchical-unit-testing</id>
   <content type="html">&lt;p&gt;Disclaimer: The following content is of an idea which might be already existing, so please feel free to comment if you find it in existing testing frameworks :)&lt;/p&gt;
&lt;p&gt;A common problem I face during &lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot;&gt;test-driven development&lt;/a&gt; is when having to tests (for ease i'll call them T1 and T2). T1 and T2 test the functionality of F1 and F2 respectively. The fun starts when F2 is dependent on F1, and both tests fail. In a test suit of thousands of tests, it would be hard to see the correlation from only the report of running the test suite.&lt;/p&gt;
&lt;p&gt;It gets worse when the dependency between tests is not direct. For example  if F3-&amp;gt;F2-&amp;gt;F1 (-&amp;gt; means &quot;depends on&quot;), where only T1 and T3 fail and T2 is fine. These relations need a very careful reviewer of the test results, and one who is well aware of the relations between components and their tests. This might be impossible in HUGE teams spanning many components.&lt;/p&gt;
&lt;p&gt;But what if the testing framework was aware of these relations, and was able to report them. Such relations could be represented for example as new annotations in JUnit. With building the relation graph between tests it would be easy show that T2 might have failed because T1 failed.&lt;/p&gt;
&lt;p&gt;So this is an open call, any one willing to try creating this, if it is not already out there?&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Google instant search: A better spell checker and calculator</title>
   <link href="http://saher.io/fun/2010/09/16/google-instant-search-a-better-spell-checker-and-calculator/"/>
   <updated>2010-09-16T12:06:30+00:00</updated>
   <id>http://saher.io/fun/2010/09/16/google-instant-search-a-better-spell-checker-and-calculator</id>
   <content type="html">&lt;p&gt;One of my main uses for Google search is not the searching, but has slowing move towards often queries just for the sake of spell checking. Recently Google released its &lt;a href=&quot;http://www.google.com/instant/&quot;&gt;instant search&lt;/a&gt;. With that, I can easily see my spelling mistakes as I type, no more need to press enter :).&lt;/p&gt;
&lt;p&gt;What I found by accident and found it even more useful is using instant search as a calculator. Some of you might know the Google easter egg about the &lt;a href=&quot;http://www.google.com/search?q=answer+to+life+the+universe+and+everything&quot;&gt;answer to life universe and everything&lt;/a&gt;. Google calculator has been part of &lt;a href=&quot;http://www.google.com/help/features.html&quot;&gt;Google's search features&lt;/a&gt; for some time now. With the instant search, the results of the calculator is also changed live. A cool and useful example (that was the way that made me discover this) is the binomial coefficient function. Give it a try and play around with it &lt;a href=&quot;http://www.google.com/search?q=100+choose+50&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Happy lazy calculating :)&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Layar POI service using Google App Engine</title>
   <link href="http://saher.io/opensource/technical/2010/04/04/layar-poi-service-using-google-app-engine/"/>
   <updated>2010-04-04T16:54:51+00:00</updated>
   <id>http://saher.io/opensource/technical/2010/04/04/layar-poi-service-using-google-app-engine</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://layar.com/&quot;&gt;Layar&lt;/a&gt; is a cool handheld augmented reality application that allows to overlay &quot;Layers&quot; on the image seen by a handheld device's camera. One can think of these layers as content that is seen based on your current location. This allows to overlay digital data over actual live imagery.&lt;/p&gt;
&lt;p&gt;The Layar API depends that the source of data (Points Of Interest) is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Representational_State_Transfer&quot;&gt;RESTful web service&lt;/a&gt;, that sends an HTTP GET request, and expects back  a &lt;a href=&quot;http://en.wikipedia.org/wiki/JSON&quot;&gt;JSON&lt;/a&gt; object. The details of the GET parameters, and the required JSON object could be found here in the &lt;a href=&quot;http://layar.pbworks.com/GetPointsOfInterest&quot;&gt;layar API documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To create a layer, one needs to provide such a service that provides the Points Of Interest (POI). Such a service could easily be written and provided by &lt;a href=&quot;http://code.google.com/appengine/&quot;&gt;google app engine&lt;/a&gt;. This article will discuss how to do so using the google app engine python SDK, and is highly depends on the &lt;a href=&quot;http://code.google.com/appengine/docs/python/gettingstarted/&quot;&gt;getting started guide for google app engine through python&lt;/a&gt;. Sections 1-4,6 are sufficient for understanding of the coming content. &lt;/p&gt;
&lt;h3&gt;Handling Requests&lt;/h3&gt;
&lt;p&gt;Since requests from layar to the POI web service come in the form of GET requests, the parameters can simply be accessed in the request handling method through:&lt;br /&gt;
[sourcecode language=&quot;python&quot;]&lt;br /&gt;
self.request.get(parameter_name)&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;h3&gt;POI Response&lt;/h3&gt;
&lt;p&gt;The POI response that layar expects is a json object. The API place many restrictions on the response. The first comes in the content type of the HTTP response. Thus, it has to be set as follows:&lt;br /&gt;
[sourcecode language=&quot;python&quot;]&lt;br /&gt;
self.response.headers['Content-type'] = 'text/javascript; charset=utf-8'&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;Another restriction is in JSON object returned as a response, where almost all the fields are required by layar. To make things simpler, the object is to be represented as a python object. This could be later converted to a JSON object. The JSON object responded with could be represented as follows (as a minumum):&lt;br /&gt;
[sourcecode lanaguage=&quot;javascript&quot;]&lt;br /&gt;
{'layer':'layer name', 'hotspots':list_of_POI, 'errorCode':0, 'errorString':'ok'}&lt;br /&gt;
[/sourcecode]&lt;br /&gt;
Where hotspots is a list of POI object. These object could be represented as:&lt;br /&gt;
[sourcecode language=&quot;python&quot;]&lt;br /&gt;
class POI:&lt;br /&gt;
    def __init__(self,poi_id,title,lat,lang):&lt;br /&gt;
        self.actions = []&lt;br /&gt;
        self.id = poi_id&lt;br /&gt;
        self.imageURL = None&lt;br /&gt;
        self.lat = lat&lt;br /&gt;
        self.lon = lang&lt;br /&gt;
        self.distance = None&lt;br /&gt;
        self.title = title&lt;br /&gt;
        self.line2 = None&lt;br /&gt;
        self.line3 = None&lt;br /&gt;
        self.line4 = None&lt;br /&gt;
        self.attribution = &amp;quot;&amp;quot;&lt;br /&gt;
        self.type = 0&lt;br /&gt;
        self.dimenion = 1&lt;br /&gt;
        self.transform = {'rel':True, 'angle':0, 'scale':1.0}&lt;br /&gt;
        self.object = {'baseURL': &amp;quot;&amp;quot;}&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;h3&gt;From python to JSON&lt;/h3&gt;
&lt;p&gt;As python follows a batteries all included strategy, there are libraries that convert python dictionaries to JSON objects. Even though google app engine uses python, the &quot;json&quot; module is not available. Thankfully, an equivalent one is found through &quot;from django.utils import simplejson&quot;. It could be used to convert a python dictionary (that looks frightfully like a JSON object) to a JSON object string as follows:&lt;br /&gt;
[sourcecode language=&quot;python&quot;]&lt;br /&gt;
simplejson.dumps({'layer':'guc', 'hotspots':poi_list, 'errorCode':0, 'errorString':'ok'})&lt;br /&gt;
[/sourcecode]&lt;br /&gt;
The problem with simplejson is that it only takes dictionaries or lists. Thus, this poses a problem when using the POI class mentioned earlier. Again, python comes with a rescue, where a dictionary representing the object could be obtained as follows:&lt;br /&gt;
[sourcecode language=&quot;python&quot;]&lt;br /&gt;
poi = POI('C1','C1',29986707,31438864)&lt;br /&gt;
poiDictionary = poi1.__dict__&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;h3&gt;Putting the code together&lt;/h3&gt;
&lt;p&gt;Now that we have the POI object, and the conversion mechanism, we are ready to have a request handler for layar requests. An example of static POIs is as follows:&lt;br /&gt;
[sourcecode language=&quot;python&quot;]&lt;br /&gt;
from django.utils import simplejson&lt;br /&gt;
from poi import POI&lt;br /&gt;
from google.appengine.ext import webapp&lt;br /&gt;
from google.appengine.ext.webapp.util import run_wsgi_app&lt;/p&gt;
&lt;p&gt;class POIHandler(webapp.RequestHandler):&lt;br /&gt;
	def get(self):&lt;br /&gt;
		self.response.headers['Content-type'] = 'text/javascript; charset=utf-8'&lt;br /&gt;
		#latitude and longitude is an integer will be divided by 10^6&lt;br /&gt;
		# so take care of accuracy after the division&lt;br /&gt;
		poi1 = POI('C1','C1',29986707,31438864).__dict__&lt;br /&gt;
		poi2 = POI('C2','C2',29986744,31439272).__dict__&lt;br /&gt;
		poi3 = POI('C3','C3',29986995,31438923).__dict__&lt;br /&gt;
		poi4 = POI('C4','C4',29987153,31439245).__dict__&lt;br /&gt;
		poi5 = POI('C5','C5',29986326,31438810).__dict__&lt;br /&gt;
		poi6 = POI('C6','C6',29986688,31438569).__dict__&lt;br /&gt;
		poi7 = POI('C7','C7',29986442,31438370).__dict__&lt;br /&gt;
		pois = [poi1,poi2,poi3,poi4,poi5,poi6,poi7]&lt;br /&gt;
		# final getPOI response dictionary&lt;br /&gt;
		d = {'layer':'guc', 'hotspots':pois, 'errorCode':0, 'errorString':'ok'}&lt;br /&gt;
		self.response.out.write(simplejson.dumps(d))&lt;/p&gt;
&lt;p&gt;application = webapp.WSGIApplication(&lt;br /&gt;
		[('/',POIHandler),&lt;br /&gt;
		 ('/getPOI',POIHandler)],&lt;br /&gt;
		debug=True)&lt;/p&gt;
&lt;p&gt;def main():&lt;br /&gt;
	run_wsgi_app(application)&lt;/p&gt;
&lt;p&gt;if __name__=='__main__':&lt;br /&gt;
	main()&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;h4&gt; Updates &lt;/h4&gt;
&lt;p&gt;With the new layar 4 api coming soon, and the new features being in &lt;a href=&quot;http://layar.pbworks.com/Layar-4-API-changes?utm_source=August+2010&amp;amp;utm_campaign=5bc67acfdf-back&amp;amp;utm_medium=email&quot;&gt;beta2&lt;/a&gt;, un update of how to add one of my favorite new features is needed. This is having different actions on the entire layar. It can be easily done by adding an action attribute to the final getPOI response dictionary (see code above). An example of the addition is as follows:&lt;br /&gt;
[sourcecode language=&quot;python&quot;]&lt;br /&gt;
d['actions'] = [{'uri':'http://google.com','label':'action on the entire layar'}]&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>SVN post-commit hook cronjob</title>
   <link href="http://saher.io/opensource/technical/2010/04/04/svn-post-commit-hook-cronjob/"/>
   <updated>2010-04-04T12:08:17+00:00</updated>
   <id>http://saher.io/opensource/technical/2010/04/04/svn-post-commit-hook-cronjob</id>
   <content type="html">&lt;p&gt;Few SVN hosting sites provide ssh access to their svn servers. Such is needed to create hooks, like a post-commit hook that sends an email with every commit. Such hooks are often required by the development team. This article discusses the creation of a cron job that polls the SVN repository to simulate a post-commit hook that sends an email with every commit.&lt;/p&gt;
&lt;h3&gt;Setting up sendEmail&lt;/h3&gt;
&lt;p&gt;sendEmail is a nice tool to send emails via command line. This is needed to script in the cronjob sending an email. On ubuntu, install it from apt-get by:&lt;/p&gt;
&lt;pre&gt;sudo apt-get install sendemail libio-socket-ssl-perl libcrypt-ssleay-perl&lt;/pre&gt;
&lt;p&gt;The latter 2 packages are needed for connecting to an SMTP server that uses a secure connection (like Gmail, which is used in the example).&lt;/p&gt;
&lt;h3&gt;The post-commit hook script&lt;/h3&gt;
&lt;p&gt;The following is a python script, that could be added as an entry in the cron table&lt;br /&gt;
[sourcecode language=&quot;python&quot;]&lt;br /&gt;
#! /usr/bin/env python&lt;/p&gt;
&lt;p&gt;import os,re&lt;/p&gt;
&lt;p&gt;log_file = LOG_DIR&lt;br /&gt;
svn_log_seperator  = '------------------------------------------------------------------------'&lt;br /&gt;
svn_dir = SVN_DIR&lt;br /&gt;
mail_filter = '[special mail identifier in subject]'&lt;br /&gt;
message_file = '/tmp/commit_mail'&lt;/p&gt;
&lt;p&gt;mail_from = MAIL_FROM&lt;br /&gt;
mail_to = MAIL_TO&lt;/p&gt;
&lt;p&gt;smtp_server = &amp;quot;smtp.gmail.com:587&amp;quot;&lt;br /&gt;
smtp_user = SMTP_USER&lt;br /&gt;
smtp_pass = SMTP_PASS&lt;/p&gt;
&lt;p&gt;def send_mail(subject,mail):&lt;br /&gt;
    mail_file = open(message_file,'w')&lt;br /&gt;
    mail_file.write(mail)&lt;br /&gt;
    mail_file.close()&lt;br /&gt;
    mail_command = 'sendEmail -f %s -t %s -u &amp;quot;%s&amp;quot; -s %s -xu &amp;quot;%s&amp;quot; -xp &amp;quot;%s&amp;quot; -o message-file=&amp;quot;%s&amp;quot;' % (mail_from, mail_to, subject, smtp_server, smtp_user, smtp_pass,message_file)&lt;br /&gt;
    print mail_command&lt;br /&gt;
    os.system(mail_command)&lt;/p&gt;
&lt;p&gt;print &amp;quot;analyzing old log file&amp;quot;&lt;/p&gt;
&lt;p&gt;old_log_f = open(log_file)&lt;br /&gt;
old_log = old_log_f.read().split(svn_log_seperator)&lt;br /&gt;
old_log_f.close()&lt;/p&gt;
&lt;p&gt;print &amp;quot;updating svn&amp;quot;&lt;br /&gt;
os.system(&amp;quot;/usr/local/bin/svn update %s&amp;quot; % svn_dir)&lt;br /&gt;
os.system(&amp;quot;/usr/local/bin/svn log %s &amp;gt; %s&amp;quot; % (svn_dir,log_file))&lt;br /&gt;
print &amp;quot;got new log&amp;quot;&lt;/p&gt;
&lt;p&gt;new_log_f = open(log_file)&lt;br /&gt;
new_log = new_log_f.read().split(svn_log_seperator)&lt;br /&gt;
new_log_f.close()&lt;/p&gt;
&lt;p&gt;delta = set(new_log) - set(old_log)&lt;/p&gt;
&lt;p&gt;for commit in delta:&lt;br /&gt;
    l = [x for x in commit.split('\n') if x]&lt;br /&gt;
    details = l[0].split('|')&lt;br /&gt;
    subject = &amp;quot;%s %s %s&amp;quot; %(mail_filter,details[0],details[1])&lt;br /&gt;
    f_diff=os.popen('/usr/local/bin/svn diff -c %s %s' % (details[0], svn_dir))&lt;br /&gt;
    diff = f_diff.read()&lt;br /&gt;
    f_diff.close()&lt;br /&gt;
    mail = &amp;quot;%s\n%s&amp;quot; % (commit, diff)&lt;br /&gt;
    send_mail(subject,mail)&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;h3&gt;Perquisites before running the script&lt;/h3&gt;
&lt;ul&gt;
&lt;ol&gt;Having a working copy of the svn reposity&lt;/ol&gt;
&lt;ol&gt;Running the following command once before the script:&lt;/p&gt;
&lt;pre&gt;svn log &amp;gt; $PATH_TO_LOG_FILE&lt;/pre&gt;
&lt;/ol&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Developer vs. User <=> Driver vs. Mechanic</title>
   <link href="http://saher.io/2010/04/01/developer-vs-user-driver-vs-mechanic/"/>
   <updated>2010-04-01T17:51:50+00:00</updated>
   <id>http://saher.io/2010/04/01/developer-vs-user-driver-vs-mechanic</id>
   <content type="html">&lt;p&gt;Hypothesis: The Developer User relation is equivalent to the car driver mechanic relation.&lt;/p&gt;
&lt;p&gt;Proof:&lt;br /&gt;
Through my few numbered years of driving in the lovely streets of Cairo, i faced car troubles every now and then. In the case of such circumstances, I head to my trusty mechanic. From here, starts the problem, when I am driving my car, and i notice a problem, it is very difficult to &lt;strong&gt;reproduce&lt;/strong&gt; by the mechanic. Such a reproduction often happens when it's too late.&lt;/p&gt;
&lt;p&gt;Here, comes the fitting analogy, mechanics are car using experts. They manage to use cars in an expert manner, one that hides any possible problems in the car. &lt;/p&gt;
&lt;p&gt;The same maps to the computer software users, where they see problems that developers are unable to reproduce, simply because of their computer usage habits that are so much different from that of end users.&lt;/p&gt;
&lt;p&gt;Quod Erat Demonstrandum (QED).&lt;/p&gt;
&lt;p&gt;Thus, the lesson to learn here is, every time you want to feel like a user, think of yourself driving your car, and weird things starting to happen.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Life: A python perspective</title>
   <link href="http://saher.io/2010/03/17/life-a-python-perspective/"/>
   <updated>2010-03-17T01:40:32+00:00</updated>
   <id>http://saher.io/2010/03/17/life-a-python-perspective</id>
   <content type="html">&lt;p&gt;[sourcecode]&lt;br /&gt;
from people import friends&lt;/p&gt;
&lt;p&gt;while not dead:&lt;br /&gt;
    try:&lt;br /&gt;
        something_new()&lt;br /&gt;
    except LifeIsToughError:&lt;br /&gt;
        pass&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Breaking up with your code</title>
   <link href="http://saher.io/2010/03/04/breaking-up-with-your-code/"/>
   <updated>2010-03-04T20:14:30+00:00</updated>
   <id>http://saher.io/2010/03/04/breaking-up-with-your-code</id>
   <content type="html">&lt;p&gt;A famous quote from &lt;a href=&quot;http://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar&quot;&gt;The Cathedral and the Bazaar&lt;/a&gt; is &quot;Plan to throw one away; you will, anyhow&quot;. This never hits a programmer with it's true meaning until they have to throw aways a large bit of code base that they invested time and effort in. Coders tend to build an emotional connection towards every letter of code they wrote (I know i sure do). On the other hand, needs arise where obstacles render current software &quot;unfixable&quot;. This confronts with the painful fact that change must be done. Taking an objective stand point in that decision is a tough decision, but facts are fact in face of improvement. In the end of the day, breaking up is tough but a fresh start would most likely end up in more bulletproof code.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Recurring Beauty</title>
   <link href="http://saher.io/computer%20science/2009/12/27/the-recurring-beauty/"/>
   <updated>2009-12-27T17:38:57+00:00</updated>
   <id>http://saher.io/computer%20science/2009/12/27/the-recurring-beauty</id>
   <content type="html">&lt;p&gt;Recently, I stared reading one of the essential books for a computer scientists, namely &lt;a href=&quot;http://en.wikipedia.org/wiki/Concrete_Mathematics&quot;&gt;Concrete Mathematics&lt;/a&gt;. After the first chapter, it really got me thinking &quot;Oh My!! Recurrences could solve anything.&quot; This is of course not matched to the thrill of the challenge in funding recurring patterns in a structure.&lt;/p&gt;
&lt;p&gt;Along my college years, colleges tend to step away from recurrences. In fact, many cases it is the easier approach to tackle. Furthermore, it could be in some cases the more efficient approach. This reminds me of many algorithm techniques that largely depend on finding substructures or small solutions that are used for generalizations. The most vivid example comes to me in the form of memoization in dynamic programming (DP). For me the corner stone of DP is finding the &quot;magical&quot; recurrence. Thus, from super slow, to super fast (lots of memory use though :D).&lt;/p&gt;
&lt;p&gt;Other examples of how recursive thinking makes complex problems elegantly simple could be seen in graph theory. Just by examining some properties on nodes, arcs, degrees, huge complexities just boil down to some elegantly beautiful properties that are easily generalizable.&lt;/p&gt;
&lt;p&gt;Such beauty could be easily seen when recurrences could end up in something that is visually breath taking. An example are &lt;a href=&quot;http://en.wikipedia.org/wiki/Fractal&quot;&gt;Fractals&lt;/a&gt;, a stunning example of how simple math with recursion lead to amazing imagery.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Two Columned LaTeX Presentation Slides</title>
   <link href="http://saher.io/latex/technical/2009/12/07/two-columned-latex-presentation-slides/"/>
   <updated>2009-12-07T12:01:36+00:00</updated>
   <id>http://saher.io/latex/technical/2009/12/07/two-columned-latex-presentation-slides</id>
   <content type="html">&lt;p&gt;Coming from a &lt;a href=&quot;http://en.wikipedia.org/wiki/Microsoft_PowerPoint&quot;&gt;Power Point&lt;/a&gt; background of creating presentation slides, i am often tempted to used a two column approach when laying out the content of my slides. This is where text is shown on the left column and related pictures are placed on the right.&lt;/p&gt;
&lt;p&gt;After i decided to to move all my document creation work to be in &lt;a href=&quot;http://en.wikipedia.org/wiki/LaTeX&quot;&gt;LaTeX&lt;/a&gt;, I started to also create my presentations that way too. Such a feat is made possible using the &lt;a href=&quot;http://en.wikipedia.org/wiki/Beamer_%28LaTeX%29&quot;&gt;beamer&lt;/a&gt; document class, whose user guide could be found &lt;a href=&quot;http://www.ctan.org/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The environment for a single slide is the &quot;frame&quot; environment. It is used a follows:&lt;/p&gt;
&lt;p&gt;[sourcecode]&lt;br /&gt;
\begin{frame}{frame title}&lt;/p&gt;
&lt;p&gt;\end{frame}&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;To be able to split the frame (slide) into two columns, the &quot;columns&quot; environment is places inside the slide content. It is used as follows:&lt;/p&gt;
&lt;p&gt;[sourcecode]&lt;br /&gt;
\begin{columns}&lt;br /&gt;
\column{column_width} %first column&lt;br /&gt;
column 1 content&lt;br /&gt;
\column{column_width} %second column&lt;br /&gt;
column 2 content&lt;br /&gt;
\column{column_width} %third column&lt;br /&gt;
column 3 content&lt;br /&gt;
...&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;It is best to have the column_width in terms of the text width. So for example:&lt;/p&gt;
&lt;p&gt;[sourcecode light=&quot;true&quot;]&lt;br /&gt;
\column{0.5\textwidth} %half slide's text width&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;An example for a two columned slide looks as like:&lt;/p&gt;
&lt;p&gt;[sourcecode collapse=&quot;true&quot; wraplines=&quot;true&quot;]&lt;br /&gt;
\documentclass{beamer}&lt;br /&gt;
\mode&amp;lt;presentation&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  \usetheme[width=2cm]{Hannover}&lt;br /&gt;
  \setbeamercovered{transparent}&lt;br /&gt;
}&lt;br /&gt;
\title[Presentation]{Presentation}&lt;br /&gt;
\author[Saher Mohamed El-Neklawy]{Saher Mohamed El-Neklawy}&lt;/p&gt;
&lt;p&gt;\begin{document}&lt;br /&gt;
  \begin{frame}{Frame Title}&lt;br /&gt;
    \begin{columns}&lt;br /&gt;
      \column{0.5\textwidth}&lt;br /&gt;
	\begin{itemize}&lt;br /&gt;
	\item Item 1&lt;br /&gt;
	\item Item 2&lt;br /&gt;
	\item Item 3&lt;br /&gt;
	\end{itemize}&lt;br /&gt;
      \column{0.5\textwidth}&lt;br /&gt;
	\includegraphics[width=\textwidth]{i1.eps}&lt;/p&gt;
&lt;p&gt;	\includegraphics[width=\textwidth]{i2.eps}&lt;br /&gt;
    \end{columns}&lt;br /&gt;
  \end{frame}&lt;br /&gt;
\end{document}&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;[caption id=&quot;attachment_66&quot; align=&quot;aligncenter&quot; width=&quot;300&quot; caption=&quot;Two Columned Slide&quot;]&lt;a href=&quot;http://saherneklawy.files.wordpress.com/2009/12/two_columns.png&quot;&gt;&lt;img class=&quot;size-medium wp-image-66&quot; title=&quot;Two Columned Slide&quot; src=&quot;assets/two_columns.png?w=300&quot; alt=&quot;&quot; width=&quot;300&quot; height=&quot;224&quot; /&gt;&lt;/a&gt;[/caption]&lt;/p&gt;
&lt;p&gt;The next step is to sequence the appearance of the images along with the images. In the beamer class, this could be done using the &quot;&quot; operator, following a certain component in the frame. The &quot;n&quot; represents when the component appears in the frame. For example:&lt;/p&gt;
&lt;p&gt;[sourcecode]&lt;br /&gt;
\begin{itemize}&lt;br /&gt;
  \item&amp;lt;2&amp;gt; Item 1 % seen after 1 transition&lt;br /&gt;
  \item&amp;lt;3&amp;gt; Item 2 % seen after 2 transition&lt;br /&gt;
  \item&amp;lt;4&amp;gt; Item 3 % seen after 3 transition&lt;br /&gt;
\end{itemize}&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;In a sense, the &quot;&quot; splits a frame into n slides, placing the respective component in the nth slide of that frame. For more advanced uses of &quot;&quot;, check out the &lt;a href=&quot;http://www.ctan.org/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf&quot;&gt;beamer class user guide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To do the same for images, the &quot;\visible&quot; or &quot;\only&quot; macros could be used along with the &quot;&quot; operator.&lt;/p&gt;
&lt;p&gt;With using &quot;\visible&quot;, the slides would now look like:&lt;/p&gt;
&lt;p&gt;[sourcecode collapse=&quot;true&quot;]&lt;br /&gt;
\documentclass{beamer}&lt;br /&gt;
\mode&amp;lt;presentation&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  \usetheme[width=2cm]{Hannover}&lt;br /&gt;
  \setbeamercovered{transparent}&lt;br /&gt;
}&lt;br /&gt;
\title[Presentation]{Presentation}&lt;br /&gt;
\author[Saher Mohamed El-Neklawy]{Saher Mohamed El-Neklawy}&lt;/p&gt;
&lt;p&gt;\begin{document}&lt;br /&gt;
  \begin{frame}{Frame Title}&lt;br /&gt;
    \begin{columns}&lt;br /&gt;
      \column{0.5\textwidth}&lt;br /&gt;
	\begin{itemize}&lt;br /&gt;
	  \item&amp;lt;2&amp;gt; Item 1&lt;br /&gt;
	  \item&amp;lt;3&amp;gt; Item 2&lt;br /&gt;
	  \item&amp;lt;4&amp;gt; Item 3&lt;br /&gt;
	\end{itemize}&lt;br /&gt;
      \column{0.5\textwidth}&lt;br /&gt;
	\visible&amp;lt;2&amp;gt;&lt;br /&gt;
	{&lt;br /&gt;
	  \includegraphics[width=\textwidth]{i1.eps}&lt;br /&gt;
	}&lt;br /&gt;
	\visible&amp;lt;3&amp;gt;{&lt;br /&gt;
	  \includegraphics[width=\textwidth]{i2.eps}&lt;br /&gt;
	}&lt;br /&gt;
    \end{columns}&lt;br /&gt;
  \end{frame}&lt;br /&gt;
\end{document}&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;[caption id=&quot;attachment_74&quot; align=&quot;aligncenter&quot; width=&quot;300&quot; caption=&quot;Sequenced Two Columned 1&quot;]&lt;a href=&quot;http://saherneklawy.files.wordpress.com/2009/12/two_columns_sequenced_1.png&quot;&gt;&lt;img class=&quot;size-medium wp-image-74&quot; title=&quot;Sequenced Two Columned 1&quot; src=&quot;assets/two_columns_sequenced_1.png?w=300&quot; alt=&quot;Sequenced Two Columned 1&quot; width=&quot;300&quot; height=&quot;225&quot; /&gt;&lt;/a&gt;[/caption]&lt;/p&gt;
&lt;p&gt;[caption id=&quot;attachment_75&quot; align=&quot;aligncenter&quot; width=&quot;300&quot; caption=&quot;Sequenced Two Columned 2&quot;]&lt;a href=&quot;http://saherneklawy.files.wordpress.com/2009/12/two_columns_sequenced_2.png&quot;&gt;&lt;img class=&quot;size-medium wp-image-75&quot; title=&quot;Sequenced Two Columned 2&quot; src=&quot;assets/two_columns_sequenced_2.png?w=300&quot; alt=&quot;Sequenced Two Columned 2&quot; width=&quot;300&quot; height=&quot;225&quot; /&gt;&lt;/a&gt;[/caption]&lt;/p&gt;
&lt;p&gt;The problem with &quot;\visible&quot; is that it keeps the place of the component from the previous transition reserved in the next, just not seen. The fix to this issue is the use of &quot;\only&quot;, where the space for components is not reserved across transitions. Such makes the slides look as follows:&lt;/p&gt;
&lt;p&gt;[sourcecode collapse=&quot;true&quot;]&lt;br /&gt;
\documentclass{beamer}&lt;br /&gt;
\mode&amp;lt;presentation&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  \usetheme[width=2cm]{Hannover}&lt;br /&gt;
  \setbeamercovered{transparent}&lt;br /&gt;
}&lt;br /&gt;
\title[Presentation]{Presentation}&lt;br /&gt;
\author[Saher Mohamed El-Neklawy]{Saher Mohamed El-Neklawy}&lt;/p&gt;
&lt;p&gt;\begin{document}&lt;br /&gt;
  \begin{frame}{Frame Title}&lt;br /&gt;
    \begin{columns}&lt;br /&gt;
      \column{0.5\textwidth}&lt;br /&gt;
	\begin{itemize}&lt;br /&gt;
	  \item&amp;lt;2&amp;gt; Item 1&lt;br /&gt;
	  \item&amp;lt;3&amp;gt; Item 2&lt;br /&gt;
	  \item&amp;lt;4&amp;gt; Item 3&lt;br /&gt;
	\end{itemize}&lt;br /&gt;
      \column{0.5\textwidth}&lt;br /&gt;
	\only&amp;lt;2&amp;gt;&lt;br /&gt;
	{&lt;br /&gt;
	  \includegraphics[width=\textwidth]{i1.eps}&lt;br /&gt;
	}&lt;br /&gt;
	\only&amp;lt;3&amp;gt;{&lt;br /&gt;
	  \includegraphics[width=\textwidth]{i2.eps}&lt;br /&gt;
	}&lt;br /&gt;
    \end{columns}&lt;br /&gt;
  \end{frame}&lt;br /&gt;
\end{document}&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;[caption id=&quot;attachment_76&quot; align=&quot;aligncenter&quot; width=&quot;300&quot; caption=&quot;Two column slide using \only macro 1&quot;]&lt;a href=&quot;http://saherneklawy.files.wordpress.com/2009/12/two_columns_only_1.png&quot;&gt;&lt;img class=&quot;aligncenter size-medium wp-image-78&quot; title=&quot;Two Column using \only&quot; src=&quot;assets/two_columns_only_1.png?w=300&quot; alt=&quot;&quot; width=&quot;300&quot; height=&quot;224&quot; /&gt;&lt;/a&gt;[/caption]&lt;/p&gt;
&lt;p&gt;[caption id=&quot;attachment_79&quot; align=&quot;aligncenter&quot; width=&quot;300&quot; caption=&quot;Two column slide using \only macro 2&quot;]&lt;a href=&quot;http://saherneklawy.files.wordpress.com/2009/12/two_columns_only_2.png&quot;&gt;&lt;img class=&quot;size-medium wp-image-79&quot; title=&quot;Two column slide using \only macro 2&quot; src=&quot;assets/two_columns_only_2.png?w=300&quot; alt=&quot;&quot; width=&quot;300&quot; height=&quot;224&quot; /&gt;&lt;/a&gt;[/caption]&lt;/p&gt;
&lt;p&gt;When taking a closer look at the &lt;a href=&quot;//saherneklawy.files.wordpress.com/2009/12/two_columns_using_only.pdf&quot;&gt;output pdf&lt;/a&gt;, it will be observed that there is a slight change in the position of the bulleted list. This is most seen between pages 3 and 4 of the pdf. Such is due to the nature of the \only, as it does not reserver the position of component across transitions of the frame. Thus, the location of the bulleted list differs when there is a transition with a slide having a slide to one without, and vice versa.&lt;/p&gt;
&lt;p&gt;This problem could be fixed by going back to the &quot;\visible&quot; macro, as it reserves the spaces for components. The difference this time is is that the location of the image in the slide will be forced. This could be done using the &quot;picture&quot; environment as follows:&lt;/p&gt;
&lt;p&gt;[sourcecode]&lt;br /&gt;
\begin{picture}(0,0)(x,y)&lt;br /&gt;
    \put(0,0){\includegraphics[width=\textwidth]{i1.eps}}&lt;br /&gt;
\end{picture}&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
&lt;p&gt;Take care to consider the x and y values from the top right corner of the column.&lt;/p&gt;
&lt;p&gt;The final code results in this &lt;a href=&quot;http://saherneklawy.files.wordpress.com/2009/12/two_columns_final.pdf&quot;&gt;pdf&lt;/a&gt;, and looks like follows:&lt;/p&gt;
&lt;p&gt;[sourcecode]&lt;br /&gt;
\documentclass{beamer}&lt;br /&gt;
\mode&amp;lt;presentation&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  \usetheme[width=2cm]{Hannover}&lt;br /&gt;
  \setbeamercovered{transparent}&lt;br /&gt;
}&lt;br /&gt;
\title[Presentation]{Presentation}&lt;br /&gt;
\author[Saher Mohamed El-Neklawy]{Saher Mohamed El-Neklawy}&lt;/p&gt;
&lt;p&gt;\begin{document}&lt;br /&gt;
  \begin{frame}{Frame Title}&lt;br /&gt;
    \begin{columns}&lt;br /&gt;
    \column{0.5\textwidth}&lt;br /&gt;
      \begin{itemize}&lt;br /&gt;
	\item&amp;lt;2&amp;gt; Item 1&lt;br /&gt;
	\item&amp;lt;3&amp;gt; Item 2&lt;br /&gt;
	\item&amp;lt;4&amp;gt; Item 3&lt;br /&gt;
      \end{itemize}&lt;br /&gt;
    \column{0.5\textwidth}&lt;br /&gt;
      \visible&amp;lt;2&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
	\begin{picture}(0,0)(40,50)&lt;br /&gt;
	  \put(0,0){\includegraphics[width=\textwidth]{i1.eps}}&lt;br /&gt;
	\end{picture}&lt;br /&gt;
      }&lt;br /&gt;
      \visible&amp;lt;3&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
	\begin{picture}(0,0)(50,50)&lt;br /&gt;
	  \put(0,0){\includegraphics[width=\textwidth]{i2.eps}}&lt;br /&gt;
	\end{picture}&lt;br /&gt;
      }&lt;br /&gt;
    \end{columns}&lt;br /&gt;
  \end{frame}&lt;br /&gt;
\end{document}&lt;br /&gt;
[/sourcecode]&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Open source Projects, The Life Cycle</title>
   <link href="http://saher.io/opensource/2009/11/21/open-source-projects-the-life-cycle/"/>
   <updated>2009-11-21T20:08:01+00:00</updated>
   <id>http://saher.io/opensource/2009/11/21/open-source-projects-the-life-cycle</id>
   <content type="html">&lt;p&gt;Recently, I have been involved into the development of an open source project, that is currently under major modifications. Seeing this change happening before my eyes got me to think, how do open source projects evolve, and how do exiting well matured (old) projects reached their current state.&lt;/p&gt;
&lt;p&gt;I feel that most open source projects start with a crazy idea, usually driven by some sort of need (the itch as called by &lt;a href=&quot;http://catb.org/~esr/writings/cathedral-bazaar/&quot;&gt;The Cathedral and the Bazaar&lt;/a&gt;). But when one thinks about it, not many people have the guts to go out in the open to satisfy that drive. Mostly people who do aim to get an up and running prototype that shows the idea to the community. This is mainly to get people in the community excited, and people who had a similar itch involved.&lt;/p&gt;
&lt;p&gt;To reach that initial prototype, the team working is often small, as the community knows nothing yet. The lack of the outsider perspective might limit the developers to their own coding style, and the drive of getting a prototype out might loose focus on certain coding aspects.&lt;/p&gt;
&lt;p&gt;After the prototype is out, the effects of the bazaar model is seen, where bugs are fixed, code is optimized, improved, and documented. At this stage, the project takes it's first step to maturity.&lt;/p&gt;
&lt;p&gt;The changes over time could range the minor to the drastic. The main issue that developers wanting to get involved  with an evolving project, whether rapidly or slowly, patience is need. This is due to the need to take time to obtain a deep understanding of the code. Furthermore, patience is needed when a project is changing rapidly, as they mostly could end up in code breaks, but keep in mind they will eventually be fixed (possibly by you). Such an aspect also requires high flexibility.&lt;/p&gt;
&lt;p&gt;After these many iterations by the community, the project starts to stabilize into a state of maturity. Usually this is called the 1.0 release. After that stage, progress starts to slow down, and focus starts to go to having new features. The main code base is rarely changed unless with major following released, or core feature additions that require that due to the structure of the code.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Running launchpad remotely</title>
   <link href="http://saher.io/technical/2009/11/04/running-launchpad-remotely/"/>
   <updated>2009-11-04T20:58:28+00:00</updated>
   <id>http://saher.io/technical/2009/11/04/running-launchpad-remotely</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://launchpad.net/&quot;&gt;Launchpad &lt;/a&gt;is a software collaboration platform developed by &lt;a href=&quot;http://www.canonical.com/&quot;&gt;Canonical&lt;/a&gt; (famous for &lt;a href=&quot;http://www.ubuntu.com/&quot;&gt;Ubuntu&lt;/a&gt; :D). Recently the the launchpad project &lt;a href=&quot;http://blog.launchpad.net/general/launchpad-is-now-open-source&quot;&gt;went open source&lt;/a&gt;. This allowed people to host copies of it locally. The process for the installation process could be found &lt;a href=&quot;https://dev.launchpad.net/Getting&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The next natural step is to configure remote computers to be able to access launchpad. After following the &lt;a href=&quot;https://dev.launchpad.net/Running/RemoteAccess&quot;&gt;how-to&lt;/a&gt; by launchpad, and trying the access the local copy of launchpad from an external source, the following error is shown by the running launchpad server:&lt;/p&gt;
&lt;pre&gt;NotFound: Object: &amp;lt;canonical.launchpad.webapp.servers.ProtocolErrorPublication
object at 0x8157b50&amp;gt;, name: ''&lt;/pre&gt;
&lt;p&gt;The solution to this lies in the /etc/hosts file on the &lt;strong&gt;client&lt;/strong&gt; accessing the lauchpad copy. The file should contain the following:&lt;/p&gt;
&lt;pre&gt;{ip for server}      launchpad.dev answers.launchpad.dev api.launchpad.dev
bazaar-internal.launchpad.dev beta.launchpad.dev
blueprints.launchpad.dev bugs.launchpad.dev code.launchpad.dev
feeds.launchpad.dev id.launchpad.dev keyserver.launchpad.dev
lists.launchpad.dev openid.launchpad.dev ppa.launchpad.dev
private-ppa.launchpad.dev shipit.edubuntu.dev shipit.kubuntu.dev
shipit.ubuntu.dev translations.launchpad.dev
xmlrpc-private.launchpad.dev xmlrpc.launchpad.dev

{ip for server}      bazaar.launchpad.dev&lt;/pre&gt;
&lt;p&gt;{ip of the server} is the ip of the machine containing the running copy of the launchpad server. Also take care the lines starting with {ip of the server} until an empty line should be a single line in the file. For client systems that are not linux, check out the &lt;a href=&quot;http://en.wikipedia.org/wiki/Hosts_file&quot;&gt;Wikipedia article concerning hosts&lt;/a&gt; for the files equivalent to &quot;/etc/hosts&quot;.&lt;/p&gt;
&lt;p&gt;To run launchpad, access &lt;a href=&quot;https://launchpad.dev/&quot;&gt;https://launchpad.dev/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On a side note, when installing launchpad, it does not add scripts for running automatically at startup, this process has to be done manually.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Searching Source Code: LXR and grep</title>
   <link href="http://saher.io/technical/2009/11/01/searching-source-code-lxr-and-grep/"/>
   <updated>2009-11-01T23:07:02+00:00</updated>
   <id>http://saher.io/technical/2009/11/01/searching-source-code-lxr-and-grep</id>
   <content type="html">&lt;p&gt;Looking for a certain functionality in someone else's code could prove to be a tough challenge. This is increased by the size of the given project. Many systems exist today facilitating easy search in a project. For Java, eclipse is best used for that task, as it contains a strong in java class indexing, classification, and searching.&lt;/p&gt;
&lt;p&gt;Some projects provide for you a portal to search their code base. Famous examples of these are &lt;a href=&quot;http://lxr.linux.no/&quot;&gt;LXR&lt;/a&gt; for the Linux kernel, and it's customized version &lt;a href=&quot;http://mxr.mozilla.org/&quot;&gt;MXR&lt;/a&gt; used for Mozilla projects.&lt;/p&gt;
&lt;p&gt;When all the above options are not available, the alternative exists natively in most linux systems. This is namely &quot;grep&quot;. &lt;a href=&quot;http://en.wikipedia.org/wiki/Grep&quot;&gt;Grep&lt;/a&gt; is a strong command for regular expression matching. On if it's features is that it can also match to the content within files. Putting that in mind, the following command could be very useful:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; grep -R &quot;search query&quot; . &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This looks recursively for all mentions of &lt;code&gt;search query&lt;/code&gt; in all files under the current directory. This prints output in the console the file name where this query was found, and the line that included it.&lt;/p&gt;
&lt;p&gt;To be able to store this search result in a file, the output could be piped as follows:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; grep -R &quot;search query&quot; . &amp;gt; log.txt &lt;/code&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>"Bug Free Zone"</title>
   <link href="http://saher.io/opensource/2009/11/01/bug-free-zone/"/>
   <updated>2009-11-01T22:42:17+00:00</updated>
   <id>http://saher.io/opensource/2009/11/01/bug-free-zone</id>
   <content type="html">&lt;p&gt;As you can see from the title of my post, it's all about bug. But not bugs as in insects, but as in computer bugs/problems. In the &lt;a href=&quot;http://se.bigbuddysociety.net/wiki/index.php?title=OSSE&quot;&gt;open source development course&lt;/a&gt;, we were introduced to the mozilla development ecosystem.&lt;/p&gt;
&lt;p&gt;This introduction was done via &lt;a href=&quot;http://www.mozillamessaging.com/en-US/thunderbird/&quot;&gt;Thunderbird&lt;/a&gt;, the Mozilla email client. The first step was to compile a debug build for Thunderbird from source. Instructions for that could be found &lt;a href=&quot;https://developer.mozilla.org/En/Simple_Thunderbird_build&quot;&gt;here&lt;/a&gt;. Along the process, &lt;a href=&quot;http://se.bigbuddysociety.net/wiki/index.php?title=A_step_by_step_tutorial_for_building_thunderbird&quot;&gt;several bumps&lt;/a&gt; along the way were met, but managed to get by them.&lt;/p&gt;
&lt;p&gt;After the successful compilation, I had to start tackling the  the bug famous in the open source educational community. The &lt;a href=&quot;http://se.bigbuddysociety.net/wiki/index.php?title=Fixing_a_Bug_in_Thunderbird#The_Problem&quot;&gt;Thunderbird auto linkification bug&lt;/a&gt;. This bug is usually exists in Thunderbird, and usually mainly found under the &lt;a href=&quot;https://landfill.bugzilla.org/bugzilla-3.0-branch/&quot;&gt;test bugzilla&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;aligncenter size-medium wp-image-37&quot; title=&quot;Thunderbird Autolinkification Bug&quot; src=&quot;assets/thunderbird_mailto_bug.png?w=290&quot; alt=&quot;Thunderbird Autolinkification Bug&quot; width=&quot;290&quot; height=&quot;300&quot; /&gt;&lt;/p&gt;
&lt;p&gt;To start on fixing that bug, a &lt;a href=&quot;http://wp.me/pFeWE-C&quot;&gt;search of the source code&lt;/a&gt; is needed. Since Thunderbird is a Mozilla project, they offer an on-line portal for searching their code using &lt;a href=&quot;http://mxr.mozilla.org/comm-central/&quot;&gt;MXR&lt;/a&gt;. This tool searches the content of the repository. After some searching, the best query to find the file related to this problem was &quot;mailto&quot;. This is because the bug is related to the mail rendering component, when looking at it from purely a user's point of view.&lt;/p&gt;
&lt;p&gt;At finding the correct file, the hacking started. Once that was done, I generated a patch of the file i changed from inside the &lt;code&gt;comm-central/mozilla&lt;/code&gt; folder.&lt;/p&gt;
&lt;p&gt;[caption id=&quot;attachment_41&quot; align=&quot;aligncenter&quot; width=&quot;288&quot; caption=&quot;Thunderbird Bug&quot;]&lt;img class=&quot;size-medium wp-image-41 &quot; title=&quot;Thunderbird Bug&quot; src=&quot;assets/thunderbird_bug_fixed.png?w=288&quot; alt=&quot;Thunderbird Bug Fixed&quot; width=&quot;288&quot; height=&quot;300&quot; /&gt;[/caption]&lt;/p&gt;
&lt;p&gt;Once the results of my fixing looked promising, i decided to submit a bug report on the test bugzilla containing a patch. But before the submission, i decided to test my patch first on an &lt;a href=&quot;http://beaufour.dk/jst-review/&quot;&gt;automated reviewer&lt;/a&gt;. To my surprise, it showed me problems that would have never came up on my mind.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[caption id=&quot;attachment_42&quot; align=&quot;aligncenter&quot; width=&quot;450&quot; caption=&quot;JST Review&quot;]&lt;img class=&quot;size-full wp-image-42 &quot; title=&quot;JST Review&quot; src=&quot;assets/rev1.png&quot; alt=&quot;JST Review&quot; width=&quot;450&quot; height=&quot;111&quot; /&gt;[/caption]&lt;/p&gt;
&lt;p&gt;Passing the automated reviewer gives one a boost of confidence, even if it responds to you with the message of &quot;Congratulations! I found no coding problems in your patch. That does not mean that it is ready for check in though... you still need to pass something more intelligent than a script. :-)&quot;.&lt;/p&gt;
&lt;p&gt;Now, it was time to submit the bug, attach the patch, and request review. This was amazingly simple. Just filling a form, being very detailed, and attaching the patch file. After the &lt;a href=&quot;https://landfill.bugzilla.org/bugzilla-3.0-branch/show_bug.cgi?id=7258&quot;&gt;submission&lt;/a&gt; of the bug report, I requested reviews from 2 parties, which I am still waiting for a response for.&lt;/p&gt;
&lt;p&gt;On a final note, I found this exercise and experience very entertaining and thrilling. The rush of hacking the code, and submitting was a new feeling for me. This test experience drove me to submit an &lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=525761&quot;&gt;actual bug&lt;/a&gt; related to bespin's new refactoring code. Hopefully I get a good review on it too, and possibly a commit :D.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Converting System::String to char *</title>
   <link href="http://saher.io/technical/2009/10/31/converting-systemstring-to-char/"/>
   <updated>2009-10-31T16:05:14+00:00</updated>
   <id>http://saher.io/technical/2009/10/31/converting-systemstring-to-char</id>
   <content type="html">&lt;p&gt;The official way to convert a visual c++ System::String to a char * could be found &lt;a href=&quot;http://support.microsoft.com/kb/311259&quot;&gt;here&lt;/a&gt;. Such strings are everywhere in windows forms applications.&lt;/p&gt;
&lt;p&gt;A simpler way (for people who are used to using standard c\c++) to do the conversion is as follows:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
void string2charPtr(String ^orig, char *&amp;amp;out)&lt;br /&gt;
{&lt;br /&gt;
    int length = orig-&amp;gt;Length;&lt;br /&gt;
    out = new char[length+1];&lt;br /&gt;
    for(int i=0;i&amp;lt;length;i++)&lt;br /&gt;
        out[i] = (char) orig[i];&lt;br /&gt;
    out[length] = &amp;#039;&amp;#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Please feel free to comment on the function above.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Opensource Needs Open Internet</title>
   <link href="http://saher.io/opensource/2009/10/26/opensource-needs-open-internet/"/>
   <updated>2009-10-26T10:24:30+00:00</updated>
   <id>http://saher.io/opensource/2009/10/26/opensource-needs-open-internet</id>
   <content type="html">&lt;p&gt;When installing opensource software, dependencies are are usually downloaded over the internet.  This is done via build automation scripts. Putting this in mind, when trying to install software in a location with restricted internet access, downloading dependencies is not possible. Thus, installing software is challenging.&lt;/p&gt;
&lt;p&gt;This was seen while trying to install bespin locally. Under restricted access, was not possible. With open internet, too 3 minutes.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Processing.js:Reinventing the wheel</title>
   <link href="http://saher.io/technical/2009/10/26/processing-js-reinventing-a-10-year-old-flash-wheel/"/>
   <updated>2009-10-26T07:45:51+00:00</updated>
   <id>http://saher.io/technical/2009/10/26/processing-js-reinventing-a-10-year-old-flash-wheel</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/HTML_5&quot;&gt;HTML5&lt;/a&gt; is the new standard for web pages. One of the most exciting features that it introduces is the canvas tag. This component allows rendering vector graphics on the browser. This was not previously possible with older HTML versions.&lt;/p&gt;
&lt;p&gt;With that advancement in HTML, new JavaScript libraries emerge to be able to create vector visualizations at the client side. One of these libraries is &lt;a href=&quot;http://processingjs.org/&quot;&gt;Processing.js&lt;/a&gt;, which is a port of the &lt;a href=&quot;http://processing.org/&quot;&gt;java processing&lt;/a&gt; library.&lt;/p&gt;
&lt;p&gt;For a first look at processing, the examples show very exciting examples. But the week point of the framework shows when try to develop an application that required much interaction week. To reach such an application, the &quot;processing.js&quot; written has to be highly optimized. No room for unnecessary code execution, use of floats or doubles, cache as much as you can, etc....&lt;/p&gt;
&lt;p&gt;My other issue with &lt;a href=&quot;http://processingjs.org/&quot;&gt;Processing.js&lt;/a&gt; is the fact that they ported from the java library everything, even the syntax. This comes to be very frustrating to web developers. The first reason for that is most web developers are used to the syntax of JavaScript, so having things like &lt;code&gt;int x=0;&lt;/code&gt; and &lt;code&gt;int [] arr = new int[4];&lt;/code&gt; come as a big surprise. This could be good for the java developer, but not the the web developer.&lt;/p&gt;
&lt;p&gt;My other bone to pick with &lt;a href=&quot;http://processingjs.org/&quot;&gt;Processing.js&lt;/a&gt; is how primitive it is relative to the current state of the web. There are no components, and you can't define events on specific components. Everything  has to be done from scratch. Further strengthening the point of needing highly optimized code.&lt;/p&gt;
&lt;p&gt;Backing to the title of my post, &lt;a href=&quot;http://processingjs.org/&quot;&gt;Processing.js&lt;/a&gt; tries to provide an alternative for &lt;a href=&quot;http://en.wikipedia.org/wiki/Adobe_Flash&quot;&gt;Flash&lt;/a&gt;. In the web, the major disadvantage of Flash is it's isolation from the rest of the webpage, making it an independent entity. &lt;a href=&quot;http://processingjs.org/&quot;&gt;Processing.js&lt;/a&gt; does not over come this problem, as the visualization code for each canvas is a world of it's own. It can only access normal JavaScript code in the same page (which is possible with ActionScript 3's &lt;a href=&quot;http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html&quot;&gt;ExternalInterface&lt;/a&gt;). This problem even escalates with lack of direct communication between different canvases directly using Processing.js code. Furthermore, Flash is currently cross browser compatible, unlike the canvas tag due to it's new addition to the HTML standard.&lt;/p&gt;
&lt;p&gt;Putting all the above factors in mind, I feel that using a the much mature flash plugin libraries which are closer to web developers is the best option currently in the market until the canvas tag matures more with richer libraries.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The ubiquitous jQuery, the nouns, and the documentation</title>
   <link href="http://saher.io/opensource/2009/10/19/the-ubiquitous-jquery-the-nouns-and-the-documentation/"/>
   <updated>2009-10-19T19:19:10+00:00</updated>
   <id>http://saher.io/opensource/2009/10/19/the-ubiquitous-jquery-the-nouns-and-the-documentation</id>
   <content type="html">&lt;p&gt;With starting up the &lt;a href=&quot;http://se.bigbuddysociety.net/wiki/index.php?title=Main_Page&quot;&gt;German University in Cairo Open Source Community (g-osc)&lt;/a&gt; working along the &lt;a href=&quot;http://se.bigbuddysociety.net/wiki/index.php?title=OSSE&quot;&gt;open source course&lt;/a&gt;, we were assigned to write &lt;a href=&quot;https://ubiquity.mozilla.com/&quot;&gt;ubiquity&lt;/a&gt; commands for our community to use. This would make it easier for users to access different functionalities. I choose to build a command that would submit issues to the g-osc issue tracker.&lt;/p&gt;
&lt;p&gt;As I had some experience building very simple commands for some of my own day to day internet surfing, I decided to focus on this command a bit more to see the full potential of &lt;a href=&quot;https://ubiquity.mozilla.com/&quot;&gt;ubiquity&lt;/a&gt;. This was to provide the means of submitting an issue in the most natural way. As I went through details of the &lt;a href=&quot;https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Author_Tutorial&quot;&gt;ubiquity tutorial&lt;/a&gt;, I figured that a natural approach for defining how the command will be used is as follow:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gosc post issue {issue title} to {user issue will be assigned to} as {type of issue}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Such a formulation is similar to how it would be written in normal English.&lt;/p&gt;
&lt;p&gt;The first design question was, how will be the issue submitter be known. This is automatically figured out by &lt;a href=&quot;http://www.mediawiki.org/wiki/MediaWiki&quot;&gt;mediawiki&lt;/a&gt;, though the browser session. In other words, if a user is already logged in, then mediawiki knows this information on its own. With that issue out of the way, there was no need to write specific login functions.&lt;/p&gt;
&lt;p&gt;The next step, was to reverse engineer the issue posting form, so that &lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_(programming)&quot;&gt;AJAX&lt;/a&gt; would be able to send the information as if a user was filling the form manually.  After obtaining the form information, the next obstacal was actually send the data. This was straight forward task, due to the inclusion of the JavaScript &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; library within  ubiquity. This a very strong feature, due to &lt;a href=&quot;http://blog.creonfx.com/javascript/mootools-vs-jquery-vs-prototype-vs-yui-vs-dojo-comparison-revised&quot;&gt;strength of jQuery&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With that out of the way, the command was able to submit issues to the tracker. The next step was to be able to format the command natually, and to provide auto-completion for the available users and types of issues. This was done using &lt;a href=&quot;https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Author_Tutorial#Introduction_to_Noun_Types&quot;&gt;ubiquity nouns&lt;/a&gt;. These tell ubiquity that a certain argument has a specific format. This idea is same as auto-completion,  where the specific format is a specific set of word.  In both the users and issue types, this data has to be dynamically loaded. Again, jQuery was used to load the form page, and parse the data to obtain the data inside the combo boxes.&lt;/p&gt;
&lt;p&gt;A problem that comes up with auto-completion and loading dynamic data, is the need for doing the AJAX call with every key stoke. This is very expensive. The first solution that came to my mind was to cache the data, and refresh it every time the &lt;a href=&quot;https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Author_Tutorial#Running_on_page_load.2C_Ubiquity_load_and_startup&quot;&gt;ubiquity command line is loaded&lt;/a&gt;. Sadly, as i mentioned in a previous &lt;a href=&quot;http://saherneklawy.wordpress.com/2009/10/12/software-versions-documentation-and-the-pain/&quot;&gt;post&lt;/a&gt;, the ubiquity documentation is not very accurate. Thus this cache technique was not successful, as the function for handing the loading function was not called. The alternative solution, was to cache the content only once.&lt;/p&gt;
&lt;p&gt;With both the auto-completion working well, and a preview of the possible users present the command was complete. The complete code for the issue submission command could be found &lt;a href=&quot;http://se.bigbuddysociety.net/wiki/index.php?title=G-osc_ubiquity_commands#g-osc_post_issue&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Finding your true computer name on the network</title>
   <link href="http://saher.io/technical/2009/10/13/finding-your-true-computer-name-on-the-network/"/>
   <updated>2009-10-13T18:57:35+00:00</updated>
   <id>http://saher.io/technical/2009/10/13/finding-your-true-computer-name-on-the-network</id>
   <content type="html">&lt;p&gt;In many cases, it is essential to find the name of a computer over a local network. Such fits well when on a DHCP network, and need to always reach a certain machine.&lt;/p&gt;
&lt;p&gt;An easy way to obtain this data, is via the python &lt;a href=&quot;http://docs.python.org/library/socket.html&quot;&gt;socket&lt;/a&gt; library. The ip of the desired machine is obtained via &lt;code&gt;ipconfig&lt;/code&gt; (windows) or &lt;code&gt;ifconfig&lt;/code&gt; (linux). For the sake of the example, assume that the ip from the DHCP network is 10.0.0.5.&lt;/p&gt;
&lt;p&gt;In the python interpretor, execute the following code:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
import socket&lt;br /&gt;
true_name = socket.gethostbyaddr(&quot;10.0.0.5&quot;)[0]&lt;br /&gt;
print true_name&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The code above prints the true name of the machine, as seen on the network. This name is not always the machine name. For example the machine name could be &quot;saher-desktop&quot;, while the name on the network is &quot;saher-desktop.local&quot;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Software versions, documentation, and the PAIN</title>
   <link href="http://saher.io/opensource/2009/10/12/software-versions-documentation-and-the-pain/"/>
   <updated>2009-10-12T19:52:12+00:00</updated>
   <id>http://saher.io/opensource/2009/10/12/software-versions-documentation-and-the-pain</id>
   <content type="html">&lt;p&gt;When working on a piece of software using a framework or an API, the first source of help to rely on is the official documentation. As development on that code base continues, so does the documentation that changes accordingly. Sadly this is not always the case!!&lt;/p&gt;
&lt;p&gt;At the time of this post, the latest stable release of the &lt;a title=&quot;ubiquity&quot; href=&quot;https://ubiquity.mozilla.com/&quot; target=&quot;_blank&quot;&gt;ubiquity&lt;/a&gt; project is version 0.54  and the version pulled from mercurial is 0.55pre8. I was trying to write an &lt;a href=&quot;http://ubiquity.mozilla.com/trac/ticket/872&quot; target=&quot;_blank&quot;&gt;enhancement&lt;/a&gt; to provide feedback to a command's author. My testing environment had the latest stable version, and as the &lt;a href=&quot;https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Author_Tutorial&quot; target=&quot;_blank&quot;&gt;ubiquity wiki&lt;/a&gt; is under 0.5, I assumed it matches my currently running version. At the end of the wiki, a link is provided with the documentation of the &lt;a href=&quot;https://ubiquity.mozilla.com/hg/ubiquity-firefox/raw-file/tip/ubiquity/index.html#modules/cmdutils.js&quot; target=&quot;_blank&quot;&gt;CmdUtils&lt;/a&gt; library, containg the command &lt;code&gt;CmdUtils.getCommand(id)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Such a command is very helpful as it returns the object representing the command matching the given id. Thus, details about the command's author could be obtained, and hence sending to them feedback. Being very excited about this, I gave it a test, and to my shock nothing worked. Even to my bigger surprise, &lt;a href=&quot;http://getfirebug.com/&quot; target=&quot;_blank&quot;&gt;firebug&lt;/a&gt; that is used for &lt;a href=&quot;https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Author_Tutorial#Firebug&quot; target=&quot;_blank&quot;&gt;debuging ubiquity&lt;/a&gt; commands showed &lt;code&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;CmdUtils.getCommand is not a function&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This caught curiosity, so I opened the ubiquity extension's installation folder, and took a look at the &quot;modules/cmdutils.js&quot; file. With no surprise, the file did not contain the &lt;code&gt;CmdUtils.getCommand&lt;/code&gt; function.&lt;/p&gt;
&lt;p&gt;At the same time, &lt;a href=&quot;http://aelguindy.blogspot.com/2009/10/easy-alternative-to-svn.html&quot; target=&quot;_blank&quot;&gt;Abdallah El Guindy&lt;/a&gt; was working on the same enhancement, reached the same conclusion, but had the function correctly working. When I asked about his running ubiquity version, it as the latest development version 0.55pre8. After taking and installing that version of the code, the &quot;modules/cmdutils.js&quot; file was the one matching the current online documentation.&lt;/p&gt;
&lt;p&gt;Having the correct version number attached to the online documentation, would have saved development time and confusion. Such a problem is not restricted to the &lt;a title=&quot;ubiquity&quot; href=&quot;https://ubiquity.mozilla.com/&quot; target=&quot;_blank&quot;&gt;ubiquity&lt;/a&gt; project, but is also seen in other frameworks or APIs. The main lesson learned here, is that one has to be very careful during development, and not give up easily on finding the root of the problem.&lt;/p&gt;
&lt;p&gt;On a small side note, this same problem with &lt;a title=&quot;ubiquity&quot; href=&quot;https://ubiquity.mozilla.com/&quot; target=&quot;_blank&quot;&gt;ubiquity&lt;/a&gt; 0.54 is also in 0.55pre7 (the current latest beta). So the &lt;code&gt;CmdUtils.getCommand(id)&lt;/code&gt; is a brand new addition to the code base.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>HCI Workshop</title>
   <link href="http://saher.io/teaching/2009/10/08/hci-workshop/"/>
   <updated>2009-10-08T15:01:14+00:00</updated>
   <id>http://saher.io/teaching/2009/10/08/hci-workshop</id>
   <content type="html">&lt;p&gt;My first experience being involved in a workshop was both exciting and educational. This aimed to introduce different technologies technologies to students of the course. They would then choose a technology to work with a project of their proposal.&lt;/p&gt;
&lt;p&gt;The workshop started with my Flex presentation. I followed through the standard sequence of over viewing highlights of the framework and showing sample applications.&lt;/p&gt;
&lt;p&gt;Following my presentation was the talk by Mohamed Azab regarding Silverlight and WPF. There was a strong competition between these technologies and Flex during his talk. Such competition is always healthy and gives a chance for people to explore different options to perform the similar development tasks.&lt;/p&gt;
&lt;p&gt;The day continued with presentations regarding mobile development platforms, where interesting talks were presented by Bahia El Sharkawy (JAVA-ME) and Mariam Rady (Android Framework).&lt;/p&gt;
&lt;p&gt;The workshop concluded with my talk on Multitouch surfaces. It contained an the architecture behind building a multitouch enabled software, and the idea for detecting multiple interaction points. Furthermore, a live demo of the Mini Touch &amp;amp; Write table was demonstrated.&lt;/p&gt;
&lt;p&gt;In general, the feedback is very positive, and I hope the talks inspired the students for thinking of highly interactive application ideas.&lt;/p&gt;
</content>
 </entry>
 

</feed>
