<?xml version="1.0" encoding="iso-8859-1"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
  <title>LazaX</title>
  <link rel="alternate" type="text/html" href="http://lazax.com/blog/" />
  <modified>2008-02-14T06:45:26Z</modified>
  <tagline>by Zoran Lazarevic</tagline>
  <id>tag:lazax.com,2008:/blog//1</id>
  <generator url="http://www.movabletype.org/" version="2.65">Movable Type</generator>
  <copyright>Copyright (c) 2008, laza</copyright>
  <entry>
    <title>Skiing Utah 2008</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000109.html" />
    <modified>2008-02-14T06:45:26Z</modified>
    <issued>2008-02-14T01:45:26-05:00</issued>
    <id>tag:lazax.com,2008:/blog//1.109</id>
    <created>2008-02-14T06:45:26Z</created>
    <summary type="text/plain"> &quot;The Best Snow on Earth!&quot; Featuring: Colleen, Dave, Chris, &amp;#381;ika, Maja, Sa&amp;#353;ka, Laza, and Pavle! [album]...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Travel</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p><p><br />
<a href="/photos/2008-02-14%20Ski%20Utah/"><br />
<img src="/photos/2008-02-14%20Ski%20Utah/thumbnails/img_0081.jpg" width="154" height="118" align="left"><br />
<img src="/photos/2008-02-14%20Ski%20Utah/thumbnails/img_0014.jpg" width="118" height="154" align="left"><br />
<img src="/photos/2008-02-14%20Ski%20Utah/thumbnails/img_0159.jpg" width="154" height="118" align="left"><br />
</a><br />
<br clear="all"><br />
<p>"The Best Snow on Earth!"<br />
<p>Featuring: Colleen, Dave, Chris, &#381;ika, Maja, Sa&#353;ka, Laza, and Pavle!</p>

<p><a href="/photos/2008-02-14%20Ski%20Utah/">[album]</a><br />
<br clear="all"><br />
</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Cherry Blossom Festival at Brooklyn Botanical Garden    </title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000108.html" />
    <modified>2007-05-18T04:33:17Z</modified>
    <issued>2007-05-18T00:33:17-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.108</id>
    <created>2007-05-18T04:33:17Z</created>
    <summary type="text/plain"> Sa festivala cvetanja japanske tre&amp;#353;nje u bruklin&amp;#353;koj botani&amp;#269;koj ba&amp;#353;ti (4. april 2007): [Album]...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Travel</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<a href="/photos/2007-04-29 Brooklyn Botanical Garden/">
<img src="/photos/2007-04-29 Brooklyn Botanical Garden/thumbs/DSCN4337.JPG" width="142" height="182" alt="Cherry Bloom" border="0" align="right">
<img src="/photos/2007-04-29 Brooklyn Botanical Garden/thumbs/DSCN4264.JPG" width="142" height="182" alt="Cherry Bloom" border="0" align="right">
</a>
<p>Sa festivala cvetanja japanske tre&#353;nje u bruklin&#353;koj botani&#269;koj ba&#353;ti (4. april 2007):
<p><a href="/photos/2007-04-29 Brooklyn Botanical Garden/">
[Album]
</a>
<br clear="all">]]>
      
    </content>
  </entry>
  <entry>
    <title>Manhattan Cruise</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000107.html" />
    <modified>2007-05-10T05:53:26Z</modified>
    <issued>2007-05-10T01:53:26-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.107</id>
    <created>2007-05-10T05:53:26Z</created>
    <summary type="text/plain"> Nakon krstarenja oko Menhetna, &amp;#381;ivica i Ljilja su rekli: &quot;Ovo je najbolji na&amp;#269;in da se vidi grad!&quot; [album]...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Travel</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p><a href="/photos/2007-04-22%20Manhattan%20Cruise/"><br />
<img src="/photos/2007-04-22%20Manhattan%20Cruise/thumbs/DSCN4220.JPG" width="182" height="142" align="left"><br />
</a><br />
Nakon krstarenja oko Menhetna, &#381;ivica i Ljilja su rekli: "Ovo je najbolji na&#269;in da se vidi grad!"</p>

