Sunday, July 3, 2016

How The Mind Works by Steven Pinker

A good book. Sometimes a bit too wordy. Sometimes a bit off topic. Nevertheless, very interesting. It's not just about the mind. It is about evolution, genes, neural networks, optics, and mathematics of music. It is about reverse-engineering us. Why we act the way we act. How our senses work. 
To understand sight, we have to look to optics and computer vision systems. To understand movement, we have to look to robotics. To understand sexual and familial feeling, we have to look to Mendelian genetics. To understand cooperation and conflict, we have to look to the mathematics of games and to economic modeling.
Reverse engineering is the key to understanding how we work. Take morning sickness for example. Why is it part of pregnancy? A biologist, Margie Profet assumed that if it is there, it must be beneficial in some way, and she found it: 

  1. Pregnancy sickness protects the developing baby from toxins: plant toxins in quantities that adults tolerate can cause birth defects
  2. Pregnancy sickness starts when the embryo is most vulnerable to teratogens (birth defect inducing chemicals)
  3. Pregnancy sickness ends when the embryo is past the critical stage of organ development and needs nutrients for further growth
  4. Women with more severe pregnancy sickness are less likely to miscarry
Natural selection started with a replicator. Itself not a product of natural selection, but of chemical and physical processes. Replicators compete for resources. Copying errors that improve chances of reproduction are preserved by pushing out organisms that don't reproduce as well.

Confucius said "A common man marvels at uncommon things; a wise man marvels at the commonplace."

Steve Pinker is looking at commonplace human acts and wonders how they work, how could a robot do them.

Two related, interesting texts:
DNA seen through the eyes of a coder
The math equation for universal AI

The latter one is especially important. It may be describing how our intelligence works.

New observations allow AIXI to improve its world model, which over time gets better and better. This is the learning component. [...] 
The goal of AIXI is to maximise its reward over its lifetime – that’s the planning part. [...] 
[...] every interaction cycle consists of observation, learning, prediction, planning, decision, action and reward, followed by the next cycle.

Saturday, July 2, 2016

How to Fail at Almost Everything and Still Win Big by Scott Adams

The full title includes: "Kind of the Story of My Life". Published in 2013.

Scott's recipe for happiness, condensed:
Healthy diet -> Energy -> Exercise -> More energy -> Learn new skills -> Flexible schedule

"Goals are for losers and systems are for winners"

Forcing yourself to do something, for example to eat right, or to exercise, takes a lot of willpower. The trick is to set up yourself and your environment, so the things that you want to achieve come without effort. How to do that? For eating: you could stack your fridge with healthy foods, use spices to make them taste great. For exercise: you need a routine - exercise must be done every day and must be pleasant. You should not overdo it the first day, and then be in pain for a few days.

I grew up in an environment that was setup for more healthy living:

  • The pantry with the best food (sweets, sausages) was locked. My snacks were carrots and apples.
  • I walked to school, shops, church. I took a train when going farther away.
  • I played with other kids in the streets, in a park, and on school grounds.

Polish Proverbs - Part Three

1. Starych drzew się nie przesadza. Old trees are not to be replanted. Old people should not be uprooted. They should live out their days in a familiar environment.

2. Cicha woda brzegi rwie. Quiet water rips the banks (of a river). The quiet ones are sometimes the most adventurous.

3. Podróże kształcą. Journeys educate.

4. Cudze chwalicie, swego nie znacie. You are praising others' (things or customs), you don't know yours'. You are praising foreign things, and you are unaware of your country's achievements.

5. Potrzeba matką wynalazku. A need is a mother of invention.

6. Głodnemu chleb na myśli. A hungry person's thoughts are about bread. 

7. Lepiej późno niż wcale. Better late than never.

8. Pan Bóg nie rychliwy, ale sprawiedliwy. God is not quick, but fair/just. Similar to "You reap, what you sow".

9. Przyganiał kocioł garnkowi. The cauldron critiqued the pot. I understood it about the big one criticising the small one, while doing the same thing. It seems that it is not about the size, but about getting dirty. The full version of the saying is "Przyganiał kocioł garnkowi, a sam smoli" - the cauldron critiqued the pot, but it is sooting too.

