<?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>elblogg &#187; php</title>
	<atom:link href="http://blog.elzapp.com/category/programming/php/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.elzapp.com</link>
	<description>blogge v1 (norr bloðga, av *blod) skjære, stikke fisk slik at blodet renner ut, jf *bløgge</description>
	<lastBuildDate>Fri, 09 Jul 2010 13:38:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Flickr shortcode plugin for WordPress</title>
		<link>http://blog.elzapp.com/2009/11/20/flickr-shortcode-plugin-for-wordpress.html</link>
		<comments>http://blog.elzapp.com/2009/11/20/flickr-shortcode-plugin-for-wordpress.html#comments</comments>
		<pubDate>Fri, 20 Nov 2009 06:00:52 +0000</pubDate>
		<dc:creator>elzapp</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.elzapp.com/?p=1611</guid>
		<description><![CDATA[Earlier this week I wrote about how you can add a shortcode to the functions.php to make it easier to use Creative Commons images on your blog, while always remembering to put in the correct attribution. Adding this to your theme has some drawbacks. The most important one is that you&#8217;ll have to do it [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this week I wrote about <a title="Flickr shortcode" href="http://blog.elzapp.com/2009/11/16/flickr-shortcode.html">how you can add a shortcode to the functions.php</a> to make it easier to use Creative Commons images on your blog, while always remembering to put in the correct attribution.</p>
<div class="wp-caption image imageclassB centered" style="width:510px">
<img src="http://farm4.static.flickr.com/3525/3802092158_40321f6cc0.jpg" width="500" height="332"><div class="caption wp-caption-text">
<span class="title"><a href="http://www.flickr.com/photos/d0ppler/3802092158/">Bergen viewed from Fløien</a></span> 
    <span class="author">by  ( 
    <a href="http://flickr.com/photos/27566631@N02">d0ppler</a> on flickr)</span>
</div>
</div>
<p>Adding this to your theme has some drawbacks. The most important one is that you&#8217;ll have to do it all over when you change the theme, another is that you have to add the flickr api key directly into the code.</p>
<p>That&#8217;s why I have just made it into a wordpress plugin. This means you just need to download the package, extract it into the plugins folder, and then use the &#8220;El Flickr&#8221; menu entry to add the flickr api key.</p>
<p>I have changed the flickr shortcode to elflickr, so there should be less possibility for conflict with other plugins. You chan also change the shortcode to whatever you want (including flickr) from the configuration page.</p>
<p>I&#8217;ve also added another feature. Lets say you need a HDR picture of Bergen, but don&#8217;t care too much which one is used, what if you could add the picture without going to flickr to look it up? The question is of course rhetorical, because now you can.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1611code3'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p16113"><td class="code" id="p1611code3"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>elflickr search<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;HDR Bergen from Fløien&quot;</span><span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p>yields the picture in the beginning of this article. The result of the search is stored, so you don&#8217;t need to worry that the search results will change over time. It also limits the search to Creative Commons licensed pictures.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1611code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p16114"><td class="code" id="p1611code4"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>elflickr search<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Tilt shift bergen city&quot;</span><span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<div class="wp-caption image imageclassB centered" style="width:510px">
<img src="http://farm5.static.flickr.com/4014/4356584074_4d5d9e1850.jpg" width="500" height="333"><div class="caption wp-caption-text">
<span class="title"><a href="http://www.flickr.com/photos/kroolik/4356584074/">old houses in Bergen</a></span> 
    <span class="author">by Julia ( 
    <a href="http://flickr.com/photos/35421783@N04">kroolik</a> on flickr)</span>
</div>
</div>
<p>I have a lot of ideas for this plugin, the release is numbered 0.0.2, and there&#8217;s a lot of room for improvements. For instance I will incorporate <a href="http://blog.elzapp.com/photogallery">the gallery</a> into the plugin, which currently is implemented in my theme.</p>
<p><a style="border:2px outset #CCC;-moz-border-radius:10px;padding:4px;display:block;float:left;background:#77F" href="http://elzapp.com/downloads/el_flickr-0.0.2.tgz">Download el_flickr 0.0.2</a><br />
<br style="clear:both" /><br />
If your blog is hosted on my server, I will install it for you if you ask me to.</p>
<p>The plugin just generates the HTML code, you need to style it using your stylesheet, see <a href="http://blog.elzapp.com/2009/11/16/flickr-shortcode.html">the flickr shortcode</a> for an example, and for more examples on how to use the plugin.</p>
<p>Planned improvements:</p>
<ul>
<li>styling from configuration page</li>
<li>configuration of licenses to search for</li>
<li>more caching of rest call results</li>
<li>integrate the gallery into the plugin</li>
<li>provide a default theme</li>
<li>search by geolocation</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.elzapp.com/2009/11/20/flickr-shortcode-plugin-for-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great news in the software world</title>
		<link>http://blog.elzapp.com/2009/06/30/python3-1-firefox3-5-php5-3.html</link>
		<comments>http://blog.elzapp.com/2009/06/30/python3-1-firefox3-5-php5-3.html#comments</comments>
		<pubDate>Tue, 30 Jun 2009 16:45:36 +0000</pubDate>
		<dc:creator>elzapp</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[closures]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[namespaces]]></category>

		<guid isPermaLink="false">http://blog.elzapp.com/?p=1315</guid>
		<description><![CDATA[During the last week there has been a couple of great releases in the software I use every day. First out was Python 3.1. It was released June 27th and features An ordered dictionary type Various optimizations to the int type New unittest features including test skipping and new assert methods. A much faster io [...]]]></description>
			<content:encoded><![CDATA[<p>During the last week there has been a couple of great releases in the software I use every day.</p>
<p><img class="alignright" title="Python logo" src="http://www.python.org/images/python-logo.gif" alt="" width="211" height="71" /><br />
First out was <a href="http://www.python.org/download/releases/3.1/"><strong>Python 3.1</strong></a>. It was released June 27th and features</p>
<ul>
<li>An ordered dictionary type</li>
<li>Various optimizations to the int type</li>
<li>New unittest features including test skipping and new assert methods.</li>
<li>A much faster io module</li>
<li>Tile support for Tkinter</li>
<li>A pure Python reference implementation of the import statement</li>
<li>New syntax for nested with statements</li>
</ul>
<p><img class="alignright" title="Mozilla Firefox logo" src="http://www.mozilla.com/img/tignish/home/feature-logo.png" alt="" width="400" height="105" /><br />
Next out was <a href="http://mozilla.com"><strong>Mozilla Firefox 3.5</strong></a>, which was released earlier today (June 30th), most noteworty items from that release is the <a href="http://hacks.mozilla.org/2009/06/web-typography/"><strong>@font-face</strong></a> css-attribute, that allows web-designers to bundle custom fonts with their website designs, and use custom fonts in their design.  I have used that feature to change the header of my blog, you would se a grudge font if you use the new Firefox or Safari. They have also released a new javascript-engine, which they claim to be a lot faster than the old one. Also, support for the <strong>&lt;video&gt;</strong>-tag has been added.</p>
<p><img class="alignright" title="PHP logo" src="http://no2.php.net/images/php.gif" alt="" width="120" height="67" /><br />
Then last, but not least, the long awaited <a href="http://www.php.net/archive/2009.php#id2009-06-30-1"><strong>PHP 5.3.0</strong></a> has been released, which provides <strong>namespaces</strong> and <strong>closures</strong> for PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elzapp.com/2009/06/30/python3-1-firefox3-5-php5-3.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merging two lists</title>
		<link>http://blog.elzapp.com/2009/03/12/merging-two-lists.html</link>
		<comments>http://blog.elzapp.com/2009/03/12/merging-two-lists.html#comments</comments>
		<pubDate>Thu, 12 Mar 2009 12:13:56 +0000</pubDate>
		<dc:creator>elzapp</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.elzapp.com/?p=1262</guid>
		<description><![CDATA[Lets say you have two lists, one of them containing the values [1,2,3] and the other one containing the values [4,5,6], and you want to combine these two lists into one list, like this one: [1,2,3,4,5,6]. Let&#8217;s see how this can be done in different (high level) programming (or scripting or templating) languages. Java Java [...]]]></description>
			<content:encoded><![CDATA[<p>Lets say you have two lists, one of them containing the values [1,2,3] and the other one containing the values [4,5,6], and you want to combine these two lists into one list, like this one: [1,2,3,4,5,6].</p>
<p>Let&#8217;s see how this can be done in different (high level) programming (or scripting or templating) languages.</p>
<h3>Java</h3>
<p>Java has multiple list implementations, lets start with the most basic one, the builtin array.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1262code9'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12629"><td class="code" id="p1262code9"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> A <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span>,<span style="color: #cc66cc;">3</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> B <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">4</span>,<span style="color: #cc66cc;">5</span>,<span style="color: #cc66cc;">6</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> C <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span>A.<span style="color: #006633;">length</span> <span style="color: #339933;">+</span> B.<span style="color: #006633;">length</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> counter<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> e <span style="color: #339933;">:</span> A<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  C<span style="color: #009900;">&#91;</span>counter<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>e<span style="color: #339933;">;</span>
  counter<span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> e <span style="color: #339933;">:</span> B<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  C<span style="color: #009900;">&#91;</span>counter<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>e<span style="color: #339933;">;</span>
  counter<span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>or with an ArrayList:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1262code10'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p126210"><td class="code" id="p1262code10"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*Dropped importing the correct classes, 
and constructing the ArrayLists A and B, since thats not the focus here...*/</span>
List<span style="color: #339933;">&lt;</span>Integer<span style="color: #339933;">&gt;</span> C <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aarraylist+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">ArrayList</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
C.<span style="color: #006633;">addAll</span><span style="color: #009900;">&#40;</span>A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
C.<span style="color: #006633;">addAll</span><span style="color: #009900;">&#40;</span>B<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>PHP</h3>
<p>So, how is the same done in PHP?</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1262code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p126211"><td class="code" id="p1262code11"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$A</span><span style="color: #339933;">=</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$B</span><span style="color: #339933;">=</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$C</span><span style="color: #339933;">=</span><a href="http://www.php.net/array_merge"><span style="color: #990000;">array_merge</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$A</span><span style="color: #339933;">,</span><span style="color: #000088;">$B</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Python</h3>
<p>And at last, how does the Pythonistas do this?</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1262code12'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p126212"><td class="code" id="p1262code12"><pre class="python" style="font-family:monospace;">A=<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>,<span style="color: #ff4500;">2</span>,<span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span>
B=<span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span>,<span style="color: #ff4500;">5</span>,<span style="color: #ff4500;">6</span><span style="color: black;">&#93;</span>
C=A + B</pre></td></tr></table></div>

<p>Note: the rubyists use the same approach.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elzapp.com/2009/03/12/merging-two-lists.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merkelapper</title>
		<link>http://blog.elzapp.com/2009/02/06/merkelapper.html</link>
		<comments>http://blog.elzapp.com/2009/02/06/merkelapper.html#comments</comments>
		<pubDate>Fri, 06 Feb 2009 05:30:10 +0000</pubDate>
		<dc:creator>elzapp</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[webdesign]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.elzapp.com/?p=937</guid>
		<description><![CDATA[De observante der ute (og som ikke bare leser bloggen min fra rss-leseren sin) kan ha oppdaget at merkelappene på bloggpostene har fått et nytt utseende. Det begynte egentlig med at jeg så på en post jeg hadde skrevet og tenkte &#8220;Hm, de taggene der ser ikke ut som om de egentlig hører hjemme der&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>De observante der ute (og som ikke bare leser bloggen min fra rss-leseren sin) kan ha oppdaget at merkelappene på bloggpostene har fått et nytt utseende.</p>
<p>Det begynte egentlig med at jeg så på en post jeg hadde skrevet og tenkte &#8220;Hm, de taggene der ser ikke ut som om de egentlig hører hjemme der&#8221;. Videre tenkte jeg, hva skal jeg gjøre for å få dem mer inn i det visuelle uttrykket på bloggen. Det hadde vært fint med noen bilder, men da må jeg vedlikeholde en haug med bilder for alle taggene. Det har jeg forsøkt før, da bare for kategoriene, og det er nesten ti ganger så mange tagger som kategoriene.</p>
<p>Hva om jeg kunne lage en bakgrunn som fikk merkelappene til å se mer ut som merkelapper? Vel.. min assosiasjon til merkelapper i denne sammenhengen er slike brune lapper som brukes på postsekker. Jeg kunne alltids lage en bakgrunn som så slik ut, men jeg syntes det ville være rart om de bare gikk rett horisontalt.<img class="alignright" title="merkelapp" src="http://elzapp.com/~base/img.php?tag=++++++" alt="" width="48" height="48" /></p>
<p>Her kommer vi til en av de tingene som jeg har savnet i CSS. En mulighet til å rotere objekter.</p>
<p>Velvel. vi kan jo alltids generere bilder på serveren, og bruke det&#8230; Og det var akkurat det jeg endte opp med også. Ikke bare får jeg da generert merkelappene slik jeg vil ha dem, men jeg kan velge den fonten jeg vil ha også, selv om webfonts ikke er støttet i nettleserene enda.</p>
<p>Resultatet er merkelappene nedenfor, og php-koden som genererer dem finner du <a href="http://elzapp.com/~base/img.phps">her</a><br />
Og <a href="http://elzapp.com/~base/tagsnippet.phps">her</a> er det jeg brukte for å putte det inn i wordpress-temaet</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elzapp.com/2009/02/06/merkelapper.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress 2.7 is out</title>
		<link>http://blog.elzapp.com/2008/12/11/wordpress-27-is-out.html</link>
		<comments>http://blog.elzapp.com/2008/12/11/wordpress-27-is-out.html#comments</comments>
		<pubDate>Thu, 11 Dec 2008 08:17:50 +0000</pubDate>
		<dc:creator>elzapp</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.elzapp.com/?p=738</guid>
		<description><![CDATA[WordPress 2.7 final was announced today. I just upgraded to wordpress 2.7. It took me about 30 seconds , thanks to svn switch. ?View Code BASHtar -czf backup.tar.gz blog.elzapp.com mysqldump -u root -p -- elblogg &#38;gt; backup.sql svn sw http://svn.automattic.com/wordpress/tags/2.7 There! that&#8217;s it. Now, what&#8217;s my first impressions? It looks very nice It is VERY [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress 2.7 final was <a href="http://wordpress.org/development/2008/12/coltrane/">announced</a> today.<br />
I just upgraded to wordpress 2.7. It took me about 30 seconds <img src='http://blog.elzapp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> , thanks to svn switch.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p738code14'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p73814"><td class="code" id="p738code14"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-czf</span> backup.tar.gz blog.elzapp.com
mysqldump <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> <span style="color: #660033;">--</span> elblogg <span style="color: #000000; font-weight: bold;">&amp;</span>gt; backup.sql
<span style="color: #c20cb9; font-weight: bold;">svn</span> sw http:<span style="color: #000000; font-weight: bold;">//</span>svn.automattic.com<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.7</span></pre></td></tr></table></div>

<p>There! that&#8217;s it. <img src='http://blog.elzapp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Now, what&#8217;s my first impressions?</p>
<ul>
<li>It looks very nice</li>
<li>It is VERY much slower than WordPress 2.6.5, that&#8217;s atleast my first impression.</li>
</ul>
<p>I haven&#8217;t played much around with it yet. I basicly installed, and went right away writing this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elzapp.com/2008/12/11/wordpress-27-is-out.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Should have guessed it</title>
		<link>http://blog.elzapp.com/2008/11/05/should-have-guessed-it.html</link>
		<comments>http://blog.elzapp.com/2008/11/05/should-have-guessed-it.html#comments</comments>
		<pubDate>Wed, 05 Nov 2008 09:16:58 +0000</pubDate>
		<dc:creator>elzapp</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://blog.elzapp.com/?p=414</guid>
		<description><![CDATA[I have sort of a love/hate relationship with Python, the programming language. Coming from PHP and Java which both have excellent documentation, while lots can be said about the solutions. With Python 2.6 the documentation really has improved, but its still not really there, while the solutions are so elegant that the only reason you [...]]]></description>
			<content:encoded><![CDATA[<p>I have sort of a love/hate relationship with Python, the programming language. Coming from PHP and Java which both have excellent documentation, while lots can be said about the solutions. With Python 2.6 the documentation really has improved, but its still not really there, while the solutions are so elegant that the only reason you don&#8217;t guess how to do stuff is that it feels too simple.</p>
<p>Today I had one of these realizations, while reading <a href="http://pieceofpy.com/index.php/2008/11/04/voting-and-the-land-of-ice-and-snow/">Wayne&#8217;s snippet</a> of the day.</p>
<p>Python has a really nice list-generation scheme, so you can generate lists of the content you want from another list of object with only one line of code.</p>
<p>Example:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p414code19'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p41419"><td class="code" id="p414code19"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> <span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">math</span> <span style="color: #ff7700;font-weight:bold;">import</span> floor
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> a = <span style="color: black;">&#91;</span><span style="color: #ff4500;">1.5</span>, <span style="color: #ff4500;">1.9</span>, <span style="color: #ff4500;">2.5</span>, <span style="color: #ff4500;">3.1</span>, <span style="color: #ff4500;">5.7</span><span style="color: black;">&#93;</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> b = <span style="color: black;">&#91;</span>floor<span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> a<span style="color: black;">&#93;</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> <span style="color: #ff7700;font-weight:bold;">print</span> b
<span style="color: black;">&#91;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">2.0</span>, <span style="color: #ff4500;">3.0</span>, <span style="color: #ff4500;">5.0</span><span style="color: black;">&#93;</span></pre></td></tr></table></div>

<p>Here I generated a list of whole numbers from a list of non-whole numbers.</p>
<p>Now We&#8217;ll take this further.<br />
Lets say we want to filter the list, so we&#8217;ll only get the numbers that satisfy <code>1<=x<2</code>.</p>
<p>We could do this using <code>filter()</code> and lambda functions. Which is totally OK. It'll make Python newbies totally confused (which it did with me until recently, when I realized what lambda functions really are (I'll get back to this)), but it'll work nicely.</p>
<p>But wouldn't it be nice if we could use the same list generation scheme for this as well?<br />
Guess what. You can!</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p414code20'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p41420"><td class="code" id="p414code20"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> a = <span style="color: black;">&#91;</span><span style="color: #ff4500;">1.5</span>, <span style="color: #ff4500;">1.9</span>, <span style="color: #ff4500;">2.5</span>, <span style="color: #ff4500;">3.1</span>, <span style="color: #ff4500;">5.7</span><span style="color: black;">&#93;</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> b = <span style="color: black;">&#91;</span>i <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> a <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff4500;">1</span><span style="color: #66cc66;">&lt;</span>=i <span style="color: #ff7700;font-weight:bold;">and</span> i<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> <span style="color: #ff7700;font-weight:bold;">print</span> b
<span style="color: black;">&#91;</span><span style="color: #ff4500;">1.5</span>, <span style="color: #ff4500;">1.9</span><span style="color: black;">&#93;</span></pre></td></tr></table></div>

<p>Doing the same using filter and a lambda function will look like this</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p414code21'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p41421"><td class="code" id="p414code21"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> a = <span style="color: black;">&#91;</span><span style="color: #ff4500;">1.5</span>, <span style="color: #ff4500;">1.9</span>, <span style="color: #ff4500;">2.5</span>, <span style="color: #ff4500;">3.1</span>, <span style="color: #ff4500;">5.7</span><span style="color: black;">&#93;</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> b = <span style="color: #008000;">filter</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> x: <span style="color: #ff4500;">1</span><span style="color: #66cc66;">&lt;</span>=x <span style="color: #ff7700;font-weight:bold;">and</span> x<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">2</span>, a<span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> <span style="color: #ff7700;font-weight:bold;">print</span> b
<span style="color: black;">&#91;</span><span style="color: #ff4500;">1.5</span>, <span style="color: #ff4500;">1.9</span><span style="color: black;">&#93;</span></pre></td></tr></table></div>

<p>and without using a lambda function:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p414code22'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p41422"><td class="code" id="p414code22"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> <span style="color: #ff7700;font-weight:bold;">def</span> myfilter<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>:
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span>     <span style="color: #ff7700;font-weight:bold;">return</span> x: <span style="color: #ff4500;">1</span><span style="color: #66cc66;">&lt;</span>=x <span style="color: #ff7700;font-weight:bold;">and</span> x<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">2</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> a = <span style="color: black;">&#91;</span><span style="color: #ff4500;">1.5</span>, <span style="color: #ff4500;">1.9</span>, <span style="color: #ff4500;">2.5</span>, <span style="color: #ff4500;">3.1</span>, <span style="color: #ff4500;">5.7</span><span style="color: black;">&#93;</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> b = <span style="color: #008000;">filter</span><span style="color: black;">&#40;</span>myfilter, a<span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;&amp;</span>gt<span style="color: #66cc66;">;</span> <span style="color: #ff7700;font-weight:bold;">print</span> b
<span style="color: black;">&#91;</span><span style="color: #ff4500;">1.5</span>, <span style="color: #ff4500;">1.9</span><span style="color: black;">&#93;</span></pre></td></tr></table></div>

<p>All of these will work equally fine, and none of them is very hard to understand, as long as you keep in mind that lambda functions just are like anonymous functions/classes.</p>
<p>But there is something very facinating with the elegance and simplicity in the syntax of the list generator snippet.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elzapp.com/2008/11/05/should-have-guessed-it.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading WordPress to 2.5</title>
		<link>http://blog.elzapp.com/2008/03/31/upgrading-wordpress-to-25.html</link>
		<comments>http://blog.elzapp.com/2008/03/31/upgrading-wordpress-to-25.html#comments</comments>
		<pubDate>Mon, 31 Mar 2008 08:47:52 +0000</pubDate>
		<dc:creator>elzapp</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://blog.elzapp.com/?p=307</guid>
		<description><![CDATA[According to Stuart Herbert, if you use the advanced TinyMCE editor instead of the builtin wysiwyg editor, disable it before upgrading. Its not compatible with 2.5 (yet). On the other hand, always disable all plugins before upgrading, and enable them one by one afterwards. And, Bjørge, I will get back to what I did to [...]]]></description>
			<content:encoded><![CDATA[<p>According to <a href="http://blog.stuartherbert.com/php/2008/03/30/disable-tinymce-editor-when-upgrading-to-wordpress-25/">Stuart Herbert</a>, if you use the advanced TinyMCE editor instead of the builtin wysiwyg editor, disable it before upgrading. Its not compatible with 2.5 (yet).</p>
<p>On the other hand, always disable all plugins before upgrading, and enable them one by one afterwards.</p>
<p>And, Bjørge, I will get back to what I did to make WP-upgrading easy soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elzapp.com/2008/03/31/upgrading-wordpress-to-25.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
