Some(blog)

about programming and stuff

Blogging with Hugo

So, I decided to throw out Jekyll and give Hugo a try. The main reason for this is that I got tired of fighting Ruby, RubyGems and all that every time (once a year) I wanted to do something with this blog. Hugo is just an independent executable which makes it way easier to use. Although there are quite a few nice templates for Hugo, I didn’t find one that I wanted to use. Read more...

Let's encrypt!

security privacy
If you pay attention to privacy and security news you’ve probably heard of and maybe even used Let’s Encrypt. If not, this is your lucky day! This is their own description: Let’s Encrypt is a new Certificate Authority: It’s free, automated, and open. What does that mean? Well, from now on everyone gets easy and access to certificates that they can use to serve over HTTPS. No more need to buy expensive certificates or sign them yourself (which means a non-trusted cert). Read more...

Simplified value objects in Java

Java Boilerplate Immutables
If you’ve ever taken a step out of your Java code you know that defining so called POJOs are quite cumbersome. Let’s say you’re defining a Item class. The item has a name and an optional description. You add the private variables, and it’s time for getters and setters. Also, you need a constructor. You should probably override a equals, hashCode and toString as well. Oh, and wait. The class should be immutable as well, so remove the setters again and make the fields final. Read more...

Fedora 23 installation report

Linux Fedora
I’ve been thinking about installing some flavour of linux on my macbook for a while. After Ubuntu added features that many see as privacy concerns I’ve mostly been using other distros. Up until now I’ve been a Debian and Arch user, but after reading about Fedora I got interested in giving it a try. Here are some of the stuff I learned. My biggest concern for this installation was to mess up something so that I couldn’t boot OS X (this laptop is my work computer). Read more...

Long time, no see. Here's some Clojure!

Clojure
Recently I got inspired by this blog post (it’s in norwegian, but I’m sure you can find a way to translate it) which solves the bowling kata in Haskell. The goal is to implement a function that gives you a score for a series of rolls in a bowling game. This blog post mentions other posts as well, and all of the solutions are worth a read. So, back to me. Read more...

Adding some Clojure tools

Clojure
Clojure is a very interesting language. It’s a lisp for the JVM, and Emacs is very well suited as a Clojure IDE. In this post I’ll add some customizations that will enhance the Clojure experience in Emacs. After completing this part I’ll have a setup that let me edit Clojure code in a nice and effective way with help from clojure-mode, clj-refactor and smartparens. I can compile and evaluate code, as well as running tests with help from Cider and company-mode gives me autocompletion powered by Cider. Read more...

Adding Magit

Git is great. I use it all the time, and when I work in Emacs, I use Magit. It gives you a nice interface to perform tasks and work with code in a git repository. Let’s add it to the mix! setup-git.el I’ve created a new setup file, nameley setup-git.el. I suspect that there will be more git related customizations, but for now it will only contain magit specific code. Read more...

Configuring Emacs from scratch

I’ve been using Emacs for quite some while now. I’ve been using others setup, and I’ve smashed together my own setups. And now, after using ohai-emacs for a while, I’ve decided to throw it all out and build it up from scratch again. First of all; I’m no Emacs expert. Not at all! By doing this I hope to learn more about Emacs and the Emacs Lisp dialect. I’ll take small steps and try to explain why and how. Read more...

Optional, what is it good for?

Optional Null
NullPointerExceptions. They occur everywhere and are often caused by stupid programming mistakes. Its a really common problem in Java applications. And the guy that first introduced null references calls it the billion dollar mistake. Many programming languages have a solution to this. In idiomatic Scala you don’t use null. You would use Option instead with either Some value or None. Haskell has the Maybe monad. Clojure has no optional type, but most functions deal with nil and empty lists in a way that makes it close to transparent. Read more...

Show me what, not how!

Java 8 was released last year, and with it came lambdas and better possibilities for functional programming. This is old news to a lot of people, but if you have been living exclusively in Java lately you might wonder why you should bother with a new style of coding when the old way is just as “readable” in most cases? I see this as a big improvement and benefit, but some people do not. Read more...
1 of 2 Next Page