Posts with tag: programming

The many ways of helping Open Source (and Free) Software projects

Wed Jan 10 2024

Did you know that there are more ways to contribute to open source projects than just coding? If you want to help, there are several ways to do so! I have done a few of these myself, and I think you might get great joy from it to.

Read more..

The academically hostile professor - How NOT to teach and promote learning

Tue Jan 02 2024

This time I'm going to do something different than usual; we are going to look into a story from my past that I recently remembered. Teaching and promoting the joy of learning is something I care about immensely. If we could just show more joy, and point newcomers to good resources, I think we would have more great material out there (i.e, books, indie games blogs, and other works building upon said knowledge). The story I will share today is a story about how to NOT promote joy with relation to math and physics, but can be extended to all sorts of fields. I have made sure to NEVER do it myself. Hopefully after reading this article, you will stop behaving like this if you do…

Read more..

Want to get a job as a backend developer? - Learn these topics now!

Fri Aug 18 2023

Sometimes I get questions on how to learn the skills necessary to get a backend programmer job. That is exactly my aim for this article: to give you a set of terms, keywords and knowledge to get started on your journey. My hope is that you know what you need to learn after reading on.

Read more..

Often overlooked String operations in the Kotlin Standard Library

Mon Mar 06 2023

The Kotlin standard library provide many useful helper extension functions for string operations. You probably know the basic ones to make a string lower and upper case, but did you know that there are many more? Some of them do operations that you would otherwise implement yourself, and some are more focused on making the code more clear by exposing the intent of the operations as a name. Some of these may be common to you, but I hope that you at least find one that you are not familiar with!

Read more..

Often overlooked Collections operations in the Kotlin Standard Library

Sat Mar 04 2023

If you work with Kotlin, you probably use Collection types like list a lot. Most people already know of simple list operations like getting elements, checking if an element is present, mapping etc. Did you know that the standard library provides a whole plethora of useful operations? In this article we will look at operations that are often overlooked when we talk about list processing. For the people who are more new to Kotlin, we will start with a small recap. So don't worry if you are relatively new to Kotlin, hopefully you will learn some new nifty tricks here as well!

Read more..

Essential books on the Rust programming language

Wed Feb 22 2023

Rust is gaining popularity fast, and is a language loved by many (including myself). It has recently been used for device drivers in the Linux kernel. While many early adopters did more low level code, it is gaining popularity in higher level problems as well (e.g, writing REST APIs and CRUDL database applications). You might want to learn Rust, and wonder about some resources to use. That is exactly what we will look into in this article! While books are the main topics, links to other useful resources are also provided.

Read more..

Debugging GameCube applications/games (in Emacs)

Fri Jan 13 2023

In the last article, we discussed running Linux on your GameCube. This time we will look at debugging your regular applications/games (i.e, not running inside Linux, but directly on your GameCube). While GameCube is an older platform, it can still be interesting to explore. Some creative coders might also find the technical limitations inspiring. No matter why you find the platform interesting, you might need to debug your applications. Let's see how, and also how we can make it the most comfortable.

Read more..

What I love about Rust

Mon Oct 31 2022

I have really fallen in love with Rust this year! It has many positive features, like compiling to almost any platform, nice syntax and more. In this article I will show you some of these features, tell you about them, and maybe inspire you to look into learning Rust yourself! If you disagree about something being awesome, then that is okay too, as the article is based upon my personal opinion.

Read more..

Bit tricks - Counting the number of 1 bits (Kernighan algorithm)

Sat Oct 22 2022

It's been too long since the last bit tricks article, so I thought I would share another one! This time we will look at a simple fun bit trick to count the number of 1 bits in a binary string (e.g, a 32 bit integer). This algorithm was discovered by Brian Kernighan of Bell Labs and C fame. Unlike the previous algorithm presented in my bit tricks series, this one requires some branching.

Read more..

Best resources to learn Kotlin (in my view)

