hjertnes.blog

#

02.08.2018 11:00

I finally got arround to ordering a Nintendo Switch about a week ago, and it is awesome. This is the first modern “handheld” Nintendo device I have used that feel modern, both in terms of design and graphics. It is great, but it feels more like an “iPad” than an “iPhone”, unlike the Nintendo 3DS. And I think I would have preffered something a tiny bit smaller, because I mostly use it as a handheld device while communting etc.

Clojure needs its Django / Rails moment.

01.08.2018 02:00

I’m not a huge fan of Django and Rails, I don’t think they are bad either, the languages they use are not a good fit for how I think any more. I also think they have not managed to integrate the whole web app moment in as well as they should.

But that is a blog post for another time.

Both frameworks are very important in the history of web development because they managed to turn a lot of difficult or complicated topics in a way that was very easy to deal with, in a way that felt very native to their respective programming languages.

Having a proper way to deal with databases, database schema changes, login, and solid implementations of the MVC.

The Clojure world might not be into the idea of frameworks, but neither was the Python world. Most of it outside Django are more about putting together various different libraries with your own code to get what Django would give you out of the box.

A bare minimum solution of what Clojure would need is:

  • A solid way to write API’ and the controller side of a server side rendered web page
  • A way to define how the database looks in code
  • A way to query the database you modelled in code.
  • A template language
  • A middleware system (to make it easy to make reusable component to deal with common stuff)
  • A login system that just works without any config, that you can configure if you need to.

And all of this have to feel natural for a Clojure programmer.

Having all the lenses I need.

31.07.2018 02:00

Less than a year after I got this camera, I finally have all the stuff I “need”. While there are still some stuff that I would like to have in addition to what I have, I now feel like I have everything I need.

It would be nice to have a zoom, or to have something wider than a 23, and something longer than 50. But still, if I bring my X-Pro and three primes + plus my Fish eye I have all I need: really fucking wide, kind of wide, normal and kind of long. And my favourite thing about the lenses (except the fish eye) is that they are all usable as my only lens, even though they may not always be the ideal.

I don’t want to add any huge lenses to my kit, because I know myself well enough to say that I would not bring them with me much, if at all. But I would totally love it if Fuji came out with a 16mm f2 and a fast and compact prime between 70-90mm.

Here is the thing, I bring my cameras everywhere. My X-Pro 2 is on my laptop bag with some kind of lens every single day I go to work. And I have a dog. Having a huge lens on my camera would mean that I did not bring it as often with me to work, if at all. And having someting so big that I could not shoot one handed would mean that I could not use that combo when I walk my dog. Shooting while talking the dog is a large portion of my shooting.

When I don’t shoot while walking my dog, I do street shooting or shoot while I hang out with my girlfriend, and in either situation I want as little attention as possible. And walking around with a huge lens brings a lot of attention.

Like I have written many times before: I want the fastest lens I can get that is still light and has fast auto focus. You might not need fast auto focus or light, and should make your own choices based on what your needs are. # Burst shooting on the X-Pro 2.

I’m a burst shooter, and I have been for as long as I can remember.

That doesn’t mean I end up with 70 pictures of every “scene” I shoot. That could be the case if you use the fastest burst mode on the X-Pro 2. Instead I use the slower one. And that works exactly how I want it to be. It is slow enough to control exactly how many frames you want. The problem with some of the faster burst mode is that you get at least three or four frames before you get a chance to lift your finger.

I always shoot more than one image of each thing, because I hate not having something usable. And using a burst mode just makes it easier. My current fear is that the burst modes will become so fast that they aren’t really useful for how I like to use them. Because I’d hate to have to go through like 15 pictures instead of four.

Battery Hell

30.07.2018 02:00

The first thing I do when I get into the office in the morning is to plug in my iPhone and my Apple Watch. Because I use the latter to monitor my sleep, and the former as a alarm clock; and then I start to charge my AirPods. First the right, then the left. And when my iPhone is fully charged I charge my case, before I plug in my iPhone again and leave it like that until I leave for the day.

I really hope that the charging pad thingies take off soon. Because all of this battery crap have started to get kind of annoying. There are so many things I use every single day that needs charging.

My AirPods, iPhone, Watch, Laptops, Nintendo Switch, power banks etc. It would be great if some of it could be solved by just placing it on a charging area. It doesn’t need to be fast, but it should not require you to place it at a exact place, and it should support many devices.

Daily Carry

30.07.2018 02:00

I have not done one of these in way too long.

Because I mostly use pencils in my pocket sized notebooks I ordered an order of Field Notes; mainly because I was running out and I needed something fast. I got a few packs of Pitch Black, which is really nice. I think this is the first order of a limited edition Field Notes I have ordered since Arts and Sciences. And I still use Leuchtturm1917 notebooks for long form writing and for managing tasks. One lined and one dot grid.

