Skip to main content

Posts

Showing posts from 2013
Hier is an advertisement on a floor of U-Bahn station Kurfürstendamm. Advertisement on the floor of U-Bhf Kurfürstendamm 1 Advertisement on the floor of U-Bhf Kurfürstendamm 2

Why it's secret? That's secret, too.

Pyramid (exponential) Power (2)

Here is the answer of my math question. A1.  Assume the 3rd and 4th levels are complete, Hitoshi can get the money: 40^2 * 1000 * 0.25 * 0.9 - 1000 = 359000 Euro. Hitoshi is rich! A2. Daniel is the same. Wait, Daniel needs the 6th level of the pyramid. To complete the 6th level, we need:     1+ 40 + 40^2 + 40^3 + 40^4 + 40^5 = 105025641 (around 100 million)> 2.5 million There is not enough people in Berlin for Daniel. He lost his 1000 Euro every month. and Hitoshi lost Daniel as a friend. ;_;  Actually German population is around 80 million, so, even if all the German people joined this, Daniel can not get the expected full payment. Actually next answer shows Daniel has absolutely no chance to get any Euro. A3.  Hitoshi needs total 5 levels.     1+ 40 + 40^2 + 40^3 + 40^4 = 2625641 > 2.5 million So Hitoshi's level needs a bit more than the people in Berlin. But if everyone is convinced in Berlin, even babies and children pay 1000 Euro every month, Hitoshi ca

A picture at near my company.

This place changes quickly....

Pyramid (exponential) Power (1)

When I walked down a street, I was thinking about creating an exponent exercise for my math class. I sometimes just get inspired an idea when I walk down a street. My main purpose is to show how fast the exponential can grow. Hitoshi has no money, so he wants to join a pyramid system . The system asked to him to buy something 1,000 Euro every month from the company. But, if he has 40 people for his next level, and the next level has 40 people each, he can get some commission from 25% of two levels lower's people's purchase. When he got the money, he also need to pay 10% to the higher level. Berlin is quite new for this system, so there are only founder (level 1) and co-founders(level 2), 41 people are there. Assume Berlin has 2.5 million people. How much money Hitoshi can get every month? Assume Hitoshi can convince even everyone in Berlin. Hitoshi asked to join his friend Daniel, to be his next level person. How much money Daniel can get? How many people must be convinc

Ich suhe einen Mann, der mich am 5.9 um 0:40 Uhr ...

A strange man is sitting at a S-bahn station. His note said, "Ich suche nach einem Mann, der mich am 5.9 um 0:40 Uhr auf dem Ku'damm tätlich angegriffen hat und dann weggelaufen ist. Er rief, dass er alle Ausländer, Chinesen und Japaner hasse. Wenn er wirklich dir Zukunft von Deutschland (und der Welt) retten will, dann kann ich ihm einen Job anbieten. Aber nur für kurze Zeit. Sehe sundayresearch.eu ".  My translation is "I am looking for a man who (physically) attacked me on Sept. 5th at 0:40 at Ku'damm and then ran away. He said, he hates all foreigner, Chinese, and Japanese. If he will really save the Germany (and the world), I can offer a job for him. But only the short time. See sundayresearch.eu ." A man with eyepatch. His odd note.

Passing command line options that have white spaces to a bash script: $* and $@

I always try to simplify a command line parser implementation regardless any programming language: C++, bash, ... To do that, I restrict the command line option to a regular form only. All my arguments should be '-arg_key value' form. Even I want to specify a file name, my program needs an argument key, e.g., '-in_file input_filename. If you do in this way, each command line argument has the key, so I can put all the command line options to a map. This makes the command line parser simple. I usually don't need getopt library. Also I try to simplify the command line option support, means smaller number of command line options, and use a config file, which contains 'key = value' lines. This has two advantages: you can support negative values without confusing the command line option, easy to reproduce the test case. However, this method still has a problem when the command line option includes white space. If I could, I will only try to use config files,

Myron Krueger's Amazing demo in 1988.