10. W gorącej wodzie kąpany.  He who had a bath in hot (too hot) water. A quicksilver. Somebody who is quick to react, usually overreact, do something without thinking it trough.

11. Czego oczy nie widzą, tego sercu nie żal. What the eyes don't see, the heart does not regret. Sometimes it is better not to see or know about something.

Friday, May 6, 2016

Belgrade, Serbia

A short stopover in Belgrade, Serbia on the way to Warsaw.

Quick, random observations:

Serbia and Serbs are in some respects very similar to Poland and Poles:

  • The looks: Serbs thought I was one of them - they would speak Serbian to me. I saw a few people in Belgrade who looked like doubles of people I know in Poland.
  • The language: not close enough to understand when spoken, but often close enough to decipher the written form.
  • History: the communism of course, although, unlike Poland, Yugoslavia was independent from the Soviet Union, but it goes further back. Serbia was a dominant force in a multicultural country that became officially known as Kingdom of Yugoslavia in 1929. The break-up of Yugoslavia in the 1990s left Serbia scarred, out of NATO, out of EU. I think Poland could face a similar fate, if after 1945 it was to keep its eastern parts with significant Ukrainian, Belorussian, and Lithuanian minorities. At some point, nationalists among these peoples could declare independence, and the clash with Polish nationalists could turn Poland into a pariah of the modern world.
  • On the way from/to the airport: a big Gazprom ad with Russian and Serbian flags (same colours, just inverted.) declaring Russian-Serbian friendship.  
  • Plastic bags in the forests along the road. I see that in Poland too. 
  • Very few tourists. The airport to city bus driver didn't speak English. People did not know where the airport bus stop was at the central railway station.
  • People in Belgrade look good. Cars look modern. Buildings, and public transport, not so much. The are modern Solaris buses visible, but most trams are ancient.
  • Serbian currency is hard to convert. A currency exchange in Poland wouldn't take it.
  • Big choice of tasty, cheap snacks at bakeries. 

Central Railway Station

Temple of Saint Sava

I remember such uneven asphalt from Warsaw of my youth

Looks like a WW2 era tram.

This could be in Warsaw too, although more likely 20 years ago, than now.

The NATO bombed ministry building finally being repaired.

This and many other trams are gifts from Switzerland.

Opposite the central railway station. Kvass and Adidas ads.

Panorama of Belgrade - no skyscrapers yet

Short-range Air Serbia planes at the Nikolai Tesla airport

Fields, no houses - very different from Poland. Strange shapes showing underground water?

Another look at Belgrade

Communist apartment buildings and lots of greenery. Could be in Warsaw too.
Similar to Poland, but bigger. Multi-family houses?

Sunday, March 13, 2016

How to Talk So Kids Will Listen & Listen So Kids Will Talk

by Adele Faber and Elaine Mazlish, originally published in 1980.

A great review of this book is here:

Some of the techniques could also be used between adults, for example at work. To see if this works, I replaced "children" with "them". Here is the cheat sheet:

1. Helping Them Deal with Their Feelings
  • Listen with full attention; don't half listen
  • Acknowledge their feelings with a word "Oh", "Mmm", "I see"; don't question and don't give advice
  • Give their feelings a name; don't deny the feeling
  • Give them their wishes in fantasy; don't explain and argue using logic

2. Engaging Cooperation
  • Describe the problem as a matter of fact, instead of: blaming, accusing, name-calling, threats, commands, lecturing, moralising, warnings, martyrdom statements, comparisons, sarcasm, prophecy
  • Give information
  • Say it with a single word
  • Talk about your feelings
  • Write a note

3. Alternatives to Punishment
  • Point out a way to be helpful; don't yell, or threaten
  • Express strong disapproval; don't attack character
  • State your expectations
  • Show how to make amends
  • Offer a choice and then follow up with an action to prevent unwanted behaviour
  • Allow to experience consequences, for example exclude from the activity next time
Advanced problem solving:
  • Talk about their feelings and needs
  • Talk about your feelings and needs
  • Brainstorm solutions together
  • Write down all ideas without evaluating
  • Decide which ideas you both like/don't like/will follow through

