sobota 12. prosince 2015

Money


 There is one thing that isolates a person from humanity better than a prison ever could - money. If you are rich, people are not going to forgive you. There are different strategies how to cope with the isolation:

  1. Bribe artists to like you by buying their art.
  2. Bribe scientist to like you by supporting their research.
  3. Bribe women to like you by hiring prostitutes.
  4. Seize power to force people to listen to you.
  5. Take drugs to forget about the world.
  6. Substitute civilization and humanity with nature.
  7. Believe in something with whole your heart.



Comparison of import.io and OutWit

When import.io was released, I was excited. However, the excitement disappeared. The reasons follow:
  1. Whenever you are defining a crawler, you have to always define at least 5 examples, even though you know, that in this case just 2 examples would be enough.
  2. The interface is sluggish even in the offline version of import.io.
  3. The crawling is approximately 10 times slower than in OutWit.
  4. The export is not satisfactory. If you tell import.io to export the data into csv, then import.io strips away all commas from the scraped text. If you need to preserve the commas, you can still export the data in XLS or JSON. But Excel has a limit on the length of text in cell. And when you get over the limit, you cannot open the file. JSON is neither a workable solution because the characters in the text are not always correctly escaped, making the JSON invalid. Hence, after several hours of web scraping with import.io you find yourself unable to scrape import.io.
While OutWit irritates me with it's deep context menus, at least it does it's work.   

čtvrtek 19. listopadu 2015

Metric

A metric has has to fulfill following properties:
  1. Be symmetric
  2. Zero for d(A, A)
  3. Be non-negative
  4. Follow the triangle inequality
Symmetry is an useful property - the distance between city A and city B should be the same as the distance between city B and city A. However, if we were measuring gas consumption of a car and city B was on a hill and city A was in the valley bellow the hill, we would expect to see different results for a route from A to B (to the hill), than from a route from B to A (down the hill).

Similarly, zero property may not be always fulfilled - for example, a taxi fare is not a metric, because you pay a minimal fare just for sitting into the taxi.

Non-negativity is not be fulfilled whenever we are interested into the direction. For example, in transactions with money, we are commonly quite interested into the direction of the money transfer.

Triangle inequality is does not hold, for instance, what if we represent the weights between nodes as the time required to travel between the points  represented by the nodes.  Further, to make this scenario more physical, let us consider 3 points. A, B, and C.  Imagine that A and C
are separated by a lake, whereas a and b are on a bank such that I can walk from A to B on land, and on B to C on land.  Let's say I can walk the ABC path in about 15 minutes, but it will take me 30 minutes to swim across the lake from A to C.  This problem is a physical possibility, but it does not exhibit triangle inequality because I increase the cost of my path by removing an intermediary point.

pondělí 2. listopadu 2015

Přijme Česká Republika Euro?

Ohlédnutí zpět:

V době hojnosti je pro státy výhodné vytvořit soulodí, protože všechny lodě míří přibližně stejným směrem - za blahobytem a prosperitou. A pro posádky lodí je výhodné, že můzou mezi sebou volně obchodovat. Problém ale nastává, když přijde bouřka. Pro velké lodě, jako Německo, je i za bouřky výhodné dál pokračovat nejkratší cestou za blahobytem a prosperitou, protože je nějaká malá bouře neohrozí. Ale pro malé lodě může být výhodnější se stočit proti vlnám, aby je vlny nezavalily. A teprve jak bouře pomine, vyrazit směr blahobyt a prosperita.

Když má stá vlastní měnu, má kontrolu nad kormidlem. Když ale stát přijme Euro, o tuto kontrolu přichází.

Jak jsem již řekl, v době blahobytu je Euro výhodné. Ale v době krize je Euro, zvláště pro malou ekonomiku, smrtící.

V současné době je pro Českou Republiku nejvýhodnější, když většina zemí přijme Euro, ale samo Euro nepřijme. Život občanů se tím zjednoduší - když vyjedou do zahraničí a zůstanou jim Eura, můžou je v klidu uložit do šuplíku, protože příští rok zase vyjedou do země, kde se platí Eurem. Přitom ale státu zůstane možnost kormidlovat v čase nečasu.

sobota 31. října 2015

I hate OS X El Capitan

There are following quirks on the new OS X that drives me crazy:
  1. I like if the typed text immediately shows on the display. However, on El Capitan the text can get sometimes delayed by whole seconds. This is a system wide problem - the "feature" equally affects Mail just as TextEdit. And when text lags behind typing even in such undemanding applications like TextEdit, I am getting furious.
  2. Why do they have to move previous/next week controls in Calendar in each version? Every time I get finally accustomed to the new position they move it from one side of the window to the other side. Guys, make your mind!
  3. GUI in some applications, like Navicat, got unbearably sluggish. This will likely get fixed with updates of the affected applications. But in the mean time, I am not happy.
  4. With each update of OS X the GUI (or display setting) gets more colorful. The change is  subtle - I am noticing the change only for the first few hours. But still, I am terrified of where this trend will end.

neděle 18. října 2015

The optimal length of text

When I was working with text I noticed that the optimal length of text is somewhere around 100 characters.

The estimate is based on following measures:
  • Twitter: 140 charactes
  • Performance of bank tellers based on their notes about the clients: 100-150 characters
  • Dating websites: 97 characters