<?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>spyked bricks in the wall &#187; code</title>
	<atom:link href="http://lucian.mogosanu.ro/bricks/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://lucian.mogosanu.ro/bricks</link>
	<description>on the internet, no one can hear you scream.</description>
	<lastBuildDate>Sun, 25 Jul 2010 17:09:40 +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>language style evolution</title>
		<link>http://lucian.mogosanu.ro/bricks/language-style-evolution/</link>
		<comments>http://lucian.mogosanu.ro/bricks/language-style-evolution/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 14:52:21 +0000</pubDate>
		<dc:creator>spyked</dc:creator>
				<category><![CDATA[bricks]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[division by zero]]></category>
		<category><![CDATA[hamlet]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[shakespeare]]></category>

		<guid isPermaLink="false">http://lucian.mogosanu.ro/bricks/?p=1121</guid>
		<description><![CDATA[[ case study: that Hamlet cliché ]
English:
To be, or not to be: that is the question:
C:

q = to ? be : !be;

Haskell:

q = or &#91;to be, &#40;not . to&#41; be&#93;

&#8230; and so on.
]]></description>
			<content:encoded><![CDATA[<p><strong>[</strong> case study: that Hamlet cliché <strong>]</strong></p>
<p><a href="http://en.wikipedia.org/wiki/To_be,_or_not_to_be">English</a>:</p>
<blockquote><p>To be, or not to be: that is the question:</p></blockquote>
<p>C:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">q <span style="color: #339933;">=</span> to <span style="color: #339933;">?</span> be <span style="color: #339933;">:</span> <span style="color: #339933;">!</span>be<span style="color: #339933;">;</span></pre></div></div>

<p>Haskell:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;">q <span style="color: #339933; font-weight: bold;">=</span> <span style="font-weight: bold;">or</span> <span style="color: green;">&#91;</span>to be<span style="color: #339933; font-weight: bold;">,</span> <span style="color: green;">&#40;</span><span style="font-weight: bold;">not</span> <span style="color: #339933; font-weight: bold;">.</span> to<span style="color: green;">&#41;</span> be<span style="color: green;">&#93;</span></pre></div></div>

<p>&#8230; and so on.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucian.mogosanu.ro/bricks/language-style-evolution/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>the badger, the mushroom, the snake and the haskell</title>
		<link>http://lucian.mogosanu.ro/bricks/the-badger-the-mushroom-the-snake-and-the-haskell/</link>
		<comments>http://lucian.mogosanu.ro/bricks/the-badger-the-mushroom-the-snake-and-the-haskell/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 20:10:10 +0000</pubDate>
		<dc:creator>spyked</dc:creator>
				<category><![CDATA[wtf]]></category>
		<category><![CDATA[badger]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[mushroom]]></category>
		<category><![CDATA[snake]]></category>
		<category><![CDATA[weebl]]></category>

		<guid isPermaLink="false">http://lucian.mogosanu.ro/bricks/?p=1069</guid>
		<description><![CDATA[How they all fit together:

1
2
3
4
5
6
7
8
module Badger where
&#160;
badger :: Int -&#62; Int -&#62; &#91;String&#93;
badger mushroom snake = badger' mushroom snake mushroom snake
    where
    badger' m s 0 s' = &#34;Mushroom&#34; : &#34;Mushroom&#34; : badger' m s m s'
    badger' m s m' 0 = &#34;Snaaaaaaaaake&#34; : badger' [...]]]></description>
			<content:encoded><![CDATA[<p>How they all fit together:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="haskell" style="font-family:monospace;"><span style="color: #06c; font-weight: bold;">module</span> Badger <span style="color: #06c; font-weight: bold;">where</span>
&nbsp;
badger <span style="color: #339933; font-weight: bold;">::</span> <span style="color: #cccc00; font-weight: bold;">Int</span> <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: #cccc00; font-weight: bold;">Int</span> <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: green;">&#91;</span><span style="color: #cccc00; font-weight: bold;">String</span><span style="color: green;">&#93;</span>
badger mushroom snake <span style="color: #339933; font-weight: bold;">=</span> badger' mushroom snake mushroom snake
    <span style="color: #06c; font-weight: bold;">where</span>
    badger' m s <span style="color: red;">0</span> s' <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;Mushroom&quot;</span> : <span style="background-color: #3cb371;">&quot;Mushroom&quot;</span> : badger' m s m s'
    badger' m s m' <span style="color: red;">0</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;Snaaaaaaaaake&quot;</span> : badger' m s m s
    badger' m s m' s' <span style="color: #339933; font-weight: bold;">=</span> <span style="background-color: #3cb371;">&quot;Badger&quot;</span> : badger' m s <span style="color: green;">&#40;</span>m' <span style="color: #339933; font-weight: bold;">-</span> <span style="color: red;">1</span><span style="color: green;">&#41;</span> <span style="color: green;">&#40;</span>s' <span style="color: #339933; font-weight: bold;">-</span> <span style="color: red;">1</span><span style="color: green;">&#41;</span></pre></td></tr></table></div>

<p>A Haskell 8-liner based on <a href="http://www.badgerbadgerbadger.com/">this short</a> made by Weebl.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucian.mogosanu.ro/bricks/the-badger-the-mushroom-the-snake-and-the-haskell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>despre dragoste [§]</title>
		<link>http://lucian.mogosanu.ro/bricks/despre-dragoste-2/</link>
		<comments>http://lucian.mogosanu.ro/bricks/despre-dragoste-2/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 15:36:05 +0000</pubDate>
		<dc:creator>spyked</dc:creator>
				<category><![CDATA[bricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[despre]]></category>
		<category><![CDATA[division by zero]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[love]]></category>
		<category><![CDATA[writing on the wall]]></category>

		<guid isPermaLink="false">http://lucian.mogosanu.ro/bricks/?p=874</guid>
		<description><![CDATA[Dacă acum ceva (destul de mult) timp am dorit să găsesc o formulă aproximativ filosofică a acestui fenomen care, țin să precizez, încă mi se pare extrem de dubios și cât se poate de diabolic, voi încerca astăzi o abordare implicită, formală [§], pur matematică, așa cum îi șade bine acestei trăiri minunate, care într-o [...]]]></description>
			<content:encoded><![CDATA[<p>Dacă acum ceva (destul de mult) timp am dorit să găsesc o formulă <a href="http://lucian.mogosanu.ro/bricks/despre-dragoste/">aproximativ filosofică</a> a acestui fenomen care, țin să precizez, încă mi se pare extrem de dubios și cât se poate de diabolic, voi încerca astăzi o abordare implicită, formală [<a href="http://lucian.mogosanu.ro/bricks/despre-dragoste-2/#footnote">§</a>], pur matematică, așa cum îi șade bine acestei trăiri minunate, care într-o lume perfectă este musai să fie una, evident, perfectă (<em>foarte</em> perfectă, după cum probabil ar spune primarul și prietenul nostru mult iubit, Marean).<span id="more-874"></span></p>
<p>Voi defini obiectul inefabilei mele iubiri, denumit sugestiv <strong>She</strong> (adicătelea ea), ca fiind cea care mă iubește, deci prin propoziția „She Loves Me”:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="color: #06c; font-weight: bold;">module</span> Shelovesmenot <span style="color: #06c; font-weight: bold;">where</span>
&nbsp;
<span style="color: #06c; font-weight: bold;">data</span> She <span style="color: #339933; font-weight: bold;">=</span> She Loves Me <span style="color: #06c; font-weight: bold;">deriving</span> <span style="color: green;">&#40;</span><span style="color: #cccc00; font-weight: bold;">Show</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: #cccc00; font-weight: bold;">Eq</span><span style="color: green;">&#41;</span>
<span style="color: #06c; font-weight: bold;">data</span> Loves <span style="color: #339933; font-weight: bold;">=</span> Loves <span style="color: #06c; font-weight: bold;">deriving</span> <span style="color: green;">&#40;</span><span style="color: #cccc00; font-weight: bold;">Show</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: #cccc00; font-weight: bold;">Eq</span><span style="color: green;">&#41;</span>
<span style="color: #06c; font-weight: bold;">data</span> Me <span style="color: #339933; font-weight: bold;">=</span> Me <span style="color: #06c; font-weight: bold;">deriving</span> <span style="color: green;">&#40;</span><span style="color: #cccc00; font-weight: bold;">Show</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: #cccc00; font-weight: bold;">Eq</span><span style="color: green;">&#41;</span></pre></div></div>

<p>Cu toate acestea, eu, cel îndrăgostit, sunt, după cum explicam în prima parte, extrem de confuz și niciodată sigur pe dragostea mea, sentimentul de nesiguranță ducându-se asimptotic către „1” logic, mai ceva ca regimul tranzitoriu al unui inversor CMOS. Clar, pe Ea o aplicăm iubirii, de unde rezultă o funcție care se aplică pe <strong>Me</strong>, subiectul. Dar din cauza nesiguranței, „She Loves Me” devine un tuplu (She, Not), în virtutea negativismului manifestat de către îndrăgostit.</p>
<p>De asemenea, dat fiind faptul că trăim într-o lume perfectă, ea mă iubește sau nu mă iubește, deci nu vom accepta o altă logică decât cea de ordinul I (deși atenție, în lumea reală lucrurile de cele mai multe ori nu stau tocmai așa). Vorba aia, într-o lume perfectă până și CMOS-ul are regimul tranzitoriu așa de bine conturat încât te lovește din „0” în „1” și invers când te aștepți mai puțin (sau după un <img src='http://s.wordpress.com/latex.php?latex=T_0%20%3D%20T%20%2B%20T%27&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='T_0 = T + T&#039;' title='T_0 = T + T&#039;' class='latex' />, unde <img src='http://s.wordpress.com/latex.php?latex=T&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='T' title='T' class='latex' /> e durata nivelului „1” și <img src='http://s.wordpress.com/latex.php?latex=T%27&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='T&#039;' title='T&#039;' class='latex' /> cea a nivelului „0”). Așadar, constructorul lui Not este:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="color: #06c; font-weight: bold;">data</span> Not <span style="color: #339933; font-weight: bold;">=</span> Indeed <span style="color: #339933; font-weight: bold;">|</span> Not <span style="color: #06c; font-weight: bold;">deriving</span> <span style="color: green;">&#40;</span><span style="color: #cccc00; font-weight: bold;">Show</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: #cccc00; font-weight: bold;">Eq</span><span style="color: green;">&#41;</span></pre></div></div>

<p>În acest moment, îndrăgostitul nostru, Me, se poate apuca să rupă petale de flori în lumea sa matematică și nu în cea reală (un gest destul de eco-friendly). Vom ignora motivele pentru care amorezul și-a ales acest context și această modalitate de a-și petrece timpul (în timpul ăsta putea să facă altceva, cum ar fi să își scoată iubirea la un film sau să o ducă în Banbu). Probabil că e peste măsură de îndrăgostit, sau poate că doar a consumat prea multe ciuperci/prafuri/pastile/ierburi, sau poate pur și simplu suferă de bipolar disorder, caz în care, într-o lume plină de imperfecțiuni cum e a noastră, funcția nu i s-ar mai termina, computațional vorbind, deci kaput la băiatu&#8217;. În cea perfectă nu ne interesează dacă se termină sau nu.</p>
<p>Până una alta, vom avea nevoie de o funcție de complementare a stării lui Me:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;">compl <span style="color: #339933; font-weight: bold;">::</span> Not <span style="color: #339933; font-weight: bold;">-&gt;</span> Not
compl x
	<span style="color: #339933; font-weight: bold;">|</span> x <span style="color: #339933; font-weight: bold;">==</span> Indeed <span style="color: #339933; font-weight: bold;">=</span> Not
	<span style="color: #339933; font-weight: bold;">|</span> <span style="font-weight: bold;">otherwise</span> <span style="color: #339933; font-weight: bold;">=</span> Indeed</pre></div></div>

<p>și de o funcție care să itereze la infinit tuplul (She, Not) între „da, nebuna mă iubește” și „nu, matracuca nu mă iubește”, adică (She Loves Me, Indeed) respectiv (She Loves Me, Not):</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;">lovesme <span style="color: #339933; font-weight: bold;">::</span> <span style="color: green;">&#40;</span>She<span style="color: #339933; font-weight: bold;">,</span>Not<span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: green;">&#91;</span><span style="color: green;">&#40;</span>She<span style="color: #339933; font-weight: bold;">,</span>Not<span style="color: green;">&#41;</span><span style="color: green;">&#93;</span>
lovesme <span style="color: green;">&#40;</span>She Loves Me<span style="color: #339933; font-weight: bold;">,</span> x<span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: green;">&#40;</span>She Loves Me<span style="color: #339933; font-weight: bold;">,</span> x<span style="color: green;">&#41;</span> :
	<span style="color: green;">&#40;</span>lovesme <span style="color: green;">&#40;</span>She Loves Me<span style="color: #339933; font-weight: bold;">,</span> compl x<span style="color: green;">&#41;</span><span style="color: green;">&#41;</span></pre></div></div>

<p>Iar acum presupunem că Me se apucă să rupă toate petalele, sepalele și alte elemente reproducătoare ale plantei (adică o apucă de bijuterii). Numărul de petale ale unei flori poate varia lejer după șirul lui Fibonacci, dar vom presupune pur întâmplător că nebunul are o floare cu opt petale [<a href="http://lucian.mogosanu.ro/bricks/despre-dragoste-2/#footnote2">ii</a>]:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="color: #339933; font-weight: bold;">*</span>Shelovesmenot&amp;gt; <span style="font-weight: bold;">last</span> <span style="color: #339933; font-weight: bold;">$</span> <span style="font-weight: bold;">take</span> <span style="color: red;">8</span> <span style="color: #339933; font-weight: bold;">$</span> lovesme <span style="color: green;">&#40;</span>She Loves Me<span style="color: #339933; font-weight: bold;">,</span> Indeed<span style="color: green;">&#41;</span>
<span style="color: green;">&#40;</span>She Loves Me<span style="color: #339933; font-weight: bold;">,</span>Not<span style="color: green;">&#41;</span></pre></div></div>

<p>Better luck next time, Me.</p>
<p><strong>[</strong>§<strong>]</strong><a name="footnote"></a> &#8211; Abordarea este, între noi fie vorba, una doar aproximativ formală, dar destul de apropiată de „the true shit”. Autorul a ales să se exprime în Haskell atât datorită acestui atu al limbajului, cât și pentru că limbajul își evaluează parametrii într-un mod al naibii de leneș, iar în cazul ăsta eu vreau să fie leneș, altfel nu ar funcționa. De asemenea, am folosit limbajul mai sus menționat fiindcă vreau să dau dureri de cap celor care nu-s acomodați cu programarea funcțională, la urma urmei de ce aș suferi doar eu.</p>
<p><strong>[</strong>ii<strong>]</strong><a name="footnote2"></a> &#8211; Și fiindcă ăsta este punctul culminant al poveștii, voi explica și celor haskell-illiterate ce se întâmplă aici: funcția <strong>lovesme</strong> numără „she loves me indeed, she loves me not, &#8230;” la infinit, deci întoarce o listă infinită de astfel de aberații. Cum floarea mea are opt petale, eu iau doar primele opt elemente ale listei cu <strong>take</strong> și, cum primele șapte elemente oricum sunt degeaba, îl aleg direct pe ultimul, folosind <strong>last</strong>. Tristul rezultat este cel pe care îl vedeți, iar de nu mă credeți convingeți-vă, nu-i magie neagră.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucian.mogosanu.ro/bricks/despre-dragoste-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>highlight my code</title>
		<link>http://lucian.mogosanu.ro/bricks/highlight-my-code/</link>
		<comments>http://lucian.mogosanu.ro/bricks/highlight-my-code/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 09:52:37 +0000</pubDate>
		<dc:creator>spyked</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-syntax]]></category>

		<guid isPermaLink="false">http://lucian.mogosanu.ro/bricks/?p=855</guid>
		<description><![CDATA[Fiindcă totuși am discutat în repetate rânduri despre computer science, iar „computer science” include și „coding”, am încercat mai devreme să fac din nou syntax highlighting-ul să meargă pe blog și am reușit. Aparent, syntaxhighlighter-ul (folosit, am impresia, și pe wordpress.com) funcționa ok, dar nu în comment-uri, fapt ce m-a făcut să revin la vechiul [...]]]></description>
			<content:encoded><![CDATA[<p>Fiindcă totuși am discutat în repetate rânduri despre computer science, iar „computer science” include și „coding”, am încercat mai devreme să fac din nou syntax highlighting-ul să meargă pe blog și am reușit. Aparent, <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/">syntaxhighlighter</a>-ul (folosit, am impresia, și pe wordpress.com) funcționa ok, dar nu în comment-uri, fapt ce m-a făcut să revin la vechiul <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a>, care își face treaba și suportă un număr mare de limbaje, inclusiv pe cele așa-zis exotice.</p>
<p>Acestea fiind spuse, se dă următorul cod Haskell:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;">gogu <span style="color: #339933; font-weight: bold;">::</span> <span style="color: #cccc00; font-weight: bold;">Int</span> <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: green;">&#91;</span><span style="color: #cccc00; font-weight: bold;">Int</span><span style="color: green;">&#93;</span>
gogu x <span style="color: #339933; font-weight: bold;">=</span> x : <span style="color: green;">&#40;</span>gogu <span style="color: green;">&#40;</span>x <span style="color: #339933; font-weight: bold;">+</span> <span style="color: red;">1</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span></pre></div></div>

<p>Codul este pus între tag-uri de tip pre, cu parametrul lang=&#8221;haskell&#8221; (și opțional, line=&#8221;x&#8221;, unde x e numărul primei linii).</p>
]]></content:encoded>
			<wfw:commentRss>http://lucian.mogosanu.ro/bricks/highlight-my-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>*nix curiosity #2</title>
		<link>http://lucian.mogosanu.ro/bricks/nix-curiosity-2/</link>
		<comments>http://lucian.mogosanu.ro/bricks/nix-curiosity-2/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 09:14:19 +0000</pubDate>
		<dc:creator>spyked</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[1234567890]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://lucian.mogosanu.ro/bricks/?p=680</guid>
		<description><![CDATA[Timpul în format standard Unix (sau POSIX [wikipedia.org]) poate fi afișat fără a recurge la cod C, folosind următoarea comandă de bash (combinat cu perl):
$ perl -e &#8220;print time();&#8221;; echo;
N-am pus aici întâmplător acest one-liner. În cam o zi de-acum, timpul Unix va fi 1234567890 [1234567890day.com], un eveniment aparte pentru sistemele *nix.
]]></description>
			<content:encoded><![CDATA[<p>Timpul în format standard Unix (sau <a href="http://en.wikipedia.org/wiki/Unix_time">POSIX</a> [wikipedia.org]) poate fi afișat fără a recurge la cod C, folosind următoarea comandă de bash (combinat cu perl):</p>
<blockquote><p>$ perl -e &#8220;print time();&#8221;; echo;</p></blockquote>
<p>N-am pus aici întâmplător acest one-liner. În cam o zi de-acum, timpul Unix va fi <a href="http://www.1234567890day.com/"><strong>1234567890</strong></a> [1234567890day.com], un eveniment aparte pentru sistemele *nix.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucian.mogosanu.ro/bricks/nix-curiosity-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>*nix curiosity #1</title>
		<link>http://lucian.mogosanu.ro/bricks/nix-curiosity-1/</link>
		<comments>http://lucian.mogosanu.ro/bricks/nix-curiosity-1/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 09:32:28 +0000</pubDate>
		<dc:creator>spyked</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://lucian.mogosanu.ro/bricks/?p=660</guid>
		<description><![CDATA[M-am decis să fac o serie de post-uri care să conţină comenzi/script-uri din lumea *nix utile, poate de bază, dar mai puţin folosite sau mai ciudate. De exemplu, azi am dat peste o comandă destul de naturală, dar de obicei neglijată,
$ cd ~gigi
care va schimba directorul curent în directorul home al user-ului gigi.
]]></description>
			<content:encoded><![CDATA[<p>M-am decis să fac o serie de post-uri care să conţină comenzi/script-uri din lumea *nix utile, poate de bază, dar mai puţin folosite sau mai ciudate. De exemplu, azi am dat peste o comandă destul de naturală, dar de obicei neglijată,</p>
<blockquote><p>$ cd ~gigi</p></blockquote>
<p>care va schimba directorul curent în directorul home al user-ului <em>gigi</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucian.mogosanu.ro/bricks/nix-curiosity-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>the problem with media players</title>
		<link>http://lucian.mogosanu.ro/bricks/the-problem-with-media-players/</link>
		<comments>http://lucian.mogosanu.ro/bricks/the-problem-with-media-players/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 14:21:13 +0000</pubDate>
		<dc:creator>spyked</dc:creator>
				<category><![CDATA[wtf]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://lucian.mogosanu.ro/bricks/?p=373</guid>
		<description><![CDATA[is that none of them implement a tolower function:



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include &#34;ctype .h&#34;
&#160;
void fixthedamnuppercaseproblem &#40;List s&#41;
&#123;
    int i,j;
    char **p = s.getList&#40;&#41;;
    for &#40;i=0;i&#60;s .getLength&#40;&#41;;i++&#41;
    &#123;
          for &#40;j=0;j&#60;strlen&#40;p&#91;i&#93;&#41;;j++&#41;
         [...]]]></description>
			<content:encoded><![CDATA[<p>is that none of them implement a <a href="http://www.cplusplus.com/reference/clibrary/cctype/tolower.html">tolower</a> function:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-374" title="upperproblem" src="http://lucian.mogosanu.ro/bricks/wp-content/uploads/2008/06/upperproblem.png" alt="" width="471" height="384" /></p>
<p style="text-align: left;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &quot;ctype .h&quot;</span>
&nbsp;
<span style="color: #993333;">void</span> fixthedamnuppercaseproblem <span style="color: #009900;">&#40;</span>List s<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">int</span> i<span style="color: #339933;">,</span>j<span style="color: #339933;">;</span>
    <span style="color: #993333;">char</span> <span style="color: #339933;">**</span>p <span style="color: #339933;">=</span> s.<span style="color: #202020;">getList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>s .<span style="color: #202020;">getLength</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>j<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>j<span style="color: #339933;">&lt;</span>strlen<span style="color: #009900;">&#40;</span>p<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
          <span style="color: #009900;">&#123;</span>
                  p<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>tolower<span style="color: #009900;">&#40;</span>p<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    s.<span style="color: #202020;">writeListToFile</span><span style="color: #009900;">&#40;</span>p<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*wish that worked */</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p></s></pre>
</p>
<p>Sper să pot să fac un review pentru Banshee cât mai curând.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucian.mogosanu.ro/bricks/the-problem-with-media-players/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