Myron Krueger's Amazing demo in 1988. This video below is Myron Krueger's 1988's demo. It is one of the origin of virtual reality and the interactive art. It includes 'zoom in' gesture by two fingers and moving around a figure by hand or finger gesture. It is common in these days on a smart phone and a tablet. (see around 4:30). http://youtu.be/dmmxVA5xhuo?t=4m30s But I have a bit strange side story. last year (2012), Apple win Samsung in lawsuit and get 1 billion dollars. One of the Apple's inventions is this zoom in effect by fingers. http://www.ndtv.com/article/world/samsung-apple-lawsuit-penalty-of-1-billion-dollar-slashed-in-half-337277 Apple invented this ``technology'' in 2005 as I read. More strangely, someone invented this technology in 1993, and he won the lawsuit against Apple. http://easthamptonstar.com/News/2013829/Springs%E2%80%99-Own-Beats-Apple Myron Krueger's demo is magnificent in many ways. The demo itself is great
I just found that some reason, Google translate doesn't like number 8 and prefer 6.

Malala Yousafzai: UN speech Subtitled (English, Japanese)

October 2012, Malala Yousafzai has been shot by Taliban who against her campaign for children' rights of education. Here is subtitle of her full speech of her 16 years old birthday. English and Japanese. Please use a HTML5 and Javascript supported browser (Firefox, Chrome, IE10, ...) to watch the video. If you have a problem to watch the video,  this page  is another page to watch the video.

Election of the House of Councilors

Today I visited the Japanese embassy to vote the Saninsen (House of Councilors). It seems LDP will hugely win. The focus is not over half, but 2/3 of the parliament. After the vote, they will restart more than 8 atom reactors. This time I felt the sign of perish of Japan. It is not about atom reactors, the mentality of the country. Once Japanese faced to a disaster, people cooperated, they invented a new technology, rebuild the city, even a better one. Disasters were hard challenges, but Japanese eventually handle each of them and use them to develop themselves to the next level. Sometimes Japanese made an opportunity from a disaster. This time they even have not been able to rebuild the city in Fukushima, have no concrete plan for the new energy.  Even I hypothesize myself to use atomic reactors, the plutonium thermal use plan has been so delayed, no breeder reactor technology yet, no sign of practical fusion reactor technology, there is no future of light water reactor. Now we dep

Why does he need to run.

Edward Snowden is on the run. I wondered why? Because the president admitted his saying was correct. Why does he need to run? The following is my thought simulation. You might find disturbing since in my simulation you don't find human factor. So I usually don't show it. But my motivation is I don't want to see him to be harmed. ``There is no worth to kill him.'' I thought. If someone or some organization kills him, what kind of effect is expected. I found two types of organizations which can see the value to kill him. One is the government, to avoid the domino effect. This government doesn't want to see other employee follows him. But this is obvious, if the government killed him, the world blame the government. The other is the organization that against the government. People suspect the first motivation. If someone against the government, the one kills him, and claims ``The government did it. You see that the government is evil.'' Now his

I believe that the education is only the possible solution to make the world better. Would you like to join me? (In English)

This is a English translation of the last post. Hi onigiri people, How are you? Not seen for a long time. I am still thinking about how I can help the Tsunami victims in  Tohoku. Although for most of the people, this is an old story. If so, you can skip the rest of my letter. You might have found a new challenging mission. If you still care, Welcome. I finally got an idea. I read an article about Tsunami victim children who have a problem to catch up the class in their school. I cannot stop thinking how can I help them. I believe that the education is only the hope to solve real long term problems. But how can I help? A few months ago, I found the people who have the similar idea and they have implemented the system to help. It's free, but they need voluntary help. It's called Kahn academy: "Khan Academy is an organization on a mission. We're a not-for-profit with the goal of changing education for the better by providing a free world-class education for

I believe that the education is only the possible solution to make the world better. Would you like to join me?

