Sunday, 7 October 2012

Inflation and deflation

Inflation is the rise in the general level of prices of goods and services over a period of time. This means that a unit of a certain currency will become less worth over time. Deflation is the exact opposite, where the general level of prices will fall, and a currency will become worth more. Both are important concepts that govern the fickle dance of the "economic market", a faceless entity to which even the mightiest politicians must bow.

In general, economists agree that a low rate of inflation is good, and preferred over zero or even negative inflation. I don't really disagree, but think some of the main points are flawed.

The main idea is that inflation encourages spending. However, it's not encouraging but rather forcing spending, which is not necessarily a good thing. You're being punished for saving money, which could have been invested later at a better opportunity. This is according to some another positive point for for inflation, as this means the market will adjust quicker.

On the other hand, deflation doesn't necessarily mean spending will be disincentivized. Although holding on to my money will make it worth more over time, it also means I might be missing opportunities.

And is incentivizing spending really always necessary? If I don't spend, I free up resources that can be used by someone else who does spend and who might make better use of it. Two quotes from HN to sum this up:

snikto: "If you want my money, make something I want to buy/invest into. Inflation forces me to spend money on things I otherwise would not buy. Thus, it promotes goods and services that are not quite as good."

enki: "using up resources is not valuable by itself. forcing someone to spend on anything, anything at all, does not lead to a good allocation of resources. it might increase GDP, but it does not create value"

I'm very curious towards a future built on different principles. With Bitcoin, we could be using a large, decentralised currency, which cannot possibly be regulated by the government or by the banks. It will be very interesting to see this play out.

Source:
1. http://news.ycombinator.com/item?id=4621043
2. http://en.wikipedia.org/wiki/Inflation

Friday, 17 August 2012

Ёфикация

I have been learning the hauntingly beautiful Russian language for some years now, though only since quite recently with some dedication. A wonderful aspect of the language is that it's almost phonetic. Even though my vocabulary is very limited, I can already pronounce almost every word reasonably well, if given the location of the stress.  Such a thing would be completely impossible in English, were it takes years to master this seemingly arbitrary chaos.

I say "almost" because there's a small problem. Apparently, most Russians fail to write the dots on the letter ё. To an educated reader, most of the time the meaning is clear from the context. However, as I am still learning, this makes things quite confusing or even ambiguous sometimes. Of course, I recognise еще as ещё, but все and всё are both valid words with a very similar meaning, respectively "everyone" and "everything". It's also amusing if not painful that English speaking people have incorrectly transliterated Хрущёв to Khrushchev, a mistake which hasn't been made in Dutch, where he is known as Chroesjtsjov.

A peculiar feature is that the letter ё is always stressed. That makes it not clear whether it's a real letter or not. Some people think it's just another way of pronouncing the е. I like to think of it backwards. Maybe it just so happens that an unstressed ё sounds exactly the same as an unstressed е, almost like the о and the а. As argumentation consider for example the endings of the verbs of the е-conjugation, (), -ешь, -ет, -ем, -ете, (-ут) or some of the instrumental case (-ем-ей). All of these е's become ё's when they are stressed. However, this would also require writing the dots on unstressed ё's, which would lead to even more confusion. Nor do I really know whether we could even tell whether an е which is always unstressed might actually be a ё in disguise.

In any case, I try to always write the dots. I was told ё only appeared in children's book and teaching material but during my stay in St. Petersburg I was pleasantly surprised by all the ё's in advertising and packing. The hilarious webshow This is Хорошо also uses them.

Let's hope for a revival!

Two kinds of value

A short post. I have been dabbling around in political economy and it is really interesting. I sometimes wished I lived forever because there is just so much to study.