Tue Oct 11 2022

Do you want to learn Kotlin? Wonder what resources you should use to learn it? In this article I collect a few different resources depending on your interests and skill level. You might pick a few, mix and match or do whatever you want that makes you learn the concepts. Only you know the way you learn things the best. Without further ado, let us dive into the resources!

Read more..

The awesomeness of pattern matching in Rust

Thu Oct 06 2022

If you have followed me for a while, you know that I have really started enjoying Rust in the last year. Rust have many great features, and pattern matching is one of them. If you have used other languages like Haskell or Standard ML, you will notice some similarities. Same with the complete basic pattern matching with when in Kotlin (with some minor work). The pattern matching in Rust makes for expressive, readable and clear code. I admit that the Rust way of doing it is my personal favorite. In this article we will take a look at this topic, and maybe you will see why I think it's so great!

Read more..

Mixed content HTML files in Emacs web-mode with context-aware completion and documentation

Tue Oct 04 2022

Today I'm going to show you my approach to make editing mixed html-files better in Emacs. web-mode is really good for editing mixed html files containing html, css and javascript, but doesn't provide any completion or other helpers like eldoc. In this article I will quickly show you my approach to make it more pleasant to work with.

Read more..

Packages that make Emacs Lisp more pleasant

Mon Oct 03 2022

Emacs Lisp can sometimes seem a little archaic compared to more modern languages. In higher level language we are spoiled with a multitude of easy string handling, list handling, pattern matching and so on. What if I told you that some packages can give you the same ease of use for Emacs Lisp? That they provide more clear APIs, give features you are used to from other languages, and/or abstract away the more tedious details.

Read more..

Programming Kotlin in Emacs - Redux 2022

Sat Sep 24 2022

Last year I wrote a blog post about the basics of using Kotlin in Emacs. Since then, some new developments have happened, including some new features have been added to the Kotlin langauge server. I also got some questions regarding which Eamcs packages I like using when developing Kotlin code. Let's answer some of the questions not answered last time, and see what Kotlin Language Server and Kotlin Debug Adapter can do!

Read more..

Emacs Lisp debugging tips

Fri Aug 05 2022

Have you ever gotten weird errors in an Emacs Lisp package? Something like "wrong type argument" or similar shown in the minibuffer? At first glance, these seem kind of cryptic. Where do they come from? Can I get a stack trace? What arguments are functions called with? Today I will show you how to answer these questions!

Read more..

Summer learning tips! - Programming, DevOps and retro

Wed Jun 29 2022

Summer means that time off work are coming closer and closer for some of us! In my off time I enjoy using extra time on learning and reading. Today, I will share with you some tips for topics that I enjoy, that you could look into if you want to look at something new.

Read more..

Debugging GameBoy Advance (GBA) programs/games in Emacs

Mon May 09 2022

There are not many articles on debugging GameBoy Advance C code around the web, and most of them seem to be about debugging in VSCode. While VSCode is good, it is far from the awesomness that is Emacs! Debugging GBA code with Emacs is far easier than you would think, and in this article I wills how you how.

Read more..

Why and how to use Github Actions

Tue Mar 01 2022

Automating repetitive tasks is great! My favorite tool these days for automating operations relating to code and development, is Github Actions. I even use it for this site! I have used Github Actions both for work and spare time for some time. Sadly the work stuff is proprietary (yes, organisations can be private on Github), so I have less examples to show here. Wonder why you should consider automating more? Or consider using Github Actions for your next project? Then continue reading!

Read more..

Bit tricks - Absolute value without branching

Mon Feb 14 2022

