Hjertnes.blog

#

May 10, 2018

Anyone with opinions about text expansion in Emacs?

How homebrew is better than most package managers

May 10, 2018

Homebrew is an awesome package manager for Mac OS X. And there is one thing about it that makes it a lot better than most. I deal with what most people expect a package manager to do. Like dependencies and updates etc. But my favourite thing about Homebrew is that all packages are installed isolated from everything else. That means that you can have every version of Python that runs on your operating system installed side by side or both Mono and Chicken scheme installed on the same system(both of them have a command called csi).

The way it works is that you can have all of them installed, and then chose which version you want to “link”. In other works is that everything is installed in “/usr/local/Cellar/PACKAGE_NAME/VERSION” and then if you want to link python 3.6.2 to the python command you can link that to /usr/local/bin/python by using “brew link”.

This is very powerful, because package manager like Pacman (on Arch Linux) will not let you install multiple packages that have the same command.

Awesome and surprisingly powerful package manager.

#

May 09, 2018

I’m probably a little bit late to this but I do not get Gnome3.

#

May 09, 2018

Upgraded my Thinkpad today; larger SSD and 16GB of memory. I’m going to experiment more with using it for work this spring / summer.

The process went much faster than I expected because of some dd and file system resizing magic.

Also: got a new ink today.

#

May 09, 2018

I’m starting to feel the itch to read philosophy again

Going back to 1Password

May 09, 2018

I have pass a real shot, because I thought the idea behind it was interesting: a command line program that is a front end to a folder of GPG encrypted files. But I have gone back to 1Password because I felt like it was a little bit too much friction. And my experience is that password manager is an area where you want to workflows to be as easy as possible to make sure that you actually use it.

The problem with pass was not the app itself, or the iOS app, both of them was good enough. But the browser extensions was very unstable. I’ll probably check it out again in the future though. fi

The Python 2 to 3 transition.

May 08, 2018

The process of going from Python 2 to 3 have taken forever. It seems like Python 3 finally is the standard now. But it was not until the latest version of Django where Python 2 was deprecated. There are many different reasons for it. But it has taken way too long.

Part of the reason it has taken such a long time was that Python 2 continued to be supported alongside with Python 3, and the end of life for Python 2.7 will be in 2020. My view is that this have taken much longer than needed because of the Python 2.7 version continued to be a up to date version of Python for as long as I did. This have meant that developers of libraries and frameworks postponed adding support, and users postponed starting to use it because none of their libraries supported it.

I get why they continued to support the 2.x branch, but I think it would have been a much faster transition if it was a little bit more forced.

#

May 07, 2018

The memory upgrade and new SSD for my Thinkpad arrive tomorrow 😬

#

May 07, 2018

How to optimise.

May 07, 2018

The basic idea behind making something fast is to take what your program does now, and then figure out the easiest way for you computer to get there. Or the way I usually say it: how do we do X by doing the least?

There are stuff that will always be slow like network operation, file system operations and input / output. For example only committing updates to the database when you have to is one way to optimise. Another is to figure out if you can run parts or all of it in parallel. And do it.

But the most important thing is that you use a profiler or a debugger to identify what parts are taking up the time and then try to make them faster. The way I usually deal with optimising is that I only start doing it after the functionality is done. And then you optimise by shaving off a second here and there in the beginning until it’s fast enough.

In some cases, though, where it being more important to be fast than everything else, you make it a policy to never commit changes before they don’t make anything slower. Like the Safari team have.