<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sasha's spot &#187; Programming</title>
	<atom:link href="http://jazzvas.wordpress.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://jazzvas.wordpress.com</link>
	<description>Random thoughts and stuff...</description>
	<lastBuildDate>Wed, 24 Jun 2009 00:44:30 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='jazzvas.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/41755b39fb435c95cdef696830161105?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Sasha's spot &#187; Programming</title>
		<link>http://jazzvas.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jazzvas.wordpress.com/osd.xml" title="Sasha&#8217;s spot" />
		<item>
		<title>How to create rotating wallpapers in Gnome</title>
		<link>http://jazzvas.wordpress.com/2008/09/12/how-to-create-rotating-wallpapers-in-gnome/</link>
		<comments>http://jazzvas.wordpress.com/2008/09/12/how-to-create-rotating-wallpapers-in-gnome/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 01:42:49 +0000</pubDate>
		<dc:creator>Saša Bodiroža</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[wallpaper]]></category>

		<guid isPermaLink="false">http://www.jazzva.com/?p=114</guid>
		<description><![CDATA[Few days ago I found artwork suggestions for Fedora 10. I really like the wallpapers in Solar theme. They should change based on the time of the day. As I don&#8217;t think that is supported in Gnome, I wrote this little script that does the job.
To run it, a directory with wallpapers needs to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=114&subd=jazzvas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Few days ago I found <a href="http://fedoraproject.org/wiki/Artwork/F10Themes" target="_blank">artwork suggestions</a> for <a href="http://fedoraproject.org/" target="_blank">Fedora</a> 10. I really like the <a href="http://fedoraproject.org/wiki/Artwork/F10Themes/Solar" target="_blank">wallpapers in Solar theme</a>. They should change based on the time of the day. As I don&#8217;t think that is supported in Gnome, I wrote <a href="http://www.jazzva.com/scripts/rotate-wallpapers" target="_blank">this little script</a> that does the job.</p>
<p>To run it, a directory with wallpapers needs to be passed.</p>
<p><code>./rotate-wallpapers /path/to/wallpaper/directory/</code></p>
<p>If you want it to run in the background, you can press Alt+F2 in Gnome, and run it.</p>
<p><code>/path/to/rotate-wallpapers /path/to/wallpaper/directory/</code></p>
<p>Once it&#8217;s run, it will count the number of wallpapers in the directory (files ending in jpg, jpeg, gif, png or svg), divide 1440 by that number and use the result as a period of time on which wallpapers will be rotated. It will set the first wallpaper, and sleep until the wallpaper needs to be changed.</p>
<p>So, this script is pretty much specific. It will work best with the series of wallpapers that have subtle changes, such as the Solar wallpapers. But, you&#8217;re free to use it in every way you want. Good luck <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#8230;</p>
<p>If you find any bugs, please post it in the comments. Thanks.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jazzvas.wordpress.com/114/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jazzvas.wordpress.com/114/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jazzvas.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jazzvas.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jazzvas.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jazzvas.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jazzvas.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jazzvas.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jazzvas.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jazzvas.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jazzvas.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jazzvas.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=114&subd=jazzvas&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jazzvas.wordpress.com/2008/09/12/how-to-create-rotating-wallpapers-in-gnome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d3bb6784a70446a0f5ccb96cd5bca85d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jazzva</media:title>
		</media:content>
	</item>
		<item>
		<title>Adapting Joomla database to UTF8</title>
		<link>http://jazzvas.wordpress.com/2008/07/23/adapting-joomla-database-to-utf8/</link>
		<comments>http://jazzvas.wordpress.com/2008/07/23/adapting-joomla-database-to-utf8/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 20:41:59 +0000</pubDate>
		<dc:creator>Saša Bodiroža</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[latin1]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.jazzva.com/?p=57</guid>
		<description><![CDATA[Few days ago I was searching for an easy way to adapt MySQL database used by Joomla from latin1 to UTF8 character set. I haven&#8217;t found anything, so I wrote this little script.
It&#8217;s easy to make a database which uses UTF8 character set when you&#8217;re installing Joomla by hand. Though, sometimes your hosting provider doesn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=62&subd=jazzvas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://flickr.com/photos/scottmarkwell/2207949953/"><img class="size-medium wp-image-58" title="SQL" src="http://jazzvas.files.wordpress.com/2008/12/sql.jpg" alt="" align="right" /></a>Few days ago I was searching for an easy way to adapt MySQL database used by Joomla from latin1 to UTF8 character set. I haven&#8217;t found anything, so I wrote this little script.</p>
<p>It&#8217;s easy to make a database which uses UTF8 character set when you&#8217;re installing Joomla by hand. Though, sometimes your hosting provider doesn&#8217;t give you the right to create new databases, so the only way is to install it using some software (cPanel, for example). It will usually set DB to use latin1 encoding. So, after it&#8217;s installed we have to modify database and its tables using SQL. This script should do the job, at least for Joomla 1.5, since it&#8217;s modifying tables used in Joomla 1.5.</p>
<p><strong>Update:</strong> I&#8217;m not sure, but altering table jos_users seems to break the passwords. I think you can safely skip it&#8230;</p>
<p><span style="font-size:xx-small;"><code><br />
ALTER DATABASE CHARACTER SET `utf8` COLLATE `utf8_general_ci`;<br />
ALTER TABLE jos_banner CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_bannerclient CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_bannertrack CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_categories CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_components CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_contact_details CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_content CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_content_frontpage CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_content_rating CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_core_acl_aro CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_core_acl_aro_groups CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_core_acl_aro_map CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_core_acl_aro_sections CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_core_acl_groups_aro_map CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_core_log_items CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_core_log_searches CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_groups CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_menu CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_menu_types CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_messages CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_messages_cfg CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_migration_backlinks CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_modules CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_modules_menu CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_newsfeeds CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_plugins CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_poll_data CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_poll_date CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_poll_menu CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_polls CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_sections CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_session CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_stats_agents CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_templates_menu CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_users CONVERT TO CHARACTER SET `utf8`;<br />
ALTER TABLE jos_weblinks CONVERT TO CHARACTER SET `utf8`;</code></span></p>
<p>This script assumes that the prefix of your tables is &#8220;jos_&#8221;. In case it&#8217;s not, just change it in the script. This script can also be applied to any other database. Just open it, and use the names of your tables, instead of these.</p>
<p>In case there is an easier way, I would be thankful if it gets posted in the comments.</p>
<p><em>Little disclaimer: I&#8217;m in no way responsible if something goes wrong. Be careful when you start doing this.</em></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jazzvas.wordpress.com/62/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jazzvas.wordpress.com/62/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jazzvas.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jazzvas.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jazzvas.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jazzvas.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jazzvas.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jazzvas.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jazzvas.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jazzvas.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jazzvas.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jazzvas.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=62&subd=jazzvas&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jazzvas.wordpress.com/2008/07/23/adapting-joomla-database-to-utf8/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d3bb6784a70446a0f5ccb96cd5bca85d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jazzva</media:title>
		</media:content>

		<media:content url="http://jazzvas.files.wordpress.com/2008/12/sql.jpg" medium="image">
			<media:title type="html">SQL</media:title>
		</media:content>
	</item>
		<item>
		<title>Assembling &#8230; done</title>
		<link>http://jazzvas.wordpress.com/2008/05/25/assembling-done/</link>
		<comments>http://jazzvas.wordpress.com/2008/05/25/assembling-done/#comments</comments>
		<pubDate>Sun, 25 May 2008 20:53:38 +0000</pubDate>
		<dc:creator>Saša Bodiroža</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[assembler]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://www.jazzva.com/?p=51</guid>
		<description><![CDATA[Well, I finished the assembler project for school. It was fun writing it and breaking the assembler into separate parts, for each specific task. I have also learned a lot about the way assembler works.
It is a basic assembler for 8086 processor with 2-byte words, and 1 byte long addressable unit.
It isn&#8217;t full with instructions, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=58&subd=jazzvas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.jazzva.com/wp-content/uploads/2008/05/assembler-code.jpg"><img class="size-thumbnail wp-image-52" title="assembler code" src="http://jazzvas.files.wordpress.com/2008/12/assembler-code-150x150.jpg" alt="Assembler code" align="right" /></a>Well, I finished the assembler project for school. It was fun writing it and breaking the assembler into separate parts, for each specific task. I have also learned a lot about the way assembler works.</p>
<p>It is a basic assembler for 8086 processor with 2-byte words, and 1 byte long addressable unit.</p>
<p>It isn&#8217;t full with instructions, but it covers the basics. There are four segments: dat, txt, bss and stack. dat and txt, as data and code segments, are represented in the object file. There is the directive DW which is used to reserve a word, END for marking the end of the input. Seven instructions are available:</p>
<ul>
<li>mov dst, src</li>
<li>add dst, src</li>
<li>push src</li>
<li>pop dst</li>
<li>int src</li>
<li>jz src</li>
<li>jmp src</li>
</ul>
<p>Eight registers are accessible: AX, BX, CX, DX, SI, DI, BP, SP. There are four addressing modes: immediate, direct, register direct and register indirect with displacement. The coded instruction is one word long, if both operands are addressed with register direct addressing, or two words long, if one of the operands is addressed in some other mode.</p>
<p>So far, the assembler is case-insensitive, but I think I&#8217;ll reprogram it, so it is case-sensitive for user-defined symbols. That would be nice <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Since I don&#8217;t think I should publicly post the project code for now (there are still other people writing it), I&#8217;m gonna post a simple assembler program and the output. The program is not doing anything meaningful. It is just presenting the assembler possibilities.<span id="more-58"></span></p>
<p>Input:</p>
<pre>PUBLIC p1,p2,p3,p4
EXTERN e1,e2,e3,e4
SEGMENT txt
p1: mov cx, 13
p2: add ax, 0x12
p4: jmp [bp]*
labela: jmp p1
add cx, p3
jz e3
add [si]*, ax
dw *
dw p1
add ax, [si]*
jz labela
jmp e4
p3: int e1
int p4
jmp labela
mov cx, bx
SEGMENT dat
dw ?
dw *
SEGMENT bss
dw ?
dw ?
SEGMENT stack
END</pre>
<p>And here&#8217;s the object file:</p>
<pre>LINK
4 8 14
# Segments
.txt	0	58	RWP
.dat	58	4	RWP
.bss	62	4	RW
.stack	66	32	RW
# Symbols
e3	0	0	U
e4	0	0	U
e1	0	0	U
e2	0	0	U
p4	8	1	D
p3	44	1	D
p2	4	1	D
p1	0	1	D
# Relocations
000A	1	1	A1
000E	1	1	A1
0012	1	1	A1
0016	1	3	RS1
001A	1	1	A1
001C	1	1	A1
001E	1	1	A1
0022	1	1	A1
0026	1	1	R1
002A	1	4	AS1
002E	1	1	AS1
0032	1	1	A1
0036	1	1	A1
003C	2	2	A1
# Data
19 00 00 0d 28 00 00 12 70 78 00 08 70 00 00 00 29 00 00 2c 60 00 00 00 2e 40 00 18
00 1c 00 00 28 70 00 20 60 00 00 0c 70 00 00 00 50 00 00 00 50 00 00 08 70 00 00 0c 19 44
00 00 00 00 00 3C</pre>
<p>And here is the same program, with some errors&#8230;</p>
<pre>labela1: SEGMENT txt
labela2: PUBLIC p1,p2,p3,p4
EXTERN e1,e2,e3,e4
p1: mov 0x13, 13
p2: add ax, 0x12
p2: jmp [ax]*
labela: jmp p1
add cx, p3
dw *
dw p1
add [ax]*, [bx]*
e1: int p2
SEGMENT dat
mov cx, bx
dw ?
SEGMENT dat
dw *
SEGMENT bss
dw *
dw ?
SEGMENT stack
dw *
SEGMENT nekiTamoSegment
END</pre>
<p>&#8230;and the errors list that is presented to the user&#8230;</p>
<pre>ERROR line 1: SEGMENT directive can not be labeled
ERROR line 2: PUBLIC directive can not be labeled
ERROR line 2: PUBLIC not called at the beginning
ERROR line 3: EXTERN not called at the beginning
ERROR line 4: Destination can not be addressed with immediate addresssing.
ERROR line 4: Uncompatible address modes - dst: immediate, src: immediate
ERROR line 6: Symbol p2 has multiple definition
WARNING line 9: DW found in TXT segment, make sure you wrapped it with "JMP yourLabelX" and "yourLabelX: ...", so it doesn't get executed.
WARNING line 10: DW found in TXT segment, make sure you wrapped it with "JMP yourLabelX" and "yourLabelX: ...", so it doesn't get executed.
ERROR line 11: Uncompatible address modes - dst: register indirect with displacement, src: register indirect with displacement
ERROR line 12: Extern symbol e1 can not be defined
ERROR line 14: MOV must be called in TXT segment
ERROR line 16: Segment dat exists
ERROR line 19: Data can not be initialized in BSS segment
ERROR line 22: DW must be called in TXT, BSS or DAT segment
ERROR line 23: Bad segment - nekiTamoSegment
Errors were encountered. Assembling is not completed.</pre>
<p>Well, I suppose that is it for now. Maybe we&#8217;re gonna have to make a linker for the second homework. That would be nice.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jazzvas.wordpress.com/58/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jazzvas.wordpress.com/58/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jazzvas.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jazzvas.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jazzvas.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jazzvas.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jazzvas.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jazzvas.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jazzvas.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jazzvas.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jazzvas.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jazzvas.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=58&subd=jazzvas&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jazzvas.wordpress.com/2008/05/25/assembling-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d3bb6784a70446a0f5ccb96cd5bca85d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jazzva</media:title>
		</media:content>

		<media:content url="http://jazzvas.files.wordpress.com/2008/12/assembler-code-150x150.jpg" medium="image">
			<media:title type="html">assembler code</media:title>
		</media:content>
	</item>
		<item>
		<title>Assembling too much</title>
		<link>http://jazzvas.wordpress.com/2008/05/22/assembling-too-much/</link>
		<comments>http://jazzvas.wordpress.com/2008/05/22/assembling-too-much/#comments</comments>
		<pubDate>Thu, 22 May 2008 21:24:52 +0000</pubDate>
		<dc:creator>Saša Bodiroža</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.jazzva.com/?p=50</guid>
		<description><![CDATA[I have been writing assembler for the school project in the past few days. I think it had some negative effect on me&#8230;
Here&#8217;s a snippet from recent conversation with a friend:
Minja: The French guy has a great song.
Me: I&#8217;ll listen it. So far, I like mov, add&#8230; I mean, Turkish, Israeli and Bosnian song.
Time for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=57&subd=jazzvas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://xkcd.com/227/" target="_blank"><img style="vertical-align:middle;" src="http://imgs.xkcd.com/comics/color_codes.png" alt="Color codes" width="200" align="right" /></a>I have been writing assembler for the school project in the past few days. I think it had some negative effect on me&#8230;</p>
<p>Here&#8217;s a snippet from recent conversation with a friend:</p>
<blockquote><p>Minja: <em>The French guy has a great song.</em></p>
<p>Me: <em>I&#8217;ll listen it. So far, I like mov, add&#8230; I mean, Turkish, Israeli and Bosnian song.</em></p></blockquote>
<p>Time for dinner&#8230; definitely.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jazzvas.wordpress.com/57/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jazzvas.wordpress.com/57/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jazzvas.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jazzvas.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jazzvas.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jazzvas.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jazzvas.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jazzvas.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jazzvas.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jazzvas.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jazzvas.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jazzvas.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=57&subd=jazzvas&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jazzvas.wordpress.com/2008/05/22/assembling-too-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d3bb6784a70446a0f5ccb96cd5bca85d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jazzva</media:title>
		</media:content>

		<media:content url="http://imgs.xkcd.com/comics/color_codes.png" medium="image">
			<media:title type="html">Color codes</media:title>
		</media:content>
	</item>
		<item>
		<title>getString/getFormattedString in JS and XUL</title>
		<link>http://jazzvas.wordpress.com/2007/08/25/getstringgetformattedstring-in-js-and-xul/</link>
		<comments>http://jazzvas.wordpress.com/2007/08/25/getstringgetformattedstring-in-js-and-xul/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 20:46:28 +0000</pubDate>
		<dc:creator>Saša Bodiroža</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[getFormattedString]]></category>
		<category><![CDATA[getString]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[xul]]></category>

		<guid isPermaLink="false">http://jazzvas.wordpress.com/2007/08/25/getstringgetformattedstring-in-js-and-xul/</guid>
		<description><![CDATA[I&#8217;ve been working on one Firefox extension lately. As with most of the them, there was a need to work with strings  . It had the stringbundleset, with defined stringbundles. We also needed a getString and getFormattedString (gS/gFS) functions for the class. Well, it seemed easy enough: try to fetch from the first bundle, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=11&subd=jazzvas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been working on one Firefox extension lately. As with most of the them, there was a need to work with strings <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . It had the stringbundleset, with defined stringbundles. We also needed a getString and getFormattedString (gS/gFS) functions for the class. Well, it seemed easy enough: try to fetch from the first bundle, check if the string is null, if it is, try to fetch from the second bundle (got used to C++ <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )&#8230;</p>
<p>I&#8217;ve looked up on the Internet to see what does stringbundle&#8217;s gS/gFS returns. Their definition can be found at <a href="http://developer.mozilla.org/">MDC</a>&#8217;s <a href="http://developer.mozilla.org/en/docs/XUL:stringbundle">page on stringbundles</a>. Unluckily, there&#8217;s no info what happens if a string is not found. Luckily, MDC&#8217;s <a href="http://developer.mozilla.org/en/docs/XUL_Tutorial:Property_Files#Getting_a_String_from_the_Bundle">tutorial on property file</a> says that gS/gFS returns null in that case. I tried that and it didn&#8217;t work. It would just throw an exception.</p>
<p>So, I searched through the code to see if there&#8217;s some other gS/gFS (which I should have done in the start). There was one other class that had them. No &#8220;if (!string)&#8221; testing, but catching an exception <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . If you bumped upon this problem, here&#8217;s an example of the solution:</p>
<pre class="brush: jscript;">var result;
try {
&nbsp;&nbsp;result = document.getElementById(stringBundleFirst).getString(key);
}
catch (e) {
&nbsp;&nbsp;result = document.getElementById(stringBundleSecond).getString(key);
}
return result;</pre>
<p>Happy coding <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jazzvas.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jazzvas.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jazzvas.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jazzvas.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jazzvas.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jazzvas.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jazzvas.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jazzvas.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jazzvas.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jazzvas.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jazzvas.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jazzvas.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jazzvas.wordpress.com&blog=1556633&post=11&subd=jazzvas&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jazzvas.wordpress.com/2007/08/25/getstringgetformattedstring-in-js-and-xul/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d3bb6784a70446a0f5ccb96cd5bca85d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jazzva</media:title>
		</media:content>
	</item>
	</channel>
</rss>