<p><a href="/photos/2007-04-22%20Manhattan%20Cruise/">[album]</a><br />
<br clear="all"></p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Ski Stowe,VT 2007-04-14</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000106.html" />
    <modified>2007-05-10T05:40:46Z</modified>
    <issued>2007-05-10T01:40:46-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.106</id>
    <created>2007-05-10T05:40:46Z</created>
    <summary type="text/plain"> Netipi&amp;#269;no za sredinu aprila, kada bi skija&amp;#353;ka sezona trebalo da se privodi kraju, velika me&amp;#263;ava je donela nekoliko stopi snega na severoistoku. Iskoristili smo tu priliku da odemo u Stou, na&amp;#353;e omiljeno mesto u Vermontu. Pavle je u&amp;#382;ivao u...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Travel</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<a href="/photos/2007-04-14%20Ski%20Stowe%20VT/">
<img src="/photos/2007-04-14%20Ski%20Stowe%20VT/thumbs/DSCN4082.JPG" width="182" height="142" align="right" >
</a>
<p>Netipi&#269;no za sredinu aprila, kada bi skija&#353;ka sezona trebalo da se privodi kraju, velika me&#263;ava je donela nekoliko stopi snega na severoistoku. Iskoristili smo tu priliku da odemo u <a href="http://stowe.com/">Stou</a>, na&#353;e omiljeno mesto u <a href="http://www.vermont.gov/">Vermontu</a>. Pavle je u&#382;ivao u sankanju, Sa&#353;ka i Laza su u&#382;ivali u skijanju na sve&#382;em prahu dok je sneg vejao bez prestanka. Baka i deka su malo bili u turizmu, a vi&#353;e &#269;uvali Pavla.

<br clear=all>
<a href="/photos/2007-04-14%20Ski%20Stowe%20VT/">
<img src="/photos/2007-04-14%20Ski%20Stowe%20VT/thumbs/DSCN4110.JPG" width="182" height="142" align="left" >
</a>
<p>U povratku smo vozili 30mph po zavejanim putevima, proklizavali nebrojeno puta, i gledali proklizale automobile po jarkovima pored druma. I tako do Masa&#269;useca gde je sneg pre&#353;ao u neprestanu ki&#353;u.

<p>Oko pono&#263;i, na ulazu u Njujork smo nai&#353;li na neverovatnu gu&#382;vu. Radio je javljao da je na&#353; auto put (a i mnogi drugi u okolini grada) poplavljen i zatvoren. Sa&#353;ka nas je ekspertski provela zaobilaznicama oko mesta gde radi, tako da smo stigli ku&#263;i za 8 sati od polaska. To je bilo fenomenalno vreme, jer put u dobrim uslovima obi&#269;no traje 7 sati.

<a href="/photos/2007-04-14%20Ski%20Stowe%20VT/">
<img src="/photos/2007-04-14%20Ski%20Stowe%20VT/thumbs/DSCN4066.JPG" width="182" height="142" align="right" >
</a>
<p>Naravno, posle pono&#263;i je gotovo nemogu&#263;e na&#263;i parking na ulici. Pravac komercijalna gara&#382;a, a kad ona popunjena. Ostale gara&#382;e u kraju ne treba ni proveravati jer su one popunjene bez izuzetka. Taman kada sam mislio da mi ni&#353;ta ne preostaje nego da spavam u kolima, vidim prazno mesto na ulici odmah kod izlaza iz gara&#382;e!!! Ovo je manje verovatno nego me&#263;ava u aprilu.

<p>Sutradan na poslu su se svi jadali da su im ku&#263;e poplavljene. &#381;iveti u stanu na vrhu brda ima svojih prednosti.
]]>
      
    </content>
  </entry>
  <entry>
    <title>Easter 2007</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000105.html" />
    <modified>2007-05-10T05:04:41Z</modified>
    <issued>2007-05-10T01:04:41-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.105</id>
    <created>2007-05-10T05:04:41Z</created>
    <summary type="text/plain"> Slike sa Uskrsa:...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Kids</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p><a href="/photos/2007-04-08%20Uskrs/"><br />
Slike sa Uskrsa:<br />
</a></p>

<p><a href="/photos/2007-04-08%20Uskrs/"><br />
<img src="/photos/2007-04-08%20Uskrs/image.jpg" width="376" height="145"><br />
</a></p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Slike</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000104.html" />
    <modified>2007-05-10T04:36:45Z</modified>
    <issued>2007-05-10T00:36:45-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.104</id>
    <created>2007-05-10T04:36:45Z</created>
    <summary type="text/plain">Pavle voli da se slika:...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Kids</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p>Pavle voli da se <a href="/photos/2007-04-01%20Pavle/">slika</a>:</p>

