November 25, 2014

Project Euler p. 2

The next one was a bit trickier to figure out, due to my inexperience with looping constructs in Clojure. The actual Fibonacci is quite simple, the problem description contain all the information you need: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, … Read more

November 24, 2014

Project Euler p. 1

The first problem is fairly straight-forward: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. Ok, so we need something that looks a little something like this: (defn solve "Solve for x < 1000" [] (solve-for-x-lower-than 1000)) First thing to do, what qualifies a number x as a multiple of 3 or 5? Read more

November 24, 2014

A Clojure adventure into Project Euler

After writing some C# a couple of weeks ago, I realised that I have gotten very rusty as a coder, resulting in code that was unwieldly, over-engineered or plain bizarre. This made me rethink my priorities, and eventually I decided to go back a number of steps and work on the fundamentals once again. The first thing that came to my mind was the Code Wars website (brilliant website), only problem with it was that it focused on four languages at the time, Python, Ruby, Coffee Script and JavaScript. Read more

November 5, 2014

Running .desktop files from command line

I have been mildly annoyed from time to time that I did not know of any way to start a .desktop file from command line. After all, I can do so just fine from nautilus so there had to be a way to do it from a terminal too, right? Turns out xdg-open can’t do it since .desktop files are a subclass of text files and as such the associated program is of course a text editor. Read more

October 3, 2014

Shout-out: Drip

Drip is one of those programs that when found make you all giddy and want to start jumping around giggling to yourself. The “long story, short” version is that Drip can preemptively fire up a vm in the background after you run a certain command for the first time, and then just hands you this sleeping one the next time you ask it, reducing start-up time significantly. But don’t just take my word for it, go ahead and check it out yourself, you can grab it here: Drip@Github

© Sebastian Hörberg 2018

Powered by Hugo & Kiss.