C omputer security has seen its share of mind-boggling news lately. None more mind boggling than the news about how alleged Russian hackers installed a backdoor into the IT monitoring product Solarwind Orion. Through this they got got entrance into the computer systems of several US agencies and departments — ironically even into the systems of a cyber security company (Fireeye) and Microsoft itself . The news made me think of my own history with computer security, and down memory lane I went.

One particular day in late July or early August 1989 my parents, sister and me were driving…


Image for post
Image for post

Recently I have read a lot of books on swimming — which, if you knew me, would seem unexpected. Having a fear of water after a near-drowning accident as a child, I never became a swimmer. Not even a so-so swimmer: I managed to learn what we in Norway call “Grandma swimming”, a sort of laborious and slow breast swimming with the head as high above water as humanly possible and the feet similarly low beneath.

But many years later, as an adult and a father, this slowly changed when my oldest son started attending swim practice. Even before taking…


This week’s Perl Weekly Challenge (#19) has two tasks. The first is to find all months with five weekends in the years from 1900 through 2019. The second is to program an implementation of word wrap using the greedy algorithm.

Both are pretty straight-forward tasks, and the solutions to them can (and should) be as well. This time, however, I’m also going to do the opposite and incrementally turn the easy solution into an unnecessarily complex one. Because in this particular case we can learn more by doing things the unnecessarily hard way. …


Image for post
Image for post
(CC-SA)

There’s been a few weeks where I haven’t followed Perl Weekly Challenge, but luckily I found some time for Challenge #11 this week. Inititally both exercises looked they quite a bit of coding. But after a while it became apparaent that both could be solved with relatively simple one (or two) liners.

But I also found that one-liners aren’t always very robust when it comes to error handling, so that gave me an opportunity to explore Perl6’s built-in type (and content) checking of command line input parameters, as well as how to use Perl 6’s built-in methods of generating friendly…


After a week’s hiatus I’ve returned to the Perl Weekly Challenge. This is the seventh challenge so far. As before there are two excercises. The first one is to calculate all niven numbers between 0 and 50. Niven numbers are integers that are divisible by the sum of its digits. I.e. 47 is a niven number if 47 / (4 + 7) is an integer without remainder (it’s not, as the result is 4.2727; 48 is, as 48/(4+8) is 4).

These kinds of operations are called modulo operations or mods. Most programming languages use the operator % for this, so…


The Perl Weekly Challenge has come to its fifth instalment. This time both challenges has to do with anagrams.

Challenge 1: Write a program which prints out all anagrams for a given word. For more information about Anagram, please check this wikipediapage.

Challenge 2: Write a program to find the sequence of characters that has the most anagrams.

Now — the challenge doesn’t mention whether the solutions are supposed to find one-word anagrams or multi-word anagrams. Later, on Twitter, told us to write one-word solutions, but at that point I’d finished my answer that supports both one and two-word solutions.

Challenge 1


I didn’t have the time to solve last week’s challenge, but easter has started with slower days — so I decided to try my hand at the Perl Weekly Challenge number 4.

In my opinion, exercise 1 and 2 was not beginner vs advanced this time; both were peculiar. The first exercise was this:

Write a script to output the same number of PI digits as the size of your script. Say, if your script size is 10, it should print 3.141592653.

Thinking about this I thought that Perl 5 seemed to be easiest this time, as the Math::BigFloat package…


It’s the second week of the Perl Weekly Challenge, and like last week we’ve got two assignments — one “beginner” and one “advanced”.

The advanced assigment this time was: “Write a script that can convert integers to and from a base35 representation, using the characters 0–9 and A-Y.” Even though this is a blog mainly about Perl 6 I thought it’d be fun to start with my Perl 5 solutions to the advanced assigment, just so it’s even more easy to appreciate the simplicity of the Perl 6 solution… although not, as you will see, without some discussion.

PERL 5


Image for post
Image for post

Last week I discovered a new Twitter account, the Perl Weekly Challenge. This is an initiative by Mohammad Anwar where Perl 5 and 6 programmer will get a programming challenge every week. There will be challenges both for beginners and advanced programmers.

This week we got the first two-part challenge. The first — the beginner challenge — was to substitute every ‘e’ in the string “Perl Weekly Challenge” and count every occurence of ‘e’. The second — the expert challenge — was to program a one-liner that solves the Fizz Buzz challenge for every integer from 1 through 20. …


I’ve got a dual-boot laptop that lets me switch between Windows 10 and Linux. The Linux distribution varies between Ubuntu 18.04 LTS, 18.10 and Fedora 29, but what I’m about to describe is the same for all of them.

Sometimes — for instance now over the holidays — my laptop can lay unused for days. If I was booted into Linux and did not shutdown the computer before closing, the battery slowly drains. After a few days it’s completely discharged.

When I connect the computer to AC power and boot Linux again, the charge remains at 0 %. It basically…

Jo Christian Oterhals

Norwegian with many interests. Programming being one of them.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store