<p><a href="/photos/2007-04-01%20Pavle/"><br />
<img src="/photos/2007-04-01%20Pavle/image.jpg"><br />
</a></p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Win32 Registry For Ruby Gems</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000103.html" />
    <modified>2007-05-06T02:41:33Z</modified>
    <issued>2007-05-05T22:41:33-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.103</id>
    <created>2007-05-06T02:41:33Z</created>
    <summary type="text/plain">When creating and Ruby gems under Win32, it is convenient to double-click .gemspec file in order to build the gem. And, in the same manner, double-clicking .gem file should install the gem. Registry entries below achieve just that: Windows Registry...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Ruby</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[When creating and <a href="http://ruby-lang.org/">Ruby</a> <a href="http://docs.rubygems.org/">gems</a> under Win32, it is convenient to double-click <b>.gemspec</b> file in order to <b>build</b> the gem. And, in the same manner, double-clicking <b>.gem</b> file should install the gem. Registry entries below achieve just that:

<pre>
Windows Registry Editor Version 5.00


[HKEY_CLASSES_ROOT\.gemspec]
@="rubygemspec"

[HKEY_CLASSES_ROOT\.gemspec\ShellNew]
"NullFile"=""


[HKEY_CLASSES_ROOT\rubygemspec]
@="Ruby Gem Specification"

[HKEY_CLASSES_ROOT\rubygemspec\DefaultIcon]
@="C:\\Programs\\lang\\Ruby\\lib\\ruby.ico,0"

[HKEY_CLASSES_ROOT\rubygemspec\Shell]
@="Build"

[HKEY_CLASSES_ROOT\rubygemspec\Shell\Edit]

[HKEY_CLASSES_ROOT\rubygemspec\Shell\Edit\command]
@="\"C:\\Programs\\utils\\SciTE\\SciTE.exe\" \"%1\" %*"

[HKEY_CLASSES_ROOT\rubygemspec\Shell\Build]

[HKEY_CLASSES_ROOT\rubygemspec\Shell\Build\command]
@="\"C:\\Programs\\lang\\Ruby\\bin\\gem.bat\" build \"%1\" %*"




[HKEY_CLASSES_ROOT\.gem]
@="rubygem"

[HKEY_CLASSES_ROOT\.gem\ShellNew]
"NullFile"=""

[HKEY_CLASSES_ROOT\rubygem]
@="Ruby Gem Package"

[HKEY_CLASSES_ROOT\rubygem\DefaultIcon]
@="C:\\Programs\\lang\\Ruby\\lib\\ruby.ico,0"

[HKEY_CLASSES_ROOT\rubygem\Shell]
@="Install"

[HKEY_CLASSES_ROOT\rubygem\Shell\Install]

[HKEY_CLASSES_ROOT\rubygem\Shell\Install\command]
@="\"C:\\Programs\\lang\\Ruby\\bin\\gem.bat\" install \"%1\" %*"


</pre>]]>
      
    </content>
  </entry>
  <entry>
    <title>Bronx Botanical Garden</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000102.html" />
    <modified>2007-04-04T04:27:36Z</modified>
    <issued>2007-04-04T00:27:36-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.102</id>
    <created>2007-04-04T04:27:36Z</created>
    <summary type="text/plain">Pavle apparently enjoyed the sight of flowers and trees:...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Travel</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p>Pavle apparently enjoyed the sight of flowers and trees:</p>

<p><a href="/photos/2007-04-01%20Bronx%20Botanical%20Garden/"><br />
<img src="/photos/2007-04-01%20Bronx%20Botanical%20Garden/slides/DSCN3982.JPG" width="732" height="552"><br />
</a></p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Pavle and Nikola Sled Riding</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000099.html" />
    <modified>2007-03-19T02:13:20Z</modified>
    <issued>2007-03-18T22:13:20-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.99</id>
    <created>2007-03-19T02:13:20Z</created>
    <summary type="text/plain">Well, Pavle and Nikola were not sled riding by themsleves, but they allowed their fathers (and grandfather) to haul them up and down and around....</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Kids</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p>Well, Pavle and Nikola were not sled riding by themsleves, but they allowed their fathers (and grandfather) to haul them up and down and around.</p>

