hjertnes.blog

Programming asynchronously- Callbacks

06.11.2017 01:00

Most mainstream programming languages are synchronous, which means that it runs line one, and when that’s finished in continues to the next one etc. While in asynchronously programming a lot of things are going on at once. There are good and bad sides to both. I personally think that asynchronously is the way to go if you are building user interfaces because you don’t need to deal with firing off threads etc when a user clicks a button. The bad side is that some people find it confusing and that the code is a little bit more complicted by necessity. The way we deal with stuff that takes an unknown amount of time in asynchronously languages like for example Javascript is that you define a method(or apair of methods in some cases) to be ran when it succeeds or experiences some kind of error. For example like this:

```text Some libraries use a single function, like above, while others, like jQuery (not that jQuery is a good example of anything these days) use a separate callback for success and error. But the basic idea is that the function (or functions) you define will run when an error occurs or you get a response. ```

#

05.11.2017 01:00

Another Review of the J. Herbin 1670 Caroube de Chypre

05.11.2017 01:00

```text I got this bottle of ink from Pen Chalet for the purpose of reviewing it, and I did, but I was never that happy about the review. I’m not sure why, probably because this ink is so far removed from what I usually use. ```

```text My typical ink in the beginning was black, I used the Lamy and Pilot cartridges for a very long time. And I loved them for the convenience. I would probably have used cartridges in my Vanishing Point if the Iroshizuku line was available on that form(you can have that idea for “free” Pilot, just send me a red Falcon with a soft broad nib in exchange). Then I moved over to bottles, first Noodelers Bernanke (which I loved), then I moved over to the Lamy black (which I hate) before I ordered my first Iroshizuku bottle (take-sumi) and I have gone through two full bottles and two half bottles of Iroshizuku ink since then. ```

```text They have some shading, in the of their inks, but no glimmer or crazy colours. This J’herbin ink is all kinds of crazy, the colour is fantastic, it is a reddish brown, with gold glimmer. ```

```text This is probably the first time I’ve used “fantastic” and “brown” in the same sentence. ```

```text I have now used the ink quite a lot. First I used it in a Noodlers Ahab for a few weeks, and now I have used it as my only ink in all of the pens I have in rotation. And I enjoy it a lot. ```

```text The dry time is a little bit longer than what I prefer. But I think it is a great ink. ```

App Review

05.11.2017 01:00

```text Finder is a pretty good file manager, not the best for everything; but I believe it is the best option for a majority of user for a majority of tasks. ```

```text When I want something more powerful, I always go for Path Finder. ```

```text There are two aspects of it in particular that makes it very useful in certain situations. ```

```text The first is that it does not close the window when a drive or CD is removed. This might seem like a minor thing, but it is a major pain in the ass when you are copying the contents of many different CD’s, like I often do, when I get rolls of film back after getting them developed. ```

```text The Second is its dual browser. This is a very old feature, that used to be in more or less every file manager. Especially in the world of text based software. I remember to use it a lot in GNU Midnight Commander in my Linux days. ```

```text This feature alone is worth the price of Path Finder, it makes it so much faster to re-organise stuff on my Mac. ```

```text Path Finder is not as pretty as Finder, but it is the power user version. Instead of hiding useful but confusing features and information it is there, right in your face. ```

```text Check it out, if you are looking for a more powerful alternative to Finder. ```

#

04.11.2017 01:00

“Optimising your notation to not confuse people in the first 10 minutes of seeing it but to hinder readability ever after is a really bad mistake.” (David MacIver, via a post about Scala syntax).

#

04.11.2017 01:00

#

04.11.2017 01:00

F# or Clojure?

What I got out of studing Philosophy.

03.11.2017 01:00

I have always had a hard time explaining to people why they should study Philiosophy, I just think that it will do most people some good. Here are some of what I got out of the four years I spend completing a three year bachelor programme in Philosophy.

  1. I know less than when I started; or rather I’m wiser, and certain of far fewer things than when I started

  2. I have a solid foundational understanding of how and where the ideas that form modern society come from, and came to be.

  3. When a text is difficult to understand, it can be because of multiple reasons

  4. You don’t have the tools required to understand it

  5. It is bad writing

  6. What you are trying to read, are something at odds with or too complex to be elegantly put into words.

  7. There are no obvious solutions; and the winning one is very often the least shitty solution; if there is a winning one.

  8. Even a hard core atheist like myself can read and appreciate religious thinkers like Augustine. Because behind the religious rhetoric is just the same moral and being problems any person willing to open a philosophy book struggle with.

  9. It is amazing how different it is what different people get out of the same text. Both in how they understand it, and what they think about it.

  10. How you read is very different, depending on the text; sometimes you just need to power through without understanding everything, and then re-read it a million times; while other times is understanding every single sentence in relation to each other the proper strategy.

  11. You need to put the Philosopher to the side, when you read a text. And you need to put what you know about the text and the philosopher to the side. If you want to get the most out of reading it.

  12. Some books can give a literal headache. For me is it Tractatus Logico-Philosophicus.

  13. Question everything, and accept nothing based on authority or tradition.

  14. What you thought you meant is always what you mean, when you analyse it logically.

  15. Logic is hard, but useful, up to a point.

  16. Understanding different interpretations, even though you disagree, is useful.

  17. Listen to the eccentric professors.

Half of what you get from a structured programme from a University is something you could do by yourself. Many universities have all their syllabuses available online, and you can probably find them in their book stores, if not. And if you read all of you have around half of it.

The other half is what you don’t get by yourself, plus the “if I don’t read this it will have consequences”. Because getting through the I don’t know how many thousands of pages was hard.

What you don’t learn by yourself is the tools and the discussions. When you go to lectures and seminars, you learn how one reads and studies philosophy and you also learn how to discuss the content of the same texts with fellow students. The former is necessary to get anything at all out of reading most philosophy, because there are more to it than skimming through the books. And the latter is important because it opens your eyes to how different people understand the same thing.

What is babel

03.11.2017 01:00

Babel started out as a project called 5to6. It is a tool chain to transpile Javascript code. You can for example use Javascript syntax that isn’t even included in the standard yet and transpile it over to code that will work in the browsers you need it to work. It is modular, and easy to configure in most build system. I mainly use it through webpack. But you can also use it together with node.

#

02.11.2017 01:00

I’ve only bought one Apple product on launch, my Apple Watch; and that was by accident.