Friday, February 17, 2012

Polish Proverbs - Part One

Proverbs and sayings are like psychology, sociology, history, and economics books condensed to one sentence statements that make it easy for us to remember the essence of the story. Proverbs often contain old knowledge, something that was observed to be generally true for hundreds of years, across villages and towns. It may no longer be true in our curent world, or it may have never been true in another culture or in another place, but sometimes it's eerily adequate today.

Here is a collection of proverbs and sayings that I remember from my youth. I grew up in a small town in the Mazovia region of Poland and I heard these mainly from my grandparents throughout the 1980s.

1. Kto pod kim dołki kopie ten sam w nie wpada. He who digs holes under another, falls into them himself. He who plots against somebody, falls himself the victim of that plotting.

2. Kto mieczem wojuje, od miecza ginie. He who fights with a sword, dies from a sword. This one was supposed to make you think before you use "the sword". Is it worth attacking? You may meet with retribution in kind.

3. Do odważnych świat należy. The world belongs to the brave. You must take action, or risk, to achieve something.

4. Nie święci garnki lepią. It is not the saints who glue (form or make) pots. Making pots from clay was probably seen at one time as a very complicated process, maybe almost magical. The proverb is encouraging us to believe that we - the regular folks - can do it too. It is not "the saints" (people who can make miracles) who make pots, it is people like us.

5. Lepiej z mądrym stracić niż z głupim znaleźć. It is better to lose something while in a company of a wise man, than to find something while in a company of a fool. Stay away from fools.

6. Z kim przestajesz taki się stajesz. You become like those you hang around with. Pick your friends, collegues, and in the broad sense everything around you carefully, because it will affect you. You will adjust, regardless of if you want it or not, and become like the ones you spend most time with.

7. Nie rób drugiemu co tobie nie miłe. Don't do to the other, what you don't like done to you.

8. Jak Kuba Bogu, tak Bóg Kubie. As Coby (Jacob) to God, so God to Coby.

9. Nie chciała góra przyjść do Mahometa, to musiał Mahomet pójść do góry. The mountain didn't want to come to Mahomet, so Mahomet had to go to the mountain. Sometimes you have to make the first move.

10. Upiec dwie pieczenie przy jednym ogniu. Make two roasts with one fire. A much gentler version of the English equivalent: Kill two birds with one stone. Use one event, or thing in a clever manner to achieve two goals.

11. Lepszy wróbel w garści, niż gołąb na dachu. Better a sparrow in the hand, than the pigeon on the roof. Settle for less. Having something now, even small, is better than trying to get something bigger, which is visible, but not achievable.

12. Do wesela się zagoi. It is going to heal before wedding. Usually told to a small child when he or she is crying after suffering a small injury. The said wedding is probably at least 15 years into the future, so yes, it's probably going to heal.

13. Czas leczy rany. Time heals wounds.

14. Gość w dom, Bóg w dom. A guest enters the house, the God enters the house. Treat the guest as if it was Jesus Christ himself. The source of this one is probably in the teachings of the Catholic Church. Jesus is supposed to test us by showing up as a beggar, or some other needy person, and we pass the test if we help him, not recognising him for being God.

15. Pies ogrodnika: sam nie zje i drugiemu nie da. Gardener's dog: it will not eat something, and it will not let another to eat that. Meaning: a person, who doesn't share despite that he or she has no use for the thing in question.

16. Odpłacić pięknym za nadobne. Pay back with beautiful, for the pretty. This one has a strange, ironic meaning. It is used when you do something bad to a person who did something bad to you earlier. You are paying back with an "ugly" deed, for an "ugly" deed.

17. Prawdziwych przyjaciół poznaje się w biedzie. You learn who your true friends are when you are poor (in need).

18. Z rodziną najlepiej wychodzi się na obrazku. This one is difficult to translate literally. It means something like: you look best with your family in a family picture. It is used when the family hurts you or in some other way disappoints you. You all look fine in the photo, but in reality, you aren't.

19. Z głupim się nie dyskutuje. You don't argue with a fool. It is a waste of time to argue with a fool, he won't understand you anyway.

20. Baba z wozu, koniom lżej. Old woman off the cart, the horses have it easier. Used ironically or with anger to come to terms with the fact that we lost something or someone, or that someone abandoned us.

21. Gdzie kucharek sześć, tam nie ma co jeść. Where you have six cooks (female form), there is nothing to eat. You need one boss, not six, to get things done.

22. Dla chcącego, nic trudnego. For someone who really wants, nothing is difficult.