This is a letter I sent today to my old friends. We once worked together for Tohoku tsunami victims. Many thanks to RM to check my German. Hallo Onigiri Leute, Wie geht es Euch? Lange nichts von Euch gehört. Obwohl für die meisten eine alte Geschichte ist, denke ich noch immer darüber nach, wie ich den Tsunami-Opfer in Tohoku helfen kann. Wenn Du damit abgeschlossen hast und eine neue, herausfordernde Aufgabe gefunden hast, kannst du den Rest meiner Email überspringen. Wenn Dich die Frage immer noch beschäftigt: herzlich Willkommen,  Ich habe eine Idee! Vor mehr als einem Jahr habe ich einen Artikel über Kinder, die Tsunami Opfer geworden sind gelesen. Die Kinder haben das Problem, den Unterrichtsstoff in der Schule aufzuholden. Seitdem mache ich mir Gedanken darüber, wie ich ihnen helfen kann. Ich glaube, dass allein Bildung langfristige Probleme lösen kann. Aber wie kann ich ihnen helfen? Vor ein paar Monaten habe ich Menschen gefunden, die eine ähnliche Idee verfolgen u

Fascist hunter

I have a friend who is a writer. He is unsuccessful as Kilgore Trout, but he is not at all famous like Kilgore Trout. The title of today's story is ``Fascist hunter.'' Umaya is a fascist hunter. A fascist hunter is a bounty hunter who catches people who are called ``real fascism.'' It is difficult to find a real fascist. Since usually they are no different from the normal citizen. Each country's government has a problem to find them out and put a quite high award on them. The real fascist seems well organized. In Umaya's world, people need to pay tax for alive. If someone could not pay the tax, the one will be suspended. Although everyone has a right to alive at least one year per five years. Umaya failed his business once and he was in a cold sleeping machine for four years. Umaya needed some money quickly. The hunter job is high risk, but also high return. Every hunter must put a think-support-unit in his brain. Because it is believed that the real fa

Unselected man

I have a friend who is a writer. He is unsuccessful as Kilgore Trout,  but he is not at all famous like Kilgore Trout. I got a permission from him to write one of his plots here. The title is ``Unselected man''. Billy is a successful businessman. He is also a charming person. But, he never succeeded with a woman. Actually, his mother also put some distance with him. The success of business didn't bring him a joy. He tried to find what brings him a joy: looking around the world, try out many hobbies... When he came back to his town, he is only interested in teaching children. He could not find nothing can make a world better other than education. He quieted his job. He put all his money to establish a small school. He chased his dream and to find a partner who may share his life. But no success. Whenever he feels a woman, the woman said the same answer: ``You are nice. I like you. But, it doesn't feel right.'' One day, he found a story about a polar bea

Memory leak

I have a friend who is a writer. But he only sold 20 books so far, he is  unsuccessful as Kilgore Trout, but he is not at all famous like Kilgore Trout. I got a permission from him to write his plot here. Otherwise, nobody knows him at all. The title of the story is ``Memory leak''. The main character ``Fred'' in the story is a researcher of ``resurrection''.  It is called ``resurrection'' in general, but he found that is more like a sharing memory with past people. Fred found there are resurrected people who has more than two people's memory. Though many of the case, the contents of the memory is corrupted. Fred realized he shared his memory with his young six-year-old daughter. The memory share is not necessary with a past person. One day, he lost his wife and his daughter by a space travel accident. He shared a piece of memory with his daughter's last moment. That is physically nonsense, maybe not true. But, he has a hypothesis of this ph

Thomasbrötchen

Heute Morgen fragte Kerstin mich: ,,Kannst du zur Bäckerei gehen und 10 Franzbrötchen kaufen?'' Ich antwortete: ,,OK. Aber wie heißen die nochmal?'' ,,Franzbrötchen, wie ein Name, Franz.'' ,,OK.'' Ich ging die Straße entlang und ich sagte den Namen immer wieder um ihn nicht zu vergessen. ,,Franzbrötchen, Franz--bröt--chen, eins, zwei, drei. Franzbrötchen, Franz--bröt--chen, eins, zwei, drei...'' Um die Ecke traf ich einen Freund. ,,Hallo Hitoshi. Schöne Ostern.'' ,,Hallo Thomas. Schöne Ostern.'' Ich ging weiter. ,,Thomasbrötchen, Thomas--bröt--chen, eins, zwei, drei. Thomas--brötchen.'' In der Bäckerei sagte ich der Verkäuferin: ,,Hallo, schönen Tag. Ich möchte 10 Thomasbrötchen, bitte.'' ,,Wie bitte?'' ,,Thomasbrötchen, 10 Stück.'' Sie fragte ihren Mann. ,,Franz, was sind Thomasbrötchen?'' ,,Ach ja'', sagte ich, ,,Franzbötchen, 10 Stück, bitte.'' Franzb

