<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>mok0&#039;s world</title>
	<atom:link href="http://mok0.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mok0.wordpress.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 10:57:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mok0.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>mok0&#039;s world</title>
		<link>http://mok0.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mok0.wordpress.com/osd.xml" title="mok0&#039;s world" />
	<atom:link rel='hub' href='http://mok0.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Python for crystallographers 1</title>
		<link>http://mok0.wordpress.com/2012/01/26/python-for-crystallographers-1-2/</link>
		<comments>http://mok0.wordpress.com/2012/01/26/python-for-crystallographers-1-2/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 10:53:16 +0000</pubDate>
		<dc:creator>mok0</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[IPython]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[objects]]></category>

		<guid isPermaLink="false">http://mok0.wordpress.com/?p=119</guid>
		<description><![CDATA[Table of Contents 1 Python for Crystallographers 1 1.1 IPython 1.2 Simple Python variables 1.3 Compound objects 1.3.1 Lists 1.3.2 Dictionaries 1.3.3 Tuples 1.3.4 Sets 1.4 Copying objects 1.5 Modules 1.5.1 Namespace 1.6 Functions 1.7 Files 1.8 File-like objects 1.9 Take-home message Appendix 1 Python for Crystallographers 1 This is the first in a series [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=119&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Python for Crystallographers 1 </a>
<ul>
<li><a href="#sec-1.1">1.1 IPython </a></li>
<li><a href="#sec-1.2">1.2 Simple Python variables </a></li>
<li><a href="#sec-1.3">1.3 Compound objects </a>
<ul>
<li><a href="#sec-1.3.1">1.3.1 Lists </a></li>
<li><a href="#sec-1.3.2">1.3.2 Dictionaries </a></li>
<li><a href="#sec-1.3.3">1.3.3 Tuples </a></li>
<li><a href="#sec-1.3.4">1.3.4 Sets </a></li>
</ul>
</li>
<li><a href="#sec-1.4">1.4 Copying objects </a></li>
<li><a href="#sec-1.5">1.5 Modules </a>
<ul>
<li><a href="#sec-1.5.1">1.5.1 Namespace </a></li>
</ul>
</li>
<li><a href="#sec-1.6">1.6 Functions </a></li>
<li><a href="#sec-1.7">1.7 Files </a></li>
<li><a href="#sec-1.8">1.8 File-like objects </a></li>
<li><a href="#sec-1.9">1.9 Take-home message </a></li>
</ul>
</li>
<li><a href="#sec-2">Appendix </a></li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"></h2>
<h2>1 Python for Crystallographers 1</h2>
<div id="text-1">
<p>This is the first in a series of tutorials on Python I gave at the Department of Molecular Biology, Aarhus University. It is aimed at crystallographers and structural biologists. This text is a commented transcript of the session log file produced by IPython The transcript does not include the output from Python. You will have to try it yourself.</p>
</div>
<div id="outline-container-1.1" class="outline-3">
<h3 id="sec-1.1"></h3>
<h3>1.1 IPython</h3>
<div id="text-1.1">
<p>Python has a quite decent interactive mode that offers readline editing of your input. However, IPython is an extension of Python that offers some very convenient features. IPython has a number of so-called &#8220;magic&#8221; commands that can be listed using</p>
<pre class="example">%lsmagic</pre>
<p>Magic commands start with the percent sign, but if the automagic mode is activated (IPython uses that mode by default) you can omit it. I will activate logging of my session using the magic:</p>
<pre class="example">logstart</pre>
<p>There are several very good screencasts for IPython at <a href="http://showmedo.com">http://showmedo.com</a>, search for tutorials by Jeff Rush and unpingco. You will see that you can do some very cool stuff with IPython!</p>
</div>
</div>
<div id="outline-container-1.2" class="outline-3">
<h3 id="sec-1.2"></h3>
<h3>1.2 Simple Python variables</h3>
<div id="text-1.2">
<p>Python has simple variables, integers, floats, complex and strings. Here is an integer:</p>
<pre class="example">a = 1</pre>
<p>and a float:</p>
<pre class="example">f = 1.</pre>
<p>We can see what variables we have assigned with the magic commands <code>%who</code> and <code>%whos</code>. The latter offers more detail.</p>
<pre class="example">who</pre>
<p>Strings are defined by strings surrounded by quotes or double quotes, so &#8220;python&#8221; and &#8216;python&#8217; is the same thing. If you need to put quotes or double quotes inside a string variable, you can do that like this:</p>
<pre class="src src-python"><span style="color:#cdcd00;">s</span> = <span style="color:#00cd00;">'"python"'</span>
<span style="color:#cdcd00;">s</span> = <span style="color:#00cd00;">"python's way"</span></pre>
<p>Complex numbers are defined like this:</p>
<pre class="src src-python"><span style="color:#cdcd00;">b</span> = <span style="color:#0000ee;font-weight:bold;">complex</span>(1,5)</pre>
<p>A complex number has real and imaginary parts. These are stored in the object <em>attributes</em> <code>real</code> and <code>imag</code>:</p>
<pre class="src src-python">b.imag
b.real</pre>
<p>A complex number can be used in arithmetic expressions as expected:</p>
<pre class="src src-python"><span style="color:#cdcd00;">a</span> = 3.4
b*a
b*b</pre>
</div>
</div>
<div id="outline-container-1.3" class="outline-3">
<h3 id="sec-1.3"></h3>
<h3>1.3 Compound objects</h3>
<div id="text-1.3"></div>
<div id="outline-container-1.3.1" class="outline-4">
<h4 id="sec-1.3.1">1.3.1 Lists</h4>
<div id="text-1.3.1">
<p>Pythons true strength comes from the powerful built-in compound objects. First, we have the list, which is defined using square brackets.</p>
<pre class="src src-python"><span style="color:#cdcd00;">L</span> = []</pre>
<p>This defines an empty list. When running interactively, you can inspect the value of objects by typing their name,</p>
<pre class="src src-python">L</pre>
<p>but when running a Python program, you need to print it:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">print</span>(L)</pre>
<p>Here is a list containing integers:</p>
<pre class="src src-python"><span style="color:#cdcd00;">L</span> = [2,4,6,8]</pre>
<p>We can append numbers to the list:</p>
<pre class="src src-python">L.append(100)</pre>
<p>This also demonstrates that the list object has a number of associated methods. Here we used the &#8220;append&#8221; method. It is like a function that implicitly operates on that element. You can inspect any Python object using the <code>dir()</code> built-in:</p>
<pre class="src src-python"><span style="color:#0000ee;font-weight:bold;">dir</span> (L)</pre>
<p>This concept is called <em>introspection</em>. From the dir() output, we find a method called <code>insert()</code>. To see what that does, we use an IPython help feature: typing a question mark after an object name prints a small help text:</p>
<pre class="src src-python">L.insert?</pre>
<p>Here we insert an element in <code>L</code> after element 3:</p>
<pre class="src src-python">L.insert(3, <span style="color:#00cd00;">"morten"</span>)</pre>
<p>This illustrates that a list can contain any type of object, in any mixture. Lists can also contain lists:</p>
<pre class="src src-python"><span style="color:#cdcd00;">M</span>=[<span style="color:#00cd00;">'hej dude'</span>]
M.append(L)
M.append(<span style="color:#00cd00;">'hej'</span>)</pre>
<p>We can access the individual elements of a list using the square bracket notation:</p>
<pre class="src src-python">L[1]
L[0]
L[4]</pre>
<p>We can step through (&#8220;iterate&#8221;) a list in a for loop:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">for</span> x <span style="color:#00cdcd;font-weight:bold;">in</span> L:
   <span style="color:#00cdcd;font-weight:bold;">print</span> x</pre>
</div>
</div>
<div id="outline-container-1.3.2" class="outline-4">
<h4 id="sec-1.3.2"></h4>
<h4>1.3.2 Dictionaries</h4>
<div id="text-1.3.2">
<p>Another very useful built-in compound object is the <em>dictionary</em>. A dictionary is defined using curly brackets:</p>
<pre class="src src-python"><span style="color:#cdcd00;">D</span> = {1:<span style="color:#00cd00;">'ditlev'</span>, 2:<span style="color:#00cd00;">'rune'</span>}</pre>
<p>Here, the numbers 1 and 2 are the <em>keys</em> of the dictionary. The strings &#8216;ditlev&#8217; and &#8216;rune&#8217; are the <em>values</em>. A key can be any immutable object, like strings:</p>
<pre class="src src-python">D[<span style="color:#00cd00;">'ditlev'</span>] = <span style="color:#00cd00;">'brodersen'</span></pre>
<p>Values of a dictionary can be any object, for example also our list <code>L</code> from before:</p>
<pre class="src src-python"><span style="color:#cdcd00;">D</span> = {1:<span style="color:#00cd00;">'ditlev'</span>, 2:<span style="color:#00cd00;">'rune'</span>, <span style="color:#00cd00;">'ditlev'</span>:<span style="color:#00cd00;">'brodersen'</span>, <span style="color:#00cd00;">'mylist'</span>:L}</pre>
<p>We can iterate through a dictionary in a for loop. Here, we use two dicts &#8216;isoelectric&#8217; and name that I defined when preparing for this session. (I saved this object earlier using the magic command <code>%store</code>, then it is loaded automatically when IPython starts up.)</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">for</span> a <span style="color:#00cdcd;font-weight:bold;">in</span> isoelectric:
   <span style="color:#00cdcd;font-weight:bold;">print</span> a, name[a], isoelectric[a]</pre>
</div>
</div>
<div id="outline-container-1.3.3" class="outline-4">
<h4 id="sec-1.3.3"></h4>
<h4>1.3.3 Tuples</h4>
<div id="text-1.3.3">
<p>Tuples are exactly like lists, except they are <em>immutable</em> (elements can not be modified once defined.) A tuple is defined using parentheses:</p>
<pre class="src src-python"><span style="color:#cdcd00;">T</span> = (42,43,44,2)</pre>
<p>Tuples are used extensively internally in Python, for example when passing arguments to functions.</p>
</div>
</div>
<div id="outline-container-1.3.4" class="outline-4">
<h4 id="sec-1.3.4"></h4>
<h4>1.3.4 Sets</h4>
<div id="text-1.3.4">
<p>The set is a very useful Python object. You define it like this:</p>
<pre class="src src-python"><span style="color:#cdcd00;">S</span> = <span style="color:#0000ee;font-weight:bold;">set</span>()</pre>
<p>This is an empty set. The set constructor can also take a sequence (e.g. lists, tuples)</p>
<pre class="src src-python"><span style="color:#cdcd00;">S</span> = <span style="color:#0000ee;font-weight:bold;">set</span>([1,2,3,4,5,6])</pre>
<p>Sets are <em>unique</em>, an element can exist only once. The set constructor silently discards duplicate elements:</p>
<pre class="src src-python"><span style="color:#cdcd00;">S</span> = <span style="color:#0000ee;font-weight:bold;">set</span>([100,2,2,2,2,23,4,5,6])</pre>
<p>The <code>Set()</code> class has an <code>add()</code> method:</p>
<pre class="src src-python">S.add(<span style="color:#00cd00;">"morten"</span>)</pre>
<p>This illustrates that a set can contain different types of objects. The <code>add()</code> method is similar to the <code>append()</code> method of lists, but &#8220;append&#8221; doesn&#8217;t make sense for a set, since it is unordered.</p>
<p>You can iterate through a set in a for loop:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">for</span> i <span style="color:#00cdcd;font-weight:bold;">in</span> S:
   <span style="color:#00cdcd;font-weight:bold;">print</span> i</pre>
<p>Sets are very powerful. You can use the well-known set operations like <em>union</em>, <em>difference</em> and <em>intersection</em>. Previously, I have defined the set aa containing one-letter codes of the 20 amino acids:</p>
<pre class="src src-python"><span style="color:#cdcd00;">aa</span> = <span style="color:#0000ee;font-weight:bold;">set</span>(<span style="color:#00cd00;">"ACDEFGHIKLMNPQRSTVWY"</span>)</pre>
<p>(NOTE: The set <code>aa</code> defined above does <em>not</em> contain the string &#8220;ACD…&#8221;! To achieve that I would need to use the constructor set(["ACD…"]). That is because the set constructor takes 1 argument which is an iterable object, and the string &#8220;ACDE…&#8221; iterates to &#8220;A&#8221;, &#8220;C&#8221;, …)</p>
<p>We now define sets of the acidic and basic amino acids:</p>
<pre class="src src-python"><span style="color:#cdcd00;">basic</span> = <span style="color:#0000ee;font-weight:bold;">set</span> ((<span style="color:#00cd00;">'K'</span>, <span style="color:#00cd00;">'R'</span>))
<span style="color:#cdcd00;">acidic</span> = <span style="color:#0000ee;font-weight:bold;">set</span>((<span style="color:#00cd00;">'D'</span>, <span style="color:#00cd00;">'E'</span>))</pre>
<p>We can find the set of &#8220;neutral&#8221; amino acids:</p>
<pre class="src src-python"><span style="color:#cdcd00;">neutral</span> = aa - acidic - basic</pre>
<p>The set phobic, which I have defined previously, has the set of hydrophobic amino acids. The hydrophilic set is thus:</p>
<pre class="src src-python"><span style="color:#cdcd00;">philic</span> = aa - phobic</pre>
<p>The set of amino acids, that is hydrophilic but not charged is:</p>
<pre class="src src-python">philic - (acidic|basic)</pre>
<p>The set of amino acids without a side chain charge is:</p>
<pre class="src src-python">aa - acidic - basic</pre>
</div>
</div>
</div>
<div id="outline-container-1.4" class="outline-3">
<h3 id="sec-1.4"></h3>
<h3>1.4 Copying objects</h3>
<div id="text-1.4">
<p>Python is very economical with computer memory, and tries to reference the same memory locations if at all possible. This gives a few unexpected effects that you need to know about. It is normally never any problem.</p>
<p>Simple objects (ints, strings, etc.) can be copied like you expect:</p>
<pre class="src src-python"><span style="color:#cdcd00;">a</span> = 10
<span style="color:#cdcd00;">b</span> = a</pre>
<p>We have assigned a to b, and they are separate, independent objects. If we subsequently alter b, a will stay the same. This is not the case for compound objects, and more complicated objects. For example, create a list:</p>
<pre class="src src-python"><span style="color:#cdcd00;">A</span> = <span style="color:#0000ee;font-weight:bold;">range</span>(10)</pre>
<p>(this gives a list of integers 0-9), and make an assignment to <code>B</code>:</p>
<pre class="src src-python"><span style="color:#cdcd00;">B</span> = A</pre>
<p>Next, let&#8217;s change element 1 of B:</p>
<pre class="src src-python">B[1] = 100</pre>
<p>You will notice that element 1 of <code>A</code> changes too! So, Python is using the same memory for lists <code>A</code> and <code>B</code>, and <code>B</code> is just another reference to that memory.</p>
<p>We can get around that by using the copy module:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">import</span> copy</pre>
<p>If we now copy <code>A</code> to <code>B</code>, it will work as expected:</p>
<pre class="src src-python"><span style="color:#cdcd00;">B</span> = copy.copy(A)
B[1] = 200</pre>
<p>and <code>A</code> stays the same. However, copy.copy() is a <em>shallow</em> copy. If <code>A</code> contains anything but simple objects (for example another list), we need to use a <em>deep copy</em>. For example, this fails:</p>
<pre class="src src-python"><span style="color:#cdcd00;">C</span> = [A,B]
<span style="color:#cdcd00;">D</span> = copy.copy(C)
D[1][1] = 1000
<span style="color:#00cdcd;font-weight:bold;">print</span>  C</pre>
<p>but using the deep copy will work:</p>
<pre class="src src-python"><span style="color:#cdcd00;">D</span> = copy.deepcopy(C)
D[1][1] = 2000
<span style="color:#00cdcd;font-weight:bold;">print</span> C
<span style="color:#00cdcd;font-weight:bold;">print</span> D</pre>
</div>
</div>
<div id="outline-container-1.5" class="outline-3">
<h3 id="sec-1.5"></h3>
<h3>1.5 Modules</h3>
<div id="text-1.5">
<p>Since we already met the copy module above, let us briefly introduce the concept of modules in Python. In short, a module is a collection of variables, functions and classes that you can load. An often used module is <code>os</code>. It contains a bunch of objects needed if you want to interact with the operating system. Modules need to be imported:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">import</span> os</pre>
<p>Now, the power of the <code>os</code> module is available to us. You can inspect its content using <code>dir()</code>:</p>
<pre class="src src-python"><span style="color:#0000ee;font-weight:bold;">dir</span>(os)</pre>
<p>Let&#8217;s take a look at the <code>uname()</code> object from the <code>os</code> module. This basically does the same information that is given when you type <code>uname</code> from the shell:</p>
<pre class="src src-python"><span style="color:#cdcd00;">x</span> = os.uname()
<span style="color:#0000ee;font-weight:bold;">type</span>(x)</pre>
<p>You see, that <code>x</code> is a tuple. We can access its elements:</p>
<pre class="src src-python"><span style="color:#cdcd00;">hostname</span> = x[1]
<span style="color:#00cdcd;font-weight:bold;">print</span> hostname</pre>
<p>This was an example of a core module (distributed with Python). There is a very large number of third-party Python packages. One example, that we will study more later, is <code>numpy</code>, Numerical Python.</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">import</span> numpy
<span style="color:#0000ee;font-weight:bold;">dir</span>(numpy)</pre>
<p>You can see that Numpy contains a very large number of objects, which all deal with numerical data (&#8220;numbers&#8221;) in a very efficient way. The most basic object is the array:</p>
<pre class="src src-python"><span style="color:#cdcd00;">a</span> = numpy.array((1,2,3,4,5,6,7,8,9))</pre>
<p>This defines a linear array of 9 elements. We can reshape that to a <code>(3,3)</code> array:</p>
<pre class="src src-python">a.reshape(3,3)</pre>
<p>That array can be recast to a matrix object, and participate in very efficient matrix and vector operations. We will look more into this later.</p>
</div>
<div id="outline-container-1.5.1" class="outline-4">
<h4 id="sec-1.5.1"></h4>
<h4>1.5.1 Namespace</h4>
<div id="text-1.5.1">
<p>In the above, you have seen that whenever you need to reference an object from a module, you need to prefix it with the name of the module. That is because each module has its own namespace. If you need to reference a specific object a lot, you can import it into the current namespace, like so:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">from</span> os <span style="color:#00cdcd;font-weight:bold;">import</span> uname</pre>
</div>
</div>
</div>
<div id="outline-container-1.6" class="outline-3">
<h3 id="sec-1.6"></h3>
<h3>1.6 Functions</h3>
<div id="text-1.6">
<p>Python provides functions. Let us define a function to add two objects:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">def</span> <span style="color:#0000ee;font-weight:bold;">mysum</span>(a,b):
   <span style="color:#00cdcd;font-weight:bold;">return</span> a+b</pre>
<p>The parenthesis contains the two <em>formal parameters</em> of the function. These exist in the local namespace of the function. Variables <code>a</code> and <code>b</code> in the calling program (if they exist) will not be affected. Let&#8217;s test the function:</p>
<pre class="src src-python">mysum(10,20)
mysum(0.4,20)</pre>
<p>This works as expected. However, you can also do this:</p>
<pre class="src src-python">mysum(<span style="color:#00cd00;">'asdfa'</span>,<span style="color:#00cd00;">'aasdasdf'</span>)</pre>
<p>which demonstrates, that any object providing the method <code>__add__()</code> can be &#8220;added&#8221; using the &#8216;+&#8217; operator! However, this:</p>
<pre class="src src-python">mysum(0.4,<span style="color:#00cd00;">'a'</span>)</pre>
<p>will raise an exception because floats and strings can&#8217;t be added.</p>
</div>
</div>
<div id="outline-container-1.7" class="outline-3">
<h3 id="sec-1.7"></h3>
<h3>1.7 Files</h3>
<div id="text-1.7">
<p>It is very easy to read files from Python. This opens a file and associates a file object <code>f</code> to it:</p>
<pre class="src src-python"><span style="color:#cdcd00;">f</span> = <span style="color:#0000ee;font-weight:bold;">open</span>(<span style="color:#00cd00;">"1zen.pdb"</span>)</pre>
<p>Now <code>f</code> is an ordinary Python object that we can do stuff with:</p>
<pre class="src src-python"><span style="color:#0000ee;font-weight:bold;">dir</span>(f)</pre>
<p>The <code>readlines()</code> method simply swallows the whole file, and returns a list of lines:</p>
<pre class="src src-python"><span style="color:#cdcd00;">L</span> = f.readlines()</pre>
<p>Now the lines in the file can be accessed. <code>L[0]</code> contains the first line, and (since this is a PDB file) line 500 is one of the ATOM records:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">print</span> L[500]</pre>
<p>You can see that <code>L[500]</code> is a string:</p>
<pre class="src src-python"><span style="color:#0000ee;font-weight:bold;">type</span>(L[500])</pre>
<p>If we want to get to the individual items in that string (the X coordinate, the B factor etc.) we need to split that string into individual components. To do this, we can use the string&#8217;s <code>split()</code> method:</p>
<pre class="src src-python"><span style="color:#cdcd00;">m</span> = L[500]
<span style="color:#cdcd00;">mm</span> = m.split()</pre>
<p>Now, <code>mm</code> is a list of strings containing the individual items. If we wanted to treat the X-coordinate as a number (say, add 0.01 Angstrom to it) we need to convert it to a number:</p>
<pre class="src src-python"><span style="color:#cdcd00;">x</span> = <span style="color:#0000ee;font-weight:bold;">float</span>(mm[5])
<span style="color:#cdcd00;">x</span> = x + 0.01</pre>
<p>When done with the file, you should close it like a good boy:</p>
<pre class="src src-python">f.close()</pre>
<p>Files can be iterated like we saw for lists:</p>
<pre class="src src-python"><span style="color:#cdcd00;">L</span> = []
<span style="color:#cdcd00;">f</span> = <span style="color:#0000ee;font-weight:bold;">open</span>(<span style="color:#00cd00;">"1zen.pdb"</span>)
<span style="color:#00cdcd;font-weight:bold;">for</span> line <span style="color:#00cdcd;font-weight:bold;">in</span> f:
   L.append(line.split())</pre>
<p>Here, we did several of the steps above in one operation.</p>
</div>
</div>
<div id="outline-container-1.8" class="outline-3">
<h3 id="sec-1.8"></h3>
<h3>1.8 File-like objects</h3>
<div id="text-1.8">
<p>We saw that Python&#8217;s file object is very convenient, so Python operates with so-called <em>file-like objects</em>. These are objects that can be anything, but appear to the programmer as though they are simple files. A simple example shows that you can access a web page as though it was a file:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">import</span> urllib
<span style="color:#cdcd00;">f</span> = urllib.urlopen(<span style="color:#00cd00;">'http://www.bioxray.au.dk/index_uk.php'</span>)</pre>
<p>Now we have our &#8220;file-like&#8221; object <code>f</code>, and we can suck in the web page.</p>
<pre class="src src-python"><span style="color:#cdcd00;">W</span> = f.readlines()
<span style="color:#00cdcd;font-weight:bold;">print</span> <span style="color:#0000ee;font-weight:bold;">len</span>(W)</pre>
<p>We get a list of 413 lines containing the HTML text. However, the &#8220;file-like&#8221; object <code>f</code> can do more than an ordinary file. For example, you can get the HTTP header information:</p>
<pre class="src src-python"><span style="color:#00cdcd;font-weight:bold;">print</span> f.info()</pre>
<p>but that is another story <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>
</div>
<div id="outline-container-1.9" class="outline-3">
<h3 id="sec-1.9"></h3>
<h3>1.9 Take-home message</h3>
<div id="text-1.9">
<p>The take-home message of this presentation is:</p>
<p><span style="text-decoration:underline;">In Python, EVERYTHING IS AN OBJECT</span></p>
</div>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"></h2>
<h2>Appendix</h2>
<div id="text-2">
<pre class="src src-python"><span style="color:#cd0000;"># Amino acid properties </span>
<span style="color:#cdcd00;">hydropathy</span> = {<span style="color:#00cd00;">'A'</span>: 1.8, <span style="color:#00cd00;">'C'</span>: 2.5, <span style="color:#00cd00;">'D'</span>: -3.5, <span style="color:#00cd00;">'E'</span>: -3.5, <span style="color:#00cd00;">'F'</span>: 2.8, <span style="color:#00cd00;">'G'</span>:
-0.4,
              <span style="color:#00cd00;">'H'</span>: -3.2, <span style="color:#00cd00;">'I'</span>: 4.5, <span style="color:#00cd00;">'K'</span>: -3.9, <span style="color:#00cd00;">'L'</span>: 3.8, <span style="color:#00cd00;">'M'</span>: 1.9, <span style="color:#00cd00;">'N'</span>:
-3.5,
              <span style="color:#00cd00;">'P'</span>: -1.6, <span style="color:#00cd00;">'Q'</span>: -3.5, <span style="color:#00cd00;">'R'</span>: -4.5, <span style="color:#00cd00;">'S'</span>: -0.8, <span style="color:#00cd00;">'T'</span>: -0.7,
<span style="color:#00cd00;">'V'</span>: 4.2,
              <span style="color:#00cd00;">'W'</span>: -0.9, <span style="color:#00cd00;">'Y'</span>: -1.3}

<span style="color:#cdcd00;">tlc</span> = {<span style="color:#00cd00;">'A'</span>: <span style="color:#00cd00;">"ALA"</span>, <span style="color:#00cd00;">'C'</span>: <span style="color:#00cd00;">"CYS"</span>, <span style="color:#00cd00;">'D'</span>: <span style="color:#00cd00;">"ASP"</span>, <span style="color:#00cd00;">'E'</span>: <span style="color:#00cd00;">"GLU"</span>, <span style="color:#00cd00;">'F'</span>: <span style="color:#00cd00;">"PHE"</span>,
       <span style="color:#00cd00;">'G'</span>: <span style="color:#00cd00;">"GLY"</span>, <span style="color:#00cd00;">'H'</span>: <span style="color:#00cd00;">"HIS"</span>, <span style="color:#00cd00;">'I'</span>: <span style="color:#00cd00;">"ILE"</span>, <span style="color:#00cd00;">'K'</span>: <span style="color:#00cd00;">"LYS"</span>, <span style="color:#00cd00;">'L'</span>: <span style="color:#00cd00;">"LEU"</span>,
       <span style="color:#00cd00;">'M'</span>: <span style="color:#00cd00;">"MET"</span>, <span style="color:#00cd00;">'N'</span>: <span style="color:#00cd00;">"ASN"</span>, <span style="color:#00cd00;">'P'</span>: <span style="color:#00cd00;">"PRO"</span>, <span style="color:#00cd00;">'Q'</span>: <span style="color:#00cd00;">"GLN"</span>, <span style="color:#00cd00;">'R'</span>: <span style="color:#00cd00;">"ARG"</span>,
       <span style="color:#00cd00;">'S'</span>: <span style="color:#00cd00;">"SER"</span>, <span style="color:#00cd00;">'T'</span>: <span style="color:#00cd00;">"THR"</span>, <span style="color:#00cd00;">'V'</span>: <span style="color:#00cd00;">"VAL"</span>, <span style="color:#00cd00;">'W'</span>: <span style="color:#00cd00;">"TRP"</span>, <span style="color:#00cd00;">'Y'</span>: <span style="color:#00cd00;">"TYR"</span>}

<span style="color:#cdcd00;">charge</span>={<span style="color:#00cd00;">'A'</span>: 0, <span style="color:#00cd00;">'C'</span>: 0, <span style="color:#00cd00;">'D'</span>: -1, <span style="color:#00cd00;">'E'</span>: -1, <span style="color:#00cd00;">'F'</span>: 0, <span style="color:#00cd00;">'G'</span>: 0, <span style="color:#00cd00;">'H'</span>: 0.1,
        <span style="color:#00cd00;">'I'</span>: 0, <span style="color:#00cd00;">'K'</span>: 1, <span style="color:#00cd00;">'L'</span>: 0, <span style="color:#00cd00;">'M'</span>: 0, <span style="color:#00cd00;">'N'</span>: 0, <span style="color:#00cd00;">'P'</span>: 0, <span style="color:#00cd00;">'Q'</span>: 0,
        <span style="color:#00cd00;">'R'</span>: 1, <span style="color:#00cd00;">'S'</span>: 0, <span style="color:#00cd00;">'T'</span>: 0, <span style="color:#00cd00;">'V'</span>: 0, <span style="color:#00cd00;">'W'</span>: 0, <span style="color:#00cd00;">'Y'</span>: 0}

<span style="color:#cdcd00;">isoelectric</span>={<span style="color:#00cd00;">'A'</span>: 6.0, <span style="color:#00cd00;">'C'</span>: 5.02, <span style="color:#00cd00;">'D'</span>: 2.77, <span style="color:#00cd00;">'E'</span>: 3.22, <span style="color:#00cd00;">'F'</span>: 5.48,
             <span style="color:#00cd00;">'G'</span>: 5.97, <span style="color:#00cd00;">'H'</span>: 7.47, <span style="color:#00cd00;">'I'</span>: 5.94, <span style="color:#00cd00;">'K'</span>: 9.59, <span style="color:#00cd00;">'L'</span>: 5.98,
             <span style="color:#00cd00;">'M'</span>: 5.74, <span style="color:#00cd00;">'N'</span>: 5.41, <span style="color:#00cd00;">'P'</span>: 6.3, <span style="color:#00cd00;">'Q'</span>: 5.65, <span style="color:#00cd00;">'R'</span>: 11.15,
             <span style="color:#00cd00;">'S'</span>: 5.68, <span style="color:#00cd00;">'T'</span>: 5.64, <span style="color:#00cd00;">'V'</span>: 5.96, <span style="color:#00cd00;">'W'</span>: 5.89, <span style="color:#00cd00;">'Y'</span>: 5.66}

<span style="color:#cdcd00;">mw</span> = {<span style="color:#00cd00;">'A'</span>: 89.09, <span style="color:#00cd00;">'C'</span>: 121.15, <span style="color:#00cd00;">'D'</span>: 133.1, <span style="color:#00cd00;">'E'</span>: 147.13, <span style="color:#00cd00;">'F'</span>: 165.19,
      <span style="color:#00cd00;">'G'</span>: 75.07, <span style="color:#00cd00;">'H'</span>: 155.16, <span style="color:#00cd00;">'I'</span>: 131.17, <span style="color:#00cd00;">'K'</span>: 146.19, <span style="color:#00cd00;">'L'</span>: 131.17,
      <span style="color:#00cd00;">'M'</span>: 149.21, <span style="color:#00cd00;">'N'</span>: 132.12, <span style="color:#00cd00;">'P'</span>: 115.13, <span style="color:#00cd00;">'Q'</span>: 146.15, <span style="color:#00cd00;">'R'</span>: 174.2,
      <span style="color:#00cd00;">'S'</span>: 105.09, <span style="color:#00cd00;">'T'</span>: 119.12, <span style="color:#00cd00;">'V'</span>: 117.15, <span style="color:#00cd00;">'W'</span>: 204.23, <span style="color:#00cd00;">'Y'</span>: 181.19}

<span style="color:#cdcd00;">name</span> = {<span style="color:#00cd00;">'A'</span>: <span style="color:#00cd00;">'alanine'</span>, <span style="color:#00cd00;">'C'</span>: <span style="color:#00cd00;">'cysteine'</span>, <span style="color:#00cd00;">'D'</span>: <span style="color:#00cd00;">'aspartic acid'</span>,
        <span style="color:#00cd00;">'E'</span>:<span style="color:#00cd00;">'glutamic acid'</span>, <span style="color:#00cd00;">'F'</span>: <span style="color:#00cd00;">'phenylalanine'</span>, <span style="color:#00cd00;">'G'</span>: <span style="color:#00cd00;">'glycine'</span>,
        <span style="color:#00cd00;">'H'</span>: <span style="color:#00cd00;">'histidine'</span>, <span style="color:#00cd00;">'I'</span>: <span style="color:#00cd00;">'isoleucine'</span>, <span style="color:#00cd00;">'K'</span>: <span style="color:#00cd00;">'lysine'</span>,
        <span style="color:#00cd00;">'L'</span>: <span style="color:#00cd00;">'leucine'</span>, <span style="color:#00cd00;">'M'</span>: <span style="color:#00cd00;">'methionine'</span>, <span style="color:#00cd00;">'N'</span>: <span style="color:#00cd00;">'asparagine'</span>,
        <span style="color:#00cd00;">'P'</span>: <span style="color:#00cd00;">'proline'</span>, <span style="color:#00cd00;">'Q'</span>: <span style="color:#00cd00;">'glutamine'</span>, <span style="color:#00cd00;">'R'</span>: <span style="color:#00cd00;">'arginine'</span>, <span style="color:#00cd00;">'S'</span>:
<span style="color:#00cd00;">'serine'</span>,
        <span style="color:#00cd00;">'T'</span>: <span style="color:#00cd00;">'threonine'</span>, <span style="color:#00cd00;">'V'</span>: <span style="color:#00cd00;">'valine'</span>, <span style="color:#00cd00;">'W'</span>: <span style="color:#00cd00;">'tryptophan'</span>,
        <span style="color:#00cd00;">'Y'</span>: <span style="color:#00cd00;">'tyrosine'</span>}

<span style="color:#cdcd00;">polarity</span>={<span style="color:#00cd00;">'A'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'C'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'D'</span>: <span style="color:#00cd00;">'p'</span>, <span style="color:#00cd00;">'E'</span>: <span style="color:#00cd00;">'p'</span>, <span style="color:#00cd00;">'F'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'G'</span>: <span style="color:#00cd00;">'n'</span>,
          <span style="color:#00cd00;">'H'</span>: <span style="color:#00cd00;">'p'</span>, <span style="color:#00cd00;">'I'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'K'</span>: <span style="color:#00cd00;">'p'</span>, <span style="color:#00cd00;">'L'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'M'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'N'</span>: <span style="color:#00cd00;">'p'</span>,
          <span style="color:#00cd00;">'P'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'Q'</span>: <span style="color:#00cd00;">'p'</span>, <span style="color:#00cd00;">'R'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'S'</span>: <span style="color:#00cd00;">'p'</span>, <span style="color:#00cd00;">'T'</span>: <span style="color:#00cd00;">'p'</span>, <span style="color:#00cd00;">'V'</span>: <span style="color:#00cd00;">'n'</span>,
          <span style="color:#00cd00;">'W'</span>: <span style="color:#00cd00;">'n'</span>, <span style="color:#00cd00;">'Y'</span>: <span style="color:#00cd00;">'p'</span>}

<span style="color:#cdcd00;">aa</span> = <span style="color:#0000ee;font-weight:bold;">set</span>(<span style="color:#00cd00;">"ACDEFGHIKLMNPQRSTVWY"</span>)
<span style="color:#cdcd00;">phobic</span> = <span style="color:#0000ee;font-weight:bold;">set</span>([ x <span style="color:#00cdcd;font-weight:bold;">for</span> x <span style="color:#00cdcd;font-weight:bold;">in</span> hydropathy <span style="color:#00cdcd;font-weight:bold;">if</span> hydropathy[x] &gt; 0.1])
<span style="color:#cdcd00;">neutral</span> = <span style="color:#0000ee;font-weight:bold;">set</span>(<span style="color:#00cd00;">"ANCEGILMFQPSTWYV"</span>)
<span style="color:#cdcd00;">positive</span> = <span style="color:#0000ee;font-weight:bold;">set</span>(<span style="color:#00cd00;">"RK"</span>)
<span style="color:#cdcd00;">negative</span> = <span style="color:#0000ee;font-weight:bold;">set</span>(<span style="color:#00cd00;">"DE"</span>)
<span style="color:#cdcd00;">zwitter</span>=<span style="color:#0000ee;font-weight:bold;">set</span>(<span style="color:#00cd00;">"H"</span>)</pre>
<hr />
</div>
</div>
<div id="postamble">
<p class="date">Date: 2012-01-26 11:22:16 CET</p>
<p>HTML generated by org-mode 6.21b in emacs 23</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mok0.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mok0.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mok0.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mok0.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mok0.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mok0.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mok0.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mok0.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mok0.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mok0.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mok0.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mok0.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mok0.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mok0.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=119&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mok0.wordpress.com/2012/01/26/python-for-crystallographers-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eea81e07ef150bdbc4e459579d3a9e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mok0</media:title>
		</media:content>
	</item>
		<item>
		<title>Disk Quota Exceeded?</title>
		<link>http://mok0.wordpress.com/2011/04/11/disk-quota-exceeded/</link>
		<comments>http://mok0.wordpress.com/2011/04/11/disk-quota-exceeded/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 11:14:19 +0000</pubDate>
		<dc:creator>mok0</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mok0.wordpress.com/?p=49</guid>
		<description><![CDATA[The disk quota system in Linux is quite old, and if you have a distributed workstation environment with NFS mounted shares it is not possible in a convenient way to inform users that they have exceeded their disk limits. So we created a simple disk quota warning system, written in Python, that works using the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=49&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The disk quota system in Linux is quite old, and if you have a distributed workstation environment with NFS mounted shares it is not possible in a convenient way to inform users that they have exceeded their disk limits.</p>
<p>So we created a simple disk quota warning system, written in Python, that works using the notification interface (<code>libnotify</code>). A user who has exceeded the disk quota is then at regular intervals presented with a pop-up warning like the one shown in the figure below.</p>
<p style="text-align:center;"><a href="http://mok0.files.wordpress.com/2011/04/warnbox.png"><img class="size-medium wp-image-51 aligncenter" title="warnbox" src="http://mok0.files.wordpress.com/2011/04/warnbox.png?w=300&#038;h=191" alt="disk quota exceeded pop-up notice" width="300" height="191" /></a></p>
<p>The quotawarn system is divided into three parts. Two of them run on the file server, and one on the users workstation, under the users&#8217; own UID.</p>
<p>On the file server, there is a program called <code>quotawarn.cron</code>, which (duh!) should be run at regular intervals by cron. This program simply runs <code>repquota</code> and squirrels away the information in a convenient format. Currently, this is simply a pickled Python dictionary indexed by UID, but could of course also be a fancier database storing historical data on each user&#8217;s disk usage.</p>
<p>The second program on the server is a CGI script. Using the standard web interface lets us rely on the access settings in the HTTP server, thus minimizing the need to program a special security system, and relieving the burden on the sysadm of learning and maintaining yet another access control system.</p>
<p><code>Quotawarn.cgi</code> responds to messages from the network, replying to requests for specific UIDs by transferring the data for that user in JSON format. Or, optionally, by creating an HTML page with the data of all users.</p>
<p>On each workstation, the notification script <code>quotawarn</code> is started when the user logs on. The sysadm can achieve this by placing an entry in<code> /usr/share/autostart</code>. The program will ask for data from <code>quotawarn.cgi</code> on the file server, and if the user is under the disk quota limit, the program will exit without any more noise. If, however, the users disk quota is exceeded, the program will pop up a notification (shown below). This will continue at regular intervals (set by the sysadm).</p>
<p>A second notification system, yet to be developed, could hook into Ubuntu&#8217;s <code>motd</code> system, and provide the necessary information when the user logs on via an ssh connection to the network.</p>
<p style="text-align:center;"><a href="http://mok0.files.wordpress.com/2011/04/diagram-small.png"><img class="size-full wp-image-50 aligncenter" title="diagram-small" src="http://mok0.files.wordpress.com/2011/04/diagram-small.png?w=720" alt="quotawarn system diagram"   /></a></p>
<p>I have created a <a href="https://edge.launchpad.net/quotawarn"><b>project on Launchpad</b></a> for quotawarn in the hope that others would like to contribute to the project, and make it more generally usable. Although an attempt has been made to make the system general, we have not been able to test it in other settings than our own. So, if this has whet your appetite, please feel free to branch the project and contribute!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mok0.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mok0.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mok0.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mok0.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mok0.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mok0.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mok0.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mok0.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mok0.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mok0.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mok0.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mok0.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mok0.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mok0.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=49&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mok0.wordpress.com/2011/04/11/disk-quota-exceeded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eea81e07ef150bdbc4e459579d3a9e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mok0</media:title>
		</media:content>

		<media:content url="http://mok0.files.wordpress.com/2011/04/warnbox.png?w=300" medium="image">
			<media:title type="html">warnbox</media:title>
		</media:content>

		<media:content url="http://mok0.files.wordpress.com/2011/04/diagram-small.png" medium="image">
			<media:title type="html">diagram-small</media:title>
		</media:content>
	</item>
		<item>
		<title>Free and completely Ubuntu (2)</title>
		<link>http://mok0.wordpress.com/2011/02/12/free-and-completely-ubuntu-2/</link>
		<comments>http://mok0.wordpress.com/2011/02/12/free-and-completely-ubuntu-2/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 05:05:32 +0000</pubDate>
		<dc:creator>mok0</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mok0.wordpress.com/?p=44</guid>
		<description><![CDATA[The other day, I reported here that Tuesday evening (Feb. 8.), the popular tech-review program on danish public television channel DR2 &#8220;So Ein Ding&#8230;&#8221; dedicated an entire episode to Ubuntu. A commenter asked for a translation, so here it is, including the program host, Nicolaj Sonne&#8217;s evocative sound effects. Hey! Today we jump in, and go [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=44&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The other day, <a href="http://mok0.wordpress.com/2011/02/10/free-and-completely-ubuntu/">I reported here</a> that Tuesday evening (Feb. 8.), the popular tech-review program on danish public television channel DR2 &#8220;So Ein Ding&#8230;&#8221; dedicated an entire episode to Ubuntu.</p>
<p>A commenter asked for a translation, so here it is, including the program host, Nicolaj Sonne&#8217;s evocative sound effects.</p>
<blockquote><p>Hey!</p>
<p>Today we jump in, and go all-in with Open Source. I have purchased a compltely new Low-budget computer, nuked Windows, and installed the free OS Ubuntu. In other words, I don&#8217;t need to spend one more Krone on this computer!</p>
<p>Welcome to this episode of &#8220;So ein Ding&#8221;!</p>
<p>&#8230;</p>
<p>1:35 As always, we are playing with open cards, and this part will be a bit different &#8220;Ding&#8221; than usual. The thing is, a computer OS is a seriously complicated thing. Imagine you arrive in a new city. It will not take long before you can find your way around, but it will take a few years before you know every sneaky little watering-hole from Christianshavn to Frederiksberg. And to stay within that picture, there are three different cities in the land of Operating Systems: Windows, Mac OS and Linux.</p>
<p>My first PC was a 486DX. About 15 years ago, I installed Windows on it, and I have used that ever since. Not on an &#8220;ultra-user&#8221; level, buuuut&#8230; I have re-installed one driver or another now and then.</p>
<p>1:42 Then about five years ago, I was forced to re-school in another OS, namely Mac OS. I got a new boss, who told me, &#8220;hey, here in the firm, we use computers with apples on, period.&#8221;</p>
<p>About two weeks ago, I started using Ubuntu. I have used Ubuntu before, and other  Linux versions in the same family as Ubuntu, but it was rather sporadic.</p>
<p>So you can rightfully say, I am a completely green Ubuntologue, and it it these experiences we are going to talk about today.</p>
<p>2:17 So now, Ladies and Gentlemen, we present the danish sneak-preview on &#8220;This is how you install an operating system&#8221;.  Perhaps it will get your cold-sweat running down your back and your eyes are flickering, when words like: &#8220;boot&#8221;,  &#8220;partition&#8221;, &#8220;NTFS&#8221;, &#8220;ext4&#8243;, and so on, fly through the air. But hang on, because if you do that, you will be free-wheeling software-wise in the all foreseeable future.</p>
<p>You go to Ubuntu.com, press &#8220;download&#8221; and then you  fetch a file called &#8220;an image&#8221;, burn it to a CD or put it on a USB-stick.</p>
<p>And already now, it is obvious to see that they want customers in the shop, because there is a super, super easy step-by-step guide. Just follow that!</p>
<p>Well,  I did not need the pre-installed Windows version, so <em>ummphh</em>, it got the knife.</p>
<p>Regarding the installation, it was around 15 minutes, click, click, click, a cup of coffee, and then, everything worked. All key-combos, turn the backlighting up and down, Wi-Fi on/off, sound, and things like that. Everything apparently worked, it was fantastic!</p>
<p>THEN the system proposed an update, and, from old habit, YES! I want that update. It took around 10 minutes, and then I came back to this: a computer, where neither mouse nor keyboard works!</p>
<p>No reaction what-so-ever. Then I thought, perhaps, if I attach an external USB mouse and USB keyboard. That worked, then I could google a bit around, and I discovered, I was not the only one losing contact with the mouse and keyboard.</p>
<p>Well, that was a bit of a burn-out. The thing is, I had fetched &#8212; as usual, from habit &#8212; the newest 10.10 version of Ubuntu. Then I tried with Ubuntu 10.04 LTS &#8212; Long Term Support &#8212; you can read about it on Ubuntu&#8217;s home-page, it makes sense. I installed that, and that worked perfectly, updates and everything. Except ONE small thing, and that was: I had sound though the phone-jack, but not through the speakers!</p>
<p>IF your speakers don&#8217;t work but your phone-jack does, then you &#8220;just&#8221; need to open a terminal window, and write &#8220;sudo apt-get repository blah blah blah&#8221;.</p>
<p>You need to be good at googling, and you need to have a bit of courage. It is not rocket science but it is not something I would want to explain to my mother over the phone, aaaand: my mother is a programmer. Well, a programmer from the days when the IBM  1287 was the latest &amp; greatest, and programs was something you wrote by hand, and then sent out to be punched by &#8220;punch-ladies&#8221; who would&#8230; punch your programs</p>
<p>The free OS Ubuntu is a part of  the Linux family which is open source software. Ubuntu means, loosely translated:  &#8220;I am who I am because of who we all are.&#8221; What a bunch of hippie smoke! ;-)</p>
<p>But it is not all psycodelic, there is a meaning to the madness, Ubuntu is one of the more well-known open-source software projects, and in brief, &#8220;open source&#8221; means that the &#8220;recipe&#8221;, the source, is freely available. This is NOT true for Mac Os and Windows. There, the engine room is shut and locked!</p>
<p>Even though Ubuntu is entirely free, it is presumably neither security-wise or economically completely out in the woods, because e.g. the French parliament, the French police, and the Swedish police all use Ubuntu.</p>
<p>Ubuntu is, as mentioned, a part of the Linux family. &#8220;Linux what-creature?&#8221;. Well, you meet Linux really often! Six out of ten times you write www.some-homepage.dk, there is a Linux server in the other end.</p>
<p>6:40 And now, the Ubuntu-sun rises! [shows the Ubuntu install ID like a rising sun] I now have a computer, completely without pre-installed Windows, where everything works!</p>
<p>Here, right in the middle of the graphical user interface, you will relatively quickly feel at home. Things are organized a bit in-between Windows and MacOSX But, with respect to the tightness of things, where applications are found, files, folder-structure and so on, it is probably more like Mac OSX.</p>
<p>But, what about compatibility? Well, those days, where computers could not speak to each other&#8230; it&#8217;s no longer like that. You can easily create a file on a Ubuntu computer, put that file on a USB-stick, put that into a Mac, burn a CD, and then read that CD on a Windows machine. It is not a problem. So yes, you can easily send a mail to your grandma, with holidays pictures, music and video. Even if your grandma uses Ubuntu, everything will work just fine.</p>
<p>There IS lots of software, that only works for e.g. Windows or Mac OS, and if you save a fike in that kind of software, then you cannot open it in Ubuntu&#8230; at least it is not certain that you can.</p>
<p>8:00  <em>Tjjj , tjjj, tjj, tjj</em> [plays around with the UI] &#8230;  In spite of fancy animations, there are some things I don&#8217;t think are so polished in Ubuntu as they are under Windows and Mac OS, and an example is navigating between programs with keystrokes while you are grabbing something with the mouse. If we look at an example here:  Here in my Mail program. I say; I want to make a mail, <em>wwwyycchh</em>, and then we write a mail, write-write-write. Then I realize, I would like to attach a photo to that mail. Then I use my key-strokes to get to my pictures. Then we look at it&#8230; here is a funny picture, we want to attach that. Then, <em>aaannnchh</em>, you can grab it with the mouse. On a Windows computer, on a Mac, I would be able to &#8212; while I&#8217;ve grabbed this image &#8212; to use key-combos to get back to the mail program&#8230; I can&#8217;t do that here! And it&#8217;s really irritating!</p>
<p>Over here,  on my typewriter, it doesn&#8217;t run Windows, it runs Mac OS, I can search files in a neat way. If I want to find all the photos I have taken with a Nokia N73 phone (jpeg because it is pictures)&#8230; in no time, all the photos I have taken with that phone, they are here! That is very smart, because this information is not something associated with the file-name, it is something inside the file itself that I can search. I can&#8217;t do that in Ubuntu, there isn&#8217;t that kind of meta-meta-meta search. That is something I miss enormously!</p>
<p>One of the things that make Ubuntu somewhat special is that it has a built-in appstore, a bit like you know it from the mobile-phone world: small programs you can fetch. It is called &#8220;Ubuntu Software Center&#8221; and it is loaded with software! Right now there are 32648 different items, that all are 100% verified and totally OK programs.</p>
<p>Then you can of course browse around after categories, but now, I would like to fetch a program that can make DVDs, that is DVD graphics and so on&#8230;. that&#8217;s called</p>
<p>DVD authoring. Let&#8217;s see [browses the appstore] &#8230; <em>wwyyyccchh</em>, &#8220;DVD-ripper&#8221;.. &#8220;trans&#8221;&#8230; <em>bmm</em>, <em>bmm</em>&#8230; &#8220;auto&#8221;&#8230; <em>eetchhh</em>&#8230; &#8220;Author DVDs and  slideshow&#8221; &#8230; Then I can click here, select &#8220;More Info&#8221;, then you can read a bit about what the program can do&#8230; it looks good&#8230; &#8220;Install&#8221;&#8230; and its free. Then it asks me for my password&#8230;. <em>mmmwrrcchh</em>&#8230;</p>
<p>And that&#8217;s every time I want to alter something on the machine, then it asks for my password, which I created during the installation. Now it starts installing&#8230;. <em>dddlidstchh</em>&#8230;</p>
<p>In the meantime, we can take a look, over here, on &#8220;Installed Software&#8221;, that is also shown in one place, and here I can see all the software that&#8217;s installed on the computer. And if I feel like&#8230; <em>wwyyycchhh</em>&#8230; pull the plug on one of them, I just click on &#8220;Remove&#8221;. No nonense.</p>
<p>And now, my DVD program should be installed: <em>dlllyytchh</em> <em>boing</em>! And, now, get started makeing DVDs!</p>
<p>But, take it easy, you are not forced to only &#8220;purchase&#8221; in Ubuntu&#8217;s Software Center. You can use everything you can find on the net. Of course, it must generally be made for Ubuntu&#8230; and note I say &#8220;generally&#8221;, because the thing is, I&#8217;ve fetched this little thing here, it&#8217;s called &#8220;Wine&#8221;. And then you can see here&#8230; Wine means &#8220;Wine Is Not an Emulator&#8221;&#8230; and then you can install Windows programs&#8230; <em>wwyyyytccchhh</em>. Now I&#8217;ve fetched &#8220;Picasa&#8221; in the Windows version, and it now runs  under Ubuntu. It is not certain that exactly your favourite program runs under this &#8220;Wine&#8221;, but then perhaps you can find another favourite program that does.</p>
<p>With Ubuntu I can use my netbank. But its €&amp;&amp;#%#% no thanks to NemId [danish net id organization], who absolutely offers NO support to Linux. Definitely! (Well. I&#8217;ll keep an eye on you!)</p>
<p>Then I can of course burn CDs DVD, i can import photos from my digital camera, I can write mails, I can create documents &#8212; it&#8217;s not called &#8220;Word&#8221;, it&#8217;s called &#8220;OpenOffice&#8221; &#8212; but I can by and large do everything I usually do. And naturally, all the things I do on the net, I can do here.  Even this fellow, a 3G modem, no problems. I put it in the USB port, Yes&#8221;, &#8220;Yes&#8221; and &#8220;Yes Sir&#8221; and then I was on the net in&#8230; 1.5 minute.</p>
<p>Perhaps I have been damned lucky with Ubuntu&#8230; perhaps not.</p>
<p>12:30 Very fine and very very free, but with that said, it must be said, before the Ubuntu-sun sets, that compared to the dominating, pre-installed alternative, I can&#8217;t <em>really</em> see the great advantage, except perhaps economy and ideology.  And! You don&#8217;t need to bother with these&#8230; [several dialogue boxes appear "Your TV can break down anytime"]. The final verdict is at the end of the program.</p>
<p>[Ubuntu gets 4/6]</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mok0.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mok0.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mok0.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mok0.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mok0.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mok0.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mok0.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mok0.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mok0.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mok0.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mok0.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mok0.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mok0.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mok0.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=44&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mok0.wordpress.com/2011/02/12/free-and-completely-ubuntu-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eea81e07ef150bdbc4e459579d3a9e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mok0</media:title>
		</media:content>
	</item>
		<item>
		<title>Free and completely Ubuntu</title>
		<link>http://mok0.wordpress.com/2011/02/10/free-and-completely-ubuntu/</link>
		<comments>http://mok0.wordpress.com/2011/02/10/free-and-completely-ubuntu/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 08:39:18 +0000</pubDate>
		<dc:creator>mok0</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mok0.wordpress.com/?p=40</guid>
		<description><![CDATA[Tuesday evening (Feb. 8.), the popular tech-review program on danish public television channel DR2 &#8220;So Ein Ding&#8230;&#8221; dedicated an entire episode to Ubuntu. The program host, Nikolaj Sonne, took Ubunto for a test spin, and gives a very positive, fair and balanced review. His final verdict ends on 4 out of 6, which is extremely [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=40&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Tuesday evening (Feb. 8.), the popular tech-review program on danish public television channel DR2 &#8220;So Ein Ding&#8230;&#8221; dedicated an entire episode to Ubuntu. The program host, Nikolaj Sonne, took Ubunto for a test spin, and gives a very positive, fair and balanced review. His final verdict ends on 4 out of 6, which is extremely good, especially considering that an upgrade broke his Maverick installation in the trials (no trackpad, no keyboard) and  he had to downgrade to Lucid.</p>
<p>You can view the episode here &#8212; in danish of course &#8212; but watch the program anyway for the nice graphics.</p>
<p><a href="http://www.dr.dk/dr2/soeinding/?p=1599">﻿http://www.dr.dk/dr2/soeinding/?p=1599</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mok0.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mok0.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mok0.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mok0.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mok0.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mok0.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mok0.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mok0.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mok0.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mok0.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mok0.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mok0.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mok0.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mok0.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=40&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mok0.wordpress.com/2011/02/10/free-and-completely-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eea81e07ef150bdbc4e459579d3a9e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mok0</media:title>
		</media:content>
	</item>
		<item>
		<title>80 x 25 no more&#8230;</title>
		<link>http://mok0.wordpress.com/2010/01/12/32/</link>
		<comments>http://mok0.wordpress.com/2010/01/12/32/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 17:37:08 +0000</pubDate>
		<dc:creator>mok0</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mok0.wordpress.com/?p=32</guid>
		<description><![CDATA[On my workstation, I have a beautiful, large, Samsung SyncMaster 275, which is a 27.5&#8243; monitor. The screen area measures around 58 x 37 cm, and the nominal resolution is 1920 x 1200 pixels. The display is beautiful and crisp, and the fonts are nice and clear on the X-display, and Kubuntu looks lovely on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=32&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On my workstation, I have a beautiful, large, Samsung SyncMaster 275, which is a 27.5&#8243; monitor. The screen area measures around 58 x 37 cm, and the nominal resolution is 1920 x 1200 pixels.</p>
<p>The display is beautiful and crisp, and the fonts are nice and clear on the X-display, and Kubuntu looks lovely on the monitor. My wallpaper is an image of the stunning, intriguing and slightly eery <a href="http://www.skytopia.com/project/fractal/mandelbulb.html">MandelBulb</a> 3-D fractal.</p>
<p>For a while, however, I&#8217;ve been annoyed with the virtual TTYs on my workstation. With a screen this size, the font size of the 25&#215;80 terminal is approximately 1 cm. Working on it gives me a feeling of being teleported -25 years to an over sized version of the venerable DEC VT100 terminal. Another thing, the Kubuntu splash screen with the blue progress bar looked really ugly.</p>
<p>So today I did something about it. First, I ran:</p>
<blockquote><p><code>sudo hwinfo --framebuffer</code></p></blockquote>
<p>That gave me a rather long list of framebuffer modes. I chose the bottom one, that looked like this:</p>
<blockquote><p><code> Mode 0x037d: 1920x1200 (+7680), 24 bits</code></p></blockquote>
<p>The number I needed was <code>0x037d</code>. Next step is to edit the <code>/boot/grub/menu.lst</code> and add:</p>
<blockquote><p><code>vga=0x037d</code></p></blockquote>
<p>to the default boot line, and reboot.</p>
<p>I now have 240 x 75 character terminal, and it looks beautiful! Now, I can run <a href="https://launchpad.net/byobu">byobu</a> with all its geeky goodness. And the Kubuntu boot-splash screen now looks really professional. Nice. There&#8217;s a slight problem with the status messages (from fsck) scrolling, but I can live with that for now.</p>
<p>Needless to say, I can&#8217;t show you a screendump&#8230; well, perhaps I&#8217;ll take a photo one of these days <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I am a happy camper.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mok0.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mok0.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mok0.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mok0.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mok0.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mok0.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mok0.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mok0.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mok0.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mok0.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mok0.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mok0.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mok0.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mok0.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=32&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mok0.wordpress.com/2010/01/12/32/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eea81e07ef150bdbc4e459579d3a9e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mok0</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu on the Dell Mini 10 (3)</title>
		<link>http://mok0.wordpress.com/2009/05/27/ubuntu-on-the-dell-mini-10-3/</link>
		<comments>http://mok0.wordpress.com/2009/05/27/ubuntu-on-the-dell-mini-10-3/#comments</comments>
		<pubDate>Wed, 27 May 2009 14:09:48 +0000</pubDate>
		<dc:creator>mok0</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mok0.wordpress.com/?p=21</guid>
		<description><![CDATA[A few people have asked if the psb X driver is stable running under jaunty. It is indeed&#8230; rock stable. So now that&#8217;s established, let&#8217;s move on to something else. I really want the Dell to be a &#8220;mini-laptop&#8221; so I originally installed the ubuntu-desktop package. But I&#8217;ve felt that the response was a bit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=21&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few people have asked if the psb X driver is stable running under jaunty. It is indeed&#8230; rock stable. So now that&#8217;s established, let&#8217;s move on to something else.</p>
<p>I really want the Dell to be a &#8220;mini-laptop&#8221; so I originally installed the ubuntu-desktop package. But I&#8217;ve felt that the response was a bit sluggish. The menus were just a few fractions of a second to appear, they kind of &#8220;rolled&#8221; on instead of just appearing etc. Not much, but enough to make it annoying.</p>
<p>So a few days ago, I installed Xubuntu, and it&#8217;s brilliant! It made a true, noticeable difference in response. The Mini 10 now appears <em>really</em> snappy! Xubuntu makes use of the XFCE4 window manager, it&#8217;s lightweight compared to the Gnome environment, but still comes with a bunch of applications like terminal, text editor, etc. etc. I am truly impressed with the amazing installation the Xubuntu team has created!</p>
<p>I must admit, I am a bit shameful, because I never thought of Xubuntu as a &#8220;real&#8221; distribution&#8230; just one that could be used on really old and slow hardware. Boy was I wrong!</p>
<p>The default setup of the Xubuntu desktop, as designed by the Xubuntu team, is almost exactly like the default Gnome desktop in Ubuntu. I bet you could exchange someones desktop and (s)he would hardly notice any difference. All the functionality is there, and it&#8217;s just as elegant. An additional bonus for those who don&#8217;t like Ubuntu&#8217;s human theme with its brown/beige colors, Xubuntu&#8217;s default color scheme is pretty bluish, very light on the eyes.</p>
<p>I&#8217;ve been running with Xubuntu for a few days now. One thing that I&#8217;ve noticed &#8212; also when running ubuntu-desktop &#8212; is that the way the default desktop is set up, with panels at the top and bottom of the screen is not well suited for the Mini 10&#8242;s wide 16:9 display. What you really need is screen real estate in the vertical direction, because you tend to scroll a lot, for example in Firefox. On my Kubuntu workstation, I have a 27&#8243; Samsung SyncMaster wide screen, and there I can use the width of the screen to have two applications running side-by-side. But the Mini 10&#8242;s monitor is really too tiny to do that. </p>
<p>Another thing is that the desktop looks exactly like that of a workstation, with everything scaled down to a tiny size. It looks neat, but for most people &#8212; and especially netbook users who are not familiar with Linux &#8212; it&#8217;s probably not the best setup.</p>
<p>So, I have played a littlebit today with reorganizing the desktop layout, to make it something of an in-between of UNR and the standard desktop. Here is what I&#8217;ve come up with:</p>
<div id="attachment_22" class="wp-caption alignnone" style="width: 730px"><img src="http://mok0.files.wordpress.com/2009/05/screenshot3.png?w=720&#038;h=405" alt="Xubuntu running a la UNR" title="Xubuntu running a la UNR" width="720" height="405" class="size-full wp-image-22" /><p class="wp-caption-text">Xubuntu running a la UNR</p></div>
<p>The panels now appear on the left and right edges of the screen, where there is plenty of real estate. The left panel is &#8220;controlling&#8221;. At the top is the &#8220;Applications&#8221; menu, then the snapshot applet I used to make the screenshot (really doesn&#8217;t belong there). Third and fourth from the top is &#8220;Places&#8221; and &#8220;Help&#8221;, which are also on the standard top panel. Next is the desktop switcher (you really need lots of desktops with this small screen). At the bottom is the applet to hide all the application windows, so you can get to the launcher icons on the root.</p>
<p>The right panel is &#8220;informational&#8221;. From the top, a clock, a weather applet, the notification window (with Ubuntu One, battery, wifi and bluetooth monitors), and finally at the bottom (not visible on the screenshot) I&#8217;ve put the icon box showing running apps on that desktop.</p>
<p>The root window has some applications grouped in &#8220;Network&#8221;, &#8220;Office&#8221; and &#8220;System&#8221; areas. With a customized wallpaper image with labels and squares this could be elaborated even further. I have no need for that though <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>I am very pleased with the setup as it has developed so far. I think <strong>Xubuntu</strong>, installed with <strong>lpia</strong> architecture packages, and with a <strong>simplified desktop theme</strong> is very close to the ideal setup for a netbook. Perhaps something to consider for the Xubuntu team? An XUNRR package? (Xubuntu UNR Revisited <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mok0.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mok0.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mok0.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mok0.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mok0.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mok0.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mok0.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mok0.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mok0.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mok0.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mok0.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mok0.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mok0.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mok0.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=21&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mok0.wordpress.com/2009/05/27/ubuntu-on-the-dell-mini-10-3/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eea81e07ef150bdbc4e459579d3a9e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mok0</media:title>
		</media:content>

		<media:content url="http://mok0.files.wordpress.com/2009/05/screenshot3.png" medium="image">
			<media:title type="html">Xubuntu running a la UNR</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu on the Dell Mini 10 (2)</title>
		<link>http://mok0.wordpress.com/2009/05/25/ubuntu-on-the-dell-mini-10-2/</link>
		<comments>http://mok0.wordpress.com/2009/05/25/ubuntu-on-the-dell-mini-10-2/#comments</comments>
		<pubDate>Mon, 25 May 2009 19:20:41 +0000</pubDate>
		<dc:creator>mok0</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mok0.wordpress.com/?p=14</guid>
		<description><![CDATA[Great news! The Dell Mini 10 now runs on Ubuntu 9.04 at full nominal resolution of 1024  x  576! What has happened is that the Ubuntu Mobile Team has compiled and packaged kernel modules, X.org drivers, libraries to interface to kernel DRM services, etc. etc. for the Poulsbo chipset and made them available on their [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=14&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Great news! The Dell Mini 10 now runs on Ubuntu 9.04 at full nominal resolution of 1024  x  576!</p>
<p>What has happened is that the <a href="https://edge.launchpad.net/~ubuntu-mobile">Ubuntu Mobile Team</a> has compiled and packaged kernel modules, X.org drivers, libraries to interface to kernel DRM services, etc. etc. for the Poulsbo chipset and made them available on their PPA.</p>
<p>Remember from my previous post, that my Mini 10 was running using the VESA driver for X. All I had to do to switch to the psb driver was to create the file <code>/etc/apt/sources.list.d/ubuntu-mobile.list</code> with the following content:<br />
<code><br />
deb http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main<br />
deb-src http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main<br />
</code><br />
Then,<br />
<code><br />
apt-get update<br />
apt-get install xserver-xorg-video-psb<br />
</code><br />
and reboot! The Dell Mini 10 then came alive &#8212; after a bit of thinking &#8212; with the display at the correct resolution, and the little display just looked stunningly bright, crisp and sharp!</p>
<p>This is really great news to the many owners of Dell Mini 10 and 12 &#8212; as well as other Poulsbo based netbooks &#8212; that want to run Ubuntu Jaunty.</p>
<p>Kudos and many thanks to the Ubuntu Mobile Team for their effort and a job well done! </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mok0.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mok0.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mok0.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mok0.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mok0.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mok0.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mok0.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mok0.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mok0.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mok0.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mok0.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mok0.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mok0.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mok0.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=14&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mok0.wordpress.com/2009/05/25/ubuntu-on-the-dell-mini-10-2/feed/</wfw:commentRss>
		<slash:comments>83</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eea81e07ef150bdbc4e459579d3a9e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mok0</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu on the Dell mini 10 (1)</title>
		<link>http://mok0.wordpress.com/2009/05/22/ubuntu-on-the-dell-mini-10/</link>
		<comments>http://mok0.wordpress.com/2009/05/22/ubuntu-on-the-dell-mini-10/#comments</comments>
		<pubDate>Fri, 22 May 2009 12:46:18 +0000</pubDate>
		<dc:creator>mok0</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mok0.wordpress.com/?p=4</guid>
		<description><![CDATA[I recently purchased a Dell Mini 10 notebook. I&#8217;ve been wanting to get a netbook for some time, and I was planning to one of the Asus EEE series. However, looking at one at the local computer store, I found it a bit &#8220;plastic-y&#8221;. I&#8217;ve always heard that Dell computers have a good build quality, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=4&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently purchased a Dell Mini 10 notebook. I&#8217;ve been wanting to get a netbook for some time, and I was planning to one of the Asus EEE series. However, looking at one at the local computer store, I found it a bit &#8220;plastic-y&#8221;. I&#8217;ve always heard that Dell computers have a good build quality, so one morning, on a whim, I ordered a Dell. I told the salesman that I had no use for Windows XP. He said there was no price on it, but gave me a discount of around 26 Euro. My suspicion is that Microsoft allows Dell to install XP for free.</p>
<p>Now that I have it, I&#8217;m a bit disappointed in the Dell&#8217;s build quality. I find the Mini 10 a bit plastic-y too. But then, I&#8217;m used to the solid feel of my PowerBook G4, and in build quality, nothing comes close to Apple I guess.</p>
<p>Apart from that, the Mini 10 has some really nice features, among others I really like the touchpad without buttons. From the Mac, I am used to using gestures on the touchpad, and I can reveal that it works nearly perfectly under Ubuntu 9.04. I also really like the keyboard, which is about the same size as my <a href="http://www.cherrycorp.com/english/keyboards/Industrial/4100/index.htm">Cherry 4100 keyboard</a> that I use on my workstations. In fact, everything works&#8230; except the graphics&#8230; but more on that later.</p>
<p>Initially, I was confused by the fact that Ubuntu recommends that you install the UNR version on all netbooks, but that is for the i386 architecture only, and I wanted to use lpia, because it&#8217;s optimized for the Atom processor and has been reported to run better, and give better battery life.</p>
<p>So instead of UNR, I chose to download the <a href="http://cdimage.ubuntu.com/ubuntu-mid/daily-live/current/">MID version of Ubuntu</a> which installs lpia architecture packages.</p>
<p>I put the image file on an USB key following the <a href="https://help.ubuntu.com/community/Installation/FromImgFiles">instructions on the download page </a>. I then booted up the Mini 10 with the pre-installed XP &#8212; just to make sure that it worked. When the XP installation came to the point where you have to accept the license, it felt REALLY good to hit the &#8220;No&#8221; button <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .  The XP install process then rebooted the Mini 10 from the USB key.</p>
<p>So I installed the Ubuntu-MID version, zapping XP with 2 ext4 partitions (<code>/</code> and <code>/home</code> plus 5Gb swap). Everything went very smooth and the Mini 10 sprung to life.</p>
<p>The MID version by default installs a very simple window manager; it seems to work fine but was unfamiliar to me (and after all, the Mini 10 is not MID device) so I installed ubuntu-desktop. It works very well. (I am actually a Kubuntu user, but KDE4 is not at all suited for the limited resolution on the notebook.)</p>
<p>Every worked out of the box: WiFi, bluetooth, sound, even the little camera. BUT, the machine runs at resolution 800 x 576 so images and fonts look a bit &#8220;squished&#8221;.  The Mini 10 is based on the Poulsbo chipset and Intel&#8217;s GMA-500 graphics chip. There&#8217;s been a lot of chatter on the net on the lack of Linux drivers from Intel for these chips. You can google and see for yourself. The situation for Linux is pretty bad, since the Poulsbo chipset is appearing in more and more netbook computers.</p>
<p>To cut a long story short, X does not recognize the GMA-500 graphics chip, so it uses the VESA driver. The native resolution on the Mini 10 is 1024 x 576, but the VESA driver refuses to use that resolution. I have tried various things, i.e. specifying the modeline, but to no avail. X always returns to 800 x 576. So for now, I&#8217;ve settled and am using that resolution. Another thing is that there&#8217;s no acceleration and glxgears runs pathetically slow (25-30 fps) but the Mini 10 is perfectly usable as a netbook despite of this.</p>
<p>There&#8217;s an <a href="https://blueprints.edge.launchpad.net/ubuntu-mobile/+spec/poulsbo-packaging">effort to get drivers for the Poulsbo chipset</a> in shape, hopefully that will result in something soon.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mok0.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mok0.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mok0.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mok0.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mok0.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mok0.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mok0.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mok0.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mok0.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mok0.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mok0.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mok0.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mok0.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mok0.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mok0.wordpress.com&amp;blog=5756472&amp;post=4&amp;subd=mok0&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mok0.wordpress.com/2009/05/22/ubuntu-on-the-dell-mini-10/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eea81e07ef150bdbc4e459579d3a9e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mok0</media:title>
		</media:content>
	</item>
	</channel>
</rss>