23. Bez pracy, nie ma kołaczy. Without work, there is no sweet bread.

24. Jak sobie pościelesz, tak się wyśpisz. You will sleep well if you make your bed well. If you don't prepare, don't expect a good result.

25. Diabeł tkwi w szczegółach. The devil is in the details. Used when something looks easy at first glance, but isn't.

26. Łatwiej powiedzieć, niż zrobić. Easier said than done.

27. Ten kto daje i odbiera, ten się w piekle poniewiera. He who gives and then takes away, roams in hell. Never take away what you have given.

28. Dwa razy daje, kto szybko daje. He who gives promptly, gives twice. If you give something without hesitation, it can do more good.

29. Zastaw się, a postaw się. Take a loan, but meet put food on the table. You may need to go into debt to do what is expected from you. The thing in question that you need money for, may not be really important, it may be a matter of hosting your guest lavishly.

30. Jak się nie ma co się lubi, to się lubi co się ma. When you don't have what you like, you like what you have. Try to like what you have.

31. Zamienił stryjek siekierkę na kijek. A cousin exchanged an axe for a stick. Used when you do something stupid, especially exchange one thing for another that is cheaper.

32. Gdy się człowiek spieszy, to się diabeł cieszy. When a man makes haste, the devil is happy. Rushing things will cause something to go wrong.

33. Spiesz się powoli. Rush slowly. Don't make haste.

34. Gdyby kózka nie skakała, to by nóżki nie złamała. If the little goat had not been jumping, it would not have broken her leg. Told to a little child, when it hurts itself jumping or climbing.

35. Kochajmy się jak bracia, liczmy się jak Żydzi. Let's love each other like brothers, let's count ourselves (keep our finances) like Jews. Let's be friends, but when it comes to money let's keep it business-like, let's keep it fair, so we can stay friends. The purpose of this proverb is to remind people not to take any financial advantage of their friends.  Note: like all generalisations, negative or positive stereotyping by nationality, religion, gender, profession, etc. allows us to turn on the autopilot... and drive right into the ditch.

36. Niedaleko pada jabłko od jabłoni. Not far from the apple tree, an apple falls. Children are similar to parents. Used when the child in question does something bad, and the parent is known to be a bad person.

37. Czego Jaś się nie nauczy, tego Jan nie będzie umiał. What little Johnny doesn't learn, the big John will not know.

38. Zgoda buduje, niezgoda rujnuje. An accord builds, a discord ruins. Cooperation, compromise builds. Disagreements, quarrelling destroys, ruins. Family or neighbourly feuds had a long history in Poland. This proverb reminds that making mends and living in harmony is better than fighting.

39. Na pochyłe drzewo, każda koza skacze. Any goat can jump on a leaning tree. When something is easy, anybody can do it.

40. Nie ma dymu bez ognia. There is no smoke without a fire. When there is an effect, there must be a cause.

41. Darowanemu koniowi nie zagląda się w zęby. Don't look at teeth of a horse that you received as a gift. Be glad for any gift you receive, regardless of its value. Apparently, when buying a horse you can tell its age and health by checking the state of its teeth.

42. Jedna jaskółka nie czyni wiosny. One swallow doesn't make Spring. To be sure, sometimes you need to wait for multiple confirmations.

43. Nie od razu Kraków zbudowano. Kraków wasn't build at once. English version: Rome wasn't build in a day. Things take time, be patient.

44. Kuj żelazo póki gorące. Forge iron while it is hot. Continue promising endeavours promptly.

45. Co się odwlecze to nie uciecze. What is delayed, is not gone. Some things are inevitable. I think this one would be said by someone who was late in doing something, but wanted to assure another person that the thing in question would be done.

46. Ciasne, ale własne. Tight (small), but your own. It is better to own your house or apartment, however small it is, than to rent or share.

47. Szlachcic na zagrodzie równy wojewodzie. A noble man on his farm is equal to a statesman. Every member of mobility, and that was a relatively large class in Poland, was equal regardless of personal wealth or position. For a few centuries Poland had kings elected by nobles.

Follow-up: Polish Proverbs - Part Two, Polish Proverbs - Part Three



Monday, January 2, 2012

Facing the Singularity

In "Facing the Singularity" Luke Muehlhauser describes the inherent flaws of homo sapiens and the inevitability of Artificial Intelligence (AI) taking over. The future is quite bleak for us. The Earth is ours now, but maybe as soon as in 10 years we may be struggling to survive. Compared to AI we are mentally and physically inferior. Just one example:

