<?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>Кокановић блог</title>
	<atom:link href="http://blog.kokanovic.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kokanovic.org</link>
	<description>Мој покушај блоговања:)</description>
	<lastBuildDate>Wed, 12 May 2010 22:36:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Рачуница дупликата сличица</title>
		<link>http://blog.kokanovic.org/racunica-duplikata-slicica/</link>
		<comments>http://blog.kokanovic.org/racunica-duplikata-slicica/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 16:13:08 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Лупетање]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=64</guid>
		<description><![CDATA[Кад смо били клинци, било је много лакше — цимаш родитеље на сваких пола сата да ти купе сличице]]></description>
			<content:encoded><![CDATA[<p>Кад смо били клинци, било је много лакше — цимаш родитеље на сваких пола сата да ти купе сличице, идеш на количину и имаш гомилу људи за мењање. Сада мораш да их купујеш сâм од својих пара, а и друштво за мењање је јако сужено. Да ли формалност замени игру онда када порастемо, или смо порасли када заменимо игру формалностима не знам, али у овом животном добу, са овим знањем програмирања нисам могао да одолим искушењу да израчунам колико ме дупликата очекује на колико купљених сличица <img src='http://blog.kokanovic.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Албум за светско првенство има 639 сличица, а мене је занимало колико треба да купим да бих могао да га попуним, тј. колико дупликата могу да очекујем. Написао сам овај кратак програм у Пајтону баш за то:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">random</span> <span style="color: #ff7700;font-weight:bold;">import</span> uniform
&nbsp;
duplikati = <span style="color: #ff4500;">0</span>
<span style="color: #ff7700;font-weight:bold;">for</span> it <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>,<span style="color: #ff4500;">10000</span><span style="color: black;">&#41;</span>:
    popunjene = <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> kupljene <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>,<span style="color: #ff4500;">300</span><span style="color: black;">&#41;</span>:
        broj = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>uniform<span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">640</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> broj <span style="color: #ff7700;font-weight:bold;">in</span> popunjene:
            duplikati += <span style="color: #ff4500;">1</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            popunjene += <span style="color: black;">&#40;</span>broj,<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> duplikati/<span style="color: #ff4500;">1000.0</span></pre></div></div>

<p>Овај програм враћа број дупликата за купљених 300 сличица ако албум има укупно 639 сличица. Број дупликата је 60, што се уклапа са бројем мојих дупликата (62), што ће опет рећи да су сличице прилично униформне (лепа вест за оне који скупљају овај албум) <img src='http://blog.kokanovic.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Ево и листинга колико дупликата можете да очекујете на колико купљених сличица:</p>
<table border="1">
<thead>
<th>Купљених сличица</th>
<th>Очекивано дупликата</th>
</thead>
<tbody>
<tr>
<td>100</td>
<td>7</td>
</tr>
<tr>
<td>200</td>
<td>28</td>
</tr>
<tr>
<td>300</td>
<td>60</td>
</tr>
<tr>
<td>400</td>
<td>102</td>
</tr>
<tr>
<td>500</td>
<td>152</td>
</tr>
<tr>
<td>600</td>
<td>210</td>
</tr>
<tr>
<td><strong>639</strong></td>
<td><strong>234</strong></td>
</tr>
<tr>
<td>700</td>
<td>273</td>
</tr>
</tbody>
</table>
<p>Ово практично значи да је довољно да купите 639 сличица (тачно колико треба) и да добијена 234 дупликата замените за оне које Вам фале и попунили сте албум <img src='http://blog.kokanovic.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Ето, ово је још један пример како штребери успеју да упропасте све жеље, ишчекивања, наде, размене и тапке, ма све оно лепо у скупљању сличица и убаце математику тамо где јој није место <img src='http://blog.kokanovic.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/racunica-duplikata-slicica/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>У сусрет Гному 2.30 (превођење)</title>
		<link>http://blog.kokanovic.org/u-susret-gnomu-2-30/</link>
		<comments>http://blog.kokanovic.org/u-susret-gnomu-2-30/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 12:35:28 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[serbian]]></category>
		<category><![CDATA[гном]]></category>
		<category><![CDATA[документација]]></category>
		<category><![CDATA[локализација]]></category>
		<category><![CDATA[превођење]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=61</guid>
		<description><![CDATA[Гном 2.30 је изашао. Покушаћу укратко да резимирам оно што је тим за превод Гнома урадио, као и шта сам ја покушавао да урадим за ово издање.]]></description>
			<content:encoded><![CDATA[<p><a href="http://library.gnome.org/misc/release-notes/2.30/">Гном 2.30</a> је изашао. Покушаћу укратко да резимирам оно што је тим за превод Гнома урадио, као и шта сам ја покушавао да урадим за ово издање.</p>
<h1>Програми</h1>
<p>Пошто смо од издања 2.26 на 2.28 направили стварно огроман скок са 81% на 91% преведности, били поменути као <a href="http://library.gnome.org/misc/release-notes/2.28/#rni18">један од најбољих тимова за 2.28</a> и вратили српски превод Гнома на стазе старе славе, сада смо само <strong>одржавали исти ритам</strong>. Не би смело да нам се опет деси да се онако опустимо, а за ово издање смо чак и повећали <a href="http://l10n.gnome.org/languages/sr/gnome-2-30/ui/">преведеност на 92%</a>. Сви главни програми су <strong>потпуно преведени</strong>, као и још много програма који нису део скупа основних модула. Још једина два непреведена модула су <a href="http://live.gnome.org/Orca">Орка</a> читач за особе са посебним потребама и <a href="http://projects.gnome.org/anjuta/">Анјута</a> — интегрисано окружење за развој, тј. IDE. Дефинитивно ова два програма не спадају у приоритетне, али ћу гледати да за Гном 3.0 (пошто је следеће издање 3.0) пробам да преведем Анјуту (мада искрено не верујем да ће домаћи програмери користити тај превод, осим можда неких нових клинаца који тек упадају у програмерске воде, па ће им можда бити лакше тако). Такође, има још доста програма „са стране“ који заслужују да буду преведени пре ова два, а сад имамо времена и за њих. И наравно, највећи приоритет је дефинитивно <strong>одржавање ових постојећих превода</strong>. То је, по мени, правац у коме ће се кретати даљи развој превода за Гноме, али далеко од тога да ће бити по пароли „на западу ништа ново“ јер, већ у Гному 3.0 ће вас сачекати једна лепа промена — свако појављивање речи „умножи“ (тј. на енглеском <em>copy</em>, када се садржај пребацује у клипборд) ће бити замењено са <em>de facto</em> коришћенијим у разговору „копирај“.</p>
<p>Друга ствар која ме јако брине је што на преводу Гнома сада практично раде само два човека — Милош Поповић и ја. Мало је <strong>тужно и несхватљиво</strong> да једно од најкоришћенијих окружења за линукс нема више преводиоца, а да, са друге стране на Убунту преводу за српски ради <a href="https://translations.launchpad.net/+languages/sr">мала армија</a>. Требало би овде мало погурати, видети има ли заинтересованих људи; у првој категорији, тј. најпожељнији су они који већ користе локализовано окружење. Верујем да таквих људи има, али наравно, не по цену квантитета да изгубимо квалитет. <strong>Честитке Милошу</strong> за изгурани 2.30, урадио је лавовски посао, али већ је постало монотоно да нас двојица честитамо један другоме више, треба нам свеже крви:)</p>
<h1>Документација</h1>
<p>Гном 2.30 је посебан по томе што је по први пут започет рад на <strong>превођењу документације</strong>. Све то је почело <a href="http://blog.kokanovic.org/prva-iskustva-sa-prevodjenjem-gnom-dokumentacije/">овде</a>. Дакле, после изласка 2.28 сам започео превођење Гном документације, чисто да видим куда ће ме то одвести. Сада могу да кажем да је добро испало. Гном је добио <strong>превод документације свих игара</strong> на српски језик, што му дође негде око 9% превода целе документације. Добра ствар је што се ови преводи документације не мењају често тако да неће представљати велики проблем одржавати их касније, али, са друге стране, да се не лажемо &#8211; основни, изворни текст документације (на енглеском) и није нешто претерано од помоћи (а и лош је зато што је написан једном и ретко кад се и мења). Ево како то лепо изгледа на крају на проклетим лажима:</p>
<p><a href="http://blog.kokanovic.org/wp-content/uploads/2010/03/gnom2.30.png"><img class="aligncenter size-full wp-image-62" title="gnom2.30" src="http://blog.kokanovic.org/wp-content/uploads/2010/03/gnom2.30.png" alt="" width="600" height="358" /></a></p>
<p>Када добијете нови Гном 2.30, погледајте Помоћ-&gt;Садржај за неку игрицу, требало би да у свим дистрибуцијама добијете документацију на српском.</p>
<p>Не планирам да стајем овде, план за 3.0 ми је да одржавам ове преводе и да преведем још пар модула из истих група, а то су GNOME applets, gnome-media, а ако стигнем и gnome-utils и неко конкретно програмче (најприоритетније, типа калкулатор и сл.). То би повећало проценат преведности за још оволико, тј. до 20%, а мени би дало потребно искуство за превод највеће и најважније документације за издање после 3.0, а то је <a href="http://l10n.gnome.org/vertimus/gnome-user-docs/master/user-guide/sr">корисничка документација</a> (наравно, не за Гном 2, него за Гном 3). Уколико се појави још неко за превођење документације, тим боље. Толико од мене за Гном 2.30.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/u-susret-gnomu-2-30/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Брезе</title>
		<link>http://blog.kokanovic.org/%d0%b1%d1%80%d0%b5%d0%b7%d0%b5/</link>
		<comments>http://blog.kokanovic.org/%d0%b1%d1%80%d0%b5%d0%b7%d0%b5/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 18:29:25 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Лупетање]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=59</guid>
		<description><![CDATA[У последње време ме је баш нервирала, а вероватно и ја њу. Ја сам се, наравно, и поред тога трудио да будем што одвратнији.
- „Јао, види брезе, како су лепе!“, прокоментариса она пуна нескривеног одушевљења док смо пролазили колима поред неког тамо дворишта.
Нисам се ни трудио да прокоментаришем, нисам имао шта да кажем.
- „Знаш ли [...]]]></description>
			<content:encoded><![CDATA[<p>У последње време ме је баш нервирала, а вероватно и ја њу. Ја сам се, наравно, и поред тога трудио да будем што одвратнији.</p>
<p>- „Јао, види брезе, како су лепе!“, прокоментариса она пуна нескривеног одушевљења док смо пролазили колима поред неког тамо дворишта.</p>
<p>Нисам се ни трудио да прокоментаришем, нисам имао шта да кажем.</p>
<p>- „Знаш ли да се брезе увек саде у паровима, бреза и брез, никад једна сама“, наставила је она.</p>
<p>- „А јел схваташ ти да то нема апсолутно никаквог смисла“, рекох после кратке тишине која је уследила, морајући да се укључим у разговор.</p>
<p>- „Не, стварно. Бреза и брез увек морају да се саде заједно, ако посадиш једну брезу, она увене.“</p>
<p>- “Не, не увене. Не увене ништа више него што ће увенути, на пример&#8230;усамљени багрем или храст кад га посадиш. То је само глупа народна измишљотина.“</p>
<p>- „Какав си, све мораш да упропастиш. Моја тетка је имала пре пар година викендицу ту негде испод Голије, ишла сам тамо, знам да је морала да посади две брезе&#8230;“</p>
<p>- „Брезе су јебене дикотиледоне, не треба им неки тамо брез. Бреза&#8230;капираш, једно дрво женског рода, без преке потребе за мушким партнером.“</p>
<p>- „Не, не схваташ, какве диклодоне, причам ти о томе да једино могу да расту и успевају у заједници&#8230;“</p>
<p>- „Ма, не схваташ ти бре биологију за пети разред основне.“</p>
<p>Настала је мала пауза, док ме је гледала са неверицом.</p>
<p>- „Одвратан си“, рекла је док је излазила из кола.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/%d0%b1%d1%80%d0%b5%d0%b7%d0%b5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Count Eclipse warnings grouped by resource</title>
		<link>http://blog.kokanovic.org/count-eclipse-warnings-grouped-by-resource/</link>
		<comments>http://blog.kokanovic.org/count-eclipse-warnings-grouped-by-resource/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 19:43:41 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[warning]]></category>
		<category><![CDATA[warnings]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=52</guid>
		<description><![CDATA[Ok, I know this must be funny for most of you, but there are still some desktop Java applications that require updates, e.g. patching (some of us aren&#8217;t using web technologies, you know). So, when you have to patch some client application out there, size of your patch matters. If you, on the other hand, [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, I know this must be funny for most of you, but there are still some desktop Java applications that require updates, e.g. patching (some of us aren&#8217;t using web technologies, you know). So, when you have to patch some client application out there, size of your patch matters. If you, on the other hand, have large number of warnings in your source code (let me say, for example 40.000), you can&#8217;t just go around your classes and furiously removing warnings since it will create big patch. In that situations, you have three options:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Three_wise_monkeys" target="_blank">See no warnings, hear no warnings, speak no warnings</a> &#8211; for mediocre, but it actually works;)</li>
<li>When you commit something, make sure no warnings are commited &#8211; e.g. at least clear warnings from classes that will end up in patch anyway &#8211; this Eclipse <a href="http://commitwarncheck.sourceforge.net/" target="_blank">plugin</a> can help</li>
<li>Be a man! Have balls and clear as much warnings as you can before you get fired!</li>
</ul>
<p>OK, we&#8217;re interested in third solution. If you&#8217;re already going to clear as much warnings as possible, it would make sense to first clear warnings from those classes that have them most (remember patch problem). So, if you have 100 classes with 1 warning and 1 class with 100 warnings, you should choose to clear 100 warnings from one class. In ideal world, you wouldn&#8217;t mind, but in reality you will not manage to clear all the warnings (unless you really badly want to be fired). So, without further ado, I present you small Eclipse plugin that will show you count of warnings in workspace grouped by Java resource. Created in under 2 hours and then 2 more hours to put it on GitHub (well, what do you want &#8211; first time creating GitHub account) and there you have it:</p>
<p><a href="http://stalker314314.github.com/groupwarnings/" target="_blank">http://stalker314314.github.com/groupwarnings/</a></p>
<p>You can download plugin directly <a href="http://stalker314314.github.com/groupwarnings/GroupWarnings_1.0.0.jar" target="_blank">here</a> and just copy it to plugins/ directory of your Eclipse 3.5+ installation. If you&#8217;re lazy enough not to click on my super duper extra site I created on GitHub, then you can see screenshot here (actually, blog post will look much cooler if I put picture here, so I had to make up reason).</p>
<p style="text-align: center;"><a href="http://blog.kokanovic.org/wp-content/uploads/2010/01/groupwarnings3.png"><img class="size-full wp-image-56 aligncenter" title="groupwarnings" src="http://blog.kokanovic.org/wp-content/uploads/2010/01/groupwarnings3.png" alt="" width="618" height="232" /></a></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/count-eclipse-warnings-grouped-by-resource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming languages playground</title>
		<link>http://blog.kokanovic.org/programming-languages-playground/</link>
		<comments>http://blog.kokanovic.org/programming-languages-playground/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 22:41:43 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming language]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=50</guid>
		<description><![CDATA[It's summer. Day is sunny and all the programming languages went out to play. They all gathered at playground enjoying the beautiful day and we're now going to describe some of them.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s summer. Day is sunny and all the kids went out to play. They all gathered at playground enjoying the beautiful day and we&#8217;re now going to describe some of them.</p>
<p>First kid that catches eye is one tall boy, larger then all the other kids and obviously older then all of them. His name is <strong>C</strong>. He&#8217;s casually dressed and is always smiling cheerfully. All the other smaller kids are swirling around him and he obviously enjoys playing with them. He knows he is the coolest kid there and that he got respect from all of them, but he is not presumptuous about it. He&#8217;s fast, his moves are sharp and intelligent, he&#8217;s very agile and he likes to help other kids, knowing that they are helpless without him. Look, he just helped that kid Python to climb that tree. Python could climb that tree himself, but it would take him forever, and he asked C for help and C, smiling as always, immediately picked him up and put him on branch. He really is like older brother for all of them.</p>
<p>Speaking of brothers, C really have one younger brother. His name is <strong>C++</strong>. Actually, they are stepbrothers, C&#8217;s fathers had thicker <a href="http://upload.wikimedia.org/wikipedia/commons/3/36/Ken_n_dennis.jpg" target="_blank">beards</a> then C++&#8217;s father, and C++&#8217;s father have less <a href="http://upload.wikimedia.org/wikipedia/commons/d/da/BjarneStroustrup.jpg" target="_blank">hair</a>. You could see these two kids look alike, but C++ is little smaller and younger. C++&#8217;s father thought he could give C a little brother that will be better at handling objects at playground, but that will still looks similar to C, and although he succeeded, other kids still prefer to play with C. He&#8217;s also a bit fat for a child of that age and little slower then his older brother, but granted &#8211; he&#8217;s better at handling various objects. Reason for it&#8217;s slowness is maybe because he carries with him a lot of equipment. He got with himself a little <a href="http://en.wikipedia.org/wiki/Friend_function" target="_blank">shovel</a>, <a href="http://en.wikipedia.org/wiki/Reference_%28C%2B%2B%29" target="_blank">rake</a> and little <a href="http://en.wikipedia.org/wiki/Template_%28programming%29" target="_blank">plastic bin</a>, and man, he even have a <a href="http://en.wikipedia.org/wiki/Multiple_inheritance" target="_blank">Swiss knife</a>. Other kids looks in awe at C++&#8217;s tools and possibilities with it, but they also heard from elders that those tools he&#8217;s carrying are just burden and that it takes a skilled person to use all those tools properly and wisely, and that you may even cut yourself if you try to use them without any training, so that&#8217;s why they mostly like to play with his older brother.</p>
<p>We already mentioned <strong>Python</strong> kid. He&#8217;s one of the kids that often asks C to help him. He is fast and agile, but alas, there are some times when only C can help. He&#8217;s one small kid with shaggy hair and he enjoys doing things both nice and quick. He never stops, he&#8217;s restless, his trousers are scraped on knees from constant running, jumping and falling. In one word, he&#8217;s very dynamic. Because of his dynamic nature, he often breaks things, but he can also very quickly put them together because he always carries <a href="http://docs.python.org/glossary.html#term-duck-typing" target="_blank">duct tape</a> with him. There is one more thing he always carries with him. If you ask him to do something, he&#8217;ll get to work immediately, no matter how hard that is and when the job is finished, he likes to take out couple of batteries from his pocket and to shout childishly &#8221;batteries included!&#8221;.</p>
<p>Another kid similar to Python is <strong>Ruby</strong>. They are both very similar, but interestingly, they like to compete. If one of them does something, other kid will try to do the same, but quicker and nicer, showing that it&#8217;s better. They are even dressed similar, except Ruby likes to wear red.  When they have to do something in parallel and Python is faster then Ruby, he likes to say that Ruby&#8217;s red shirt is in fact woven from <a href="http://softwareramblings.com/2008/07/multi-thread-scaling-issues-with-python-and-ruby.html" target="_blank">green threads</a>. If, on the other hand, Ruby wins, he can then jump all day around Python making fun of him by shouting &#8220;Global Interpreter Lock!&#8221;. Ruby&#8217;s dad is from Japan and he really likes his kid. He&#8217;s so protective, and sometimes he worries so much about security of his child, that his child can&#8217;t develop normally because of him. C is also like older brother to Ruby and helps him a lot when he&#8217;s stuck.</p>
<p><strong>PHP</strong> is one of the weirdest kids out there. He&#8217;s there, loves C, but rarely hangs with him or asks for help, mostly because he never needs it. He&#8217;s smallest, but also one of the fastest, most alive and most popular kids out there. Python and Ruby want to be as popular and fast as he is, when they grow up. Also, PHP doesn&#8217;t respect anyone, he is kind of rebel and has his own ways. One time, for example, kids wanted to build sand castle. They all gathered and started to talk how to do it. They mentioned &#8220;frameworks&#8221;, &#8220;scalability&#8221;, &#8220;paradigms&#8221;, &#8220;design patterns&#8221; and all those other stuff kids talk when they build a sand castles, and suddenly, in the middle of talk, they turned and saw that PHP already built his castle. He just said &#8220;Architecture &#8211; who needs that&#8221; and built it. Ironically, his castle was better and more stable then any of the other castles.</p>
<p>Of course, not all the kids likes C and playing with him. There is this kid called <strong>Java</strong>. Although he is dependant of C, he think he&#8217;s better then him and doesn&#8217;t like to ask him for any help. Yes, he is respecting him, but thinks he can do everything on his own. He doesn&#8217;t like to play with other children and is very introvert. This is, because when he was younger, he was extremely fat and slow, and other kids always made fun of him. He is not accepted since then. All the kids remember when once one long bearded man, dressed like a hippie calling himself RMS, came to them one day and talked to them that they should avoid Java because he is not open to other kids and speaking on and on about <a href="http://www.gnu.org/philosophy/java-trap.html" target="_blank">trap</a> they will fall into if they hang out with Java. This made Java grow inferiority complex. Inferiority complex soon developed into superiority complex and that explains his behavior a lot. Since then, Java tried hard to overcome that obesity problem he had and although he&#8217;s slim now, scars from bullying and <a href="http://en.wikipedia.org/wiki/Clone_%28Java_method%29" target="_blank">wrinkled skin</a> are still visible. Even today, he tries to be more open, but like it&#8217;s all in vain. He doesn&#8217;t even want to hear about the other kids, he created his own tools, his own toys that are not compatible with other&#8217;s kids toys, even his own <a href="http://www.dev.java.net" target="_blank">part of the playground</a> he calls open and accessible for everyone, and tries to lures other kids to join him, but other kids know that, once you enter his part of the playground, there is no returning back. Because of lack of other kids&#8217; company, he artificially created his own kids from his special DNK called JVM and now plays with <a href="http://en.wikipedia.org/wiki/List_of_JVM_languages" target="_blank">them</a>.</p>
<p>There is one other kid who also thinks he&#8217;s too good to hang with C. His name is <strong>C#</strong>. He is just an ordinary kid, but he thinks that somehow, he is more mature then other kids. He wears corporate suit with pink tie and always keep his head high. He doesn&#8217;t speak with other children &#8211; they are all stupid, idiotic fools for him. He is always surrounded with his fathers, who also wears corporate suits and forbid him to play with other kids. He is very spoiled because he&#8217;s very rich and his fathers buy him everything he wants. His suit is always clean because he really doesn&#8217;t want to play very much. If, for example, he needs to climb a tree, he just calls one of his dads and order him to buy him a ladder. In fact, he thinks that money is solution to all problems. Other kids despise him because of his attitude and his fathers and even elders don&#8217;t want to have anything with him (except maybe some other similar thinking men in corporate suits).</p>
<p>Oh, I almost forgot one other kid. His name is <strong>Visual Basic</strong>. Unfortunately, he is retarded. He just sits all day long by the sandbox, with his head low, drooling in sand and hitting himself in head with his hand. Poor kid.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/programming-languages-playground/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Gnome-like password warning in Java</title>
		<link>http://blog.kokanovic.org/gnome-like-password-warning-in-java/</link>
		<comments>http://blog.kokanovic.org/gnome-like-password-warning-in-java/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 11:36:24 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[GtkEntry]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JPasswordField]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=47</guid>
		<description><![CDATA[Gnome show warning icon in password field when CAPS LOCK is on. This is my take to replicate this behavior in Java.]]></description>
			<content:encoded><![CDATA[<p>Gnome have nifty little feature to show warning icon in the right part of entry box when CAPS LOCK key is on. Actually, it&#8217;s part of <a href="http://library.gnome.org/devel/gtk/unstable/GtkEntry.html">GtkEntry</a> widget. Warning icon is shown when widget gain focus and disappear when focus is lost. You can see how that looks like:</p>
<p><img class="aligncenter size-full wp-image-48" title="gnome_warning" src="http://blog.kokanovic.org/wp-content/uploads/2009/12/gnome_warning.png" alt="gnome_warning" width="359" height="47" /><br />
<br/><br />
This is my take to replicate this behavior in Java:<br />
<br/><br/></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> WarningPasswordField <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399;">JPasswordField</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">long</span> serialVersionUID <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>4334432525061916434L<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> verticalInsets <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> rightOffset <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">BufferedImage</span> warning <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> WarningPasswordField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003399;">InputStream</span> is <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #006633;">getResourceAsStream</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/warning.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>is <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				warning <span style="color: #339933;">=</span> ImageIO.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>is<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> paint<span style="color: #009900;">&#40;</span><span style="color: #003399;">Graphics</span> g<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">paint</span><span style="color: #009900;">&#40;</span>g<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>warning <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">/* image is not loaded, behave like a normal password field */</span>
			<span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">isFocusOwner</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">/* don't paint warning icon if we don't have focus */</span>
			<span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">boolean</span> capsLockOn <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			capsLockOn <span style="color: #339933;">=</span> <span style="color: #003399;">Toolkit</span>.<span style="color: #006633;">getDefaultToolkit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getLockingKeyState</span><span style="color: #009900;">&#40;</span>
					<span style="color: #003399;">KeyEvent</span>.<span style="color: #006633;">VK_CAPS_LOCK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">UnsupportedOperationException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">/* workaround sun java bug 5100701 when using XToolkit */</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>capsLockOn<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">int</span> width <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> height <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> iconSize <span style="color: #339933;">=</span> height <span style="color: #339933;">-</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">*</span> verticalInsets<span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> dx1 <span style="color: #339933;">=</span> width <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>iconSize <span style="color: #339933;">+</span> rightOffset<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> dy1 <span style="color: #339933;">=</span> verticalInsets<span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">/*
			 * fill white rectangle where image will be, so password stars are
			 * not visible if image is transparent
			 */</span>
			g.<span style="color: #006633;">setColor</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Color</span>.<span style="color: #006633;">WHITE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			g.<span style="color: #006633;">fillRect</span><span style="color: #009900;">&#40;</span>dx1, dy1, iconSize, iconSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">/* draw warning image */</span>
			g.<span style="color: #006633;">drawImage</span><span style="color: #009900;">&#40;</span>warning, dx1, dy1, dx1 <span style="color: #339933;">+</span> iconSize, dy1 <span style="color: #339933;">+</span> iconSize, <span style="color: #cc66cc;">0</span>,
					<span style="color: #cc66cc;">0</span>, warning.<span style="color: #006633;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, warning.<span style="color: #006633;">getHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see, paint method is overridden and that&#8217;s basically it.  Because warning icon&#8217;s position is dependent on used look &amp; feel, I left two constants so you can tweak its position. If warning icon can&#8217;t be loaded, this code fails silently. I used warning icon from <a href="http://commons.wikimedia.org/wiki/File:Gnome-dialog-warning.svg">Gnome project</a>, but it could (obviously) be any icon. So here is how it looks (this is <a href="https://nimbus.dev.java.net/">nimbus</a> L&amp;F):</p>
<p><img class="aligncenter size-full wp-image-49" title="java_warning" src="http://blog.kokanovic.org/wp-content/uploads/2009/12/java_warning.png" alt="java_warning" width="286" height="38" /></p>
<p>Hope you like it and hope it will integrate quickly and nicely into your code;)</p>
<p><strong>Note</strong>: RTL languages are not supported, icon there should probably go to the left!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/gnome-like-password-warning-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ЕКВ &#8211; Срце</title>
		<link>http://blog.kokanovic.org/ekv-srce/</link>
		<comments>http://blog.kokanovic.org/ekv-srce/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 09:03:52 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Лупетање]]></category>
		<category><![CDATA[ekv]]></category>
		<category><![CDATA[poezija]]></category>
		<category><![CDATA[prepev]]></category>
		<category><![CDATA[srce]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=45</guid>
		<description><![CDATA[Само једна кратка напомена &#8211; ово није превод песме, већ препев! Значи, покушао сам (а мислим и успео) да песму препевам тако да може да се пева и на енглеском, да сви стихови остану римовани и да се не изгуби поента и смисао песме.




Није дотакла ништа што би могло да боли
Њене руке су беле као [...]]]></description>
			<content:encoded><![CDATA[<p>Само једна кратка напомена &#8211; ово није превод песме, већ <strong>препев</strong>! Значи, покушао сам (а мислим и успео) да песму препевам тако да може да се пева и на енглеском, да сви стихови остану римовани и да се не изгуби поента и смисао песме.</p>
<table style="text-align: left; font-family: sans-serif; width: 100%;" border="0">
<tbody>
<tr>
<td style="background-color: #ffffcc; white-space: nowrap; text-align: left; vertical-align: top;">
Није дотакла ништа што би могло да боли<br />
Њене руке су беле као лед<br />
Њене мисли су чисте, она мисли да воли<br />
Она верује, верује.</p>
<p>Неће доћи на јесен<br />
Када опада лишће<br />
Неће доћи у зиму кад је снег<br />
Није имала разлог, није имала када<br />
Да остане, да остане<br />
Крај мене, крај мене,<br />
Да ли да верујем у то,<br />
Да ли да верујем у то.</p>
<p>Нисам рекао ништа<br />
Што би могло да значи<br />
Нисам нашао ону праву реч<br />
Која може да веже, која може да боли<br />
Којој верујем, верујем</p>
<p>Неће доћи на јесен<br />
Када опада лишће<br />
Неће доћи у зиму кад је снег<br />
Није имала разлог, није имала када<br />
Да остане, да остане<br />
Крај мене, крај мене,<br />
Да ли да верујем у то,<br />
Да ли да верујем у то.
</td>
<td></td>
<td style="background-color: #ffffcc; white-space: nowrap; vertical-align: top; text-align: left;">
She did touch nothing that could possibly hurt<br />
Her hands are as white as ice can be<br />
Her thoughts are so pure, she thinks that she loves<br />
She believes, believes.</p>
<p>She won&#8217;t come in the autumn<br />
When all the leaves are falling<br />
She won&#8217;t come in the winter when it&#8217;s bleak<br />
She didn&#8217;t have reason, she didn&#8217;t have time<br />
To be, to be<br />
By me, by me<br />
Should I believe that,<br />
Should I believe that.</p>
<p>&#8216;Cause I have said nothing<br />
That could carry a meaning<br />
I haven&#8217;t found the word so clear<br />
A word that could bond, a word that could hurt<br />
Which I believe, believe.</p>
<p>She won&#8217;t come in the autumn<br />
When all the leaves are falling<br />
She won&#8217;t come in the winter when it&#8217;s bleak<br />
She didn&#8217;t have reason, she didn&#8217;t have time<br />
To be, to be<br />
By me, by me<br />
Should I believe that,<br />
Should I believe that.
</td>
</tr>
</tbody>
</table>
<p>Превод је под <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Attribution Non-commercial Share Alike</a> лиценцом.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/ekv-srce/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Прва искуства са превођењем Гном документације</title>
		<link>http://blog.kokanovic.org/prva-iskustva-sa-prevodjenjem-gnom-dokumentacije/</link>
		<comments>http://blog.kokanovic.org/prva-iskustva-sa-prevodjenjem-gnom-dokumentacije/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 11:14:25 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[serbian]]></category>
		<category><![CDATA[гном]]></category>
		<category><![CDATA[документација]]></category>
		<category><![CDATA[локализација]]></category>
		<category><![CDATA[превођење]]></category>
		<category><![CDATA[српски]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=42</guid>
		<description><![CDATA[Гном 2.28 је скоро изашао, превод се стишао, превели смо шта смо превели, о томе ћу неки други пут. Пред нама који преводимо Гном су се сад отвориле неке нове могућности...]]></description>
			<content:encoded><![CDATA[<h2>Увод</h2>
<p>Гном 2.28 је скоро <a href="http://library.gnome.org/misc/release-notes/2.28/index.html.sr">изашао</a>, превод се стишао, превели смо шта смо превели, о томе ћу неки други пут. Пред нама који преводимо Гном су се сад отвориле неке нове могућности јер смо добили више времена. Прва опција је била преводити основни скуп Гномових модула до краја. Од непреведених програма из главног скупа Гномових модула су остали само <a href="http://projects.gnome.org/anjuta/">Анјута</a> (C/C++ IDE) и <a href="http://live.gnome.org/Orca">Орка</a> (читач екрана са особе са посебним потребама). Не треба рећи да су ово програми најнижег приоритета. Поред њих, има доста „великих“ непреведених програма који нису део главних модула Гнома, али се налазе на Гномовом сајту. Примери су <a href="http://projects.gnome.org/dia/">Диа</a> и <a href="http://live.gnome.org/Tracker">Tracker</a>. Трећа опција је била само поправљати постојеће преводе, а четврта превођење документације. Документацију за Гном програме немамо преведену и ту нико никад није ништа радио (осим документације за 2 програма која је рађена пре пар година и која од тад није ни дирана и практично није ни употребљива више). Расправљало се шта радити даље. Кључно питање је било: да ли је, гледано са корисничке стране, битније да имамо преведену Анјуту, Диу или документацију за нпр. Калкулатор или уређивач текста, тачније како максимизовати постојеће ресурсе које имамо, а да се то највише осети и буде од највеће користи код крајњих корисника. Милош Поповић је био за превођење додатних програма из Гном пакета, док сам ја кренуо на документацију. Наравно, ови избори нису стриктни ни искључиви, свако од нас ту ради све.</p>
<h2>Анализа превођења документације</h2>
<p>Ово што сам одабрао је практично посао без краја и немам никаквих сумњи да он <strong>неће</strong> бити завршен наредних пар година (нарочито ако останемо са овим бројем преводиоца). Пре искустава са превођењем Гном документације, прво бих ставио на папир све предности и мане превођења документације. Па идемо, <strong>предности</strong> су:</p>
<ul>
<li> Јасно су дефинисане целине и редослед превођења (кренемо од превођења документације најважнијих програма ка мање значајним).</li>
<li>Много је лакше проверавати и прегледати ове преводе (своди се на превођење .po датотеке, изградњу .xml датотеке и њено покретање у `yelp`-у).</li>
<li>Колико се мени чини, документационе ниске се много ређе мењају од ниски за превођење из програма (оне две горепоменуте преведене документације рађене у 2.14 и даље имају доста ниски које се нису мењале, што не верујем да би ниске из програма могле да постигну &#8211; толико да се држе), мада је ово можда и варка.</li>
<li>Превођењем документације ћемо добити прилику да прођемо и кроз преводе програма и исправимо грешке које тамо нађемо).</li>
</ul>
<p><strong>Мане</strong> код превођења документације су:</p>
<ul>
<li>Документација је огроман залогај и не треба улазити у њу са жељом да се преведе све. Треба је разбити у мање целине и тако је радити; другим речима, не треба ниједног тренутка помислити да ће она икад бити готова.</li>
<li>Превођење документације је тотално другачији посао од превођења програма &#8211; много је тежа, већа, мора се пазити на термине коришћене у програмима, морају се радити слике..</li>
</ul>
<p>Ово разлагање на предности и мане сам писао за потребе образлагања на <a href="http://postar.prevod.org/mailman/listinfo/gnom">дописној листи</a> пре него што сам започео превођење и нешто сам погодио, нешто не, видећемо касније шта је стварност, а шта сам лоше претпоставио.</p>
<p>У интерном договору са Милошем, ухватио сам се да радим превођење игрица, тј. Гном пакета <tt>gnome-games</tt>. Он је већ разбијен на документацију за сваку игрицу посебно, оне су релативно мале, а завршавање тога би заокружило једну целину. Кренуо сам тако да преводим игрице, једну по једну, крећући од оних са најмање ниски за превођење &#8211; <a href="http://live.gnome.org/Tetravex">Слагалицу</a>, <a href="http://live.gnome.org/Klotski">Клотски</a>, <a href="http://live.gnome.org/Same%20Gnome">Гном Исто-исто</a>, <a href="http://live.gnome.org/Gnometris">Гном тетрис</a>&#8230; У тренутку писања овог текста, ни пола игрица није преведено, али циљ који сам задао сам себи је да се за Гном 2.30 заврше бар игрице, ако не и још нешто. Ево шта сам притом закључио.</p>
<h2>Искуства</h2>
<p>Све наредно што напишем за моја искуства је везано искључиво за превођење игрица, али верујем да је ситуација иста или слична и за превођење документације и осталих програма. Прво морам да кажем &#8211; превођење документације<strong> није тако тешко</strong> као што се мени чинило пре него што сам почео. Штавише, лакше је од превођења програма. Наиме, ниске су дугачке, чине потпуне реченице и јасан је контекст у коме се јављају. Ово није случај са превођењем програма где често имате само једну реч коју треба превести, па морате да се довијате да видите где се та реч види, на ком је дијалогу, да гледате изворни код, да изградите новије издање програма да бисте схватили „шта је писац хтео да каже“&#8230; Друго, у свакој .po датотеци имате 20-30 ниски које можете да <strong>умножите/убаците одмах</strong> из других програма &#8211; то су углавном ствари везане за лиценце (ту ми је помогао превод постојеће документације где је лиценца већ била преведена), аутори програма и документације који се не преводе, брдо ствари везаних за пријављивање грешака које су увек исте, а углавном се деси и да треба само превести обичне арапске бројеве. 20-30 не делује као много, али пошто преводи за игрице имају у просеку 100-150 ниски, ово је солидан проценат, а и значи, гледано са психолошке стране.</p>
<p>Оно што није једноставно, а што сам ја мислио да ће бити једноставно је прегледање готових превода са `yelp`-ом. Наиме, никако нисам успео да натерам програм `po2xml` да од .po датотеке изгенерише .xml. Вероватно је до мене, да не давим, проблем сам решио користећи <a href="http://live.gnome.org/Jhbuild">jhbuild</a> који ионако имам за потребе превођења програма. Дакле, овде сам омануо, <strong>преглед превода није једноставан</strong>. Наравно, вреди наместити jhbuild јер гледање превода у `yelp`-у не може да се мери са гледањем превода у програму за превођење &#8211; одмах се виде све грешке у куцању! Био сам у праву да ће <strong>превод документације да поправи преводе програма</strong>, нашао сам на једном месту да је „Score“ преведен као „Разултат“ (и ту ниску нажалост тренутно користе све игрице на 2.28!) уместо „Резултат“ и то се видело на снимку екрана. Одмах је послат печ на <a href="http://l10n.gnome.org/teams/sr">проклете лажи</a>.</p>
<p>Кад смо код снимака екрана, могу рећи да је то<strong> најзанимљивији део</strong> <img src='http://blog.kokanovic.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Снимци екрана које сам до сада радио су некад захтевали снимке екрана решених игрица, па човек мора да се довија како да реши игрицу &#8211; или да научи да је игра, или да се снађе. За неке игрице сам морао да их решавам да бих добио жељени снимак (ух, како сам се у том тренутку глупо осећао <img src='http://blog.kokanovic.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> , за неке сам варао, па сам ишао на „Савет“ или „Помоћ“ <img src='http://blog.kokanovic.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). Такође, за разлику од превода, слике морају да се раде и за ћирилицу и за латиницу, јер се не могу аутоматизовано транслитерализовати, тако да је до оног ко ради снимке да уради паралелно снимке и за ћирилицу и за латиницу. Углавном, кад се превод заврши, ово му дође као неки мали одмор и шлаг на торту, завршна тачка на ваш превод. Једна ствар на коју се мора пазити при превођењу ниски које имају референце на слике (и остале референце уосталом) је да референце морају да буду у номинативу. Нпр. превод следеће ниске:</p>
<blockquote><p>Starting &lt;application&gt;GNOME Tetravex&lt;/application&gt; opens the &lt;interface&gt;Main window&lt;/interface&gt;, shown in &lt;xref linkend=&#8221;mainwindow-fig&#8221;/&gt;.</p></blockquote>
<p>не може да буде:</p>
<blockquote><p>Покретањем &lt;application&gt;Гномове слагалице&lt;/application&gt; се отвара &lt;interface&gt;Главни прозор&lt;/interface&gt;, који је приказан на  &lt;xref linkend=&#8221;mainwindow-fig&#8221;/&gt;.</p></blockquote>
<p>јер би то завршило као:</p>
<blockquote><p>Покретањем Гномове слагалице се отвара Главни прозор, који је приказан на Слика 1.</p></blockquote>
<p>Ту или мора да се мења конструкција реченице („који приказује Слика 1“) или, што је још боље Милош предложио, а ја усвојио као најбоље решење, да такве реченице референцу имају у загради, што би на овом примеру гласило:</p>
<blockquote><p>Покретањем Гномове слагалице се отвара Главни прозор (Слика 1).</p></blockquote>
<p>Још неке мање битне ствари које могу да поменем су да треба пазити код превода низводно. Иако Гномов превод има једну ниску на један начин преведену, преводиоци низводно (нпр. Убунту тим) могу да је измене, па је тако Гномов тим превео игрицу „Tetravex“ као „Слагалица“, а у Убунтуу је то некако постало „Тетравекс“, тако да је то мало незгодно приликом превођења и приликом прављења снимка екрана (ако користите Убунту, наравно). Ово ми се само десило на овом примеру и ниједном више, али треба пазити дефинитивно. Такође, слање превода на проклете лажи је мало теже јер се поред .po датотека шаљу и слике. Проклете лажи имају могућност да приказују разлике превода одмах на сајту, али не и када се .po датотека и слике спакују заједно, тако да смо се договорили да се посебно шаље .po датотека, да бисмо могли да прегледамо разлике, а посебно спаковане слике јер нам за њих прегледање разлика није битно.</p>
<h2>За крај</h2>
<p>Дугачак текст, ако сте га целог прочитали &#8211; свака част. Пошто вероватно нећете ручно градити цео Гном да бисте видели превод документације на делу, а као награду што сте прочитали све довде (правићемо се да нико није варао и само клизао до краја текста <img src='http://blog.kokanovic.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ), ево и снимка како превод документације изгледа на делу. Уживајте!</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-43" title="klotski-doc-serbian" src="http://blog.kokanovic.org/wp-content/uploads/2009/10/klotski-doc-serbian.png" alt="klotski-doc-serbian" width="619" height="648" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/prva-iskustva-sa-prevodjenjem-gnom-dokumentacije/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Playing with canvas element</title>
		<link>http://blog.kokanovic.org/playing-with-canvas-element/</link>
		<comments>http://blog.kokanovic.org/playing-with-canvas-element/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 12:01:50 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=39</guid>
		<description><![CDATA[There are a lot of examples with canvas tag these days. As if world as a whole is preparing for imminent arrival of HTML5;) I&#8217;m not going to talk about canvas element &#8211; if you are a designer or developer and you still didn&#8217;t heard for it, then you will&#8230;soon. Anyway, there were nice post [...]]]></description>
			<content:encoded><![CDATA[<p>There are a lot of examples with canvas tag these days. As if world as a whole is preparing for imminent arrival of HTML5;) I&#8217;m not going to talk about canvas element &#8211; if you are a designer or developer and you still didn&#8217;t heard for it, then you will&#8230;soon. Anyway, there were nice post I found on DZone which summarizes some great examples of canvas usage, you can find it <a href="http://carsonified.com/blog/dev/html-5-dev/how-to-draw-with-html-5-canvas/">here</a> (examples are at the bottom, if you&#8217;re not interested in theory). <a href="http://addyosmani.com/blog/13-incredibly-fresh-new-canvas-demos/">Another</a> great summary post emerged few days after with a lot of cool examples (some of those examples are useless to open in anything other then Chrome, even if you <a href="http://www.tech-recipes.com/rx/3381/firefox-31-how-to-enable-the-tracemonkey-javascript-engine/">turn</a> TraceMonkey in Firefox). What caught my attention was something I saw a lot earlier with a experiment done a long ago (&#8220;long ago&#8221;  is funny term when speaking in technology context). It&#8217;s example of waving image, imitating water reflection. You can see original <a href="http://timelessname.com/canvas/experiment01/">here</a>. At the end of that page, you can read that that guy won&#8217;t add fading effect. This is where I jump in.</p>
<p><img class="aligncenter size-full wp-image-41" title="canvas" src="http://blog.kokanovic.org/wp-content/uploads/2009/10/canvas.png" alt="canvas" width="500" height="100" /></p>
<p>I took that code thinking that it will be easy. Long story short, with a complete rewrite, I <a href="http://kokanovic.org/test/svg.html">managed</a> to add fade out opacity. It turned harder then I thought it will be. Principle is the same &#8211; draw start image once and then refresh lower part every 25ms to make animation effect. In every frame, we go top down and for every row, new value of offset is calculated based on sin function. Frequency is set so one complete sine period is always shown.</p>
<p>Interesting thing is, I also managed to slow down complete animation by factor of 5-10x. Why is that? Original example uses <tt>drawImage()</tt> function and draws row-by-row. Because I use alpha channel, I had to resolve to <tt>putImageData()</tt> function (is this can be done with <tt>drawImage()</tt>?) and use it for every pixel! Basically, if image is 250&#215;50, original example have 50 drawings (for every row) and I have 12,500 pixel putting in image data. Needless to say, bigger images will hardly be of any value for this effect with this approach.</p>
<p>Once again, you can see it for yourself and look at the code <a href="http://kokanovic.org/test/svg.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/playing-with-canvas-element/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing with Smack&#8217;s PubSub extension</title>
		<link>http://blog.kokanovic.org/playing-with-smacks-pubsub-extension/</link>
		<comments>http://blog.kokanovic.org/playing-with-smacks-pubsub-extension/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:15:19 +0000</pubDate>
		<dc:creator>Бранко Кокановић</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.kokanovic.org/?p=38</guid>
		<description><![CDATA[Just played with Smack&#8217;s PubSub extension and it&#8217;s working great. PubSub is defined in XEP-0060 and offers tremendous possibilities. It&#8217;s basically the same model as JMS API. There are publishers and receivers. Publishers publish their&#8217;s payload to node and receivers subscribe to those nodes and receive those payloads. Needless to say, payload can be anything. [...]]]></description>
			<content:encoded><![CDATA[<p>Just played with Smack&#8217;s PubSub extension and it&#8217;s working great. PubSub is defined in <a href="http://xmpp.org/extensions/xep-0060.html">XEP-0060</a> and offers tremendous possibilities. It&#8217;s basically the same model as <a href="http://java.sun.com/products/jms/">JMS API</a>. There are publishers and receivers. Publishers publish their&#8217;s payload to node and receivers subscribe to those nodes and receive those payloads. Needless to say, payload can be anything. Scenario told here is just a basic example, XEP-0060 is much more than this. Robustness, scalability and other &#8220;hot&#8221; topics surrounding JMS are left to implementations, e.g. concrete implementation of Jabber server. Speaking of that, there is no better Jabber server implementation than <a href="http://www.igniterealtime.org/projects/openfire/">Openfire</a> &#8211; open-source Jabber server written in Java.</p>
<p>Guys that wrote Openfire also wrote <a href="http://www.igniterealtime.org/projects/smack/">Smack</a> &#8211; also open-source XMPP client library, and now there is PubSub extension for Smack. It&#8217;s fairly new, but as I test it, it does a nice job;  although I didn&#8217;t test any funky scenarios, all that I tried worked and there were no surprises or hidden gotchas. You can find library <a href="http://www.igniterealtime.org/issues/browse/SMACK-272">here</a> for now, but good resources for starting can also be found on theirs community forum <a href="http://www.igniterealtime.org/community/message/191463">here</a> and <a href="http://www.igniterealtime.org/community/message/196048">here</a>. Working with Smack&#8217;s PubSub extension is fairly easy (as with Smack in general). Before I post code, just to list some prerequisites in order to try this &#8211; you will need to have Jabber server with PubSub ability (if you don&#8217;t have one, I&#8217;d be happy to offer you to play on mine) and to create two test accounts on it &#8211; one for publishing, one for receiving. Create new project, add smack&#8217;s libraries and put this:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PublisherTest <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> XMPPException <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// connect as publisher</span>
        ConnectionConfiguration config <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ConnectionConfiguration<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;kokanovic.org&quot;</span>, <span style="color: #cc66cc;">5222</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        XMPPConnection connection <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XMPPConnection<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        connection.<span style="color: #006633;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        connection.<span style="color: #006633;">login</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;publisher&quot;</span>, <span style="color: #0000ff;">&quot;123&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// needed first time only to configure node</span>
        ConfigureForm form <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ConfigureForm<span style="color: #009900;">&#40;</span>FormType.<span style="color: #006633;">submit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        form.<span style="color: #006633;">setPersistentItems</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        form.<span style="color: #006633;">setDeliverPayloads</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        form.<span style="color: #006633;">setAccessModel</span><span style="color: #009900;">&#40;</span>AccessModel.<span style="color: #006633;">open</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// create node (comment second line and uncomment third to just get already created node</span>
        PubSubManager manager <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PubSubManager<span style="color: #009900;">&#40;</span>connection, <span style="color: #0000ff;">&quot;pubsub.myserver.org&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        LeafNode myNode <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>LeafNode<span style="color: #009900;">&#41;</span> manager.<span style="color: #006633;">createNode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MyNode&quot;</span>, form<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//Node myNode = manager.getNode(&quot;MyNode&quot;);</span>
&nbsp;
        SimplePayload payload <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimplePayload<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;event&quot;</span>, <span style="color: #0000ff;">&quot;pubsub:test:event&quot;</span>,
            <span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">+</span>
            <span style="color: #0000ff;">&quot;&lt;title&gt;New blog post&lt;/title&gt;&quot;</span> <span style="color: #339933;">+</span>
            <span style="color: #0000ff;">&quot;&lt;desc&gt;Stalker published new blog post&lt;/desc&gt;&quot;</span> <span style="color: #339933;">+</span>
            <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// putting null for id means you let server generate id</span>
        PayloadItem item <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PayloadItem<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, payload<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// you could use publish() for asynchronous call</span>
        myNode.<span style="color: #006633;">send</span><span style="color: #009900;">&#40;</span>item<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Receiver is similar, but a bit simpler:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ReceiverTest <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> XMPPException <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// connect as receiver</span>
        ConnectionConfiguration config <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ConnectionConfiguration<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;kokanovic.org&quot;</span>, <span style="color: #cc66cc;">5222</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        XMPPConnection connection <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XMPPConnection<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        connection.<span style="color: #006633;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        connection.<span style="color: #006633;">login</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;receiver&quot;</span>, <span style="color: #0000ff;">&quot;123&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// start listening for published items</span>
        PubSubManager manager <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PubSubManager<span style="color: #009900;">&#40;</span>connection, <span style="color: #0000ff;">&quot;pubsub.myserver.org&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        Node eventNode <span style="color: #339933;">=</span> manager.<span style="color: #006633;">getNode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MyNode&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        eventNode.<span style="color: #006633;">addItemEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ItemEventListener<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            @Override
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> handlePublishedItems<span style="color: #009900;">&#40;</span>ItemPublishEvent items<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>Item item <span style="color: #339933;">:</span> items.<span style="color: #006633;">getItems</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>PayloadItem<span style="color: #009900;">&#41;</span>item<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getPayload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// you will need this first time only</span>
        eventNode.<span style="color: #006633;">subscribe</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;receiver@myserver.org&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// do not die on me!</span>
        <span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">Thread</span>.<span style="color: #006633;">sleep</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">InterruptedException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Future of PubSub&#8230;well, it depends, and it heavily depends now of Google Wave. Don&#8217;t get me wrong, future of XMPP is secured now Google Wave is there (in fact, it was secured with Google Talk:), but future of PubSub will depend of direction Google Wave will take, e.g. will it somehow take over PubSub responsibilities and functionalities. Truth is, PubSub is not nearly utilized as it could be, and my opinion is that it&#8217;s because no big player stands behind it, no big player stands behind any implementation &#8211; there are just no &#8220;enterprisy&#8221; component in PubSub. Google Wave aside, I have no doubt that PubSub will be more and more popular, it&#8217;s its open nature and great architecture that directs to that conclusion. Also, don&#8217;t for a moment think users will ever be aware of PubSub, just as they are not aware now of XMPP protocol while chatting in Google Talk. PubSub will be somewhere down under, happily collaborating with Jabber server, Jabber client libraries and happy developer that uses it. Just think what can be done with it &#8211; from writing bots that respond to events, to turning your toaster on and off. Possibilities are endless.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kokanovic.org/playing-with-smacks-pubsub-extension/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