Ink wise I have all of my pens inked up with Pilot Iroshizuku Murasaki Shikibu, which is the coolest colour I have bought in a really long time.

I still carry my broad Vanishing Point, my medium Lamy 2000 and my board flex Metal Falcon. And I carry a old school pencil case with 24 Golden Bears(I never run out of sharp pencils).

And I carry spare Field Notes and the pens in my trusty Nock.co Hightower. My current go to pencil sharpener is a Classroom Friendly.

Editors I use

27.07.2018 02:00

I currently use three different text editors. My main one is Emacs. This is where I work when I write new code or spend a larger amount of time in one single file. While I use Visual Studio Code when I have to jump between files a lot. And my go to tool when I just need to go into a file fixing a few minor things is VIM.

I’m going to get rid of VS Code when I change jobs. Because 99% of what I use VS Code for is related to work stuff.

This is not a VIM vs Emacs discussion, both of them are more or less the same kind of thing when you enable a lot of third party code in them, and my Emacs setup is very much a “full featured” one, while my VIM setup is very minimal. That is on purpose to make sure that I can get in and out of VIM faster than it would take me to launch Emacs or VS Code (or VIM itself if I set it up to have the same kind of features my Emacs setup has).

Soft pencils and broad fountain pen nibs

27.07.2018 02:00

When I first got around to buying a box of Blackwings (after having it on my “stuff to get” list for two years, and I started using them it hit me how similar it was to using a broad fountain pen. They are both messy, put down a very satisfying line and you have to refill / sharpen it all the time. Or at least a lot compared to their finer / harder bothers.

Like I said, they are both high maintenance and very messy. If you use a broad nib you’ll end up with ink all over your hands, and if you use a broad pencil you’ll end up with graphite all over your hands.

I very soon realised that a little bit harder pencils are the thing for me. Because unlike fountain pens, there are much less you can do about it, except carrying a lot of pencils. If you like broad fountain pen nibs you can just get a huge piston filler and ink capacity isn’t a huge problem. Pencils on the other hand requires sharpening. And there is a limit to how many you can carry. How messy they are is also a part of it for me. A fountain pen is messy, but after a few seconds the ink is dry while graphite will smear the same if you drag your hand over for the first time after a minute or ten.

Even though I use Broad fountain pens, I have landed on #2 / HB pencils as “my thing”. Smooth enough for it to not annoy me, while at the same time hard enough to not look like a crazy person while I write.

Everyone else is not an argument

26.07.2018 02:00

I often see people doing stuff just because “everyone else” are doing it. Both in life and in software projects. You should not use React or Vue or what ever just because everyone else are doing so. Everyone else is not an argument. It might be a good idea to look into it. But it is not an argument.

Clojure: Macro vs Function

25.07.2018 02:00

I’m not going to get very deep into this, because there have been written entire books on the difference between the two. But I’m going to look into two aspects of the difference between the two.

  1. A function returns data, while a macro returns code.
  2. A function runs when the program runs, while a macro is expanded into code during compilation.

Macros are one of the more powerful aspects of programming languages in the LISP family. You can use them to extend the language. Like I said a Macro returns code, and you can control how and when they are evaluated. Parts of it may be evaluated in the macro, while other parts may be evaluated during when you the code runs. This is what I mean by it returning code. This means that it may depend on some variable that isn’t available to the macro, but is available where it is expanded into.

Other languages have similar concepts to this. But none of them are as elegant. Because at the surface there are no differences between a macro and a function. This is why they are so awesome and important.

Another important thing to remember is that because a macro is expanded into code, it may be a performance improvement over functions in certain situations because instead of being a bunch of function calls it is expanded into code.

Using the Cloudinary APIs from Clojure

24.07.2018 02:00

There are a few advantages to Clojure running on the JVM. One of the biggest is that we can use any Java library in our Clojure projects. Two other is that we can take advantage of all the awesome server infrastructure stuff that exist for Java services and that we can build a .jar file that runs everywhere with a Java Runtime installed.

Most of the time you want to use something that is packaged to be nice to use in Clojure. But you don’t always have that option, and it is really nice to just import some Java libraries when that occurs. The way you do this is that you add the dependency to lean like any other dependency. Lein will look in both Clojars and Maven for packages you add. And then you load the classes or packages you need using “(:import)” instead of “(:require)” in your code. Now you can just do something like (.methodName className) or (.methodName objectName). I’m going to write more about this in the future.

I have put together this GitHub repo, with some code showing the basics of interacting with the Cloudinary API’s from Clojure using the Java SDK.