Ole Bakstad

Where god does not play dice.

Nokia e71

Today I ordered the Nokia e71. I've always wanted a mobile phone with a full qwerty keyboard, but never got around to buy one. The phone runs symbian s60, and runs it very well. It got 3G, W-lan and GPS, all the fancy things you might want in your phone (see full feature list at nokia.com).

Well that's it, I'm off to play the waiting game now!

Posted in Life | 2 comments
Tags: , , , , ,

We all love the metric system…

... except for ...

Digg it!

Posted in Internet | No comments
Tags: , ,

The grades are in

Today I got the grade on my last exam. Overall I'm happy with the result. I got three B's and one D (BBBD).

B in:

  • Physics
  • Linear Algebra
  • Object Oriented Programming (Java)

D in:

  • Electronic Circuits and Digital Design

Like I commented earlier, the exam in electronic circuits and digital design was one hell of an exam. 40% of the students who showed up failed the course, and ~50% of the students who passed got an E. Seems to me that something was wrong with this exam. See the full statistics here (Norwegian).

My courses next term are:

Posted in School | No comments
Tags: ,

Google Tech Talk: Java Puzzlers

Tobias found this cool Google Tech Talk about Advanced Topics in Programming Languages: Java Puzzlers.

The puzzles are sometimes very non-intuitive, and is mostly results of bad API's or other strange features. Some of the puzzles aren't very useful, but it's always nice to have a deep understanding of a programming language.

Watch the talk a YouTube:

Posted in Java, Programming, Tips & Hints | No comments
Tags: , , , , , ,

Learn Python in 10 minutes

My friend He Yu provided me with a link where you can learn Python in 10 minutes. A nice introduction to Python assuming that you know general programming.

I'm looking into Python for two reasons. One; I want to expand my knowledge of programming languages. Two; Next term I'm taking the course Introduction to Algorithms where Python is the language we will be using. It's always nice to have a head start.

Update:

It turns out that the professor teaching the course has written books about Python and also written a short tutorial. Click here for tutorial.

Posted in Programming, Python, Tips & Hints | No comments
Tags: , , ,

Christopher Langan, a very smart man

I just found a really fascinating documentary about Chris Michael Langan. He has an IQ between 190 and 210, had a very bad childhood, works in a bar and has many interesting views on the world we live in. Particularly the part where he talk about his experience with the school system is interesting. As he says in the documentary:

I found the whole experience of school to be highly annoying. I think I could wrapped the whole thing up in a couples of years. Instead they managed to keep me around for twelve. [...] My teachers just didn't particularly care for me.

I totally agree with him. We have to realize that smart people need special attention. They should be inspired to learn more about fields they find interesting, and maybe one day make a breakthrough in their field or fields. We need more people like Newton, Einstein, Euler and so on.

The school system in Norway takes care of the people who are less fortunate than the average person, but they don't seem to care about people who are more fortunate, i.e. people with high IQ. The politicians should really sit down and do some drastic changes to the school system. We need to get back to the basics of learning and get rid of all the pedagogical bullshit that's being suggested.

See the documentary on YouTube:

Part 1:

Part 2:

Part 3:

Posted in Internet, Tips & Hints | No comments
Tags: , , , , ,

Que pasa?!

Mats has written a great post on the difference between being inspired by and outright copying. The two Norwegian geniuses Magnus Andersen and Thomas Skorpen has created this amazing new website for keeping you're friends and family updated with that you're doing. This revolutionary can be found at qpsa.no (Norwegian language).

Disappointed? So am I. The page is, like mats says, a outright copy of twitter (with a crappier design). Magnus and Thomas, you should be ashamed.

Read Mats' post to see how non-revolutionary qpsa really is.

Posted in Internet | No comments
Tags: , ,

Bug when trying to edit existing snippets in gedit

When trying to edit the existing snippets in gedit the changes was  gone the next time I opened gedit. It turns out that the predefined snippets is located in /usr/share/gedit-2/plugins/snippets/ (I'm running Ubuntu 8.04). To edit these files you need root access, which gedit doesn't have (unless you do "sudo gedit" or something). To fix this I moved the snippet files from /usr/share/gedit-2/plugins/snippets/ into ~/.gnome2/gedit/snippets/. Fix in terminal:

sudo cp /usr/share/gedit-2/plugins/snippets/* ~/.gnome2/gedit/snippets

It's probably possible to change the permission of the files too.

Posted in Tips & Hints | No comments
Tags: , , , ,

How to use and write snippets

In TextMate and in gedit (probably more editors too) you have the option to use snippets. I love snippets, and they make my day much easier.

To make a snippet you have to define a tab-trigger which is a word or a random sequence of characters that you will remember. Then you have to write the snippet body.

Easy example: If and else statements. When you write "ife" and press tab you want an if-else statement to pop up. We write the snippet:

if($1)
{
    $2
}
else
{
    $0
}

$0, $1 and $2 are where the cursor will be placed. When you first type "ife" and press the tab button the cursor will be where the $1 is. If you hit tab again the cursor moves to $2 and so on, but you always ends up at $0. Now you can use this snippet whenever you need it. Just write "ife" press tab and fill inn the code you need.

More advanced example: Lets say you are getting tired of writing all the code for a for loop every time you need one. Make a snippet!. We set the tab-trigger to be the string "for" and write the snippet:

for (\$${1:i}=${2:0}; \$${1:i} < $3; \$${1:i}++)
{
    $0
}

What the ${1:i} does is that it sets the 1st cursor position and sets a default value ("i" in this case). The default value is marked, so when you tab to the position you can immediately overwrite the default text. And an other thing in this example worth mentioning is that we use ${1:i} more than once. This enables you to change the default at more than one place at once. Let's say you don't want your variable called "i", but "index". You still just write "for", press tab, and "i" is marked. You now write "index", and the "i" in all 3 places where it's used will change to "index". Then tab again to set the start value of the for loop, and yet again to set the max value for the loop. After choosing variable name, start value and max value you just have one tab left. The last tab brings to you $0 and you're ready to write some code inside the for loop. If you tab one more time while the cursor is at $0 the tab sequence will start over.

Posted in Programming, Tips & Hints | One comment
Tags: , , , ,

gedit + plugins = \o/

I've been looking for good editor for Ubuntu for a while, and I think I found it.  After reading Micah Carrick's post on Customizing gedit as a Web Developer’s IDE I was amazed how much gedit with plug-ins could do. It almost have anything I want in an editor. I don't know if I would call it an IDE though. Missing debugging and CVS/SVN is kinda important in an IDE. There are debugging plug-ins for Perl and Python, but not for PHP, Java and JS (which is the languages I mostly use).

Personally I like the same preferences that Micah uses. I enable indent with 4 spaces, turn of line wrapping and enable line numbering. Read a more detailed description in Micah's post.

Plug-ins I use:

- Gemini
A plug-in which auto-completes parenthesis, brackets and so on (the characters: < { [ ' " " ' ] } >) and nicely indents and places the cursor where you (me) want it. This plug-in is an absolute life saver!

Before return is pressed (notice that there is no "}"):

{//Cursor here

After return is pressed:

{
    // Cursor here
}

- Symbol Browser
Shows a list of classes, functions, enums and class fields.

- Snippets
This plug-in allows you to define snippets of codes which appear when you use a tab-trigger. This one saves you a lot of time. Make a for-loop with a few keystrokes. See my post on how to use snippets.

Screenshot of my gedit (oblivion theme):

If you use an awesome plug-in or something for gedit please leave comment!

Posted in Programming, Tips & Hints | No comments
Tags: , , , ,
This site is powered by WordPress.