musicmatzes blog

After almost three weeks in Canada, we entered the US today in/near Sault Saint Marie. Time for a review, I guess.

Canada

We arrived in Canada by plane in Toronto and then continued by plane to Halifax (the same day). Our car was shipped to Halifax and we had to stay in a hostel for three days until we got the paperwork from the shipping company and the car from the harbour.

Our stay at the “Inn” (we don't have such things in Europe, we would say “Hostel” or “Herberge” – in germany – for it), was really pleasent. We were surprised by the soft bed. The breakfast, which came with the room, was good (more on that in “The 'problems'”, though. Stella and Wanda, the ladies from the Inn, helped us a lot with getting ourselves organized and Stella even called the shipping company for us when we needed to get some information from them.

Halifax itself is a really nice city. Everything is so peaceful and quiet around there. For a 400.000-people city, it is so quiet there, actually. Compare that to Stuttgart (~600.000) or Frankfurt – so much people on way less space! Always noisy, always stressy! Halifax was awesome compared to that! We saw the harbour area, the park and – of course – the Citadell, which was a nice trip into history of the area!

We also had our first Walmart-experience in Halifax. Damn! That's a huge shopping place! And prices are about the same as in Germany, to be honest. Some things are more expensive, but prices are still comparable, nothing over the head (and we even found some real german bread – “Pumpernickel”)!

During our stay in Halifax, we used our rental car (which we had for the first few days) to do a “short” trip down south, to Lunenburg and to the Lighthouse route. It is really nice there, too!

After Halifax, we hit the road. We drove up north to New Glasgow and then east, to visit the Cabot Trail and the area there – awesome places, really! And oh my gosh – the Highways! They are so big! And nobody is speeding! That's rediculous for us! In germany, everyone would drive 200km/h and more! But not here – most of the time it's 110km/h maximum and people obey that! How cool is that? And because the big trucks (how big they are!) are allowed to go full speed as well (in germany they are only allowed 80km/h), it is a really pleasant experience, because it does not put any pressure on anyone.

After visiting the Cabot Trail on Cape Breton, we started to drive west. New Glasgow, Moncton, Fredricton – then North to Rimouski and we visited Quebec. Quebec is a really nice City! We had a nice day in the City! We then drove further west, to the National Park de la Mauricie, where we stayed for two days and did a bit of hiking.

We passed Montreal without visiting the City, as we had Ottawa on our route as well and we don't like to visit that much big cities. In Ottawa, we visited the National Museum, which was a really nice experience for us as well, albeit a bit overwhelming (reading that much content after days – almost weeks – of forest and “lonelyness” was simply a bit too much).

From Ottawa we drove to Peterborough and then to “Ste-Marie among the Hurons”, which was really nice. We loved the trip through history and the little town they put together there, with all the supernumeraries was really worth the stay! Even the school classes which wandered around didn't lower our mood. Actually, it was quiet nice with the kids around as some of them responded very clever to the questions the guides asked them!

Wasaga Beach, though, was a bummer. Tourist-Beach would be a way more appropriate name. We left instantly – into the direction of Owen Sound and then north. We had some nice days in Bruce Peninsula NP and then took the Ferry from Tobermory to Manitoulin Island, which we passed rather quickly.

This was yesterday. Today, we crossed the border at Sault Ste. Marie.

The people

The Canadians are really nice people. One thing we noticed, though, is that the people in the very east (Nova Scotia, Quebec and very east of Ontario) are really hearty people. We got thumbs-up, waves and questions about our car and where we're from and so on all over the place. In the west of Ontatio – not so much! But they were still friendly and helped us a lot when we had questions where to stay or where to go.

The “problems”

“Problems” in the title is in quotes, because these are not real problems... they are, if you're especially picky, just inconveniences for us as germans.

First – the bread (my dad keeps complaining about the bread). They do not have proper bread here. They have something we germans would call “Toast”. But they have no proper dark bread (the “Pumpernickel” we got in Halifax was in the “specials” section of the market, and most stores we've been to don't have Pumpernickel).

Next: Beer. Germans love beer, and actully they got some really nice beer here. But first of all it is so expensive. We paid 4 Dollars for one (710ml) can. In Germany that would be not even 1 Euro (1.50 CAD). Maybe not the best beer then, but still okayish. To be fair, the beer was rather good (we expected lower quality, TBH). Secondly, at least in Ontario, we had to wrap it into paper. We, as Europeans, consider that funny. In Germany (and all over Europe) you can get boozed everywhere you like. Except official buildings from the state, I suppose – but in Parks, parking lots, near schools (even in schools if its the right time of the year ;–)) and so on – no problem! Even inside cars, if you don't (plan to) operate them.

The awesome things

