Go to the navigation

elblogg

»english

Printer setup

We got a new Xerox network printer at work a few months back. I haven’t had that much use for it, so I never bothered setting it up on my computer. People around me, using Macs and Windows, were complaining that it was hard getting it to work, and some never managed to get it to work.

Knowing that Macs use the same printing system as Ubuntu, I assumed that this would be complicated as well, so I had postponed it for some time. This week I finally got to setting it up, and it was really simple.

I didn’t have to enter any information at all, it was just a matter of clicking four buttons.

Start the printers control panel from the System menu. This reveals the following window:

Skjermdump-Skriverkonfigurasjon - localhost

  1. Click the “new” button (“Ny” in Norwegian).  This revealed the following window:
    Skjermdump-Ny skriver
  2. You don’t have to enter anything, just click “Forward” (“Framover” in Norwegian). The configuration wizard then asks you to verify some settings, like the name of the printer:
    Skjermdump-Ny skriver-1
  3. Still, no need to change anything. Just click “Use” (“Bruk” in norwegian)
    Skjermdump-Vindu uten tittel
  4. Now click “Yes” if you want to see the glorius and colorful ubuntu test page coming from your printer.

That’s it. Who said Linux where complicated?

I later used the information revealed by the Ubuntu (and Fedora) printer configuration tool to help out my collegues figure out how to set up the printer on a Mac, and in Windows Vista.

ubuntu-user at Narvesen

When I’m travelling, I often visit the kiosks at the airport, to see what they have of intresting magazines, specially Linux and Digital Photography magazines. I was visiting Trondheim last weekend, and on the way back, while I were waiting for my plane back to Bergen, I was looking on the shelves at Narvesen at Trondheim airport, Værnes. There were actually a quite good choice of Linux magazines, and one specially catched my eye. I had heard about the new Ubuntu User magazine at the Ubuntu UK podcast, which by the way is a pretty good podcast. But I didn’t expect to find it in a news-stand in Norway, I thought I had to order it from the UK.

So I bought it.

The magazine was priced to around £7, which would translate to about 74 norwegian kroner, or €8.20. But at when I got to the counter, I had to pay 210 NOK for it, which is about £19 or €23. In comparison, one years subscription to the magazine is €29.90 if you live in Europe outside the UK, which would include Norway. €29.90 is 269NOK or £25.5

This is a total rip-off. I understand that Narvesen needs a margin for magazines with a narrow group of readers, but this pricing is insane.

Great news in the software world

During the last week there has been a couple of great releases in the software I use every day.


First out was Python 3.1. It was released June 27th and features

  • An ordered dictionary type
  • Various optimizations to the int type
  • New unittest features including test skipping and new assert methods.
  • A much faster io module
  • Tile support for Tkinter
  • A pure Python reference implementation of the import statement
  • New syntax for nested with statements


Next out was Mozilla Firefox 3.5, which was released earlier today (June 30th), most noteworty items from that release is the @font-face css-attribute, that allows web-designers to bundle custom fonts with their website designs, and use custom fonts in their design.  I have used that feature to change the header of my blog, you would se a grudge font if you use the new Firefox or Safari. They have also released a new javascript-engine, which they claim to be a lot faster than the old one. Also, support for the <video>-tag has been added.


Then last, but not least, the long awaited PHP 5.3.0 has been released, which provides namespaces and closures for PHP.

Sugar

Ok. It has been a while since my last post, and quite a few things have happened since then, some of which I will get back to in some later posts.

One of the things that have happened is that I attended the “Skolelinux developer summit” or Debian Edu developer summit here in Bergen, with the goal to do some real contribution to free software. I didn’t end up contributing any code at that event.

Cecilie had asked Knut Yrvin to do a talk about community based projects, which inspired some of the other attendees, Walter Bender, to talk about his organization, Sugarlabs. Sugarlabs organizes the development and promotion of Sugar, the user interface for the One Laptop Per Child (OLPC) project.

from sugarlabs.org, click the image to show the whole series in context.


