<?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>Fellinghaug Blog &#187; Uncategorized</title>
	<atom:link href="http://asbjorn.fellinghaug.com/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://asbjorn.fellinghaug.com/blog</link>
	<description>&#62;&#62;&#62; from fellinghaug import asbjorn; asbjorn.play()</description>
	<lastBuildDate>Thu, 19 Nov 2009 21:22:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Discovering python&#8217;s functools.partial powers</title>
		<link>http://asbjorn.fellinghaug.com/blog/2009/11/discovering-pythons-functools-partial-powers/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2009/11/discovering-pythons-functools-partial-powers/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 13:21:15 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=283</guid>
		<description><![CDATA[Hi there.
I just recently discovered the power of the functional function named partial inside the python module &#8220;functools&#8221;. Functools provides: &#8220;Tools for working with functions and callable objects&#8221;, and comes with python v2.5 and up.
But, let&#8217;s illustrate some of the beauty with examples.

import functools
def check_balance&#40;amount, limit=0&#41;:
    if amount &#38;lt;= limit:
   [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there.</p>
<p>I just recently discovered the power of the functional function named partial inside the python module &#8220;functools&#8221;. Functools provides: &#8220;Tools for working with functions and callable objects&#8221;, and comes with python v2.5 and up.</p>
<p>But, let&#8217;s illustrate some of the beauty with examples.</p>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> functools
<span style="color: #ff7700;font-weight:bold;">def</span> check_balance<span style="color: black;">&#40;</span>amount, limit=0<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> amount <span style="color: #66cc66;">&amp;</span>lt;= limit:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">False</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">True</span>
positive_account_balance = functools.<span style="color: black;">partial</span><span style="color: black;">&#40;</span> check_balance, limit=<span style="color: #ff4500;">1</span> <span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># new func object to check if account is more than 0</span>
rich_dude = functools.<span style="color: black;">partial</span><span style="color: black;">&#40;</span> check_balance, limit=<span style="color: #ff4500;">1000</span> <span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># new func object to check if this person has more than 1000 in his account</span>
poor_dude = functools.<span style="color: black;">partial</span><span style="color: black;">&#40;</span> check_balance, limit=-<span style="color: #ff4500;">100</span> <span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># new func object to check if this person is poor (i.e. less than 100)</span></pre></div></div>

<p>So, let me explain some of this code. We are first defining a function named &#8220;check_balance&#8221; which takes two arguments (amount and limit). This function is very simple, as it only checks if amount is less than or equal to limit and returns a boolean value.</p>
<p>So, what really does the partial function do? It returns a new function object based on the function object passed in as the first argument, and the predefined arguments provided. In other words we construct new function objects where some or all of the arguments is given, and then call that particular function later on, thus saving us from writing the function arguments again.</p>
<p>Another example could be that you want a function to check if a username is also and administrator:</p>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> functools
groups = <span style="color: black;">&#123;</span><span style="color: #483d8b;">'admin'</span>: <span style="color: black;">&#91;</span><span style="color: #483d8b;">'asbjorn'</span><span style="color: black;">&#93;</span>, <span style="color: #483d8b;">'users'</span>: <span style="color: black;">&#91;</span><span style="color: #483d8b;">'asbjorn'</span>, <span style="color: #483d8b;">'lolcat'</span>, <span style="color: #483d8b;">'frank'</span><span style="color: black;">&#93;</span><span style="color: black;">&#125;</span>
is_admin = functools.<span style="color: black;">partial</span><span style="color: black;">&#40;</span> <span style="color: #ff7700;font-weight:bold;">lambda</span> <span style="color: #dc143c;">user</span>, group: <span style="color: #dc143c;">user</span> <span style="color: #ff7700;font-weight:bold;">in</span> groups.<span style="color: black;">get</span><span style="color: black;">&#40;</span>group<span style="color: black;">&#41;</span>, group=<span style="color: #483d8b;">&quot;admin&quot;</span> <span style="color: black;">&#41;</span>
is_admin<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;asbjorn&quot;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># will return True</span></pre></div></div>

<p>This functionality makes it very simple to create detailed and specific functions based on more generic designed functions. This also makes it simpler to follow the design approach <em>Domain-driven Design (DDD)</em> and  create a <em>Domain Specific Language</em>, as its easier to create domain specific functions.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2009/11/discovering-pythons-functools-partial-powers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Shiretoko 3.5.2 in Ubuntu Jaunty</title>
		<link>http://asbjorn.fellinghaug.com/blog/2009/09/using-shiretoko-3-5-2-in-ubuntu-jaunty/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2009/09/using-shiretoko-3-5-2-in-ubuntu-jaunty/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 14:49:12 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=268</guid>
		<description><![CDATA[Hi there.
Recently I installed the Shiretoko 3.5.2, which is not an official Firefox release, but more a release candidate so do speak. One major problem I discovered was that for many major websites it loses its sessions (i.e. on Facebook at least).
Now, it turns out that this is a mistake shared between this Shiretoko and [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there.</p>
<p>Recently I installed the Shiretoko 3.5.2, which is not an official Firefox release, but more a release candidate so do speak. One major problem I discovered was that for many major websites it loses its sessions (i.e. on Facebook at least).</p>
<p>Now, it turns out that this is a mistake shared between this Shiretoko and Facebook, as Facebook tries to recognize the web browser used, and performs its actions based on that. When it doesn&#8217;t recognize the web browser clearly something undefined behavior happens. Well, undefined is maybe a little harsh, but at least the behavior is very strange.</p>
<p>But, I found out that if you change the settings &#8220;general.useragent.extra.firefox&#8221; in the about:config page from &#8220;Shiretoko/3.5.X&#8221; to &#8220;Firefox/3.5.X&#8221;, then your back in buisness.</p>
<p>Hope that they can finish and put a final Firefox 3.5 release into Ubuntu. Its not a good idea to wait 6 months for a new web browser release, as its the policy of the ubuntu release cycles. They should include such software releases during the 6 months period.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2009/09/using-shiretoko-3-5-2-in-ubuntu-jaunty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python 3.0 is now released</title>
		<link>http://asbjorn.fellinghaug.com/blog/2008/12/python-30-is-now-released/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2008/12/python-30-is-now-released/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 14:09:17 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=144</guid>
		<description><![CDATA[Hi everyone!
Today I have a pleasant surprise! &#8220;Python v3.0&#8243; has reached its final milestone, and has therefore been released into the wild. This is very interesting, as this new version facilitates some neat features. Instead of listing them here, I would recommend you read the &#8220;What&#8217;s In Python 3.0&#8220;.
One issue they haven&#8217;t been able to [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone!</p>
<p>Today I have a pleasant surprise! &#8220;Python v3.0&#8243; has reached its final milestone, and has therefore been released into the wild. This is very interesting, as this new version facilitates some neat features. Instead of listing them here, I would recommend you read the &#8220;<a title="Python 3.0" href="http://docs.python.org/dev/3.0/whatsnew/3.0.html"><em>What&#8217;s In Python 3.0</em></a>&#8220;.</p>
<div id="attachment_146" class="wp-caption alignnone" style="width: 310px"><a href="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/12/python-logo-master-v3-tm.png"><img class="size-medium wp-image-146" title="python-logo-master-v3-tm" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/12/python-logo-master-v3-tm-300x101.png" alt="Python Logo" width="300" height="101" /></a><p class="wp-caption-text">Python Logo</p></div>
<p>One issue they haven&#8217;t been able to solve is the GIL (<em>Global Interpreter Lock</em>). I sincerly hope this will be solved in time, as it somewhat constraints the usage of Python in high performance computing with threads.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2008/12/python-30-is-now-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPython &#8211; enhanced python interpreter</title>
		<link>http://asbjorn.fellinghaug.com/blog/2008/11/ipython-enhanced-python-interpreter/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2008/11/ipython-enhanced-python-interpreter/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 14:23:31 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[interactive python]]></category>
		<category><![CDATA[ipython]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=130</guid>
		<description><![CDATA[Hi everyone.
A couple of times now I&#8217;ve been amazed over how many people who is still unaware of the IPython. From the IPython webpage, a very short summary of what IPython is &#8220;Enhanced interactive Python shell&#8221;. The python programming language is surrounded its interpreter, which facilitates dynamic typing and execution. This feature sufficiently increases productivity [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone.</p>
<p>A couple of times now I&#8217;ve been amazed over how many people who is still unaware of the IPython. From the IPython webpage, a very short summary of what IPython is &#8220;Enhanced interactive Python shell&#8221;. The python programming language is surrounded its interpreter, which facilitates dynamic typing and execution. This feature sufficiently increases productivity as there is no problem to test and try code snippets on-the-fly.</p>
<p>The IPython is a further extension of the standard python interpreter, as IPython provides more features in the python shell, such as auto-completion of imported modules, syntax highlightning, colors, and a variouse other usefull commands and features.</p>
<p>IPython is highly flexible in terms of providing the user with the possibility to extend the python shell even further with custom commands (<em>called magic commands</em>). There is also an even tigther integration between the python interpreter and the underlying shell, such as bash,csh, etc. It is for instance much simpler to list files and folders, by just typing &#8220;ls&#8221; directly into the shell. Even commands such as &#8220;mkdir&#8221;, &#8220;mv&#8221;, &#8220;rm&#8221; is builtin, and its trivial to further extend the shell command vocabulary with more complex commands. We&#8217;ll show an example for howto extend with custom commands below.</p>
<p>As every flexible software, IPython comes with a main configuration file ($HOME/.ipython/ipythonrc). If we wanted a custom command, such as &#8220;chmod &lt;mod&gt; &lt;file&gt;&#8221; (chmod 755 myfile.py), we could add this to the &#8220;ipythonrc&#8221; file:</p>
<div class="code"><code><br />
# my custom chmod alias. By typing '&gt;&gt;&gt; chmod 755 myprog.py' or<br />
# '&gt;&gt;&gt; chmod a+rx myprog.py' IPython will execute this<br />
# statement as a shell command.<br />
alias chmod chmod %s %s<br />
</code></div>
<p>Also, debugging lists (tuples, dictionaries, etc) is more readable within the IPython, as it wraps all such print statements inside the &#8220;pprint&#8221; (<em>pretty-print</em>) module, and therefore a comprehensible representation will find place.</p>
<p>So, if you often find yourself in the python interpreter, I would highly recommend you spending a half an hour to get to known IPython. I promise you &#8211; it will save you a lot of headaches in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2008/11/ipython-enhanced-python-interpreter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim og Python</title>
		<link>http://asbjorn.fellinghaug.com/blog/2008/10/vim-og-python/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2008/10/vim-og-python/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 07:12:36 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[VIM]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=108</guid>
		<description><![CDATA[Hepp hepp!

VIM (Vi IMproved) er en tekst editor som bygger på den svært gamle og anerkjente editoren VI. VIM (heretter kalt Vim) er en svært avansert teksteditor som har fra første stund lagt til rette for å være svært konfigurerbar. Tekst editoren har sitt eget &#8220;skript&#8221; språk der enkle trivielle operasjoner er representert ved små [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">Hepp hepp!</p>
<p style="text-align: center;">
<p style="text-align: left;"><a title="VIM tekst editor" href="http://www.vim.org">VIM (Vi IMproved)</a> er en tekst editor som bygger på den svært gamle og anerkjente editoren VI. VIM (heretter kalt Vim) er en svært avansert teksteditor som har fra første stund lagt til rette for å være svært konfigurerbar. Tekst editoren har sitt eget &#8220;skript&#8221; språk der enkle trivielle operasjoner er representert ved små kommandoer, som i sammenheng kan utføre mange spesialiserte operasjoner (alt etter hva ønsket er).</p>
<p style="text-align: left;">
<p style="text-align: left;">Vim har hatt et rykte på seg for å være en vanskelig editor, da den krever en litt spesiell tankegang i begynnelsen. Dog, etter å ha kommet over den første milepælen på læringskurven, så er verden forståelig igjen. Vim har forskjellige &#8220;modus&#8221; der man kan gjøre forskjellige ting. For eksempel har man skrivemodus som tilrettelegger for at det man skriver på tastaturet blir skrevet til dokumentet. Man har også et kommandomodus, der man skriver kommandoer som Vim skal utføre på dokumentet. Typiske kommandoer kan være &#8220;slett linjen, slett tegn, finn tekst, finn og erstatt tekst, flytt tekst, kopier, klipp ut, lim inn, etc..&#8221;.</p>
<p style="text-align: left;">
<p style="text-align: left;">Nå detter jeg litt ut her, men kan tipse om <a title="Vim beskrevet på norsk" href="http://www.vim.org/6k/features.no.txt">dette dokumentet</a> (på norsk) som beskriver Vim på en mye bedre måte. Siden Vim er så fleksibel og modulær som den er, så har mange aktive brukere skrevet &#8220;plugins&#8221; som er små spesialiserte programsnutter til Vim. Disse programsnuttene er gjerne direktet myntet mot en spesifikk oppgave; fargelegge spesielle ord, tegn, sørge for korrekt formatering gitt en spesiell filtype, etc. For de av dere som kjenner programmeringsspråket <a title="Python programming language" href="http://www.python.org">Python</a>, så trenger jeg sikkert ikke å si at det kreves litt av din IDE (<em>Integrated Development Environment</em>) for å sørge for riktig indent for blokker med kode, samt korrekt syntax, etc. Med andre ord vil en bra IDE hindre unødvendige og slurvete feil i Python kode, derfor kreves det en bra IDE for å effektivt skrive rask og bra kode.</p>
<p style="text-align: left;">
<p>Nå kommer det som sikkert ingen overraskelse at Vim fungerer utmerket som en IDE, selv om den aldri var ment for å fungere som det. Dette er en av de flotte egenskapene til Vim: den er skrevet såpass modulært at man faktisk kan sette på byggeklosser for å spesialisere den innenfor et felt. Det finnes mange python &#8220;plugins&#8221; til Vim, slik som fargelegging av Python kode (se bilde under/til siden). Andre automatiske oppgaver man gjerne vil delegere til &#8220;plugins&#8221; er at når man trykker &#8220;enter&#8221; for linjeskift så skal man holde seg på samme innrykksnivå. Dette fordi at Python ikke benytter slike klammeparanteres {} som f.eks C++ og Java.<img class="size-medium wp-image-110 alignright" style="border: 1px solid black;" title="vim2_python" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/10/vim2_python-300x214.png" alt="" width="426" height="305" /></p>
<p>Automatisk feilkorrigering er også ting man gjerne vil ta høyde for i en IDE, og det finnes det gode løsninger for i Vim. Deriblant finnes det &#8220;plugins&#8221; som forsikrer seg om at det er riktig syntaks på slike logiske uttrykk som if-elif-else krever, samt at det bestandig er en kolon helt til høyre for slike uttrykk, og at alle strenger startes og avsluttes av fnutter, slikt som &#8217;streng1&#8242;, &#8220;streng2&#8243;, &#8220;&#8221;"streng3&#8243;&#8221;". En annen faktor som har i større grad uttrykket styrken til en IDE er dens muligheter til å tilby <em>auto-completion</em> av kode. Ta for eksempel følgende lille kodesnutt:</p>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">sys</span>.<span style="color: #dc143c;">platform</span> == <span style="color: #483d8b;">'linux2'</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;you'r surely using Linux, right?&quot;</span></pre></div></div>

<p>så, når jeg så skriver &#8217;sys.&#8217; og vil gjerne ha opp hvilke funksjoner/klasser/variabler som kan aksesseres fra modulen &#8217;sys&#8217;, så vil jeg gjerne at IDE&#8217;en skal presentere en liste over disse alternativene.</p>
<p>Vim har innebygd en <em>auto-completion</em> feature, men denne baserer seg på alle enkeltord som allerede er skrevet i dokumentet. Så, gitt kodesnutten ovenfor så kan man taste &#8220;CTRL+n&#8221; for å få opp en liste med alternativer. <strong>Men</strong>, denne vil ikke funke for vårt problem, da vi gjerne vil ha alle funksjoner/klasser/variabler som ligger under modulen &#8220;sys&#8221;. Frykt ikke &#8211; det fins råd. I denne <a title="Python with a modular ide vim" href="http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/">blogposten</a> er det beskrevet hvordan man med enkle funksjoner kan muliggjøre en mer avansert <em>auto-completion</em> for Python. Merk at denne featuren krever at Vim er kompilert med Python støtte (de fleste Linux distroer har dette). Så, dersom du tar å editerer din $HOME/.vimrc fil, og legger til følgende:</p>
<div class="code"><code><br />
" enables python completion<br />
autocmd FileType python set omnifunc=pythoncomplete#Complete<br />
" maps CTRL+SPACE to autocompletion function<br />
inoremap &lt;Nul&gt; &lt;C-x&gt;&lt;C-o&gt;<br />
</code></div>
<p>Nå kan man enkelt få til den ønskede funksjonaliteten ved å skrive &#8220;sys.&#8221; også taste CTRL+SPACE. Da vil Vim editoren legge til et ekstra vindu helt øverst med forklarende tekst for den aktuelle funksjonene/klassen/variabelen, samt at man ved hjelp av piltastene kan bevege seg nedover i listen.</p>
<p><strong>Merk</strong> at dette er bare en av flere nyttige funksjoner for Vim som en IDE for Python. Vil på det sterkeste anbefale deg å lese hele denne blogposten* dersom du befinner deg i en situasjon der du gjerne vil benytte Vim til å kode Python. Legg også merke til at Vim kjører på mange plattformer: Linux, Mac, Windows. Og, den trenger ikke å kjøre i et terminalvindu, som man ofte ser på skjermbildene. Det finnes en GUI versjon (kalt gVim).</p>
<p>* <a href="http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/">http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/</a></p>
<p><a href="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/10/vim.png"><img class="alignnone size-medium wp-image-111" title="vim" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/10/vim-300x218.png" alt="" width="508" height="368" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2008/10/vim-og-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AC/DC &#8211; Black Ice Tour</title>
		<link>http://asbjorn.fellinghaug.com/blog/2008/10/acdc-black-ice-tour/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2008/10/acdc-black-ice-tour/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 17:09:33 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[acdc]]></category>
		<category><![CDATA[black ice]]></category>
		<category><![CDATA[norway]]></category>
		<category><![CDATA[oslo]]></category>
		<category><![CDATA[tour]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=103</guid>
		<description><![CDATA[Woho!
Gjett hvem som sitter med billetter til AC/DC sin Black Ice Tour til Oslo 18.Februar? (retorical question). Det var gledens øyeblikk som tok meg idet den jævla nettsiden til Billettservice endelig responerte å tilbudte meg billetter. Billettene ble lagt ut kl.09:00, og kl.09:00:17 var nettsiden så å si nede..

Der skal Billettservice tas litt! Ingen webside [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><strong>Woho!</strong></p>
<div id="attachment_104" class="wp-caption aligncenter" style="width: 234px"><a href="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/10/acdc_telenor.jpg"><img class="size-medium wp-image-104" title="acdc_telenor" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/10/acdc_telenor-201x300.jpg" alt="ACDC Black Ice Tour Oslo" width="224" height="334" /></a><p class="wp-caption-text">ACDC Black Ice Tour Oslo</p></div>
<p style="text-align: left;">Gjett hvem som sitter med billetter til AC/DC sin <em><strong>Black Ice Tour</strong></em><strong><em> </em></strong>til Oslo 18.Februar? (<em>retorical question)</em>. Det var gledens øyeblikk som tok meg idet den jævla nettsiden til Billettservice endelig responerte å tilbudte meg billetter. Billettene ble lagt ut kl.09:00, og kl.09:00:17 var nettsiden så å si nede..</p>
<p style="text-align: left;">
<p style="text-align: left;"><strong>Der</strong> skal Billettservice tas litt! Ingen webside som, i aller høyeste grad burde forvente en slik pågang, skal gå ned slik. Syns det er veldig useriøst av Billettservice, og håper at de tar noen skikkelige grep til neste gang en slik lansering står for tur. Når f.eks VG klarer flere hundretusen samtidige requests, og Google en quadrillion requests, så burde Billettservice klare ~50 000 requests.</p>
<div id="attachment_105" class="wp-caption alignnone" style="width: 310px"><a href="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/10/acdc2.jpg"><img class="size-medium wp-image-105" title="acdc2" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/10/acdc2-300x209.jpg" alt="AC/DC" width="300" height="209" /></a><p class="wp-caption-text">AC/DC</p></div>
<p>Til tross for disse vanskelighetene med å anskaffe billettene, så blir det nå altså konsert 18.Februar! Om det blir 2009&#8217;s råeste konsert vil bli å finne ut, men det tviles ikke.. <img src='http://asbjorn.fellinghaug.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2008/10/acdc-black-ice-tour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>distribuering av MS Office 2007 dokumenter</title>
		<link>http://asbjorn.fellinghaug.com/blog/2008/10/distribuering-av-ms-office-2007-dokumenter/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2008/10/distribuering-av-ms-office-2007-dokumenter/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 09:42:52 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[general IT]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[norsk]]></category>
		<category><![CDATA[odt]]></category>
		<category><![CDATA[ooxml]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=98</guid>
		<description><![CDATA[Hei.
Jeg tenkte å ta for meg et voksende problem innen utveksling av dokumenter rundt omkring i Norge (og resten av verdenen). Etter at MS Office 2007 kom ut, og med det innførte et nytt filformat (docx, pptx, xlsx, ..), så har folk som tidligere har benyttet MS Office 2003/XP (og eldre) ikke vært istand til [...]]]></description>
			<content:encoded><![CDATA[<p>Hei.</p>
<p>Jeg tenkte å ta for meg et voksende problem innen utveksling av dokumenter rundt omkring i Norge (og resten av verdenen). Etter at MS Office 2007 kom ut, og med det innførte et nytt filformat (docx, pptx, xlsx, ..), så har folk som tidligere har benyttet MS Office 2003/XP (og eldre) ikke vært istand til å lese dokumentene lagret i disse formatene. Enda verre er det for de som benytter OpenOffice (et gratis verktøy av tilsvarende funksjonalitet som MS Office).</p>
<p>Så, problemet ligger i at MS Office 2007 lagrer som default alle dokumenter i disse nye formatene. Og som kjent så tenker ikke folk flest over dette, og derfor vil mesteparten av produserte dokumenter bli lagret i slike obskure formater. Det skal nevnes at formatet er svært lik OOXML (dog oppfyller den ikke helt spesifikasjonene). Uansett, dette innebærer problemer for folk som benytter andre tilsvarende programmer.</p>
<p>Jeg har selv erfart å få e-post med slike dokumenter, da jeg konsekvent svarer at formatet er ukjent for meg og at de enten skal lagre i det (gamle) &#8220;doc&#8221; formatet eller ODT (OpenDocument format for tekstbehandling), eventuelt PDF. Sistnevnte byr på problemer dersom du er avhengig av å redigere dokumentet dog.</p>
<p>Hovedpoenget er at folk må slutte å benytte formater som er svært dårlig utbredt, da de innsnevrer mulighetene for andre å lese dokumentene. Inntil det faktisk er mulig for andre enn MS Office å lese og skrive i de respektive formatene, så anbefales det <strong>sterkt </strong>å unngå dem.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2008/10/distribuering-av-ms-office-2007-dokumenter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python and memcached</title>
		<link>http://asbjorn.fellinghaug.com/blog/2008/09/python-and-memcached/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2008/09/python-and-memcached/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 14:26:59 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scale]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=54</guid>
		<description><![CDATA[Hi.
There has been some delay since the last time I&#8217;ve presented some stuff in this blog - sorry about that. I guess I can somewhat blame it on my work which is requiring a whole lot of my time nowadays. However, today I have an interesting concept to discuss. Namely the concept of applications and cache.
Nowadays, [...]]]></description>
			<content:encoded><![CDATA[<p>Hi.</p>
<p>There has been some delay since the last time I&#8217;ve presented some stuff in this blog - sorry about that. I guess I can somewhat blame it on my work which is requiring a whole lot of my time nowadays. However, today I have an interesting concept to discuss. Namely the concept of applications and cache.</p>
<p>Nowadays, delays in software is a factor which could mean the difference between failure and success. So, how does most applications cope with this challenge? Well, some does a significant amount of work in regards to create more efficient algorithms, others focus primarily on the overall design of the application in order to reduce time delays, and also the widespread usage of compression of the data flow between systems. Not that these things is not worth thinking of, but an often forgot concept is the usage of a caching system.</p>
<p>A caching system would in this context mean a system specifically designed to hold &#8220;fresh data&#8221;, in a much similar way as a standard database. Now you may think, &#8220;why not just use the database?&#8221;. Well, we will in most cases use a database. However, when your web page (or application) has a wide range of users, and a large set of those users request the same set of data, then your database would be overwhelmed by the amount of incoming requests. A database has a large overhead as a result of all the features which it needs to support (think of JOIN operations, RELATIONS, CONSTRAINTS, etc), and therefore there would be a need to have a much faster retrieval of &#8220;fresh data&#8221; which is frequently requested.</p>
<p>How do you think <a href="http://www.digg.com">Digg</a>, <a href="http://www.reddit.com">Reddit</a> or <a href="http://www.slashdot.org">Slashdot</a> handles its requests? 1. Route HTTP request to web application. 2. Execute a SQL SELECT statement to retrieve the articles 3. Render and return the HTML ? That would not scale very well for such large web sites. Instead, they take advantage of a caching system to hold the result of a SQL SELECT statement for a defined amount of time, and then re-initiate the SQL SELECT statement. With such an approach the database server would be much less overwhelmed by the frequent requests, and the caching system, which just holds the data, would take over the load. Since the caching system is built to hold data in memory, and to make it easy and fast retrievable, the data would be much faster loaded into the application, thus reducing the time delay previously involved.</p>
<p>Enough &#8220;mombo-jombo&#8221;, lets talk technical. The Danga Interactive <a href="http://www.danga.com/memcached/"><em>memcached</em></a> is a &#8220;high-performance, distributed memory object caching system&#8221;. Its main purpose is to hold objects in a distributed manner, and to provide fast retrieval of those objects. This is done with the help of a distributed hash table across the nodes running <em>memcached</em>. Setting up and running a <em>memcached</em> server on Ubuntu and Debian is trivial:</p>
<div class="code"><code><br />
#$ aptitude install memcached<br />
#$ memcached -d -m 2048 -l 192.168.0.10 -p 12345<br />
</code></div>
<p>This would fire up a memcached server with 2GB of memory on IP 192.168.0.10:12345. Now, given the usage of python and the python memcached client library (libmcache):</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="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
   <span style="color: #ff7700;font-weight:bold;">import</span> memcache
<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">ImportError</span>:
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span>0<span style="color: black;">&#41;</span>
mc = memcache.<span style="color: black;">Client</span><span style="color: black;">&#40;</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'192.168.0.10:12345'</span><span style="color: black;">&#93;</span> <span style="color: black;">&#41;</span>
mc.<span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;fellinghaug&quot;</span>, <span style="color: #483d8b;">&quot;rocks&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">assert</span> mc.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;fellinghaug&quot;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">&quot;rocks&quot;</span></pre></td></tr></table></div>

<p>This may not be the best example of the usage of <em>memcached</em>, but the basic principle is shown. I would highly recommend reading the FAQ/Wiki at Danga&#8217;s homepage, and further these articles:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Memcached">http://en.wikipedia.org/wiki/Memcached</a></li>
<li><a href="http://www.linuxjournal.com/article/7451">http://www.linuxjournal.com/article/7451</a></li>
</ul>
<p>As a final note: if your application shares the characteristics described in this article, then you should consider using a caching system.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2008/09/python-and-memcached/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Siste arbeidsdag hos NTNU-IT</title>
		<link>http://asbjorn.fellinghaug.com/blog/2008/08/siste-arbeidsdag-hos-ntnu-it/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2008/08/siste-arbeidsdag-hos-ntnu-it/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 13:46:47 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=39</guid>
		<description><![CDATA[Hei hei.
I dag er min siste arbeidsdag hos NTNU-IT, også kjent som ITEA. NTNU-IT er den sentrale IT-avdelingen hos NTNU i Trondheim. Jeg har arbeidet der som studentansatt siden høsten 2003, da jeg startet å studere ved universitet. Jeg må absolutt si at det har vært en ekstrem lærerik og inspirerende jobb, og at jeg [...]]]></description>
			<content:encoded><![CDATA[<p>Hei hei.</p>
<p>I dag er min siste arbeidsdag hos NTNU-IT, også kjent som ITEA. NTNU-IT er den sentrale IT-avdelingen hos NTNU i Trondheim. Jeg har arbeidet der som studentansatt siden høsten 2003, da jeg startet å studere ved universitet. Jeg må absolutt si at det har vært en ekstrem lærerik og inspirerende jobb, og at jeg har vært veldig heldig med å finne en jobb ved siden av studiene som er svært relevant i forhold til studiet mitt. Og som ligger på samme plass (bokstavelig talt) som jeg studerer.. <img src='http://asbjorn.fellinghaug.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/07/bilde125.jpg"><img class="alignnone size-medium wp-image-41" title="bilde125" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/07/bilde125-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/07/dsc00210.jpg"><img class="alignnone size-medium wp-image-45" title="dsc00210" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/07/dsc00210-300x225.jpg" alt="" width="329" height="225" /></a></p>
<p>NTNU-IT har veldig mange servere, derav et eget tungregningssenter. Litt kule maskiner, så måtte jo seff vise et bilde av et lite cluster de har..</p>
<p><a href="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/07/bilde150.jpg"><img class="alignnone size-medium wp-image-40" title="bilde150" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/07/bilde150-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Jeg vil gjerne få takke alle ansatte i NTNU-IT for mange gode minner, og ønsker dere alle lykke til videre.</p>
<p><a href="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/08/bouvet_logo.png"><img class="alignnone size-medium wp-image-46" title="bouvet_logo" src="http://asbjorn.fellinghaug.com/blog/wp-content/uploads/2008/08/bouvet_logo.png" alt="" width="111" height="66" /></a></p>
<p>Neste jobb som nå venter meg er konsulentselskapet <a title="Bouvet" href="http://www.bouvet.no"><strong>Bouvet</strong></a> her i Trondheim, der jeg skal arbeide som IT-konsulent. I form av arbeidsoppgaver vil jeg primært jobbe med software utvikling, og da spesielt innen opensource og Java. Jeg må si jeg gleder med til å komme igang. Er dog en smule skremmende, da dette er det første steget mot det &#8220;voksne&#8221; liv, men jeg tror jeg kommer til å trives i den nye jobben og situasjonen. Ser frem til gode og utfordrende dager hos Bouvet.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2008/08/siste-arbeidsdag-hos-ntnu-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My master thesis is complete</title>
		<link>http://asbjorn.fellinghaug.com/blog/2008/06/my-master-thesis-is-complete/</link>
		<comments>http://asbjorn.fellinghaug.com/blog/2008/06/my-master-thesis-is-complete/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 11:28:52 +0000</pubDate>
		<dc:creator>Asbjørn Alexander Fellinghaug</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dia]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[diploma]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[thesis]]></category>

		<guid isPermaLink="false">http://asbjorn.fellinghaug.com/blog/?p=35</guid>
		<description><![CDATA[Woho!
I&#8217;ve finally completed and delivered my master thesis. At exactly kl.23.54 yesterday (Sunday 8.June 2008), I delivered my master thesis to my faculty delivery system, also know as DAIM. It was a huge relief..  

In a short time, I will provide the PDF here, as well as code and such.
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">Woho!</p>
<p style="text-align: left;">I&#8217;ve finally completed and delivered my master thesis. At exactly kl.23.54 yesterday (Sunday 8.June 2008), I delivered my master thesis to my faculty delivery system, also know as DAIM. It was a huge relief.. <img src='http://asbjorn.fellinghaug.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: left;">
<p style="text-align: left;">In a short time, I will provide the PDF here, as well as code and such.</p>
]]></content:encoded>
			<wfw:commentRss>http://asbjorn.fellinghaug.com/blog/2008/06/my-master-thesis-is-complete/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