Most of the awesome things are described above (in “Canada”), but lets wrap it up once more:

The national parks are awesome, of course. The highways, the awesomely friendly people, everything is so calm and relaxed Quebec had awesome stores. Buying alcohol inside the same store as buying bread (or bread-equivalent) is nice. And they had a fine selection of cheese there as well, which we considered really a thing.

Thank you Canada, we'll be back!

Overall, our first three weeks in Canada were awesome. We really loved it. Now we're in the States and heading for Badlands NP and Yellowstone NP. In a few weeks, we'll be back in Canada for heading north, towards Banff, Jasper then fruther to Whitehorse, Whatson Lake and ... possibly... Alaska!

The first week in Canada has already passed and so many thinks happened! We arrived in Toronto after 8.5 hrs (actually half an hour less than expected) - what a giant city (it looks sooo big from the plane)! After a bit of sleep and another two hours (which we slept through) we arrived at Halifax, got our rental car and drove to the city where we were able to check in at our stay.

The first few days we visited the city of Halifax and drove down to Lunenburg with our rental car. Then, on Wednsday, we got our “Olli” – our Land Rover. On 17th, we drove up to New Glasgow and the days after upto Cape North, where we had beautiful days. Funnily, each other day was bad weather – good for us to make some Kilometers!

On 21st, we were near Fredericton and actually did our first night near Walmart – because we wanted to re-fill our fridge but unfortunately todays a national holiday. So we had a shower and some nice dinner. On 22nd, at 7 am, we checked out what's available at Walmart and then continued our journey into the direction of Quebec, Quebec.

On 23rd, we arrived at Quebec – finally with good weather and nice temperatures. So far, the journey was nice but nothing special actually. We did some nice trails and had some nice spots, but we also already had three bad spots, where either the attraction was closed or the weather was so bad that we did not even get out of the car.

Today I'm sitting in Quebec City with beautiful weather (but rather fresh wind) and finally found a public wifi where I can update my blog and so on.

Tomorrow is the day.

Tomorrow, we will take our plane to Toronto and later to Halifax. The Journey, no... the Dream! finally begins!

We are, of course, nervous as hell. Will everything go right? Will we arrive save in Canada? How will the flight be? That's actually the first time we fly that long. 4 hours to Iceland were ... quite okay I suppose. But 9 hours to Toronto and after that another 2 hours to Halifax? I bet we will be tired to death after that. And then there's jetlag.

I added vacation (or rather: sabatical) notices on all my programming projects and handed off maintainership to a dear friend to mine, so he can respond to issues/bug reports and pull requests. And I released imag 0.8.0 which I'm going to use myself during the trip for storing the trip-diary and more.

Another thing I thought about a lot in the last couple of weeks was whether I should buy another lens for my camera. My grandma told me she wants to give me some money for my graduation and I was really tempted to use that money for another lens. I would've added some of my own money to that. But after all, the lens I had in mind (several came to mind) where too expensive (at 500-1200 EUR) so I decided to not buy a new one “just for the trip”. Maybe I will buy a new one during my trip. Who knows?

When we initially started thinking about traveling north-america, we knew that this would be a huge undertaking.

We had to think about so many things, starting with shipping the car, what to pack into the car and what to put into handluggage, our vaccinations, insurance for the mobilehome but also for ourselves, exchanging euros for (canadian) dollars, booking a flight to Halifax, renting a car for the first few days until we can get our mobilehome from customs, booking a hotel, preparing the mobilehome (approval for example, but also maintenance repairs), and so much more.