Our axons carry signals at 75 meters per second or slower. A machine can pass signals along about 4 million times more quickly.

Luke is the director of Singularity Institute and he is researching friendly AI.

What if we cannot ensure that the AI is friendly to us?

We need to stop it. We need to introduce laws that prohibit AI and robotics research. We need to control it the same way we control chemical, biological, and nuclear weapons research and manufacturing.

And if we don't?
I can see two possibilities for us after the AI takes over:

1. It ignores us as long as we don't interfere with it, or stand in the way. Similar to how we ignore other animals. We may be treated as pets, or as pests depending on how we behave towards it. If we are hostile, it will be hostile. If we are docile, it will let us live.

2. At some point the AI may reach the conclusion that since the universe is slowly falling apart, and nobody can win the endgame, there is no point playing, and it will erase itself, like a depressed man with no future who kills himself.

Friday, December 23, 2011

Design Patterns Refresher

The most common design patterns from "Head First Design Patterns" by Eric Freeman and Elisabeth Freeman - the best book ever about design patterns:

Strategy
Encapsulate algorithms. Allows object's behaviour to be changed at runtime by substituting default algorithms. 

Observer 
Notify dependents of state changes. A very common pattern, often part of the language, see events and listeners in C#.

Decorator
Use and extend behaviour of the object being wrapped, while acting as that object to the external world. A decorator object is created with an instance of an object of the same type. When a method is invoked, it calls the embedded object's method, modifies the result, and returns it.

Simple Factory
Encapsulate object creation. Useful when you need to decide at runtime which object to create.

Factory Method
Same purpose as Simple Factory, but more abstract: moves actual object creation to other factory objects. 

Singleton
Indispensable when there is one of something in the system, like one database, or one set of configuration data. Implemented as a sealed class with private constructor and a static method that returns the only instance.

Command
Encapsulate actions. Every action object has "execute" method. Very useful for a processing system that needs to queue commands and then execute them in order. 

Adapter
Provide a converter that allows clients to use the interface they expect with an object that has a different interface.

Facade
Provide a simplified interface. Used to hide complexity of the underlying system from the external world.

Template Method
Provides extension points or hooks by defining steps of an algorithm and allowing or forcing subclasses to provide implementation for some of them. This pattern is often used in frameworks.

Iterator 
Provides a uniform way of accessing sequentially elements in an aggregate object of any type. Typically found in collections.

Composite
Organize objects into tree structures so a group of them can be treated the same way as a single element. Each object in the hierarchy is a component that can have sub-components. User interfaces are usually built as composites.

State
Encapsulate behaviours of an object in state objects. Current state object can request transition to another state.

Proxy
Provide a surrogate object that controls access to an object that is remote, needs to be secured or is expensive to create.

Saturday, December 17, 2011

Forgetting is the key to AI

I think that making computer programs fortget most of what they receive is the key to building Artificial Intelligence. Why? Because having to much data creates three problems:

1. Space needed to store it.
2. Speed of retrieval.
3. Classification: which piece of data is important?

Selective forgetting would solve these problems.

Spaced repetition algorithm should be used backwards to achieve that goal: when the AI program sees something for the first time, it keeps it until the next day. If it sees it again the next day, it keeps it for 6 more days. If by then it sees it again close to the 6th day, then it keeps it for another 15 days,  and so on. When something stops occurring, it is gradually forgotten. So, the AI program keeps less data, so the information can be retrieved faster, and the data kept is important in understanding the environment, because it keeps coming.

This mechanism works ok with the AI program learning about normal situations. It may stumble upon extraordinary, life-threatening situations, which need to be remembered separately from the spaced repetition algorithm.

Wednesday, November 30, 2011

Do you speak English, mate?

It's been almost a year since I moved to Australia, but I'm still being surprised almost every week by some cute Australian abbreviation for the long and boring English word. A few examples:
a postie - postman
a tradie - tradesman
a bikie - a member of a motorcycle gang
the ambos - ambulance personnel
a kindy - kindergarten
the crims - criminals
a journo - journalist
a doco - documentary
a sickie - sick leave
a fisho - seafood shop
a rego - car registration
a compo - compensation
a uni - university
a footie - football game
a garbo - garbage man - in our city, the garbage truck is operated by one man who drives the truck and picks up garbage using a remote arm - very XXI century
a schoolie - student on a final school break after graduating from high school
a truckie - truck driver
a ute - pick-up truck, for some strange reason it is cool to have one with low suspension, aluminium rims, two exhaust pipes, and dark windows.... are they prized by crims for easy loot loading?