Bit trickery is always interesting! Sometimes you can use them to avoid branching (like if-checks), other times they are useful to save a few CPU cycles to avoid expensive operations. The absolute value trick I will show you here, is mostly to avoid branching. Why would you want to avoid branching? Many newer processors, from the mid 90s and onward, do something called pipelining to achieve a form of instruction level parallelism. While a classic processor fetch an instruction, decode it, then execute, a pipelined processor can fetch the next instruction while the previous one is decoded. You can have multiple operations like this almost in parallel. If we have to branch, like for an if-check, we might not have fetched the correct next instruction anymore, and might have to fetch new ones (for the whole pipeline). This can be an expensive operation. Calculating absolute values is a problem where we often have to have a branch (an if-check for smaller than 0).

Read more..

Should you read Designing Data-Intensive Applications? - A short book review

Mon Jan 17 2022

You may have seen the book Designing Data-Intensive Applications mentioned several places, and wondered if you should read it. I have to admit I bought it years ago, and read parts of it (got side-tracked and researched graph databases further, and read something else). Last Christmas holiday I picked it up again, and this time I finished it. It covers many topics, ranging from how databases are designed, to how we can design good stream processing systems. Should you read it? Continue reading the review to find out!

Read more..

Often forgotten features in Kotlin

Sun Jan 16 2022

This time we will look at features in Kotlin that are often overlooked in walkthroughs or other places, but are still cool and can be useful! Some are features some of us might know of, but often forget exist. Others are features we forget exist until we see them mentioned, probably because we don't use them as often (or very rarely). Hopefully you will see at least one feature you have forgotten existed!

Read more..

What's the big deal with Reactive?

Thu Dec 16 2021

Reactive is a buzzword thrown around a lot, but what is it really? At first glance, reactive doesn't seem to be anything special. Asynchronous stream processing seems nice, but is that all? Fortunately, the answer is no! Reactive also includes nonblocking IO, which makes resource utilization better. If you have never heard any of these terms before, it may just seem like a word-soup. Don't worry! We will explain the terms below, so you can understand the big whoop with reactive. Getting an overview of the concepts will be the main goal here, but I will provide links for further reading. Some oversimplification may happen, but I hope that it will help you understand concepts without being boggled in buzzwords and lots of pre-requisite knowledge.

Read more..

Coding themed Advent calendars

Wed Dec 01 2021

Counting down the days to Christmas is a fun tradition, done with everything from chocolate advent calendars, TV shows to now coding themed Advent calendars! Holidays can mean much more than reading coding books, or getting/giving computer/technology inspired presents now!

Read more..

Scripting on the JVM?!? JBang and Kscript!

Wed Nov 10 2021

Did you know that you can use Java and Kotlin for scripting? In this post I will introduce you to my favorite ways of doing scripting on the Java Virtual Machine (JVM), which is JBang and KScript. Some people may not enjoy Java projects as much because of all the verbosity (big project structures), so small scripts may make the languages more approachable and less intimidating. Being able to easily handle all external dependencies in the same file (no extra configuration files!) is also a big bonus. Lately I've heard from several people that they did not know about JBang, so I guess that might be true for KScript as well. Hope this post will provide you with some information on them, as well as good links to get started!

Read more..

Programming Kotlin in Emacs (including KScript!)

Wed Nov 03 2021

Some people, including myself, grudgingly used IntellIJ IDEA for Kotlin programming for a long time, maybe because we didn't think the Emacs tooling was up to speed. Well, it is, and we can finally use the best editor of all time (Emacs) to do Kotlin programming! Today I'm going to show you basic setup (and share some links), so you can also use Emacs for Kotlin programming! I made the switch this summer (reasons for waiting so long below), will you make the switch too?

Read more..

The only book on classic JavaScript you'll ever neeed!

Tue Oct 26 2021

Today JavaScript (JS) has evolved a lot and has many modern features we associate with other programming languages (according to the ECMAScript standards), like classes. In the beginning these features were transpiled (like compilation, but translated from one language to another) to classic JavaScript (due to browsers and other engines not having implemented the features). If you were like me, you wondered how this was done at the time (and you may even have had some ideas). Or you may be in the other camp, and think that it's not always necessary to use big transpilers and heavy features to solve simple problems. While JavaScript has evolved, I think there is a lot of fun and advantages to knowing more about the core language that started it all! JavaScript: The Good Parts by Douglas Crockford is the best book to learn about all that!