<p><a href="/photos/2007-03-18%20Sankanje/index.html"><br />
<img src="/photos/2007-03-18%20Sankanje/slides/DSCN3835.JPG" width="518" height="390"><br />
</a></p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Skiing Lake Tahoe 2007</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000098.html" />
    <modified>2007-02-16T05:03:07Z</modified>
    <issued>2007-02-16T00:03:07-05:00</issued>
    <id>tag:lazax.com,2007:/blog//1.98</id>
    <created>2007-02-16T05:03:07Z</created>
    <summary type="text/plain">In early february, we went skiing to Lake Tahoe, California. This was probably the most beautiful place we have been so far. The area boasts the lake, snow-covered mountains, and curvy roads fenced by evergreens. It alse glimpses over the...</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Travel</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p>In early february, we went skiing to Lake Tahoe, California. This was probably the most beautiful place we have been so far. The area boasts the lake, snow-covered mountains, and curvy roads fenced by evergreens. It alse glimpses over the desert scenery of Nevada.</p>

<p>Awesome ski ares are <a href="http://www.squaw.com/">Squaw Valley</a> and <a href="http://www.kirkwood.com/">Kirkwood</a>. Heavenly is great for taking pictures and enjoying groomed trails. The snow conditions were less than perfect. When we got there, the locals complained of the worst season they remember and some trails were closed. Towards the end of the week we got a few feet of snow. I wished I could ski deep powder. We also scraped our skis while going over sharp rocks covered with 3 feet of soft powder.</p>

<p>Anyway, a few <a href="/photos/2007-02-03%20Lake%20Tahoe/">pictures</a> are available.</p>