4. Encourage Autonomy
  • Let them make choices - as a practice
  • Show respect for their struggle "it can be hard"; help, but don't do it for them
  • Don't ask too many questions
  • Don't rush to answer questions; encourage them to talk
  • Encourage them to use external sources; so they don't need to depend on you
  • Don't take away hope; let them explore and experience

5. Praise

Praise can make them doubt the praiser, lead to immediate denial, be threatening, make them focus on their weaknesses, create anxiety, be experienced as manipulation...
  • Describe what you see or feel; don't evaluate "good", "great", "you are genius"
  • Sum up using a single positive word: organisation, perseverance, self-control, friendship, loyalty, courage, willpower, flexibility, adaptability.

6. Free Them from Playing Roles
  • Look for opportunities to show them a new picture of themselves
  • Put them in situations where they can see themselves differently
  • Let them overhear you say something positive about them
  • Model the behaviour you'd like to see
  • Be a storehouse for their special moments 
  • When they behave according to the old label, state your feelings and expectations

Wednesday, February 24, 2016

Ahead of time vs just in-time compilation

An interesting blog about AOT (ahead of time) versus JIT (just in-time) compilation:
"So, Windows 10 has just been released, and with it Ahead Of Time (AOT) compilation feature .NET native. Google also just recently introduced ART for Android, and I just discovered that Oracle is planning an AOT compiler for mainstream Java."

Read the rest: Jitterdämmerung
This should really be a twit, not a blog post, but I want to keep it here, so I can expand this interesting topic later.

Tuesday, January 26, 2016

Quality of "Independent" Russian TV

I am watching Russian NTV news on SBS in Australia occasionally. The quality of reporting is appalling. In the news from Monday 25 January 2016 (listed on SBS as "Russian News 26 January"), there was a segment titled "Warsaw against the EU".  It had two short interviews with politicians from the fringe of Polish politics: Janusz-Korwin Mikke, introduced as a "veteran politician", a pro-Russian, anti-EU, far-right nationalist, and Krzysztof Bosak a very young and unknown far-right National Movement politician, presented as an "expert".

Oleg Nemenskij, a "political scientist", said that Poles do not like most: Ukrainians, Germans, Russians - in that order. Fact: CBOS poll from January 2015: Poles disliked most: Roma - 58% of Poles dislike them, Russians 50%, and Romanians 43% (commonly mistaken for Roma), the fourth group is Palestinians with 36%. No Ukrainians or Germans in the first three, just Russians, sorry Oleg. (*)

The segment showed Jacek Kurski - the new head of TVP, as president of Poland Andrzej Duda. I understand, after 10 years abroad all Poles look the same to me too. :-)
Jacek Kurski, he is not the President of Poland.
Andrzej Duda, this is the guy you should have shown.

It called Jarosław Kaczyński "the younger Kaczyński". Jarosław and Lech were twins. No Pole ever calls Jarosław the younger brother. We do not even know which one was younger, they were identical twins!

It said that after PiS took power, the EU flag was removed from the Polish parliament. Funnily enough, later they showed the parliament with the EU flag still there. (**)

There were other inaccuracies, fringe opinions stated as official state positions, and false accusations - for example about the alleged campaign to destroy Soviet Army monuments (***) in Poland. The whole segment was just a propaganda piece. Why is SBS showing that?


(*) More details on the OBOP poll: dislike: ... Turks 36%, Jews 32%, and Ukrainians 32%.

To balance this, who Poles liked most in January 2015 according to OBOP?  Italians 51%, Czechs 50%, Spaniards 49%, English 48%,  Slovaks 48%. Other nations: Americans 44%, Germans 43%, Ukrainians 36%, Jews 28%, Vietnamese 25%, Russians 22%, Roma 18%.


(**) The EU flags were removed from the government's press conference room.

(***) Some controversial Soviet Army monuments are being removed in Poland, for example, a monument to Ivan Chernyakhovsky who helped NKVD arrest Polish Home Army officers in Vilnus in 1944. Local news about the event:,Rosja-oburzona-likwidacja-pomnika-bohatera-ZSRR-Symboliczny-gest-w-Pienieznie