Math objects on programming (2)

Last article, I showed a simple enumeration generator. But I needed one more flexibility. In my job, I use GPU, that is a fast processing unit, but the available memory size is one order of magnitude small compare to a decent workstation. (E.g, GPU's memory size is 2GB to 6GB, a decent workstation can have 24GB to 256GB main memory.) In this pseudo code example, the unit of memory size is GB. 64GB or 512 GB are too much to the current stare of the art GPUs in 2013.  512GB is too much for the best workstation. Therefore, our product uses a cluster, many workstations are cooperates to do a single job. Almost every customer wants to see how our products scales regarding to the number of workstations. Because they have their needs and they want to know how many workstations and how many GPU are needed for their task. Therefore, we need to demonstrate how the performance changes depends on the number of nodes. Here one more parameter, the number of nodes are added as the following.  d

Python PIL experiment (a image comparison tool) continued

PIL and numpy When I ran this program on my data files, I found the processing time is around 6 seconds, the memory consumption size is 230MB on a 1024x1024 size image. When I processed images resolution of 3840x2160, it took 263 seconds and 2.3 GB memory is consumed. The difference of these resolutions makes only eight times different number of pixels. But the processing time is increased more than 40 times. In my program I only use three buffers for processing, my first estimated minimal program sizes are 10MB for 1024x1024 resolution and 72MB for 3840x2160 resolution. However, the `top' reported 30 times more memory size. When I profiled the program, the most of the time is consumed by the tuple construction (RBG value) and abs function. Therefore, I tried to use numpy to vectorize these code. A table below shows the result. My test environment of Intel Core i7-2720 2.20GHz Linux (Kubuntu 12.10, kernel 3.5.0-27), Python 2.7. +-----------+----------------------------------

Python PIL experiment (a image comparison tool)

Abstract: Writing image comparison tool with Python PIL. Python PIL module Python Imaging Library (PIL) is a useful Python module to process image files. This time I have a situation that I have different image file format files But the contents must be the same. For example, I wrote a image generation tool and I want to test it. I compress the reference images, but my program produces images with non-compressed image file format. I can use convert (ImageMagick) tools, though this time, I just would like to try a new tool. You can find my image comparison tool here.

Math objects on programming (1)

Abstract: Using mathematical objects often makes a program simpler. This time I have such experience and write it down here. Mathematical object and programming In a program test, we often need to generate a combination of input parameter sets. One of the most easy method to generate a combination is using nested loops. In this article, I use pseudo code based on the Python language. I will provide the real implementation of the program in the appendix. For example, we have following two parameter sets:  data_size_list = [ 5, 64, 512, ]  screen_resolution_list = [     '2560x1440', '3840x2160', ]. The following program can generate the combination of them:   for d in data_size_list:     for s in screen_resolution_list:       print_comb(d, s) # output This method is simple and straightforward, however, less flexible in some cases. For example, we don't know which sets are necessary to generate a combination when the program is written. To overc

My solution of Google drive hang up at "One moment please"

Today I installed Google drive to my Windows 7 environment to share files with my Linux machines. After sign in, the application window said "processing," then it hanged up. There was a button "you must enable javascript". I pushed it, then "One moment please..." after 5 minutes, I exited the program tried it again. It seems some security setting causes this problem. My solution: set  https://accounts.google.com  as a trusted site. Procedure: Open the control panel Go to network and control Go to Internet Options Open Security Tab Click Trusted sites Click the "site" button copy & paste  https://accounts.google.com  to "Add this website to the zone" and click Add button Now it worked for me. But if I removed this site, it still works. That puzzled me a bit...

Hasenschule: A girl who invented a matrix.

I have a fun to teach C. Six months ago, she had a problem of one digit plus and minus. She often cried in my class. But now she can calculate three digits plus and minus. One day, she was solving a question shown in Figure 1. Figure 1. The question. I expected the answer as shown in Figure 2. If she could do it, I would be happy. Figure 2. Expected answer. While I looked other students, she worked on the problem. I just walked next to her, and what I saw was, my god, a matrix! (Figure 3) Figure 3. A matrix is invented. I asked her, ``Wait a moment! Did you do this alone?'' she answered me ``Yes, I did. It is not correct?'' It doesn't matter. The correctness of the calculation doesn't matter. I was astonished that she organized the answer like this. I could see two vectors in the original question, but both numbers are written in the horizontal direction. She rearranged one of a set of horizontal numbers to the vertical direction and put the

Hasenschule: Was bedeutet das? Bitte erklären das mir. What does it mean? Please explain me that. (3)

Case A. A. was studying geometry. That time, A Rechtschreibung (spelling) teacher Ms M watched her. The question was how many cross point (Schnittpunkt) of the three lines (Gerade) in the figure. In the question figure, the cross points are emphasized, but, she could not answer the question. Ms M asked me to help her. As usual, I asked her (A.), ``Could you please explain me what is a line? (Bitte erklären mir was ist Gerade.)'' She answered me ``A line is a line. (Gerade ist Gerade.)'' Well, that's true, but there is no information. ``How the school taught you. A line has an end? Or a line has no end?'' ``A line has no end.'' I see, so I know she learned the difference between line, half line (ray), and segment at her school. ``OK, then what is Schnittpunkt?'' I actually didn't know what is a Schnittpunkt. She answered, ``I don't know.'' So we asked other teacher, what is a Schnittpunkt. It is a cross point of two lines.

Hasenschule: Was bedeutet das? Bitte erklären das mir. What does it mean? Please explain me that. (2)

Case S. S. was solving a multiplication problem. One piece of black bread costs 2.9 Euro. How much is the each of Anzahl (quantity) : 2, 4, 6, and 8? Figure 1 show the problem. Figure 1. Case S. question. She answered the first question of Anzahl (quantity) 2 case as 5.8 Euro. (As shown in the figure, some European countries including Germany use the comma as the decimal point. In this text I use period as the decimal point.) However, next question, she calculated 2.9 x 5.8 for the quantity 4 case. I asked her why she did it. (In Figure 2, you can see the trace of that.) She believe she should do that and she explained something. However, I didn't understand it. So, I said, I don't understand your explanation. It turns out she also doesn't know why she did that. So I wrote Figure 2, then I explained if we have four pieces of bread, 4 x 2.9 would be the answer. Figure 2. How to calculate the price? First she fixed my figure to put the shadow on the left side of

Hasenschule: Was bedeutet das? Bitte erklären das mir. What does it mean? Please explain me that. (1)

When my students asked me a question, I usually answerd the following: ``Was bedeutet das? Bitte erklëren das mir. (What does it mean? Could you please explain me that?)'' I continue as: ``Mathe ist eine Sprache. Es gibt eine Bedeutung. (Math is a language. There is usually some meaning.)'' When I asked my students to explain the meaning of the question, they sometimes answer me, ``You are a teacher, you explain me.'' Well, that's true. But, I want to know they understand the question. I also want to teach them how to explain something. Therefore, I ask them, ``What does the question mean?'', ``Is it true?'', ``Please explain that why.'' Sometimes some students cried saying, ``You didn't teach me an answer.'' or ``You didn't help me. Help me, please.'' I was thinking, ``The answer is not so important. I want to you to learn how to learn by yourself. This is a practice. I wish soon you don't need my

Web hosting story: Could you google your company's advertisement?

This is a story of web hosting on an Internet provider. It didn't work unfortunately in my case. I use Alice since you can quite it in a few months time span instead of  a two years contract. I signed up ``comfort'' that has a better service even the hardware is the same with extra 15 Euro/month. I liked it since I never need to wait the service operator. The quality of the operator was good. That was around 2009. After that, O2 bought Alice. This time, I could not manage the ftp connection. I can connect to the server, but the connection only kept a few seconds. It was unstable. I changed client software, I looked forum, I changed operating system, I changed other connection point... I spent around eight hours in three days. I called the service, but it turned out, the operator didn't know what was ftp. Another operator showed up, he seems also no clue about what I was asking. He told me this night shift could not handle the request, we will call back in the mor

Authors in a Markov matrix Part 2 (11): Appendix

Appendix A: Unicode and Python 2.7.x This time I develop python programs. I use python 2.7.3. Handling Unicode was needed to process web pages, not only for Japanese and German web pages, but also for English pages. Because some of the English authors have accent characters.  In the early development stage, I was bothered UnicodeDecodeError and UnicodeEncodeError exceptions. Here I will explain what they are, why they raised, and how to handle them. How the Unicode encodes characters? As far as I understand, Unicode uses two maps to encode characters. This depends on how you understand this coding system. I hadn't known this until I worked on this research. My understanding was that there are many kind of Unicode, like UTF-8, UTF-16, UTF-32. But this was my misunderstanding. UTF-8 is how to encode the Unicode data and Unicode is an encoding system how to encode characters. UTF-8 is one of the mapping methods, or transformation formats and UTF-8 is not Unicode (Universal ch

Authors in a Markov matrix Part 2 (10) Experimental results: Which author do people find most inspiring?

Conclusion To find out that which author do people find most inspiring, we used the link structure of Wikipedia. First we extracted the link structure of Wikipedia and create the adjacency matrix, then we apply an eigenanalysis method, which is also called PageRank, to answer the first question. We showed the results of German, English, and Japanese authors.  We also compared the same category (authors), but between the different data source, i.e., different language Wikipedia. We can see the interesting similarity and also difference.  Personally, one of the authors was surprised me that Winston Churchill and Issac Newton have a high ranking score. He didn't know Winston Churchill is the Nobel Prize winner of the literature. Computational literature Recently, I use a mathematical approach or an information scientific approach to understand literature and languages. This approach has a huge limitation, but on the other hand, it gives me some measureable values. Brené Brow

Authors in a Markov matrix Part 2 (9) Experimental results: Which author do people find most inspiring?

This time is a follow up discussion of the result. No link found problem We have an impression there are some amount of Japanese author links that have no reference page in German Wikipedia. We didn't check the exact numbers, but while we debugged the program, we looked into several pages. A typical no link reference case is, for instance, a page mentioned about 良寛 (Ryōkan) has a link to Ryokan, or Sōseki link to Seseki, and so on. These special characters are often omitted, this causes no link reference found. Cross reference between Wikipedia It was relatively easy to make a cross reference list between English and German Wikipedia results since these Wikipedias share how to write the author names, i.e., using the Latin character set. However, Japanese Wikipedias uses Japanese characters for the author's name. For example, Lowis Carroll is ルイス・キャロル in Japanese Wikipedia. In Japanese Wikipedia has the information also in Latin characters, but, the Wiki page ke

Authors in a Markov matrix Part 2 (8) Experimental results: Which author do people find most inspiring?

Wikipedia's Category problem The category problem here is: we expect a specific category has some expected authors on the list, but the actual Wikipedia's category doesn't have the authors we expected. This causes some data missing. There are three interesting cases we found in the following subsections. We didn't do any additional process for this problem. For example, ``Shakespeare does not exist as an English writer in the Japanese Wikipedia.'' Since we did nothing for this, there is no Shakespeare in the English author rank table in Japanese Wikipedia in our result. We tried to obtain the data as automatic as possible since this is just our Sunday hobby research project. We didn't spend much time for the fine tuning of these problem. But these are not intuitive (e.g., Shakespeare is not an English author in Japanese Wikipedia.), so how to automatically fill this gap between Wikipedia sense and our intuition is the future work. No Shakespeare in t