<p><a href="/photos/2007-02-03%20Lake%20Tahoe/"><br />
<img src="/blog/images/2007-02-16%20Skiing%20Lake%20Tahoe.PNG"><br />
</a></p>]]>
      
    </content>
  </entry>
  <entry>
    <title>with</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000097.html" />
    <modified>2006-11-12T09:07:42Z</modified>
    <issued>2006-11-12T04:07:42-05:00</issued>
    <id>tag:lazax.com,2006:/blog//1.97</id>
    <created>2006-11-12T09:07:42Z</created>
    <summary type="text/plain"><![CDATA[ # # with() - Equivalent of Pascal or VB 'WITH' # # Instead of writing ... # a.width = 1 # a.height= 2 # a.name = &quot;hello&quot; # ... write # with(a){ # width = 1 # height= 2...]]></summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Ruby</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<div class='ruby'>
<pre><span class="comment">#</span>
<span class="comment"># with() - Equivalent of Pascal or VB 'WITH'</span>
<span class="comment">#</span>
<span class="comment"># Instead of writing ...</span>
<span class="comment">#       a.width = 1</span>
<span class="comment">#       a.height= 2</span>
<span class="comment">#       a.name  = &quot;hello&quot;</span>
<span class="comment"># ... write</span>
<span class="comment">#       with(a){</span>
<span class="comment">#           width = 1</span>
<span class="comment">#           height= 2</span>
<span class="comment">#           name  = &quot;hello&quot;</span>
<span class="comment">#       }</span>
<span class="comment">#</span>
<span class="comment"># Another example:</span>
<span class="comment">#</span>
<span class="comment">#    class A</span>
<span class="comment">#        def method_missing(name, *args)</span>
<span class="comment">#            puts &quot;caught: #{name}(#{args.map{|x| x.to_s}.join(',')})&quot;</span>
<span class="comment">#        end</span>
<span class="comment">#        </span>
<span class="comment">#        def func(x)</span>
<span class="comment">#            puts &quot;A:func(#{x})&quot;</span>
<span class="comment">#        end</span>
<span class="comment">#    end</span>
<span class="comment">#    </span>
<span class="comment">#    a = A.new</span>
<span class="comment">#    </span>
<span class="comment">#    with(a){</span>
<span class="comment">#        func(3)</span>
<span class="comment">#        g(4,5,6,&quot;string&quot;)</span>
<span class="comment">#    }</span>
<span class="comment">#    </span>
<span class="comment">#    =&gt; </span>
<span class="comment">#        A:func(3)</span>
<span class="comment">#        caught: g(4,5,6,string)</span>
<span class="comment">#</span>
<span class="comment">#</span>
<span class="comment">#</span>

<span class="keyword">def </span><span class="method">with</span><span class="punct">(</span><span class="ident">a</span><span class="punct">,</span> <span class="punct">&amp;</span><span class="ident">block</span><span class="punct">)</span>
    <span class="ident">a</span><span class="punct">.</span><span class="ident">instance_eval</span> <span class="punct">&amp;</span><span class="ident">block</span>
<span class="keyword">end</span>

</pre></div>
]]>
      
    </content>
  </entry>
  <entry>
    <title>Change Filename Extension</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000096.html" />
    <modified>2006-09-12T20:54:54Z</modified>
    <issued>2006-09-12T16:54:54-05:00</issued>
    <id>tag:lazax.com,2006:/blog//1.96</id>
    <created>2006-09-12T20:54:54Z</created>
    <summary type="text/plain"><![CDATA[Below is a utility that I find myself using very often for batch scripts which read an input file, and save the output to files with same filename but different extension (e.g. "file.log" -&gt; "file.csv") # # filename_change_extension &quot;/dir/file.txt&quot;, &quot;.CSV&quot;...]]></summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Ruby</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p>Below is a utility that I find myself using very often for batch scripts which read an input file, and save the output to files with same filename but different extension (e.g. "file.log" -&gt; "file.csv")</p>

<div class='ruby'>
<pre><span class="comment">#</span>
<span class="comment"># filename_change_extension &quot;/dir/file.txt&quot;, &quot;.CSV&quot;</span>
<span class="comment"># =&gt; &quot;/dir/file.CSV&quot;</span>
<span class="comment">#</span>
<span class="comment"># filename_change_extension &quot;/dir/file&quot;,     &quot;.CSV&quot;</span>
<span class="comment"># =&gt; &quot;/dir/file.CSV&quot;</span>
<span class="comment">#</span>

<span class="keyword">def </span><span class="method">filename_change_extension</span><span class="punct">(</span> <span class="ident">filename</span><span class="punct">,</span> <span class="ident">extension</span> <span class="punct">)</span>
    <span class="ident">filename</span> <span class="punct">=~</span> <span class="punct">/</span><span class="regex">(.*[<span class="escape">\/\\</span>])?</span>    <span class="comment"># match the path, up to the last slash</span>
        <span class="regex">([^<span class="escape">\/\\</span>]+)</span>              <span class="comment"># match the filename (no slashes)</span>
        <span class="regex">$</span>                       <span class="comment"># up to the end of string</span>
        <span class="punct">/</span><span class="ident">x</span>                      <span class="comment"># remove comments from regexp</span>
    <span class="ident">path</span><span class="punct">,</span> <span class="ident">name</span> <span class="punct">=</span> <span class="punct">(</span><span class="global">$1</span> <span class="punct">||</span> <span class="punct">&quot;</span><span class="string"></span><span class="punct">&quot;),</span> <span class="global">$2</span> <span class="comment"># if no path given, use &quot;&quot; instead of nil</span>
    <span class="ident">ext</span>      <span class="punct">=</span> <span class="constant">File</span><span class="punct">.</span><span class="ident">extname</span><span class="punct">(</span><span class="ident">name</span><span class="punct">)</span>
    <span class="ident">basename</span> <span class="punct">=</span> <span class="constant">File</span><span class="punct">.</span><span class="ident">basename</span><span class="punct">(</span><span class="ident">name</span><span class="punct">,</span> <span class="ident">ext</span> <span class="punct">)</span>
    
    <span class="keyword">return</span> <span class="ident">path</span> <span class="punct">+</span> <span class="ident">basename</span> <span class="punct">+</span> <span class="ident">extension</span> 
<span class="keyword">end</span>


<span class="keyword">if</span> <span class="constant">__FILE__</span> <span class="punct">==</span> <span class="global">$0</span>

    <span class="ident">require</span> <span class="punct">&quot;</span><span class="string">test/unit</span><span class="punct">&quot;</span>
    
    <span class="keyword">class </span><span class="class">TestFilenameChangeExtension</span> <span class="punct">&lt;</span> <span class="constant">Test</span><span class="punct">::</span><span class="constant">Unit</span><span class="punct">::</span><span class="constant">TestCase</span>
        <span class="keyword">def </span><span class="method">test_1</span>
            <span class="ident">test_cases</span> <span class="punct">=</span> <span class="punct">[</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">filename</span><span class="punct">&quot;,</span>               <span class="punct">&quot;</span><span class="string">.c</span><span class="punct">&quot;</span> <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">filename.c</span><span class="punct">&quot;],</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">.filename</span><span class="punct">&quot;,</span>              <span class="punct">&quot;</span><span class="string">.c</span><span class="punct">&quot;</span> <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">.filename.c</span><span class="punct">&quot;],</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">.a.b.c.ext</span><span class="punct">&quot;,</span>             <span class="punct">&quot;</span><span class="string">.c</span><span class="punct">&quot;</span> <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">.a.b.c.c</span><span class="punct">&quot;],</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">filename.ext</span><span class="punct">&quot;,</span>           <span class="punct">&quot;</span><span class="string">s</span><span class="punct">&quot;</span>  <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">filenames</span><span class="punct">&quot;],</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">filename.ext</span><span class="punct">&quot;,</span>           <span class="punct">&quot;</span><span class="string"></span><span class="punct">&quot;</span>   <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">filename</span><span class="punct">&quot;],</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">/dir/dir2/filename.txt</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">.c</span><span class="punct">&quot;</span> <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">/dir/dir2/filename.c</span><span class="punct">&quot;],</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">/dir/dir2/filename</span><span class="punct">&quot;,</span>     <span class="punct">&quot;</span><span class="string">.c</span><span class="punct">&quot;</span> <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">/dir/dir2/filename.c</span><span class="punct">&quot;],</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">/dir/dir2/.filename</span><span class="punct">&quot;,</span>    <span class="punct">&quot;</span><span class="string">.c</span><span class="punct">&quot;</span> <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">/dir/dir2/.filename.c</span><span class="punct">&quot;],</span>
                <span class="punct">[</span>   <span class="punct">&quot;</span><span class="string">/dir2.with.dot/filename</span><span class="punct">&quot;,&quot;</span><span class="string">.c</span><span class="punct">&quot;</span> <span class="punct">,</span> <span class="punct">&quot;</span><span class="string">/dir2.with.dot/filename.c</span><span class="punct">&quot;],</span>
            <span class="punct">]</span>
    
            <span class="ident">test_cases</span><span class="punct">.</span><span class="ident">each</span><span class="punct">{|</span><span class="ident">filename</span><span class="punct">,</span> <span class="ident">extension</span><span class="punct">,</span> <span class="ident">expected</span><span class="punct">|</span>
                <span class="ident">assert_equal</span> <span class="ident">expected</span><span class="punct">,</span> <span class="ident">filename_change_extension</span><span class="punct">(</span> <span class="ident">filename</span><span class="punct">,</span> <span class="ident">extension</span><span class="punct">)</span> <span class="punct">,</span> 
                             <span class="punct">&quot;</span><span class="string">test case [<span class="expr">#{filename.inspect}</span>, <span class="expr">#{extension.inspect}</span>]</span><span class="punct">&quot;</span> 
            <span class="punct">}</span>
        <span class="keyword">end</span>
    <span class="keyword">end</span>

<span class="keyword">end</span>

</pre></div>
]]>
      
    </content>
  </entry>
  <entry>
    <title>Photos</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000095.html" />
    <modified>2006-09-06T04:33:09Z</modified>
    <issued>2006-09-06T00:33:09-05:00</issued>
    <id>tag:lazax.com,2006:/blog//1.95</id>
    <created>2006-09-06T04:33:09Z</created>
    <summary type="text/plain">Little Paul is doing great, thanks for asking. All of you who wanted pictures, here they are: http://lazax.com/photos/Pavle/ I will try to keep adding new pictures weekly....</summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Kids</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p>Little Paul is doing great, thanks for asking. All of you who wanted pictures, here they are:</p>

