My Blog thingy (mostly dorment):

I did a clojure thing!

So I've been trying to learn clojure and as it happens we did some mathematical expression parsing. Which if anyones looked at my github you can see I've done quite a bit of :P
Well so after helping a bunch of classmates getting it implemented in java, I thought this would be perfect for trying to do in clojure. Functional programming lends itself to pattern matching fairly easily I've heard at least. Although that example was for haskell, I thought there should be no problem in clojure.

I started by implementing the Shunting Yard algorithm in clojure. But quickly realized that since I'm working with immutables, while loops and pushing and poping things on stacks isn't really optimal.
So I started thinking about how to do this functionally, and remembered how mr. Hickey went on and on about "recur" and how it allows for stackless-recursion (tail-call elimination) now it wasn't too difficult imagining how to turn the alorithm from using loops to recursion, instead of writing the state, I just recall with the new one instead.

So for some examples instead of a typical iterative way of adding to a list:

def addKtoN(l,k,n):
  for i in range(k,n):
  return l

Where we iterate over a loop and modify state inside the loop every time.
Rewriting this in a recursive style can be done like so:

(defn addKtoN [l,k,n]
  (if (>= k n) l
    (recur (conj l k) n (inc k))))

As you can see the step where we "add" the item to the list:

(conj l k)

we don't really modify l, we just call the function again with a new list containing all the elements of l with i added to the end (or "conjoined" as the function is called).

So using this way of moving the "assignment" into a recursive call, I could translate the iterative algorithm from wikipedia to clojure.
And after that I got a little help from a few friends over at #clojure on freenode, and we were able to clean up the code a little bit, as I'm fairly new to clojure and don't know all the functions they had plenty of knowledge of moving the logic in more concise steps, which all in all made the whole function really clean looking.

Now the "project" is on github if you wanna have a look, after implementing the infix to postfix algorithm I used the same method to make an evaluator for the postfix expression result.

posted on: Sept. 17, 2016, 2:02 a.m. by: Andreas Larsen, permalink

Updated page design

So upon suggestion from my cousin I completely changed the design (just kidding).
I changed the page to a more of a one-page layout thing, which has the added benefit of making it look like the page has more stuff on it. Real web 3.0 like or whatever.
I've also changed lots of minor things such as fonts and margins here and there.

And thats about it, page has a new look. I should really think of more stuff to write here.

posted on: April 24, 2016, 10:32 p.m. by: Andreas Larsen, permalink

Mysql Hickups

So I tried upgrading my server today for security and feature updates and such, only to find that almost all the stuff related to mysql had been completely borked.

Now, after a while of trying to fix this, we just decided it was easier to uninstall mysql-server and restore from the backed up db (which we had from the same day, no data should be lost).
HOWEVER there seems to be something wrong with ubuntus packaging of mysql server, because even when having purged every single package related to mysql, and every config file or storage it used, it still failed to install and setup properly.

In the end I decided to try mariadb, and lo and behold it worked instantly.
Isn't software amazing?

posted on: March 1, 2016, 1:58 a.m. by: Andreas Larsen, permalink

Hello World!

The site is finally live, after what felt like ages.

posted on: Feb. 8, 2016, 12:32 a.m. by: Andreas Larsen, permalink
rss feed link

Where to reach us


Website email (for bugs and support):


Andreas @NorthcodeNo
Jens @Northcode_Jens

About Northcode

We are a small programming and software group situated in norway and switzerland. We do mostly programming in c#, python and web.

Our original projects were this website and a version manager for Minecraft. One of our biggest projects to date is cobalt vault, which is a user content sharing site for the game cobalt.

Out members


What I do:

My education

Most of my knowledge about all things computing is self taught from the internet, as the schools I've gone to have had no computer or programming courses. I am now (2016) attending first year of university at a bachelors degree in computer engineering at The Arctic University of Norway, campus Narvik.
Most of my skills currently are as follows:

Misc random stuff about me

As a resident of the frozen wastes of Norway, I enjoy skiing and snowboarding, both cross country and down-hill, as well as hiking in the summer.
I've grown to love tea a lot, and can often be seen either drinking or making tea.
I play piano whenever I feel like it, I didn't say I was any good, but I like it.
My favourite band is Coldplay, but I listen to most things from Metal to Hip Hop, follow me on soundcloud to see more of what I like.



Currently attending school for computing at Kantonsschule Hottingen in Zürich with favourite subjects being IT, Math, Physics and English.
Lots of self taught skills about computing.
Can speak multiple languages including Norwegian, English, German and a little French.


Misc info

Half-Norwegian, Half-swiss.
Hobbies include Ju-Jitsu, Hiking, Mountain Climbing and Down-hill Skiing.