onsdag 2 december 2015

A suggestion for a C++1z feature

This is probably quite a controversial proposal. And I am by no standards a very skilled programmer. But anyway, I think this feature could be rather nice to have.

The idea is to have some kind of Post-constructor automatically generated and executed member function. A suggested name for this function would be initializer. It is not entirely clear to me how it should be run, but maybe in reverse compared to constructors, so that derived classes initializers are run before base classes.

The rationale for this proposal is; How many times have you seen code like:

class A{...};
class B : private A{...};
B m(param p);
m.Init();

Or something like that. The reason for this construction (that is, why the code that goes into init does not go into the constructor) is that Init calls some interface function from a member of the base class A to the derived class B. Now this interface function for sure will need stuff created when B was constructed, and hence it can not go into A's constructor. It can also not go into B's constructor since, B does not know about all stuff in A.

For this, a really nice solution would be if all classes run Init-functions in reverse automatically. Then if this function is not user created, it does not have to be run. However, if the user created it, it should be run automatically at the end of the constructor. Maybe it could be done in a fashion similar to the init list in the constructor, but appearing at the end of the function declaration instead? Something like:
B::B(param p) : ...{
...
} : !A()
Where I named the function !A.

måndag 16 november 2015

Infrasturktur igen

Jag har tidigare skrivit om att vi borde ha ett nationellt mobilnät. Jag har också skrivit och varnat för bankernas (då) nya betaltjänst Swish. Tack och lov har denna tjänst haft svårt att få fotfäste, men användningen växer tyvärr och det börjar märkas nu att det ibland är krångligt att inte använde detta. Så, snart kommer det börja kosta.

Men min uppmaning som en förening av tidigare blog-inlägg är då: Varför ska det inte finnas ett nationellt infrastruktursystem för digitala betalningar? Detta borde ligga på myntverket, nu när människor i allt mindre grad väljer att använda analoga betalmedel, borde man anpassa de nationella systemen för att serva dagens människor. Det är helt absurt att man lämnar över denna typ av kontroll till privata aktörer!

söndag 15 november 2015

How on Earth could it hapend...

... that the Microsoft software sphere became so popular?!

Seriously, me nerves can not take working with this stuff! And the list of all faults is too long to repeat. After using this retarded software, I am now so exhausted I can not manage to write down a single thing as an example here. as they all require more than one sentence and I am just too tired! I just had to spell this out somewhere. It seriously is jeopardizing my health!

onsdag 28 oktober 2015

Super conductors at room temperature

I read this very interesting post about the new supra conducting material that actually works at temperatures above the lowest of what have been sighted on earth.

Now that got me thinking, as they speculate in the article, maybe one could have something actually working at temperatures around 20C, where we operates. But then I thought, but wait, if such a material exists, shouldn't evolution have found it by now?

Well maybe not? Then I asked my self, what we expect evolution to find? That is an extremely interesting question. If we can parameterize the space we can expect evolution to have found optimal solutions in, we can stop searching for stuff there. That would be something awesome,   no?

tisdag 29 september 2015

The only sensible reason for keeping humans in the Matrix

There have been many discussions on if humans are imprisoned in a simulated reality such as presented in the movie The Matrix. In the Matrix, the reason for imprisoning humans is to extract energy. A reason not very plausible, since it would be much less trouble to keep, say, pigs. They could perform the same function and cause much less razzling. In the book Under the skin from 2000 Michael Faber instead keeps the humans for meet production. Now, also this is something pigs would do better.

So, what reasons are the for aliens or machines or other humans to imprison humans. Well, I can only see one: for the computing power of our brains. It is reasonable to assume that there is something unique with the human brain. Unique enough that it could be worth the trouble of creating a simulation like the Matrix. What do you think? Any other reason?

fredag 25 september 2015

Why are we still using Bluetooth?!

I have never used a pair of Bluetooth devices that works flawlessly. The latest addition to the set, is my new Windows 8/ASUS laptop which simply refuses to find my Sony Bluetooth headset.

Whys is this, and why is there no improvement. I have been frustrated with this now for 10 years, and the same issues still persist. What is the wireless community planning to do about this?