As far as I have understood, there are two kinds of value. Individual value, sometimes simply called value, which chiefly determined by the labour to produce something, and use value, or utility, which is determined by how much society needs it. At the extremes, a mudpie would have a certain non-zero individual value, though its use value would most likely be none. On the other hand, bread would also have a reasonable individual value, though it's utility is a lot higher. The moment the object is being traded on the market, it gains an exchange value and a price. Exchange value and use value aren't necessarily linked, with diamonds (no use, high exchange) and water (high use, low exchange) as extremes. Some things have no individual value though are useful, like air.

Some of these values are regulated by the "Law of Value", which is an extremely vague concept I can't find a good explanation of. Figures.

Maybe I should read "Das Kapital".

Thursday, 9 August 2012

Fuck. You.Gnome Shell.

Gnome Shell. Fuck you. Fuck you Gnome Shell.
And especially fuck you, Gnome developers. You're brilliant programmers, but brain dead when it comes to user interfaces. Fuck you.
The Gnome programmers are clueless and should be ashamed.

I promise I'll stop swearing, but I had to get that out of my system. Besides, I think it's justified because of the months of lost productivity. And the clear inanity of the whole thing.

I have used Gnome 3 for months and I can now safely say that it is completely broken. Let us see why.

I do want to start with countering the oft-heard argument that all chance is received badly in the beginning. However, if it's still bad after one year and four months, and I still can't use it after trying my hardest for months on end, it's just bad in itself. That argument just doesn't fly anymore after almost one and half year. Besides, you should know something is wrong when you get your own Wikipedia article.

Bad interface

So let's talk about the eponymous shell itself. No dock, and no task bar. The only way to manage running applications is to open an overview that shows miniatures of all open windows. The idea being that you shouldn't get distracted when doing work on an application.
A sound idea perhaps, but it doesn't work out. For developing, I need to have a minimum of a GVim session, a browser window and a few terminals open. It's completely impossible to manage all this without a list somewhere of open windows. Ironically, the overview ends up distracting me because I have to look through all the tiny windows to find the one I need. They don't even take up all possible screen space. Especially distracting is that they get thrown in a different order when windows close and open, something which would never happen to a task bar or dock. Often I (subconsciously) remember the function of a window by remembering its place on the dock.

You know who can work without taskbars or docks? Tiling window managers! These are wonderfully productive systems that don't try to follow the same metaphor like stacking window managers do. Gnome Shell takes something from both and ends up half-assed. Besides, the desktop metaphor might have been a good idea 30 years ago to convince your boss to invest in computers, I think we can all agree it wasn't a good idea then and it is not a good idea now. Places where user interfaces have developed anew, like on the web, follow completely different paradigms.

The also broke Alt-Tab. Alt-Tab doesn't cycle through apps anymore, it cycles through windows. To cycle through the windows of a single app, you have to use Alt-².

Bad implementation

Heaps of stuff is still not implemented and might not ever be for arcane reasons. There's also a disturbing amount of bugs. Given the huge changes they made, that is understandable but I never wanted these changes in the first place.

I'm not completely opposed to the idea of sane defaults, but I should be able to change my font and the font size. Or decide what my laptop does when I close the screen. Things like this are basic in every desktop environment out there for every operating system.

Gnome Shell also crashes way too often. That is especially unforgivable given that most of it runs in JavaScript, which is awesome, yet managed languages cannot crash like system languages do (Segmentation Error). This must mean the developers never invested in graceful degradation.
It is also extremely annoying to get the Sad Computer, "Something has gone wrong", and the when I press the overview key, everything looks fine. I can understand that even with a shell, a window manager and several applications there might still be problems, but letting me see that is just mocking me.

Inconsistent Unicode support
Bad or inconsistent support for Unicode. Take a look at this screenshot. Both of these should be the Cyrillic Capital Letter Я. The window list title displays it correctly, though the label on the right side prints Đ¯. In UTF-8, Я is encoded as 0xD0 0xAF. For some reason, I think Gnome wishes to interpret this as ISO/IEC_8859-4 (Latin 4) or similar. I have no idea how they manage their translation in Russian, Japanese, Chinese and other extremely common languages without Latin alphabet and frankly, this shouldn't be a problem I should fix. My locale clearly states en_US.utf8 and that should be supported.