But today, one major step was taken: The car arrived at the harbour and will be shipped in the next few days (I don't know the exact date when the ship will depart).

Now, the mental stress really starts. Have we thought about all the details? Did we miss something we really should've thought about? What happens if we missed to pack one thing we really need and cannot bring by plane? I'm rather confident that we thought about everything, but one never knows, right?

We had several friends who forwarded us contacts in both the US and Canada, so we can visit friends and friends-of-friends in almost every other state. That's really awesome! We even got contacts to a Family in Florida State, despite our route going anywhere near this state!

Less than three weeks from now we will board our plane to Halifax (to Toronto and from there to Halifax). 9 hours to Toronto and 2 more to Halifax – we'll see how to survive that!

This post was written during my trip through Iceland and published much later than it was written.

This is a really important topic in programming and I really hope to get this article right. Not only for technical correctness, but also for ease to understand, as explaining types is not that simple if one has never heard of them.

Let's give it a try...

What are types

Well, that's a question which is, in my opinion, not easy to answer. In fact, I thought several days about this question before writing this down, in hope it will become a sufficient answer. Hence, you might find other answers which are easier to understand and maybe more correct as mine, but I'll give it a try nonetheless.

From what I think

Types are a combination of abilities and properties that are combined to express and limit a certain scope of a thing.

For example, A type Car may have four wheels, two doors and a horn (its properties) and can drive slow, drive fast and park (its abilities). That is certainly not a real representation of a car (also because only a car is a real representation of a car) but because of the domain this is used in, it is sufficient in the scenario at hand. The type Car cannot be multiplied, but another type Number may have this ability. Thus, the scope and abilities are also limited in a certain way.

I hope this description is a good one for you to understand.

Now that we know what types are, we should also learn some other terms around the subject of types. The first thing I want to talk about here is “strong typing” and “weak typing”. The reason for this is: These things do not exist. Yes, you've read this correctly: There is no such thing as “strong typing”. There is only stronger and weaker typing. The Java programming language is not strongly typed, neither is it weakly typed (but it is, of course badly typed... forgive me that joke, pity java programmer).

But what is a stronger typing? That is rather simple to explain, actually. We discussed that types are limitations of things to be able to only do some specific operations and such. These things are enforced by the compiler or interpreter of the programming language, of course. And stronger typing only says that the compiler has more information (implicitly via the definition of the programming language) to enforce these rules, the rules of “the function A is defined for type T, so you cannot call it on U”. Of course there is more to that because of generic typing and so on, but that's basically it.

The next term is “type inference”. Type inference is nothing a programmer experiences explicitely, because it happens implicitly. Type inference is a feature of the compiler and interpreter of the language to guess the type of a variable without the programmer stating the actual type. It's nothing more to that actually.

I mentioned the term “generic types” in one of the former paragraphs already, so we should have a look there, too. Generic types, or shorter Generics, are types which are partial, in a way. So for example, one can define a Bag of things, whatever things is. This is often (at least in typed languages – languages where types actually matter for the compiler or interpreter) specified in the code via “type parameters” (though this term differs from language to language).

Why more types are better then few

The more types you introduce in your programs (internally or even for the public API), the more safety you get (speaking in the context of a stronger typed programming language, but also if you do a lot of runtime-type-checking in a weaker typed language). That does not mean that you should introduce a BlueCar, a BlackCar and a GreenCar as types in your program, but rather a type Color and a type Car whereas each Car has a Color – even if your domain is cars and not colors.

Maybe that example lacks a certain expressiveness, so consider this: Your Car has wheels. You can set the number of wheels when constructing the Car object. But instead of passing an integer here, which would yield an API where one can pass 17 as valid number for the number of wheels – or 1337 or possibly even -1. But if you introduce a type which represents the number of wheels, you get some safety into the construction of the Car object – safety checks in your code are not necessary anymore and thus your code will be shorter, better focused on what the actual problem is instead of fighting for valid values and of course, the compiler or interpreter can do the work for you.

Sounds nice, doesn't it? You can get this all with (almost) no cost attached, you just have to write down some more types. If your programming language contains feature like enumerations, you do not even have to make validity checks anymore, as the compiler can execute them.

Next

In the next post we will focus on the coding environment.

tags: #open-source #programming #software #tools #rust

On April 4th, NixOS 18.03 was released.

It is by far the best NixOS release so far, featuring Nix 2.0, major updates for the KDE desktop environment as well as the Gnome Desktop Environment, Linux kernel updated from 4.9 to 4.14 and glibc, gcc and system updated.

With this release, I switched from the unstable channel, which is basically the “rolling release” part of NixOS, to stable (18.03). I did that because I wanted to make sure I get even better stability. Don't get me wrong, even with the unstable channel, I had maybe two or three times in the last year where updating was not possible because one package did not build. But I want to be able to update always, and with 18.03 I get that (at least I hope so).

Also, because as soon as I'm on vacation and possibly without the ability to connect to the internet (or fast internet), I need a certain level of stability. And with the stable channel, the download size for updates shrinks, I guess, because the stable channel only gets small updates and security fixes.

I hope I will be able to switch from 18.03 to 18.09 in October without having too much trouble and downloading the world.

The update/upgrade process was surprisingly simple. The Manual explains what to do and it worked like every other unstable update: Executing some bash commands and then relying on the guarantees NixOS gives me.

Now I'm running stable.

tags: #software #nixos

This post was written during my trip through Iceland and published much latern than it was written.

While we heavily focused on the code-surrounding things in the last parts, we will return to focus on code-related things from here on.

This article discusses code verbosity and how it can improve your open source code and also your contributors experience a lot.

What is code verbosity

Code verbosity is mainly explicitness of code. For example, in Java you have to be more explicit when declaring a variable than in (recent) C++ or even Ruby:

String s = someFunctionCall(param); // Java

auto s = someFunctionCall(param); // C++

s = someFunctionCall param # Ruby

So code verbosity is how explicit you have to state certain things so that the compiler or interpreter understands your intention.

Because we do not always tell the compiler or interpreter what we want to do exactly and because we want to re-use functionality, we introduced abstractions. So abstractions are a way to make code less verbose, in some ways.

How to make code less verbose

Abstraction. It is as simple as this. You introduce abstraction to minimize repetition which leads to less verbose code. Of course, you cannot always make the code less verbose if the language does not allow it: in the above example we used the auto keyword for specifying the type in C++, which is nice, but not possible in Java. So in the borders of your languages abilities, you can make code less verbose.

If you do that right and the abstractions results in nice code, you know that you've done fine.

How much is too much

But there can also be too much abstraction which then yields unreadable code. Not unreadable as in clustered with stuff but just too abstract to grasp at first sight.

Abstraction can get too much. So make sure you introduce sensible abstractions, abstractions that can be combined nicely and of course one can step around the abstractions and use the core functionality, the not-abstracted things beneath.

As a sidenote: sometimes it makes sense to hide certain things completely or even introducing several layers of abstractions.

Next

This was a rather short one, I guess. The next article will be longer I hope, as it will be about typing.

tags: #open-source #programming #software #tools #rust

This is mostly a reminder for myself how to do it, because the documentation non the nix side is pretty sparse.

What I want to do is to build imag on a remote server using nix 2.0 features - nix remote builds.

Here are the steps I did for achieving that goal:

  1. build the Cargo.lock file with cargo generate-lock for the imag workspace
  2. generate a build.nix file using carnix --standalone --src . --output build.nix Cargo.lock
  3. monkey-patching the generated nix file because carnix generates wrong pathes for the build.rs file in the nix expressions. I did that with a simple substitude pattern in vim: %s/"\.\.\/\.\.\/\.\.\/build\.rs"/.\/build.rs/
  4. ensure the remote machine has nix 2.0
  5. use NIX_REMOTE=ssh-ng://user@host nix build -f ./build.nix imag_0_7_0 to build imag on the remote machine.

Unfortunately, because the generated expressions do not use cargo but execute the rustc compiler directly, the build fails because I need the CARGO_BUILD_VERSION and CARGO_PKG_VERSION environment variables which are set by cargo during the build.

I hope carnix gets support for automatically adding those variables to the build soonish, so I can build imag completely remote.

tags: #imag #nix #rust

Starting with this post, I'm not using sigal anymore for my gallery, but the awesome hugo-easy-gallery.

So pictures will be posted as normal blog posts now.

{{< gallery >}}

{{< figure link=“/other_images/P1010120.png” hover-effect=“grow” caption=“Hmmm... tasty!” >}}

{{< figure link=“/other_images/P1020610.png” hover-effect=“grow” caption=“One of my parents cats” >}}

{{< figure link=“/other_images/P1050585.png” hover-effect=“grow” caption=“On a walk through the local forest” >}}

{{< gallery />}} {{< load-photoswipe >}}

tags: #photography

Images of my 4-week-trip to iceland in summer 2017.

{{< gallery >}}

{{< figure link=“/iceland_2017/P1010195.png” hover-effect=“grow” caption=“The Geysir” >}}

{{< figure link=“/iceland_2017/P1010306 – P1010324.png” hover-effect=“grow” caption=“” >}}

{{< figure link=“/iceland_2017/P1010328.png” hover-effect=“grow” caption=“” >}}

{{< figure link=“/iceland_2017/P1010361.png” hover-effect=“grow” caption=“” >}}

{{< figure link=“/iceland_2017/P1010642.png” hover-effect=“grow” caption=“” >}}

{{< figure link=“/iceland_2017/P1010672.png” hover-effect=“grow” caption=“” >}}

{{< figure link=“/iceland_2017/P1010784.png” hover-effect=“grow” caption=“In the West-Fjords” >}}

{{< figure link=“/iceland_2017/P1010797.png” hover-effect=“grow” caption=“In the West-Fjords” >}}

{{< figure link=“/iceland_2017/P1010801.png” hover-effect=“grow” caption=“Puffin in the West-Fjords” >}}

{{< figure link=“/iceland_2017/P1010924.png” hover-effect=“grow” caption=“” >}}

{{< figure link=“/iceland_2017/P1020157.png” hover-effect=“grow” caption=“” >}}

{{< figure link=“/iceland_2017/P1010949.png” hover-effect=“grow” caption=“Black sand at the east-coast of Iceland” >}}

{{< figure link=“/iceland_2017/P1020258.png” hover-effect=“grow” caption=“Black sand at the east-coast of Iceland” >}}

{{< gallery />}} {{< load-photoswipe >}}

tags: #iceland #life #photography