<?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>Web side of life</title>
	<atom:link href="http://blog.ivanjovanovic.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ivanjovanovic.com</link>
	<description>by Ivan Jovanovic</description>
	<lastBuildDate>Tue, 13 Sep 2011 14:17:27 +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>CoffeeScript implementation of Conway&#8217;s Game of Life</title>
		<link>http://blog.ivanjovanovic.com/2011/08/02/coffeescript-implementation-of-conways-game-of-life/</link>
		<comments>http://blog.ivanjovanovic.com/2011/08/02/coffeescript-implementation-of-conways-game-of-life/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 07:14:48 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[jasmine]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=217</guid>
		<description><![CDATA[Over the weekend I wanted to get a bit deeper into the CoffeeScript and get around how it feels working with it. I gave myself task to do something simple  but inspiring. Therefore I implemented simple version of Conway&#8217;s Game of Life to be played in browser. Go here to see how it looks like. [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I wanted to get a bit deeper into the <a title="CoffeeScript website" href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> and get around how it feels working with it. I gave myself task to do something simple  but inspiring. Therefore I implemented simple version of Conway&#8217;s Game of Life to be played in browser. <a title="CoffeeScript Conway's Game of LIfe" href="http://blog.ivanjovanovic.com/labs/cgol/">Go here to see how it looks like</a>.</p>
<h3>CoffeeScript</h3>
<blockquote><p><strong>CoffeeScript is a little language that compiles into JavaScript.</strong> Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.</p></blockquote>
<p>In other words, CoffeeScript is an attempt to replace JavaScript syntax with a better one based on experiences from Ruby and Python worlds. Beside that it introduces couple of new abstractions which natively do not exist in the vanilla JavaScript like classes, list comprehensions, return of multiple values from function etc.</p>
<p>CoffeeScript brings a lot of relaxation on the original JavaScript syntax and makes writing it at first weird experience but only until you get used to it. Afterwards it gets obvious that it takes much less to write the same thing in CoffeeScript than in plain JavaScript.</p>
<h3>My observations on developing with CoffeeScript</h3>
<p>First and obvious observation is that with CoffeeScript you need additional tool in your toolset which will continuously compile your work to JavaScript. I used Jasmine for writing tests and I based my setup on <a href="https://gist.github.com/956438">this gist</a> which proposes using <a title="guard Ruby gem on GitHub" href="https://github.com/guard/guard">guard Ruby gem</a> for tracking changes and compiling CoffeeScript files into JavaScript ones.</p>
<p>It looked a bit weird at start, but after couple of hours playing it started getting better. One thing I had always to do is to look in the actual compiled JavaScript to see how to do some things i.e. how to pass index to function that maps an array. But it was intuitive enough that I almost didn&#8217;t need official documentation. Here I have to tell that it might not be as intuitive to people without experience with writing Ruby and Python code or lack of understanding for rather mathematical</p>
<pre class="brush: jscript; title: ; notranslate">(a, b) -&gt; a + b</pre>
<p>function notation.</p>
<p>At the end I really liked it. Problem that I was solving didn&#8217;t need using some advanced CoffeeScript constructs like classes but one that I used like multiple return values from the function really show how much you can get out of language if you have some basic tools implemented within.</p>
<p>Last several months I was developing mostly in the Rails framework and since <a title="Ruby on Rails 3.1 enabling CoffeeScript by default" href="http://weblog.rubyonrails.org/2011/5/22/rails-3-1-release-candidate">Rails 3.1</a> is going to have CoffeeScript enabled by default I suppose I&#8217;ll give CoffeeScript a chance again in next months and write more about experiences developing more complex things again in future.</p>
<h3>Code is on GitHub</h3>
<p>You can find the source code for the implementation of the game on <a title="Source code for CoffeeScript implementation of Conway's Game of Life" href="https://github.com/ivanjovanovic/coffee-cgol">GitHub</a></p>
<h3>Related links</h3>
<ul>
<li><a title="CoffeeScript implementation of Conway's Game of Life" href="http://blog.ivanjovanovic.com/labs/cgol/">My CoffeeScript implementation of Conway&#8217;s Game of Life</a></li>
<li><a title="CoffeeScript official page" href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a></li>
<li><a title="Conway's game of life on Wikipedia" href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">Conway&#8217;s Game of LIfe on Wikipedia</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2011/08/02/coffeescript-implementation-of-conways-game-of-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to JavaScript BDD testing with Jasmine library</title>
		<link>http://blog.ivanjovanovic.com/2011/07/22/introduction-to-javascript-bdd-testing-with-jasmine-library/</link>
		<comments>http://blog.ivanjovanovic.com/2011/07/22/introduction-to-javascript-bdd-testing-with-jasmine-library/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 21:03:31 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[jasmine]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=203</guid>
		<description><![CDATA[If we look at the developments in the software testing area, step beyond in evolution after TDD is, so called, BDD (Behavior Deriven Development). It is hard to describe BDD in couple of sentences. Excerpt taken from Wikipedia says: BDD focuses on obtaining a clear understanding of desired software behaviour through discussion with stakeholders. It extends TDD by writing test [...]]]></description>
			<content:encoded><![CDATA[<p>If we look at the developments in the software testing area, step beyond in evolution after <a title="Razvoj vođen testovima" href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a> is, so called, <a title="Razvoj softvera vođen ponašanjem" href="http://en.wikipedia.org/wiki/Behavior_Driven_Development">BDD</a> (Behavior Deriven Development). It is hard to describe BDD in couple of sentences. Excerpt taken from Wikipedia says:</p>
<blockquote><p>BDD focuses on obtaining a clear understanding of desired software behaviour through discussion with stakeholders. It extends <a title="Test-driven development" href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a> by writing test cases in a natural language that non-programmers can read. Behavior-driven developers use their native language to describe the purpose and benefit of their code. This allows the developers to focus on why the code should be created, rather than the technical details, and minimizes translation between the technical language in which the code is written and the domain language spoken by the business, users, stakeholders, project management, etc.</p></blockquote>
<p>If this looks a bit complicated, in one sentence it would mean: <strong>BDD helps programmers and non-technical stakeholders understand each other better and develop software which will be the most representative model of the problem solved by writing the software  itself. </strong></p>
<h2>Jasmine: BDD for your JavaScript</h2>
<p><a title="Jasmine: BDD za vaš JavaScript" href="http://pivotal.github.com/jasmine/">Jasmine</a> is a library for BDD testing of your JavaScript. It offers range of possibilities to describe software functionalities by simple and descriptive tests, which is one of the basic principles of BDD based development. This way tests usually serve as the most accurate software documentation. More about Jasmine library on the <a title="Jasmine na GitHub" href="https://github.com/pivotal/jasmine">GitHub repository</a>.</p>
<p>After you download standalone Jasmine distribution from <a title="Nezavisna distribucija Jasmine biblioteke" href="http://pivotal.github.com/jasmine/download.html">here</a> you&#8217;ll find in the archive all you need to write your first tests together with the example of your code organization. The most important fie is <strong>SpecRunner.html</strong> which, when run in browser, will execute tests and give you report about the state of the tests. SpecRunner.html is very simple and self explanatory. <strong>lib</strong> folder contains Jasmine library, <strong>src</strong> folder contains code to be tested and  <strong>spec</strong> folder contains actual software specifications as tests.</p>
<p>Further, I will implement simple object that can register multiple callback functions and call them with given data. Something like simple observer. I will always first write tests and then implement functionality to make tests pass.</p>
<h2>Example of simple JavaScript observer with Jasmine tests</h2>
<p>We start from the downloaded archive for standalone Jasmine library. We need to delete example code provided with the library to implement our own example.</p>
<pre class="brush: bash; title: ; notranslate">cd jasmine-standalone # folder in which we extracted downloaded archive
rm src/*
rm spec/*</pre>
<p>Also, from <code>SpecRunner.html</code> file we delete references to just removed scripts. Therefore, part which includes them stays empty like this:</p>
<pre class="brush: jscript; html-script: true; title: ; notranslate">
...

  &lt;!-- include source files here... --&gt;

  &lt;!-- include spec files here... --&gt;

...
</pre>
<h3>First test</h3>
<p>In TDD and BDD philosophy one rule is essential for success.</p>
<blockquote><p>First you write the test which will at the beginning fail, then you implement code which should satisfy specification described by test. Then, you execute test and continue with implementation until test passes. When that happens you know that implementation is OK.</p></blockquote>
<p>According to this we create file to place our tests in <code>spec/ObserverSpec.js</code> and we define first test to simply check existence of the observer object.</p>
<pre class="brush: jscript; title: ; notranslate">
describe(&quot;rs.ji.observer&quot;, function () {

    it(&quot;should be present in the global namespace&quot;, function () {
        expect(rs.ji.observer).toBeDefined();
    });

});
</pre>
<p>And we add this specification to <code>SpecRunner.html</code> to execute it:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- include spec files here... --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;spec/ObserverSpec.js&quot;&gt;&lt;/script&gt;
</pre>
<p>If we now open <code>SpecRunner.html</code> in some browser (i.e. Google Chrome) we will see one failing test.</p>
<p>It is important to take a look in how our test looks like. If you read the test you&#8217;ll see how descriptive it is and how with simple words expresses how our code should behave, although example is very simple. Here it takes some creativity of the developer to make tests really valuable but more than that is important that developer have deep understanding of the dictionary and terminology of the domain for which software is developed because understanding of the domain should be heavily embedded in the test definitions.</p>
<p>Next step is to implement the code which will satisfy test. We will create file <code>src/observer.js</code></p>
<pre class="brush: jscript; title: ; notranslate">
// defining so called namespace objects so I can namespace observer into
// rs.ji.observer
var rs = {};
rs.ji = {};

// observer implementation
rs.ji.observer = {};
</pre>
<p>And we will add it to <code>SpecRunner.html</code>:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- include source files here... --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;src/observer.js&quot;&gt;&lt;/script&gt;
</pre>
<p>If we run <code>SpecRunner.html</code> again, we can see that our test passes, it is green <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Rest of implementation</h3>
<p>Now, when we know for the principle  <strong>&#8220;First failing test, then implementation&#8221;</strong> we can add new functionalities to our simple example. We add next test:</p>
<pre class="brush: jscript; title: ; notranslate">
    it(&quot;should be able to register callback function&quot;, function () {
        // define function to be placed into the observer register
        function callback() { return null; }
        rs.ji.observer.register(callback);
        var callbacks = rs.ji.observer.getCallbacks();
        expect(callbacks.length).toBe(1);
        expect(callbacks[0]).toBe(callback);
    });
</pre>
<p>And implementation that makes this test pass:</p>
<pre class="brush: jscript; title: ; notranslate">
rs.ji.observer = {
    callbacks: [],
    register: function (callback) {
        this.callbacks.push(callback);
    },
    getCallbacks: function () {
        return this.callbacks;
    }
};
</pre>
<p>We want to check if we can register multiple callbacks. This functionality should be supported already, but we write test to confirm this:</p>
<pre class="brush: jscript; title: ; notranslate">
    // before every test we reset array of callbacks
    beforeEach(function () {
        rs.ji.observer.callbacks = [];
    });

    it(&quot;should be able to register multiple callbacks&quot;, function () {
        function callback1() { return null; }
        function callback2() { return null; }
        rs.ji.observer.register(callback1);
        rs.ji.observer.register(callback2);
        var callbacks = rs.ji.observer.getCallbacks();
        expect(callbacks.length).toBe(2);
        expect(callbacks[0]).toBe(callback1);
        expect(callbacks[1]).toBe(callback2);
    });
</pre>
<p>Programmers often use <code>print, echo</code> and friends to test code for certain functionalities. That takes time as for writing a test, but from other side tests are possible to be executed all the time after this initial check is done even when we move to implement something else.</p>
<p>If we run <code>SpecRunner.html</code> in browser, all tests should pass.</p>
<p>Last thing our observer should do to satisfy its basic purpose is to update callback functions with some new information. That means it should be able to call them with some data. To define this functionality we write new test:</p>
<pre class="brush: jscript; title: ; notranslate">
    it(&quot;should provide update method to execute all callbacks with provided data&quot;, function () {
        window.callback1 = function () { return null; }
        window.callback2 = function () { return null; }
        spyOn(window, 'callback1');
        spyOn(window, 'callback2');
        rs.ji.observer.register(window.callback1);
        rs.ji.observer.register(window.callback2);
        rs.ji.observer.update(&quot;data string&quot;);
        expect(window.callback1).toHaveBeenCalledWith(&quot;data string&quot;);
        expect(window.callback2).toHaveBeenCalledWith(&quot;data string&quot;);
    });
</pre>
<p>Here we use some advanced techniques of <a title="Jasmine špijuniranje metoda" href="https://github.com/pivotal/jasmine/wiki/Spies">spying on methods</a> (SpyOn) in order to see if some method is called while other is executed.</p>
<p>As a helper, we will add <a title="jQuery biblioteka" href="http://code.jquery.com/jquery-1.6.2.min.js">jQuery library</a> to <code>src/jquery.js</code> location and add it to <code>SpecRunner.html</code> file:</p>
<pre class="brush: xml; highlight: [2]; title: ; notranslate">
&lt;!-- include source files here... --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;src/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;src/observer.js&quot;&gt;&lt;/script&gt;
</pre>
<p>And we implement code to satisfy the test:</p>
<pre class="brush: jscript; highlight: [11,12,13,14,15,16,17]; title: ; notranslate">
// observer implementation
rs.ji.observer = {
    callbacks: [],
    register: function (callback) {
        this.callbacks.push(callback);
    },
    getCallbacks: function () {
        return this.callbacks;
    },

    // added update method to inform registered callbacks
    // uses jQuery to iterate over the array
    update: function(data) {
        $.each(this.callbacks, function (i, callback) {
            callback.call(null, data); // call every callback with provided data
        });
    }
};
</pre>
<h2>Complete picutre</h2>
<p>That is it, now we have full implementation of simple observer with tests that can pretty clearly describe functionalities of the software we developed and they can as well prove in every time that needed functionalities are working OK by executing them in the browser (or different browsers to see if they will work in all of them).</p>
<p>Complete files:</p>
<pre class="brush: jscript; collapse: true; light: false; title: spec/ObserverSpec.js; toolbar: true; notranslate">
describe(&quot;rs.ji.observer&quot;, function () {

    beforeEach(function () {
        rs.ji.observer.callbacks = [];
    });

    it(&quot;should be present in the global namespace&quot;, function () {
        expect(rs.ji.observer).toBeDefined();
    });

    it(&quot;should be able to register callback function&quot;, function () {
        // define anonymous function to be placed into the observer register
        function callback() { return null; }
        rs.ji.observer.register(callback);
        var callbacks = rs.ji.observer.getCallbacks();
        expect(callbacks.length).toBe(1);
        expect(callbacks[0]).toBe(callback); // so we need to have first funtion in registered callbacks
    });

    it(&quot;should be able to register multiple callbacks&quot;, function () {
        function callback1() { return null; }
        function callback2() { return null; }
        rs.ji.observer.register(callback1);
        rs.ji.observer.register(callback2);
        var callbacks = rs.ji.observer.getCallbacks();
        expect(callbacks.length).toBe(2);
        expect(callbacks[0]).toBe(callback1);
        expect(callbacks[1]).toBe(callback2);
    });

    it(&quot;should provide update method to execute all callbacks with provided data&quot;, function () {
        window.callback1 = function () { return null; }
        window.callback2 = function () { return null; }
        spyOn(window, 'callback1');
        spyOn(window, 'callback2');
        rs.ji.observer.register(window.callback1);
        rs.ji.observer.register(window.callback2);
        rs.ji.observer.update(&quot;data string&quot;);
        expect(window.callback1).toHaveBeenCalledWith(&quot;data string&quot;);
        expect(window.callback2).toHaveBeenCalledWith(&quot;data string&quot;);
    });
});
</pre>
<pre class="brush: jscript; collapse: true; light: false; title: src/observer.js; toolbar: true; notranslate">
// defining so called namespace objects so I can namespace observer into
// rs.ji.observer
var rs = {};
rs.ji = {};

// observer implementation
rs.ji.observer = {
    callbacks: [],
    register: function (callback) {
        this.callbacks.push(callback);
    },
    getCallbacks: function () {
        return this.callbacks;
    },
    update: function(data) {
        $.each(this.callbacks, function (i, callback) {
            callback.call(null, data);
        });
    }

};
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2011/07/22/introduction-to-javascript-bdd-testing-with-jasmine-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why (I think) Khan Academy really matters.</title>
		<link>http://blog.ivanjovanovic.com/2011/06/09/why-khan-academy-really-matters/</link>
		<comments>http://blog.ivanjovanovic.com/2011/06/09/why-khan-academy-really-matters/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 22:12:07 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[community]]></category>
		<category><![CDATA[khan academy]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=174</guid>
		<description><![CDATA[Today I made first translation to Serbian on Khan Academy and this post is about why I loved doing it and why I think it really matters. If you havent heard of Khan Academy yet you should immediately get out that rock you are hiding under. No joke, Khan Academy is a big thing. Watch this [...]]]></description>
			<content:encoded><![CDATA[<p>Today I made <a title="Serbian translation of Khan Academy video" href="http://www.universalsubtitles.org/en/videos/2QEdZnl4jZvK/sr/115753/">first translation to Serbian on Khan Academy</a> and this post is about why I loved doing it and why I think it really matters.</p>
<p>If you havent heard of <a title="Khan Academy" href="http://www.khanacademy.org/">Khan Academy</a> yet you should immediately get out that rock you are hiding under. No joke, Khan Academy is a big thing. Watch <a title="Salman Khan TED talk" href="http://www.ted.com/talks/salman_khan_let_s_use_video_to_reinvent_education.html">this TED talk</a> to see how amazing is what Salman Khan is doing. I was really happy when I saw that <a href="http://ejohn.org/">John Resig of jQuery fame</a> has <a href="http://ejohn.org/blog/next-steps-in-2011/">joined their crew</a> to help bringing this extraordinary mission to the next level. It is really extraordinary, especially for the times of today when everything is in profits and money. But it doesn&#8217;t matter only because of that.</p>
<p>I come from Serbia, country which is in kind of development. Last 20 years where not that good for us. Degradation of every part of society to the critical level happened during that time. People mostly without jobs, hope and will to go forward despite the fact that time passes by them fast. Yes, time passes by and developed world is changing even faster every day. And if you stand still for 20 years, you can imagine how far world goes in front of you. It goes so far that you, from your own point of view don&#8217;t understand any more all that modern development and trends.</p>
<p>So the big question for countries like Serbia is how do they catch up with the modern world. How do you learn things you have to know when you don&#8217;t have access to good and innovative education, have no great people to lead the country because they are all spread around the world. Well, there are options. And improving education of people is in the core of all of them. In this context Khan Academy really matters. Not as final solution but more as announcement of future where education is going to be much less institutionalized and much easier spread across the globe, especially in the countries which need this the most.</p>
<p>Internet has evolved to a point where it is becoming a platform for spreading something more than Facebook and Farmville. Recently I watched <a title="Chris Anderson on TED.com" href="http://www.ted.com/talks/lang/eng/chris_anderson_how_web_video_powers_global_innovation.html">TED talk of Chris Anderson</a> on how web video powers global innovation and I could not agree more. And Khan Academy proves this in practice on a high scale and is able to motivate thousands to join the train of global education improvement and to bring it to the higher level. This might lead to looking at the education in whole lot different ways than before and using peoples potential most efficiently to solve problems of underdeveloped communities. It brings some hope at least.</p>
<p style="text-align: center;"><!--copy and paste--><object width="446" height="326"><param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"></param><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"></param><param name="bgColor" value="#ffffff"></param> <param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/SalmanKhan_2011-medium.flv&su=http://images.ted.com/images/ted/tedindex/embed-posters/SalmanKhan-2011.embed_thumbnail.jpg&vw=432&vh=240&ap=0&ti=1090&lang=scc&introDuration=15330&adDuration=4000&postAdDuration=830&adKeys=talk=salman_khan_let_s_use_video_to_reinvent_education;year=2011;theme=new_on_ted_com;theme=a_taste_of_ted2011;event=TED2011;&preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" allowScriptAccess="always" flashvars="vu=http://video.ted.com/talks/dynamic/SalmanKhan_2011-medium.flv&su=http://images.ted.com/images/ted/tedindex/embed-posters/SalmanKhan-2011.embed_thumbnail.jpg&vw=432&vh=240&ap=0&ti=1090&lang=scc&introDuration=15330&adDuration=4000&postAdDuration=830&adKeys=talk=salman_khan_let_s_use_video_to_reinvent_education;year=2011;theme=new_on_ted_com;theme=a_taste_of_ted2011;event=TED2011;"></embed></object></p>
<p>Currently I live in Switzerland, country blessed by the best standard in the world and really great performance in every aspect, from administration to education. One thing I see here is that people are not aware enough how others in the world live and when aware it is on the level of general empathy and not on the level of doing something with it. Paradoxically, countries like this can give the most to the world, not only by sharing money but experiences and knowledge about their success as well. Internet in this case might be a great leverage for small and great ones to influence world wide.</p>
<p>Considering all of this, I though I could be one among this army of good people to help on this idea. I&#8217;ll try to contribute on this topic as much as I can in my spare time and motivate others to do the same. Translating as much videos to Serbian would be one of primary goals and promoting the idea as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2011/06/09/why-khan-academy-really-matters/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Random Hacks of Kindness &#8211; building a better world commit by commit</title>
		<link>http://blog.ivanjovanovic.com/2011/06/06/random-hacks-of-kindness-building-better-world-commit-by-commit/</link>
		<comments>http://blog.ivanjovanovic.com/2011/06/06/random-hacks-of-kindness-building-better-world-commit-by-commit/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 22:40:50 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[community]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[rhok]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=153</guid>
		<description><![CDATA[It was long time ago since I realized that every discussions about this or that technology falls into water without putting it in the context of the real-world problem. And, unfortunately, real world today doesn&#8217;t lack problems. What it lacks are people of good will to solve them, or at least good people lack organization [...]]]></description>
			<content:encoded><![CDATA[<p>It was long time ago since I realized that every discussions about this or that technology falls into water without putting it in the context of the real-world problem. And, unfortunately, real world today doesn&#8217;t lack problems. What it lacks are people of good will to solve them, or at least good people lack organization and coordination in order to efficiently solve these problems.<br />
<a href="http://www.rhok.org/about">Random Hacks of Kindness</a> project was started with idea to address this problem.</p>
<blockquote><p>RHoK works by bringing together experts in development and volunteers with a broad set of skills in software development and design to solve problems defined by NGOs and other institutions which work in the area of disaster management.</p></blockquote>
<p>Last weekend RHoK happend for the first time in Switzerland. <a href="http://wernerkrippendorf.blogspot.com/">Frank</a>, driven by his experience from RHoK #2 in Berlin, organized great event in Basel and gathered around 20 of us to attack some of the <a href="http://www.rhok.org/problems">RHoK problem definitions</a> we found interesting. On the following video you can see presentations of all the teams, their problem definitions and explanations of solutions.</p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/3y-afSoX_YA?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/3y-afSoX_YA?version=3" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>I worked with <a href="http://www.rhok.org/users/mullinger">Max</a>, <a href="http://www.rhok.org/users/philipp">Phillip</a>, <a href="http://www.rhok.org/users/delixfe">Felix</a>, <a href="http://www.rhok.org/users/tomtomaso">Thomas</a> and Chad from <a href="http://www.secondmuse.com">SecondMuse</a> on the <a href="http://www.rhok.org/problems/hazards-map-field-use">problem defined by Caritas Switzerland</a>. Overall idea was to gather different sources of scientific GIS data for different global community risk related information like percentage of child hunger per country or intensity of cyclones in coastal areas and to present this information in usable way on one map with some tools to examine data more deep. Technically, the most difficult part of the problem is the fact that, as far I could understand, GIS area lacks standardization of data exchange file formats, and getting head around this domain in 2 days is really hard. We did not finish much on the practical side, but we examined the problem from technical side and came to deeper understanding of the problem domain and some ideas how it can be solved properly in future. One visible thing we made is <a href="http://blog.ivanjovanovic.com/labs/chm/">half-working prototype</a> of Google Map with two custom tile layers, more like proof of concept for our idea.</p>
<div class="wp-caption aligncenter" style="width: 586px"><img class=" " title="Me, explaining our solution" src="http://farm3.static.flickr.com/2559/5801680178_e18be382ff_z.jpg" alt="" width="576" height="383" /><p class="wp-caption-text">Me, explaining our solution</p></div>
<p><a href="http://oleg.utou.ch/">Oleg</a>, who worked on the Person finder problem, gave <a title="Olegs overview of RHoK Basel" href="http://ol.posterous.com/random-hacks-of-kindness-basel">great overview of the whole RHoK Basel event on his blog</a>.</p>
<p>Beside great time, meeting great people and working on challenging problem I found that participating to this event additionally boosted my motivation to get deeper into non-technical side of problems of communities around the world. Also I became more aware how important is to motivate people to put some effort into solving this kind of problems and how easy is to help if proper environment is set and some basic organization is provided.</p>
<p>On the line of organization, I liked that we could give the input about how we could improve the event organization for future. I found couple of possible optimizations of the process which might help me achieve better results next time:</p>
<ul>
<li>As software developer I&#8217;m sensitive to quality of requirements. Problem definitions, as given today, are definitely not the best to work with. If we could <strong>involve engineers in the problem definition process</strong> before problem definition comes for implementation it might help to get more done during the short and intense 2 days of hacking. And even more important maybe is to <strong>have the problem owner present in place for all time during the event</strong>. This not only helps team but even more helps them to understand the problem better for future.</li>
<li>The way teams are formed is not the most efficient. Although, getting together with group of completely unfamiliar people is personally great and can lead to lot of innovation, it makes continuity a bit harder. Working with people you know and trust is from other side more efficient but can lead to not that innovative approaches. If these could be combined in a way I&#8217;m sure we could achieve better results and insure better continuity which is essential for finishing the project to some usable state. Therefore I&#8217;ll try to make effort to<strong> form a team for next RHoK and try to stick to a problem until it is finished at least in the basic version</strong>.</li>
<li><strong>Event should be promoted to the broader audience</strong> and involve more different professions like <strong>designers, usability experts, product owners, scrum masters</strong> and other involved in agile software development which is I believe the most appropriate for this way of attacking problems.</li>
<li>In future whole RHoK idea should be expanded to <strong>involve problem areas other than disaster management</strong>. I would personally be the most interested in problems related to online education of countries in development, and others certainly have their own preferences as well. This way we might gather much bigger community around it.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 586px"><img class="  " title="RHoK #3 Basel participants" src="http://farm4.static.flickr.com/3475/5801145819_ee4b6a5841_z.jpg" alt="" width="576" height="383" /><p class="wp-caption-text">RHoK #3 Basel participants</p></div>
<p>And of course, next time consider to join</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2011/06/06/random-hacks-of-kindness-building-better-world-commit-by-commit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Am I stupid, or is that = this stupid?</title>
		<link>http://blog.ivanjovanovic.com/2011/04/27/am-i-stupid-or-is-that-this-stupid/</link>
		<comments>http://blog.ivanjovanovic.com/2011/04/27/am-i-stupid-or-is-that-this-stupid/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 22:26:06 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=147</guid>
		<description><![CDATA[JavaScript development has got really much momentum and its popularity is peaking. In the moment of design it was probably never foreseen as such success. Maybe that is why we have to satisfy to using only its &#8220;Good Parts&#8221;. There are lot of compromises with it, in order to make programming it a success overall. [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript development has got really much momentum and its popularity is peaking. In the moment of design it was probably never foreseen as such success. Maybe that is why we have to satisfy to using only its <a title="No affiliates ;)" href="http://www.amazon.com/exec/obidos/ASIN/0596517742/">&#8220;Good Parts&#8221;</a>. There are lot of compromises with it, in order to make programming it a success overall. One thing that I always found weird is usage of <strong>that = this</strong> concept. JavaScript guru <a title="The guy that is bravely hiding Chuck Norris on the picture" href="http://www.crockford.com/">Douglas Crockford</a> <a href="http://javascript.crockford.com/private.html">explains on his website</a> this concept of preserving connection of method with parent object regardless of the context of invocation. In practical usage I saw this pattern used for essentially the same reason but on other places. Consider this example (code purpose and quality in general do not matter that much)</p>
<pre class="brush: jscript; highlight: [4]; title: ; notranslate">
// Returns array of positions of current players on the field
tofu.Table.prototype.getPlayerPositions = function() {
    var positions = [];
    var that = this
    $.each(this.rods,
    function(i, rod) {
        var left = that.getRodDistance(i)
        // produce positions for all players
        for (var j = 0; j &amp; lt; rod.men_number; j++) {
            var position = {
                left: left,
                top: j * rod.men_distance + rod.position
            }
            positions.push(position);
        }
    });
    return positions;
}
</pre>
<p>The main point here is that we try to preserve reference to parent object with <strong>var that = this</strong> because $.each(this.rods, &#8230; ) will overwrite reference to local variable <strong>this</strong>. In that case we access closure reference <strong>that</strong> to refer to our original object.</p>
<p>And there is a problem, I keep seeing this pattern all around. As I understand programming, proper naming of &#8220;things&#8221; is very important. And one that calls everything around in the terms of <strong>this</strong> and <strong>that</strong> might not be considered much smart <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Can&#8217;t we have a name for <strong>that</strong> reference. Considering same example with small change in code I think it looks more natural than before and more readable and self explainable</p>
<pre class="brush: jscript; highlight: [4]; title: ; notranslate">
// Returns array of positions of current players on the field
tofu.Table.prototype.getPlayerPositions = function() {
    var positions = [];
    var table = this
    $.each(this.rods,
    function(i, rod) {
        var left = table.getRodDistance(i)
        // produce positions for all players
        for (var j = 0; j &amp; lt; rod.men_number; j++) {
            var position = {
                left: left,
                top: j * rod.men_distance + rod.position
            }
            positions.push(position);
        }
    });
    return positions;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2011/04/27/am-i-stupid-or-is-that-this-stupid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting around first steps with Git</title>
		<link>http://blog.ivanjovanovic.com/2011/03/25/getting-around-first-steps-with-git/</link>
		<comments>http://blog.ivanjovanovic.com/2011/03/25/getting-around-first-steps-with-git/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 15:35:00 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=112</guid>
		<description><![CDATA[So, your pain threshold limits are exhausted by everyday use of your current version control software (SVN, CVS anyone?). You are looking for another solution to version control problems and you start exploring Git. You heard that it is really cool, but now you&#8217;re getting hands on to figure out how cool it really is. [...]]]></description>
			<content:encoded><![CDATA[<p>So, your pain threshold limits are exhausted by everyday use of your current version control software (SVN, CVS anyone?). You are looking for another solution to version control problems and you start exploring <a href="http://git-scm.com/">Git</a>. You heard that it is really cool, but now you&#8217;re getting hands on to figure out how cool it really is.</p>
<p>For start, you should know that <a title="Git basics" href="http://progit.org/book/ch1-3.html">Git is different</a>. Your current mindset will drive you into using it the same way you used SVN, but very soon you&#8217;ll find out that if you don&#8217;t start working on your mindset, using Git can become more a problem than a solution. Fortunately, <a href="http://progit.org/book/">Pro Git book</a> is available online for free and I highly recommend going through it with understanding.<span id="more-112"></span></p>
<p>If there is a list of things to understand and clarify at start that I would recommend:</p>
<ul>
<li><a href="http://progit.org/book/ch2-0.html">Git basics</a></li>
<li>track -&gt; edit -&gt; stage -&gt; commit -&gt; push file lifecycle</li>
<li><a href="http://stackoverflow.com/questions/292357/whats-the-difference-between-git-pull-and-git-fetch">fetching vs pulling</a> changes from remote origin</li>
<li>every Git repository of a project <a href="http://progit.org/book/ch3-5.html">represents part of one common history</a>, your local branches are just one part of it, remote origin as well and repositories of your colleagues too.</li>
<li><a href="http://progit.org/book/ch3-0.html">working with branches</a> properly and efficiently</li>
<li><a href="http://progit.org/book/ch7-1.html">managing configuration</a> of your local repository and global Git configuration</li>
</ul>
<p>I&#8217;m new to Git and I had some basic questions to answer for myself, and afterwards I saw others asking again the same things. If I would take a couple of them to answer that would be these.</p>
<h3>Git autocompletion</h3>
<p>Great tool to explore and learn Git commands during your everyday work. It is easy to set up and invaluable to have it.</p>
<p>First download the git-completion.bash file</p>
<pre class="brush: bash; title: ; notranslate">cd # to go to your home folder
curl https://github.com/git/git/raw/master/contrib/completion/git-completion.bash -O</pre>
<p>and then add this line to your ~/.bash_profile or however you name your profile file</p>
<pre class="brush: bash; title: ; notranslate">source ~/git-completion.bash</pre>
<h3>Checking out remote branch</h3>
<p>Someone pushed new branch to remote repository and you are having tough time to start working on it. Use</p>
<pre class="brush: bash; title: ; notranslate">git fetch</pre>
<p>this will fetch all remote branches and put them in local repository</p>
<pre class="brush: bash; title: ; notranslate">git checkout -b local-branch-name origin/remote-branch-name</pre>
<p>will check out branch and set tracking between local and remote branch properly for you.</p>
<h3>Pushing and pulling only to and from current branch</h3>
<p>After you have finished your work on a branch, you want to push your changes. But git push command by default pushes changes from all branches if no other parameters are given. It can be configured in general to push only current branch with</p>
<pre class="brush: bash; title: ; notranslate">git config push.default current</pre>
<p>Regarding puling is a bit more complicated, since this is the option to be set for each branch. Probably it can be generalized. For example, you can have  a remote branch called funky-branch which is on the origin remote repository and local branch with same name funky-branch. Then we can pull only its changes if we set following config options for this local branch</p>
<pre class="brush: bash; title: ; notranslate">git config branch.funky-branch.remote origin
git config branch.funky-branch.merge refs/heads/funky-branch</pre>
<p>now git pull works without pulling other branches along the way.</p>
<p>There are of course numerous more questions to answer regarding Git, but when you touch the ground with your own feet, you&#8217;ll get to answer them really quickly since it has a <a href="http://git-scm.com/documentation">great documentation</a> and an active community.</p>
<p>Git is extremely powerful and incredibly fast tool which enables us to make some really complicated development scenarios easy to manage. On the other hand it can often look like a kind of magic since there is a bit more to understand of it comparing to centralized version control solutions. One thing that is obvious after some weeks of everyday usage of Git is that it fits really good to the way my mind works during development. If you still have doubts, give it a try, it might even help <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Making current git branch visible in your command prompt</h3>
<p>Git is known for powerful branching possibilities. Although, it is hard to shuffle between branches and to always know in which you are currently. There is simple solution to this. You can add name of current branch to your command prompt by adding this to your shell profile script.</p>
<pre class="brush: bash; title: ; notranslate">
# Set up git branch information in command prompt
parse_git_branch() {
git branch 2&gt; /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
# Example of use of the function in command prompt $(parse_git_branch)
PS1=&quot;\w\$(parse_git_branch) $ &quot;
</pre>
<p>After resourcing your shell profile you&#8217;ll see current checkout branch name in command prompt whenever you enter git workspace folder.</p>
<h3>Selecting only part of a change for commit</h3>
<p>Usually changes we make are not perfectly clean, or currently changed files contain at least two unrelated changes. Git provides the way to select only a part of all the changes and stage them for commit. It is done by using:</p>
<pre class="brush: bash; title: ; notranslate">git app -p</pre>
<p>Then you would have a change to decide on every group of lines weather to include it or not, you can even split it to parts so you can select more granular way &#8230;</p>
<h3>Cleaning up repository with garbage collection</h3>
<p>Git doesn&#8217;t do garbage collection on the repositories by default which has couple of advantages. Commands don&#8217;t lose time to prune objects all the time and you have kind of history to refer to locally. But, over time it gets slower, which can be fixed with activating garbage collection.</p>
<pre class="brush: jscript; title: ; notranslate">
git gc --prune
// or check `man git-gc` for more information about git garbage collection
</pre>
<p>&nbsp;</p>
<h3>Getting up to more speed</h3>
<p><a title="Six Revisions Git resources" href="http://sixrevisions.com/resources/git-tutorials-beginners/">Here</a> you can find extensive list of resources for learning Git with selection of top 10 sites that provide the best resources online.</p>
<p>After you have finished the basics you can proceed with more advanced topics. This <a href="http://nuclearsquid.com/writings/git-tricks-tips-workflows.html">great post from Markus Prinz </a> can help you with optimizing Git for more advanced and more personalized workflows.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2011/03/25/getting-around-first-steps-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextMate for PHP development</title>
		<link>http://blog.ivanjovanovic.com/2010/12/29/textmate-for-php-development/</link>
		<comments>http://blog.ivanjovanovic.com/2010/12/29/textmate-for-php-development/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 00:08:18 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=97</guid>
		<description><![CDATA[If you want to improve your productivity and programming skills in general, getting to know better the tools you use every day is one of  the important things to invest your time in. Keyboard shortcuts of your favorite editor are especially important and using them in your daily routine will save you lot of hand [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to improve your productivity and programming skills in general, getting to know better the tools you use every day is one of  the important things to invest your time in. Keyboard shortcuts of your favorite editor are especially important and using them in your daily routine will save you lot of hand movements towards mouse, lot of context switching and will help you focus on what is important.</p>
<p>I use TextMate for everyday PHP development and I find it excellent. There are some features that more complex IDEs provide out of the box, but after you get used to work with TextMate and learn how to be productive you can hardly find better option. Keyboard shortcuts are one of its good parts and key to boosting your productivity.</p>
<p><span id="more-97"></span></p>
<p>There are some general purpose shortcuts that will work on any type of document, therefore on PHP files as well.</p>
<p>Regarding the notation: <strong>A + B</strong> means press in same time, <strong>A -&gt; B</strong> means type A and then after it press B</p>
<ul>
<li><strong>mate filename1 filename2</strong> &#8211; you can always start TextMate from command line and give list of files/folders to open</li>
<li><strong>open projectname.tmproj</strong> &#8211; if you saved your TextMate project to a file, which is good way to preserve custom project configuration, you can open it from shell with standard OSX <em>open</em> command</li>
<li><strong>Cmd + T</strong> &#8211; search for file in the project</li>
<li><strong>Cmd + Shift + F</strong> &#8211; search for a given string through all files in the project</li>
<li><strong>Cmd + F</strong> &#8211; regular search for a given string in current file</li>
<li><strong>Ctrl + S</strong> &#8211; faster way to search for strings in current file. Notice the input text box at the bottom of you TextMate window. Hit Esc to get out of fast search mode.</li>
<li><strong>Cmd + Shift + T</strong> &#8211; search for a function/class name in current file</li>
<li><strong>Cmd + Ctrl + R</strong> &#8211; see where the current file is in the project folder tree.</li>
<li><strong>Ctrl + W</strong> &#8211; select whole word under cursor</li>
<li><strong>Ctrl + Shift + A</strong> &#8211; gives you the list of SVN commands to execute on current file or folder if it is selected in project file tree.</li>
<li><strong>Ctrl + Shift + G</strong> &#8211; gives you the list of Git commands to execute on current file or folder if it is selected in project file tree.</li>
<li><strong>Alt + Mouse Selection</strong> &#8211; selecting in vertical blocks has never been easier, and editing afterwards as well <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Set of shortcuts for doing fast search and replace
<ul>
<li><strong>Cmd + E</strong> &#8211; set keyword to be replaced</li>
<li><strong>Shift + Cmd + E</strong> &#8211; set replacement word</li>
<li><strong>Ctrl + Cmd + F</strong> &#8211; replace in current file</li>
<li><strong>Ctrl + Shift + Cmd + F</strong> &#8211; replace in selection only</li>
</ul>
</li>
</ul>
<p>Great thing about TextMate is its possibility to be customized for specific needs by adding so called <a title="Textmate bundles" href="http://manual.macromates.com/en/bundles#bundles">bundles</a>. TextMate comes with <a title="Default PHP Bundle" href="https://github.com/textmate/php.tmbundle">default PHP bundle</a> embedded. You can see all the functionalities it provides in <em>TextMate -&gt; Bundles -&gt; Bundle Editor -&gt; Show Bundle Editor</em> or <strong>Ctrl + Alt + Cmd + B</strong> as shortcut. Here are some interesting ones from this bundle or useful for development in general</p>
<ul>
<li><strong>Esc</strong> &#8211; hitting escape after you typed couple of letters  will do code completion from the symbols defined in current editing file. Will work as well for native PHP functions. Just start typing <em>mk</em> and hit <em>escape</em> then and it will complete it as <em>mktime</em> <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li><strong>Alt + Esc</strong> &#8211; this will give you list of possible completions. After selecting one of them, you&#8217;ll get full function signature injected in the document.</li>
<li><strong>Ctrl + H</strong> &#8211; will give you PHP documentation related to the selected word in your current editing document.</li>
<li><strong>Ctrl + Shift + V</strong> &#8211; will check your file for syntax validity.</li>
<li><strong>Shift + Cmd + D</strong> &#8211; will jump to file that is included in the current PHP file.</li>
<li><strong>doc -&gt; Tab</strong> &#8211; if you type word <em>doc</em> above class/method/function and hit Tab after it, you will get documentation block for the related entity.</li>
<li><strong>Cmd + Shift + R</strong> &#8211; will run your file with current system PHP executable. This is very nice when you just test something and want to see the output, but don&#8217;t want to get out to shell and command line.</li>
<li><strong>Alt + F1</strong> &#8211; documentation about function signature in the form of tooltip. If you forgot weather $haystack or $needle goes first as the param in the array function this is easy way not to search through extensive documentation.</li>
<li><strong>Shift + Ctrl + T</strong> &#8211; if you like to place lot of <em>TODO</em>, <em>FIXME</em> or <em>CHANGED</em> meta information in your comments for later addressing, this will help you find them quickly and navigate through them easily.</li>
</ul>
<p>Beside these shortcuts there are a lot of snippets triggered by hitting Tab after typing its abbreviation. For example <strong>doc_f -&gt; Tab</strong> will create new function together with doc block. You can see list of all of them in the mentioned bundle editor in the section for PHP bundle. It is pretty easy as well to create your own specific snippets.</p>
<p>Many more general or specific shortcuts can be found online e.g. as printable <a href="http://www.g-design.net/textmate.pdf">cheat</a> <a href="http://www.grayskies.net/TMcheatsheet.pdf">sheets</a>. Or in TextMate <a href="http://manual.macromates.com/en/">manual</a>. The best way to adopt them is to take them one by one and pay attention to use it regularly, as soon as it is at the back of the brain start with new one until you become TextMate productivity wizard.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2010/12/29/textmate-for-php-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Then I saw the tests, now I&#8217;m a believer.</title>
		<link>http://blog.ivanjovanovic.com/2010/11/24/then-i-saw-the-tests-now-im-a-believer/</link>
		<comments>http://blog.ivanjovanovic.com/2010/11/24/then-i-saw-the-tests-now-im-a-believer/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 00:41:56 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[code quality]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=85</guid>
		<description><![CDATA[These days I was working on a small feature that had to be added to an application here at local.ch. The application was originally written by some other developers and it was first time that I looked at that code. Everything would be OK, and I would not write this post at all if at one [...]]]></description>
			<content:encoded><![CDATA[<p>These days I was working on a small feature that had to be added to an application here at <a title="Local.ch AG, Official Swiss Phonebook" href="http://local.ch/">local.ch</a>. The application was originally written by some other developers and it was first time that I looked at that code. Everything would be OK, and I would not write this post at all if at one moment I didn&#8217;t feel strong need to rewrite the application completely. To be clear, it is not kind of need that draws motivation in &#8220;Not my code, I&#8217;m smarter than others.&#8221; source of frustration. Point is that this code really needs refactoring in order to grow in future and remain maintainable while adding new features to it. But that is by itself not a problem, what code doesn&#8217;t need refactoring, especially your own!  And if you have no constant need to refactor things that could mean you didn&#8217;t learn anything since last time you saw that code.</p>
<p>The problem becomes obvious and bit more acute when you figure out that, despite the fact that we try to keep our micro applications pretty simple with least possible code and logic, you don&#8217;t have all clues about how that piece of software works. Then you become aware  that amount of time needed to get into all the bits of included functionalities is way bigger than just  refactoring the code. Therefore, you lose peak of your motivation since you instantly visualize all the non-engineering time you need to invest in gathering information instead of just doing it. But of course, when just doing it, at the end it should have the same function as before, I guess. So without some proof that you didn&#8217;t degrade functionality, just do it approach would be even worse than not doing it.</p>
<p>And where would you expect to find up to date documentation in such case? Browsing the Wiki &#8230; not <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>While letting you think a bit, I&#8217;d tell you that at <a href="http://local.ch">local.ch</a> we are passionate about agile practices and testing in particular. We always try to cover our code with reasonable amount of coverage and quality of tests. Since I joined, I accepted this as a fact and acted in that sense, but was not believer in testing in the religious way. Not until I imagined ideal world where I would go to test cases and could understand all functionalities implemented in the code that these tests cover. And in more ideal world, I would be able to drop the code, leave the tests and write new code which would be proved as correct in the moment all tests get green again. But not when tests are written in the way to reflect bad implementation choices in the code and not thoroughly though through. Then you have to throw the tests as well and you are back at the start point.</p>
<p>I could imagine that in mentioned idealized model of the world you could continuously improve quality of the code, reduce price of its maintenance, add new features and experiment with different ways of implementing the same thing while exploring new approaches to solving old problems. And all that while being sure that you didn&#8217;t break function of software that might in a case pay your salary at the end of the month.</p>
<p>Yes, and &#8220;The Beatles&#8221; are now in iTunes. Lucky us, the whole world has changed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2010/11/24/then-i-saw-the-tests-now-im-a-believer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webtuesday at local.ch offices</title>
		<link>http://blog.ivanjovanovic.com/2010/04/14/webtuesday-at-local-ch-offices/</link>
		<comments>http://blog.ivanjovanovic.com/2010/04/14/webtuesday-at-local-ch-offices/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 22:40:25 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[community]]></category>
		<category><![CDATA[local.ch]]></category>
		<category><![CDATA[webtuesday]]></category>

		<guid isPermaLink="false">http://blog.ivanjovanovic.com/?p=57</guid>
		<description><![CDATA[Every first Tuesday of a month, Zürich oriented web community gather for an evening of tech talks and some beer for, so called, webtuesday. Yesterday, we had pleasure to host event at  local.ch for the first time as unofficial opening for the community after movement to new offices. As Harry tweeted already during the event, it was pretty packed. I was personally happy to see lot of people coming since this was only my second webtuesday since I started working for local.ch 6 months ago. This time Patrice and Chris from memonic.com gave great talk on the current state of the architecture and tools that are behind their startup]]></description>
			<content:encoded><![CDATA[<p>Every first Tuesday of a month, Zürich oriented web community gather for an evening of tech talks and some beer for, so called, <a title="Webtuesday web site" href="http://webtuesday.ch/">webtuesday</a>. Yesterday, we had pleasure to host event at  <a title="Local.ch web site" href="http://local.ch/">local.ch</a> for the first time as unofficial opening for the community after movement to <a title="Local.ch address" href="http://yellow.local.ch/en/d/Zuerich/8001/Internet/local.ch-ag-jXdlhL7d_gnuD1d-TjoTTw?what=local.ch">new offices</a>. As Harry <a title="Harry's twitter status" href="http://twitter.com/hfuecks/status/12115799946">tweeted</a> already during the event, it was pretty packed. I was personally happy to see lot of people coming since this was only my second webtuesday since I started working for local.ch 6 months ago.</p>
<div class="wp-caption alignleft" style="width: 346px"><a href="http://twitter.com/hfuecks/status/12115799946"><img class="  " title="Packed webtuestad @localch offices" src="http://a.yfrog.com/img707/5599/4lmg.jpg" alt="Packed Webtuesday @localch offices" width="336" height="252" /></a><p class="wp-caption-text">Packed webtuesday @localch offices (by Harry Fuecks)</p></div>
<p>This time <a title="Patrice's blog" href="http://weblog.patrice.ch/">Patrice</a> and Chris from <a title="Memonic" href="http://memonic.com">memonic.com</a> gave great talk on the current state of the architecture and tools that are behind their startup. Since both of them worked for local.ch before (Patrice as Lead of Frontend Development, Chris as backend Java developer)  it was interesting to see how much they kept and where they improved along the way.</p>
<p>Interesting point was the choice of the language for their startup. At local.ch, we are kind of separated on frontend and backend development, before all, by the languages we use. Shortly, PHP on the frontend and Java in backend with HTTP communication in between, XML result got from backend parsed by XSL to produce HTML. At Memonic they decided to bring that together and make gap between backend and frontend development smaller by choosing Python as common language. Having experience with the Scrum and challenges which this kind of separation between frontend and backend carries, I see this as reasonable decision. I was surprised to hear that none of them had professional experience with Python before founding Memonic.</p>
<p>Their architecture is highly web service oriented. The way Patrice conceptually sees the architecture can be paraphrased like this:</p>
<blockquote><p>&#8220;I see web services in our architecture as classes are used traditionally, or maybe better, as components of the traditional framework&#8221;</p></blockquote>
<p>end of lousy paraphrase <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . So, if we take Zend Framework for example: imagine that instead of having Zend_Auth, Zend_Session, Zend_Log, Zend_Mail &#8230; and sending messages to their objects, you have web services that expose interfaces over HTTP. On the <a title="Memonic blog post" href="http://blog.memonic.com/archive/2010/04/14/webtuesday-memonic-architecture.html">slides Patrice provided</a> can be seen in smaller detail way their architecture is broken into smallest possible web services that communicate among each other. Web services are based on <a title="wsgiservice on GitHub" href="http://github.com/pneff/wsgiservice">wsgiservice</a> (Python WSGI framework to create REST web service) library that is open sourced by Patrice. One thing I was interested is what is the performance loss in HTTP communication overhead between components. In current state of the load they do not see it as problem and they see using HTTP features as e.g. caching more valuable than performance loss introduced.</p>
<p>Here are some links, if you are more interested to find out about <a title="Local.ch - official website" href="http://www.local.ch/en/s/aboutus/facts_and_figures">local.ch</a>, <a title="Webtuesday website" href="http://webtuesday.ch">webtuesday</a> or <a title="Keep the essential, memonic.com website" href="http://memonic.com/">memonic.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2010/04/14/webtuesday-at-local-ch-offices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A year behind my back</title>
		<link>http://blog.ivanjovanovic.com/2009/09/16/a-year-behind-my-back/</link>
		<comments>http://blog.ivanjovanovic.com/2009/09/16/a-year-behind-my-back/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 23:44:58 +0000</pubDate>
		<dc:creator>Ivan Jovanovic</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://ivan/?p=24</guid>
		<description><![CDATA[The year is behind me since I wrote last post. A lot, mostly good, has happened. First and most important I have finished my studies. Now I can proudly say that I&#8217;m an Electrical Engineer in the field of Automation and Control Engineering. But wait, how does Senior Web Developer position relates to that? Let [...]]]></description>
			<content:encoded><![CDATA[<p>The year is behind me since I wrote last post. A lot, mostly good, has happened.</p>
<p>First and most important I have finished my studies. Now I can proudly say that I&#8217;m an Electrical Engineer in the field of Automation and Control Engineering. But wait, how does Senior Web Developer position relates to that? Let that be a topic for further evaluation <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Let just say that in one moment I had to decide what interests me more.</p>
<p>Somewhere at the beginning of February, after almost year and a half, our cooperation with Tilllate ended. Thanks to the Maarten, Leo, Silvan, Cyprian, Jia-yong Ou, Michael, Thilo and others for being friendly, positive and smart to create great surrounding to work in. I have raised my skill to much higher level and learned a lot about programming in high-traffic, heavy-loaded environment and gained much wider view on software development than I had before. I&#8217;d like to specially thank to Tilllate Chief Software Engineer Maarten Manders for having confidence that I will do proper job with some crucial parts of Tilllate, I hope I succeeded.</p>
<p><span id="more-24"></span>During the March I have started looking for a new job, preferably in Switzerland. After evaluation of open positions in the market I have applied for a position of frontend engineer in <a title="Local.ch" href="http://www.local.ch">local.ch</a>. In May I went to Zurich on the interview and until the beginning of the June I was offered a job. I accepted the offer and there was just one little thing standing between me and Zurich, the procedure of getting working permission for the non-EU citizen. Hard times for me <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  To cut the story (since writing this post took some time and things happened meanwhile) I got my working permission after several months. Now I&#8217;m waiting for Swiss entrance visa and until the end of October I should start on my new job in Zurich. Currently I&#8217;m looking for a temporary flat in Zurich where I could reside for couple months before I find real place to live and bring my wife to Zurich too.</p>
<p>As it is in real life, some stories are at the beginning, and some are at the end. While writing this post, I&#8217;m spending last days in <a title="youngculture" href="http://www.youngculture.com">youngculture</a>. It was great experience and pleasure, before all, for me to work with some of the most advanced developers in Belgrade in very high-quality working environment. I met friends for the whole life here and my two years in Belgrade will stay clearly positive experience. However, <a href="http://www.youngculture.com">youngculture</a> headquarters is based in Zurich, and people that I worked with regularly travel to Switzerland, so I presume I won&#8217;t miss them too much <img src='http://blog.ivanjovanovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m ready for beer or two whenever you call!!!!</p>
<p>The year has passed so fast that I almost did not notice it. Just heard &#8220;whuush&#8221; sound somewhere around birthday. I had no time to devote to the things I like as blogging and out-of-work internet existence, but I hope that next year will change that. I planned to reorganize this domain and blog so I could efficiently present what I&#8217;m working on and things I like. I hope as well that starting new job will give me the chance to reconsider some priorities in life and bring some fresh air as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanjovanovic.com/2009/09/16/a-year-behind-my-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