Gnome Shell has also destroyed my working directory of the Bottom Panel extension I was working on. That is actually quite dangerous. If there's no way for me to safely work on extensions, why would I take the risk of losing a lot of work? Why should I trust it won't do the same to other directories?

Bad documentation

An amazing thing about the new Gnome is that most of the shell is implemented in JavaScript. Together with the half-baked developer console, it's really fun to tinker with just about everything.

With extensions, I'm trying to fix Gnome. I have 15 extensions installed and 11 of them activated and I'm closing in on perfection.

Absolute necessities:
Without these, the Gnome Shell is not usable.

Useful extensions:
Not necessary, but immensely enhance the Gnome experience

But the documentation of Gnome Shell is horrid. I really shouldn't have to dive in the source that often. Yet some rare comments in the source look like they're documentable.

// addChrome:
    // @actor: an actor to add to the chrome
    // @params: (optional) additional params

Isn't this Javadoc? Where is the corresponding documentation?

What the hell is the CSS property spacing? I don't mind them adding new properties, but it is nowhere documented what it exactly does. Is is the spacing between elements? Probably, but how to know for sure? And what would then be the difference be between spacing and margin? I found some vaguely relevant information in the GTK+ source, but I should not have to do that.

Not only is a lot not documented, it is also not even implemented. With the new window manager, Mutter, there is no way for me to know when a window defocuses or pin it. I'm still researching, but it's not looking good for Gnome here.

Conclusion

Gnome 3 is a horrible mistake.

However, given that a large part of the userbase and the developers feel the same, I think part of this mess will be fixed, and I will be able to solve most of my problems with extensions.

PS:
I know it's supposed GNOME. I say Gnome because I don't like shouting. It hasn't been an acronym for 15 years, get over it and start spelling it as everyone pronounces it.

This judgement has been based on Gnome 3.2. Has the situation improved? Let me know.

Monday, 2 July 2012

What's eating my CPU frequency?

I noticed that after sequentially unplugging my laptop, suspending, connecting it to the AC and resuming, computationally intensive applications suddenly were a lot slower. Today I finally investigated this conundrum.

First I looked around in /sys/devices/system/cpu/cpu?/cpufreq/. The file scaling governor told me my CPU frequency was regulated by in userspace. The current frequency was 1.3 GHz according to scaling_cur_freq. My CPU is an Intel Core i7-2670QM running at 2.2 GHz (3.1 GHz in Turbo Mode) so it was running way too slow. By fiddling with scaling_setspeed and scaling_governor I could put the processor speeds back to normal and restore the performance. A simpler solution was to unplug the AC adapter and plug it back in. Presumably, fires an (ACPI?) event which some system regulating my CPU missed when my laptop was suspended.

Manually fiddling with these files got tiresome so I installed sys-power/cpufrequtils and app-benchmarks/i7z to lighten this workload.

I wanted to find the application that was responsible for tinkering with my CPU without my permission, so I used the inotify framework. I wasn't sure this would work on a sysfs file system but I did get results. Yet they were not what I expected. Apparently something wrote a "1" or "0" to /sys/devices/system/cpu/sched_smt_power_savings which is a scheduler option to determine whether or not to distribute load over different cores in the CPU. No application altered the frequencies or it had to remain unnoticeable to inotify. I tried using the audit framework of the Linux kernel to investigate further but it triggered kernel oopses and I didn't feel like solving that problem too.

The sched_smt_power_savings file turned out to be a dead end. Although inotify doesn't give you the PID of the offending process, it wasn't hard to find it in the folder which contains the source code for all installed programs. Thanks to my powerful CPU and a Corsair Performance Pro 256GB SSD, it only took about 10 seconds to zgrep the entire 2.9 GB folder. This pointed me towards sys-power/pm-utils which as it turned out had nothing to do with it.