Sugar is an user interface aimed at kids and learning, rather than changing the learning process to use the computer and the web, it changes the user interface, so it is suited for a classroom environment. That being said, using sugar will probably revolutionize the way learning is done in the classroom, to a much more collaborative approach. Everything in sugar is made for sharing between the pupils and/or the teacher.

I had seen some screenshots of Sugar before, but I was totally blown away about the collaboration part of the system, and also how it changes the approach to computers, where we make the computer suitable for the classroom, rather than making the classroom suitable for the computer.

My contribution during the developer summit ended up beeing translating the Turtle Art activity into Norwegian, and helping Mr. Bender finding some bugs.

Since then I’ve translated the download pages on the Sugarlabs wiki into Norwegian. Sadly the current state of Sugar is that it’s quite buggy as “Sugar on a Stick”, completely broken in Ubuntu, and probably somewhat buggy in Fedora.

Also, listen to the Episode 66 of the FLOSS weekly podcast about the implementation of the OLPC in Nepal, which goes more into detail about Sugar.

Merging two lists

Lets say you have two lists, one of them containing the values [1,2,3] and the other one containing the values [4,5,6], and you want to combine these two lists into one list, like this one: [1,2,3,4,5,6].

Let’s see how this can be done in different (high level) programming (or scripting or templating) languages.

Java

Java has multiple list implementations, lets start with the most basic one, the builtin array.

int[] A = {1,2,3};
int[] B = {4,5,6};
int[] C = new int[A.length + B.length];
int counter=0;
for(int e : A){
  C[counter]=e;
  counter++;
}
for(int e : B){
  C[counter]=e;
  counter++;
}

or with an ArrayList:

/*Dropped importing the correct classes, 
and constructing the ArrayLists A and B, since thats not the focus here...*/
List<Integer> C = new ArrayList();
C.addAll(A);
C.addAll(B);

PHP

So, how is the same done in PHP?

$A=array(1,2,3);
$B=array(4,5,6);
$C=array_merge($A,$B);

Python

And at last, how does the Pythonistas do this?

?View Code PYTHON
A=[1,2,3]
B=[4,5,6]
C=A + B

Note: the rubyists use the same approach.

New howto: Using apache to create an authenticated proxy

I just wrote a description on how you can use apache to create an authenticated proxy ahead of your development server, or other http-based servers that doesn’t provide authentication themselves.
You can find it under the docs-section or by clicking here: Using apache to create an authenticated proxy.

The kindle guide to the galaxy

This XKCD comic are just asking to be cited.
[An XKCD comic joking about the fact that the kindle is like the hichhikers guide to the galaxy]
Click the image to read the whole comic.

Picture update 6

It’s plumbertime… It’s time for some pictures from the new bathroom furniture install

Blogging code

As a programmer and linux geek I often need, or at least want to write about code, scripts and commands on my blog, but as many of you know, displaying raw code in HTML is setting yourself up for failure. The simplest part of the problem is the fact that line breaks and whitespace might be significant, this is simply solved by putting the code inside a <pre> block. The more tricky part is that code often is full of characters like &, > and <. Characters that have a specific meaning in HTML and can’t be echoed directly. & needs to be typed as an HTML entity (&amp;), just as > (&gt;) and < (&lt;). Talking about HTML and XML code on your blog can be a really tedious task (as the above).

I have usually solved this by writing the code in a file first, and then running the file through this sed command

cat file.html|sed -e 's/&/&amp;/' -e 's/</&lt;/' -e 's/>/&gt;/'

But as I work on a Macintosh these days, I’ve been using TextMate a bit.. Not as much as i use OpenKomodo though. TextMate has some nice blogging capabilities. You can use it to post directly onto your blog, and it has shortcuts for converting sections of your post into HTML entities. Just select the text, and hit ⌘+&, 1

Edit: it seems like there is some compatibility problems with WordPress 2.7 and TextMate. The post was published two hours off, and as a private post.

Officespace

Its not enough that I’m moving into a new apartment, the company I work for also moved offices yesterday. Here’s some pictures from my new office.

Bloggurat Twingly BlogRank Blogglisten