Some other differences between everyday Australian and American English that may trip you out:
to chuck out - throw away
a rubbish bin - waste basket
a cash out - cash back
a bashing - beating
the thongs - flip-flops (for American readers: thongs are called g-strings in Oz, and they may draw a blank if you mention flip-flops)
relief teacher - substitute teacher
super - 401k
a council - town or county government


All over the town you can see signs that may make most American visitors smile:
Dick Smith - a chain of electronics shops.
LJ Hooker - a chain of real estate agents.

The word "mate" is used where "man" or "sir" would be used in the States.
The word "cheers" is used where "thanks" or "bye" would be used in the States.
The "shopping mall" is more commonly known as "shopping centre".

Australians write "kind regards" in e-mails where Americans would put "best regards".
I haven't heard anyone say bullsh#t, but sh#t is heard quite often.
I almost never hear "bless you" when someone sneezes, and almost never hear politicians referring to God. It may be related to the low importance of religion in general. Australian Roman Catholic Churches, new or old, are miniatures of their American counterparts.

The pronunciation may be peculiar : Super is often pronounced and written as "supa", doctor is often pronounced "docta". Strangely, I did not see a single "nite" or hear "wanna", "gonna", "gotta" or "ain't".

Some other general (subjective, subject to change, and not to be taken dead serious) observations:

Australians are very punctual and it's contagious as demonstrated by the fact that most Poles living in Australia tend to be punctual. That doesn't mean that things get done quickly. Although new laws are introduced very swiftly compared to the US.

Bureaucracy is alive and well. Things often get done slowly and costly, maybe after a number of failed attempts, but surely - they DO get done. Australians love filling forms. They must do. How else to explain these hundreds of pages that I had to go through to rent a house, open a bank account, register with Centrelink, buy a car, sign up the child for school, keep the child at school, and last but not least do taxes? On the other hand, medical forms are minuscule in Australia compared to the US.

Australia surprises me sometimes by giving for free things I expect to pay for elsewhere, and for paying for things I expect to be free. For example, my child went with the school choir to sing in a shopping centre. In the States, the school would get some donation from the shopping centre for that. In Australia, parents paid for the bus. Children and parents at my daughter's elementary school must buy tickets to go to the official end of school year event. On the other hand there are great free libraries with CDs, DVDs, computer games, and books and movies in foreign languages. At work, I have to buy and wear company polo shirts to come to office in jeans, but I get free breakfast everyday, and beer, wine, and snacks every Friday afternoon. There are free council events including movies in the park and various classes. You are never too far away from a free public park with playgrounds, toilets, and barbecues.

Australians love challenge and a chance to beat the odds. Sailing solo around the world? An Australian girl can do it. Getting in and out of the parking garage without a scratch? The designers and builders put a lot of effort into making the spaces and corners as tight as possible. Most Australians pass, the paint and grooves on the concrete walls are the fault of the tourists, probably Americans. Parking in your own garage? Again, the designers and builders made sure that in many homes you need a 4 wheel drive to get up the driveway, and then when you get to the top you either stop in place or turn 90 degrees to park. Trying to get on the motorway? You turned right to go right or you went straight to go straight? Wrong decision mate, you will have at least 3 kilometres to rethink that and try your luck at getting back on the motorway in the right direction.

Many Australians speak softly. In my first work meeting in Australia I was confused for a while, because I didn't notice that it started. The person chairing the meeting spoke so quietly that I thought it was a private conversation.

Australians love America, except those who don't. But most do. I think. Julia likes Barack very much.

Australians make great mainstream TV shows and movies about life (that includes sex): Satisfaction, The Slap, and about controversial subjects: Go Back to Where You Came From.

Australians have high quality public radio and television without irritating fund-raising drives.

Australians have a sense of humour. The public TV made a comedy about the current prime minister: At Home With Julia.

On a more serious note. I noticed that Australians are able to take with a smile various misfortunes: floods, fires, being robed, being demoted, being bitten by a jelly fish, spraining an ankle, long commute, expensive living, low quality housing and so on.

The sight of multiple families having a picnic, preparing a hot meal on a barbie in a park, sometimes right by the beach is a very Australian scene for me. Another is people, not just children, sometimes walking barefoot in shopping centres or in the city, but you can see that in New Zealand too, so what do I know?

Cheers mate!

Sunday, October 16, 2011

The Code Book by Simon Singh / The proof that we are a simulation

The Secret History of Codes & Code-breaking.