<p><a href="http://lazax.com/photos/Pavle/">http://lazax.com/photos/Pavle/</a></p>

<p>I will try to keep adding new pictures weekly.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Baby!</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000094.html" />
    <modified>2006-08-08T11:14:58Z</modified>
    <issued>2006-08-08T07:14:58-05:00</issued>
    <id>tag:lazax.com,2006:/blog//1.94</id>
    <created>2006-08-08T11:14:58Z</created>
    <summary type="text/plain"><![CDATA[We are delighted to announce the birth of our son: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Paul Lazarevi&#263; Born on 8th of August 2006, weighing 7 lb 2 oz (3,245g). Happy parents, Alex and Laza...]]></summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Kids</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<p>We are delighted to announce<br />
the birth of our son:</p>

<p><big><b>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br />
Paul Lazarevi&#263;</b></big></p>

<p>Born on 8th of August 2006, weighing 7 lb 2 oz (3,245g).</p>

<p>Happy parents,</p>

<p>Alex and Laza</p>

<p><img src="/blog/images/2006-08-08%20Pavle%20Announcement.jpg" alt="The baby with parents"/><br />
</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Populating Windows Registry from Ruby hash</title>
    <link rel="alternate" type="text/html" href="http://lazax.com/blog/archives/000093.html" />
    <modified>2006-07-14T17:30:54Z</modified>
    <issued>2006-07-14T13:30:54-05:00</issued>
    <id>tag:lazax.com,2006:/blog//1.93</id>
    <created>2006-07-14T17:30:54Z</created>
    <summary type="text/plain"><![CDATA[ require 'win32/registry.rb' # # Populates registry keys with values given in a hash # h = { &quot;.c&quot; =&gt; { nil =&gt; &quot;source_code_file&quot;, # default # &quot;Content Type&quot; =&gt; &quot;text/plain&quot; }, # '.txt\shell\edit\command'=&gt; { nil, 'editor.exe &quot;%1&quot;' } }...]]></summary>
    <author>
      <name>laza</name>
      <url>http://lazax.com/blog</url>
      <email>laza@cs.columbia.edu</email>
    </author>
    <dc:subject>Ruby</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://lazax.com/blog/">
      <![CDATA[<div class='ruby'>
<pre><span class="ident">require</span> <span class="punct">'</span><span class="string">win32/registry.rb</span><span class="punct">'</span>

<span class="comment">#</span>
<span class="comment"># Populates registry keys with values given in a hash</span>
<span class="comment">#   h = { &quot;.c&quot; =&gt; { nil =&gt; &quot;source_code_file&quot;,       # default</span>
<span class="comment">#                   &quot;Content Type&quot; =&gt; &quot;text/plain&quot; },</span>
<span class="comment">#         '.txt\shell\edit\command'=&gt; { nil, 'editor.exe &quot;%1&quot;' } }</span>
<span class="comment"># </span>
<span class="comment">#   populate_registry HKCR, h</span>
<span class="comment">#</span>
<span class="comment">#   # From an open key:</span>
<span class="comment">#   Win32::Registry::HKEY_CLASSES_ROOT.create(&quot;.c&quot;, KEY_ALL_ACCESS) do |reg|</span>
<span class="comment">#       populate_registry reg, {nil =&gt; &quot;source_code_file&quot;, &quot;Content Type&quot; =&gt; &quot;text/plain&quot; }</span>
<span class="comment">#   end</span>
<span class="comment">#</span>
<span class="keyword">def </span><span class="method">populate_registry</span><span class="punct">(</span> <span class="ident">root</span><span class="punct">,</span> <span class="ident">registry_hash</span> <span class="punct">)</span>
    <span class="ident">registry_hash</span><span class="punct">.</span><span class="ident">each</span><span class="punct">{|</span><span class="ident">k</span><span class="punct">,</span><span class="ident">v</span><span class="punct">|</span>

        <span class="comment"># Make a copy of a String because hash keys are frozen and ...</span>
        <span class="ident">key</span> <span class="punct">=</span> <span class="ident">k</span><span class="punct">.</span><span class="ident">frozen?</span>  <span class="punct">?</span>  <span class="ident">k</span><span class="punct">[</span><span class="number">0</span><span class="punct">..-</span><span class="number">1</span><span class="punct">]</span> <span class="punct">:</span> <span class="ident">k</span>    <span class="comment"># ... Registry tries to modify them</span>
        
        <span class="keyword">if</span> <span class="ident">v</span><span class="punct">.</span><span class="ident">kind_of?</span> <span class="constant">Hash</span>
            <span class="ident">root</span><span class="punct">.</span><span class="ident">create</span><span class="punct">(</span><span class="ident">key</span><span class="punct">,</span> <span class="constant">KEY_ALL_ACCESS</span><span class="punct">){|</span><span class="ident">reg</span><span class="punct">|</span>
                <span class="ident">populate_registry</span> <span class="ident">reg</span><span class="punct">,</span> <span class="ident">v</span>
            <span class="punct">}</span>
        <span class="keyword">else</span>
            <span class="ident">root</span><span class="punct">[</span><span class="ident">key</span><span class="punct">]</span> <span class="punct">=</span> <span class="ident">v</span>
        <span class="keyword">end</span>
    <span class="punct">}</span>
<span class="keyword">end</span>


</pre></div>
]]>
      
    </content>
  </entry>

</feed>