Read more..

Spring Boot - Easy customizations for your applications!

Wed Oct 20 2021

In this article I will show you two types of easy customizations you can do with your Spring Boot applications. One of them can be very useful, and one is mostly cosmetic for the benefit of those seeing the server logs. This article is language agnostic, so it can be used for all programming languages you might make Spring Boot applications in (probably Java or Kotlin).

Read more..

Java ServiceLoader - What it is, and how to use

Sat Oct 16 2021

ServiceLoader (aka Service Provider) is a feature that has been in Java since Java 1.3, but many people still don't know about it. The reason I think most people don't know about it, is that they use various dependency injection frameworks for the same kinds of problems. ServiceLoader can supplement these kinds of solutions, or be used as a replacement, you decide based upon the problem you are solving. Think of ServiceLoader as another tool in your toolbox. Some people like to think of it as a built in very simplistic dependency injection system.

Read more..

Retro programming (mostly games) Youtubers you shoud check out!

Fri Oct 15 2021

Todays post will be a bit shorter and different. We all need some inspiration sometimes, and I think there are few things more inspiring than the tricks used in older video games as well as the hardware that made them possible. From the clever BSP (Binary Space Partitioning) tree rendering algorithm in Doom, to the clever \(\frac{1}{\sqrt(x)}\) algorithm in Quake 3, there are tons of interesting tricks used in games out there! (know I only mentioned id Software now, but what can I say, I LOVE them! Also I wouldn't want to spoil what is coming from TT below). Sometimes I just enjoy watching some videos about these clever tricks, and also how the hardware worked on these systems. In this post I will share with you two of my favorite Youtubers, and also some notable interesting videos from them. Maybe you will be inspired too, and maybe you will also learn something!

Read more..

Which programming language should you learn in 2021?

Tue Mar 23 2021

New year, new programming languages to learn! It is overwhelming though… With so many languages to choose from, it can be hard to select what to learn. Sometimes it is easy, we might want to accomplish certain tasks. Other times you may want to learn to think in new ways, as a fun challenge.

Read more..

Java - Rethrow/wrap or log exceptions!

Sun Oct 04 2020

This probably seems like common sense to a lot of you, but it is quite easy to forget. I try to do it in my own code, but when reviewing other peoples code I forget to think about it 90 % of the time! Sometimes you don't rethrow the exception because the cause seems clear cut in all scenarios. Some of the time, we simply throw a new exception with an error code or message, and think that if we get that exception later, we will know what caused it. That may not always be the case.

Read more..

Books that boost your programming career (Java developer edition)

Mon Sep 07 2020

In this article I will share some books that helped me most in the beginning of my professional career. Even though I have programmed in my spare time for many years before getting a job, I think that programming in an enterprise is way different! Learning to cooperate with more people, reviewing code, seeing patterns in code, bigger codebases. tools and technologies that you may not use on your own, and so on! The books I will share are mostly technology agnostic, as I think patterns help way more than learning specific libraries, frameworks and tools. Learning about design patterns, how to write clean code, and how to write maintainable code are far more useful than learning many different tools and libraries. Why? Because when you learn patterns, you will see these patterns in many new libraries and tools you learn, and therefore learn them faster! I will also say that learning to think differently can help a lot, because it makes it easier for you to learn new things in the future.

Read more..

Building blocks for Domain Specific Languages (DSLs) in Kotlin

Thu Aug 27 2020

Domain Specific Languages (DSLs) can be used to solve a lot of different problems (more on that shortly!). In this article we will take a look at how we can create DSLs in a very simple way that make for highly readable and expressive code. I will not go through general DSL creation, only the building blocks unique to Kotlin. At the end we will look at an example from an open source testing library (Spek).

Read more..