I still suspected some part of the awfully unconfigureable GNOME 3 to be responsible so I tried shutting it down, with no effect on the behaviour of my CPU. Shutting down service after service nothing changed. In the end the only processes running on my computer were init and some fish shells. Still the CPU frequency dropped by 40% if I unplugged the computer. I'm assuming this means either this is because of a really stupid kernel default in the ACPI subsystem, or some service uploads a stupid power saving scheme to the kernel before it gets destroyed. Per chance this might even be built in the chipset of this laptop.

This isn't the end of this story...

Sunday, 1 July 2012

First post

I have made a blog before on this site but shut it down because I couldn't keep up a decent posting schedule.

Let's try this again. I'm going to pay less attention to the quality of the posts now but just try to post something every week or so.

The purpose of this blog is to serve as a diary of what I was doing around this time in several years but I hope some other people will also find some use in it.

The theme will be physics, computer science, programming, Linux and other things that pique my interest.

Regards,
Kasper

Thursday, 11 November 2010

Making a presentation in Latex

Who could have guessed, my first real post is a rant. A lot of things in my life grind my gears but I hope venting them here makes me feel better.

As most students trying to get their B.Sc, me and my friend Roald have to complete several projects.
Our fascinating project consisted of making a many-particle system with a huge performance upgrade by using the technique of spatial partitioning. I'll explain more on that later.

Now, after the project had reached completion, we had to give a presentation about it. As good academics, we had made our article in LaTeX but we hadn't used it before for a presentation, a Powerpoint usually sufficed. It was my idea to try out Beamer.

I still maintain LaTeX is a great typesetting program, but boy does it have some serious troubles. It's a bloated mess that should be rewritten from scratch with a better syntax and helpful error messages. Sadly, if someone were to undertake this it would break all backwards compatibility. At least it gives beautiful results, it's not as bad as to make me long back to the days of Word or Abiword.

Trouble started after I had installed beamer-latex from Portage (I use Gentoo). pdflatex complained about "beamer.cls not found". But it was in the correct place and in the latex search directories. After a lot of searching, I noticed a lot of ls-R files that contained a dump of the directory contents. Apparently you have to run texmf-update after installing a new update. It would have been nice of emerge to tell me that, but apparently it assumes everyone knows this. Thankfully, this fixed it

$ sudo texmf-update
Configuring TeXLive ...
Generating /etc/texmf/web2c/texmf.cnf from /etc/texmf/texmf.d ...
Generating /etc/texmf/web2c/fmtutil.cnf from /etc/texmf/fmtutil.d ...
Generating /etc/texmf/web2c/updmap.cfg from /etc/texmf/updmap.d ...
Generating ls-R files
Generating language.dat file
Generating language.def file
Generating format files ...
Generating font maps...

Use 'texconfig font ro'(rw) to disable (enable) font generation for users

For some reason, Beamer has navigation symbols at the bottom of each page by default. Who in their right mind came up with that idea? After some time on Google, this was easily fixed.

\setbeamertemplate{navigation symbols}{}


The frametitle system is a mess too. We were duplicating all our titles into our section names and the title took way too much space. So we decided to remove it altogether and I have to say that it looks absolutely fabulous.

\setbeamertemplate{frametitle}{}

Lastly, we didn't find a way to put the names of our overseer and T.A. for the project on the title page. The "official" way with the \thanks command puts them in a footnote. Unacceptable! So we changed the title page layout.

\addtobeamertemplate{title page}{}{
 \begin{center}
 Titularis: Prof. Walter Troost\\
 Met dank aan Matthijs van Dorp
 \end{center}
}

Kludgy, but I'm used to that with LaTeX. At least our presentation looked fantastic, went fantastic and had low maintenance. Half an hour before the presentation, we noticed that our plots were almost invisible. We changed the linewidth on the figures and they were imported automatically in the presentation.

Lastly, there is the huge troubles LaTeX has with plots and graphs, but that is worth a complete post.

Kasper