Simon Singh takes us on a journey through ages: from the cipher of Mary Queen of Scots, through Enigma, public key cryptography to quantum cryptography. He reveals the history of code making and code breaking.

The Code Book is not just about history. It is a study guide, too. Everything is illustrated with examples, formulas, and diagrams. Simon has a gift of describing frequency analysis, one way functions and even quantum computing in an simple way.

The Code Book is a great read. Highly recommended.

......................................

There is one thing in The Code Book, which may be interpreted as a proof that we live a computer simulation. It is about Thomas Young's experiment with a light source, a partition with two slits, and a screen. That experiment shows the wave nature of light. Waves of light reinforce or cancel each other producing multiple stripes on the screen. But nowadays we can send just one photon, wait for a minute, then send another, again wait, send another and so on. In this case, should we see multiple stripes on the screen or just two? Each photon that we send has no other photon to interact with, so it should behave like a particle and just go through one of the two slits. There should be only two stripes on the screen.

Simon writes: "However, for some extraordinary reason, even with single photons the result on the screen is still a pattern of light and dark stripes, just as if photons had been interacting." There are two scientific theories currently that try to explain it: superposition and multiverse. Either the photon passes through both slits simultaneously and then interacts with itself - that's superposition, or the universe splits into two which interfere with each other - that's multiverse.

Well, I'm a programmer, and from my point of view it looks like a silly bug. If I was designing the universe, I could easily make an error of assuming that the characters in my world would never get smart enough to send a single photon, so I would take a shortcut and compute the pattern as if photons were sent continuously. It's a simpler explanation than superposition or multiverse, isn't it? :-)

I need to learn more about photons.

Tuesday, October 4, 2011

Washington, DC


Originally posted 2010-04-18.

During this spring break we went on a trip to Washington, DC. After a long winter the flora was eager to flourish again. A thick layer of pollen was obstructing visibility and making life difficult for people with allergies all the way from Florida to DC.

In South Carolina we saw this fine specimen of Luna Moth.
 We spent most of the time in Washington around The Mall - the downtown area where most important institutions of the U.S. government are located.

Here is one of them, the well known classical Capitol building.






 

The most famous museums in Washington belong to the Smithsonian Institution, and the most famous of them is the Air and Space, which takes pride in the quality of their artifacts: it showcases only originals in perfect condition. The admittance is free and the guided tours are excellent. Here are some examples of what is on display.

A nose section of Boeing 747.

















The Enterprise orbiter. Smithsonian will get a real space shuttle after they are retired by NASA, if it can find the 20 something million dollar fee NASA wants for shipping and handling.









The retired British-French supersonic passenger jet - the Concorde.







Do you know why the windows are so tiny? It's because Concorde was flying much higher than other passenger jets, and if it lost a regular sized window, it would not be able to descend to safe height before suffocating everybody on board.


Enola Gay is the name of a B-29 plane that dropped an atomic bomb on Hiroshima. This specimen, like all others at Smithsonian, is an original.

   












The underside of a Predator UAV.












Finally, the UAVs. Boeing X-45 was an experimental Unmanned Aerial Vehicle. UAVs are the future of military aircrafts.

Our volunteer guide, a retired pilot, said that the F-35s are probably the last manned fighters the U.S. will produce.






Some less known museums and attractions.




Botanical Gardens near the Capitol.














The Building Museum was originally a home to the U.S. Pension Bureau headquarters.

Imagine that floor with a fountain in the middle, and plenty of air and natural light filled with desks.

This is what I call a decent office space.













The Basilica of the National Shrine of the Immaculate Conception - the largest Roman Catholic church in North America.















Ghostly Korean War Memorial.










The Postal Museum located near the Union Station is new and surprisingly interesting. You can learn that parts of U.S. Route 1 were originally a trail used by native Americans, and later by mail riders.  You can learn that pneumatic mail delivery systems were operating in major U.S. cities in the XIX century.




U.S. Mail travelled under the seat of the driver of that stagecoach.













An ingenious postal snow mobile.

   


     








On the way back to Florida, we stopped again in South Carolina and visited Patriots Point Naval and Maritime Museum near Charleston.



Slowly deteriorating USS Yorktown aircraft carrier at Patriot's Point in South Carolina.










Towards the end of the war, the kills consisted mainly of trains, planes on the ground (sitting ducks), and ships.












The legend for the stats.






International maritime signal flags.







Most planes on USS Yorktown are displayed with their wings folded allowing us to peek into the folding mechanism.