2016-11-18

apt-get: Package is in a very bad inconsistent state problem

After I dist-upgrade the Kubuntu 14.04 to 16.04, I ran the following command to update the system state.

sudo apt-get update; sudo apt-get upgrade; sudo apt-get autoremove;

Then, I got the following error.

dpkg: error processing gcc-doc (--remove):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
gcc-doc
E: Sub-process /usr/bin/dpkg returned an error code (1)

All the following attempt didn't work

sudo dpkg --remove --force-remove-reinstreq gcc-doc
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get autoclean

At the end, I did a brute force way.

Find gcc-doc related files in /var/lib/dpkg/info and remove them

find /var/lib/dpkg/info/ -name *gcc-doc* -print | xargs rm

Then,

sudo apt-get update; sudo apt-get upgrade;
sudo apt-get install gcc-doc

This worked, but it is now by apt-get/dpkg and has some risk. Please use this with your own risk if you could not find any other solution.

2016-10-12

Gauss's quote for positive, negative, and imaginary number

Recently I watched the following great videos about imaginary numbers by Welch Labs.

https://youtu.be/T647CGsuOVU?list=PLiaHhY2iBX9g6KIvZ_703G3KJXapKkNaF

https://betterexplained.com/articles/learning-tip-idea-name/

Both articles mentioned about Gauss, who suggested to use other names of positive, negative, and imaginary numbers. Gauss wrote these names are wrong and that is one of the reason people didn't get why negative times negative is positive, or, pure positive imaginary times pure positive imaginary is negative real number. I made a few videos about explaining why -1 * -1 = +1, too.

Explanation: why -1 * -1 = +1 by pattern
https://youtu.be/uD7JRdAzKP8

Explanation: why -1 * -1 = +1 by climbing a mountain
https://youtu.be/uD7JRdAzKP8

But actually Gauss's insight is much powerful. The original is in the Gauß, Werke, Bd. 2, S. 178.
Hätte man +1, -1, √-1) nicht positiv, negative, imaginäre (oder gar ummögliche) Einheit, sondern etwa directe, inverse, laterale Einheit gennant, so hätte von einer solchen Dunklelheit kaum die Rede sein können.
If I translate this to English:
If we call +1, -1, and √-1 had been called direct, inverse and lateral units, instead of positive, negative, and imaginary (or impossible) units, such an obscurity would have been out of the question.
Gauss suggested negative should be coined as inverse. So inverse times inverse is direct, like Kalid coined positive and negative as forward and backward. If you do inverse and then inverse, of course it is original direction, like backward and then backward is forward.

Gauss's imaginary number name is lateral number (side number). When direct lateral times direct lateral, which is √-1 * √-1 = -1, then -1 * √-1 is inverse lateral, - √-1, then inverse lateral * direct lateral is direct, -√-1 * √-1 = +1. You can see in the following figures.

 Figure 1: Inverse and direct instead of positive and negative

 Figure 2: direct, inverse, and lateral
In this terminology, not negative times negative is positive.'', but inverse times inverse is direct.''

Random quotes from ancient time to now

The quality measure of a city (country) is what it does with its referendum.
-- a philosopher

A good decision is based on knowledge and not on numbers.
-- Plato

Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty.
-- Plato

One of the penalties for refusing to participate in politics is that you end up being governed by your inferiors.
-- Plato

Yes, he said; but what are the characteristics of this form of government, and what are the defects of which we were speaking?
First of all, I said, consider the nature of the qualification just think what would happen if pilots were to be chosen according to their property, and a poor man were refused permission to steer, even though he were a better pilot?
-- The republic, Plato

2016-09-27

Make Ununited States of America Again.

Make Ununited States of America Again.
- D. Trump (President of 2nd Confederate States of America)

2016-08-06

In 2020, a nation is peacefully colonized

In 2020, X Y, a country A made a declaration of bankruptcy after the many years of financial crisis. The country will be auctioned by other countries soon. This is probably the first colonization without any military actions in the human history. The country A cannot postponed to pay their debt to the future anymore.

Currently there are many problems in the world.
• The size of the economy of country A is not small, the suzerain country will also have a risk.
• Currently most possible suzerain is either country B or C. However, the debt of country A is huge and the risk is too high.
• So called Terrorism quasi-country D declared to buy the country A. The spokesman of quasi-country D mentioned, they voluntarily help the country A, but international society thinks the country D wants to recognized as a real country. So, they try to buy it. The people of country A and international society against the country D's plan. However, what is the problem anyone the thing which has the price tag? Isn't that against the capitalism?
• There is an instability problem inside the country A. The generation who got money and the next generation who must pay back are against each other.
• The country G might declare the bankruptcy soon. But currently a civil war is going on inside the country G. The parents kill their children and the children kill their parents. It's not a human society anymore. One of the suzerain candidate countries of the country A mentioned the plan: organize an peace army by the country A's people and use it for the world peace for the debt. There are a lot of complains, but no countries has officially disagreed.
• A ultra right-wing politics emerged in the country H and selected their dictator. The dictator analysed the economic problem comes from their next country and declared the war. However, the country H's industry was quite weak as the economy has no substance. They lost the war due to bankruptcy in three days.
On the other hand, a new economy network is emerging. Most of them are city based. Some city invested local energy, such as solar, wind powers, they also invested agriculture. They are now independent from the global energy and food network and not influenced by the global economy. Even their life level is not so high, though, their economy is not growing oriented, but sustainable oriented. These cities created an economical network. Nations controlled movement of people, goods, and energy. But they have minimal but enough goods and energy, so they are not controlled by the nations. In this world, information is more variable, and their network provides information exchange. This economy is not shown in GDP, but it is estimated substantial. They have established own currency based on information value.

2016-08-03

1. A background story

My home machine had Windows 7 and Linux (dual boot). One day I tried to upgrade to Windows 10. But, it destroyed my MBR of the hard drive. After I fixed the MBR, I got an interesting go and back:

1. Upgrading to Windows 10 ... a problem detected and restore to the old state, reboot
3. Go to the state 1

I decided to do a clean install of Windows 7 and use the Linux in a virtual machine. I only need one Windows commercial application, but. it needs a graphics card access. Thus I cannot put the Windows in a virtual machine. I need some server processes on my Linux machine.

When I did a clean install of Windows 7, the Windows update didn't work. The Windows update program had an issue. To fix this problem, I should first need to update the updater, but the updater had an issue. I got an interesting problem here:

1. Windows update has a problem and can not update.
2. To fix the problem, you need to update the Windows update.
3. Go to 1.

Fortunately, Microsoft provided the fix and I can manually install the patch. (Installing and searching for updates is slow and high CPU usage occurs in Windows 7 and Windows Server 2008 R2)

After this fix, I can use Windows update of the Windows 7. Now finally we can talk how to connect to a guest OS from other machines.

2. How to connect to a guest OS from other machines.

My environment is Windows 7 (Host OS) and Kubuntu 14.04 (Guest OS). We need to set up two things.

1. Make the gust OS visible from other machines
2. Assign a (local) static IP address to the guest machine

2.1 Make the gust OS visible from other machines

• Environment: Virtual Box 5.0.26
• Select guest OS and right click -- Setting -- Network

 Figure 1 the network setting window
For the 2nd problem, there are a few solutions. I set up the fixed (static) IP address using the DHCP server setting. See the details here.

2016-07-03

A conversation between I and my landlord.

I: I want to move out. I think my rent is too expensive.

Landlord: OK.

I: Can I use a special method?

Landlord: ?

I: I don't want to pay the rent anymore, but I want to keep my room and have a full access to my room, like the half of the people of a country want.

Landlord: I see. We just need to change the contract a bit. I would like to charge you current two month rent for each access per day. But you don't need to pay the monthly rent. You have no obligation for that.

I: Wow, thank you!

Landlord: You are welcome.

I: Now I only pay when I go to my room. I took back the control!

2016-06-01

I use Jenkins  for a nightly automated test. In the test I use valgrind  for memory leak detection and has some graph of number of errors. So I would like to use plot plugin .

From the example plot image, it is clear we can have a graph with multiple lines. However, how to do it was a bit ambiguous to me from the web page, the example perl script, and the help (in the plot plugin).

The key idea is I need to have multiple data files for multiple lines.

For example, in the build I made the following property data files. Each file represents one data line.

• valgrind_trunk_result.definitely.property
• valgrind_trunk_result.indirectly.property
• valgrind_trunk_result.possibly.property

The contents of each file is only one line. For example, valgrind_trunk_result.definitely.property is:

YVALUE=0

This file is put under the directory of ${WORKSPACE} where the environment variable "WORKSPACE" is given by jenkins. Figure 1 shows my plot plugin setup in the jenkins configure. There are three data series and each of them has each file.  Figure 1: Plot plugin configuration in Jenkins You see there are multiple lines in Figure 2. (Actually there are three lines in the graph, but the first and second data are the same, so these lines overlapped, thus you see only two lines.)  Fugure 2: Plot data with multiple data lines 2016-04-21 Stopping is not enough Earthquake in Kyusyu, Japan still continues. No one knows when it completely stops yet. I care the people there and I also afraid the nuclear reactors they are still running there. (Japan only has two running reactors now, both are in Kyusyu area where the earthquake continues. The number of earthquakes more than scale 1 is 770 times so far.) There are several petition to stop the reactors now. I also joined. But, technically stopping them are not enough. Most of Japanese facility only have water cooling pools for nuclear fuels. If such pool had a crack by an earthquake and lost the water, it is dangerous. How do they stably supply cooling water, the earthquake can be a cause of trouble. Just loosing the electricity of the pumps causes an accident. All the reactors in Fukushima stopped when the earthquake came, but they could not maintain to cool the fuels. That we saw five years ago. To avoid an accident, we need to think about after stopping the reactors. I agree, let's first stop them. But that is not enough for safety. Birthday Donation My birthday party of this year was delayed. A birthday present is common here for a birthday party. But I have all tangible things I want, except one. Yet, I want to have several non-tangible things. However, they are either impossible for a birthday presents or meaningless. For example, I would like to have world peace, a world class free education system in many languages, I want to understand some mathematical concepts, I would like to be fluent of German, I would like to have more time for my volunteer activities, and so on. Thus, I asked some donation as a birthday present. I first show a list of organization I would like to donate. Then the people who join the party donate. I match the same amount from my pocket money to double the donation. This year was the second time. I think it went well. When I got a receipt from the organization, I will show it to the party participants. My cynical friends have already joke on them when they saw the paper, "it is just a paper and you can make it by the photoshop." This time I was a bit afraid if the donation is too much. Then, I might not be able to pay the match, however, it was fine. 2016-03-24 Tranlstaion with patterns (Emacs Lisp) I have following practice problems. I would like to translate them to Japanese and German. • The$200$is the$\\green{\\text{whole}}$. We are trying to find the$\\pink{\\text{part}}$that makes up$11\\%$of it: • The$25$is the$\\green{\\text{whole}}$. We are trying to find the$\\pink{\\text{part}}$that makes up$12\\%$of it: • ... You might notice these problems differs only inside$$. So, I can replace them with the following regexp by emacs's query-replace-regexp function. • The$$$.*$$$is the$$$.*$$$. We are trying to find the$$$.*$$$that makes up$$$.*$$$of it: •$\1$は$\2$です．私達はその$\4$となるだけの$\3$を探しています: You might also notice, you can see a pattern from this sentence • The$200$is the$\\green{\\text{whole}}$. We are trying to find the$\\pink{\\text{part}}$that makes up$11\\%$of it: to • The$$$.*$$$is the$$$.*$$$. We are trying to find the$$$.*$$$that makes up$$$.*$$$of it: I thought this is done by the following function: • (query-replace-regexp "\\$[^\\$]+\\$" "$\\\$$.*\\\$$$")
However, "\\$[^\\$]+\\$" doesn't match$\\green{\\text{whole}}$. I don't know why this doesn't work, so I wrote the following small program. This works well. (let ((finishp nil)) (while (null finishp) (progn (setq match-start (search-forward "$" nil t))
(setq match-end   (search-forward "$" nil t)) (setq finishp (or (null match-start) (null match-end))) (if (null finishp) (progn (kill-region match-start match-end) (insert "\$$.*\$$$"))))))

But I am puzzled why this regexp ("\\$[^\\$]+\\\$") doesn't match. Can anyone explain me that?

2016-03-04

Super Tuesday

I am visiting US. Coincidentally, there was the super Tuesday. Some news  show Trump's domination. His motto is Make america great again''. However, his definition of word great' is quite different from I know. He wants to build a wall on southern border and Mexico should pay it. He doesn't believe climate change. He wants to remove the public health care. He wants to bomb ISIS. He wants to restore the death penalty. (See http://www.nytimes.com/interactive/2016/us/elections/donald-trump-on-the-issues.html)

Currently, he is winning. I have a problem to understand of his definition of 'great'. If there is a problem inside a country, then the reason is outside (e.g., Mexico wall). If there is a problem, he just doesn't believe that (e.g., climate change), and so on. If he won, I am afraid what he would do. I can easily imagine it is a war to one of (or some of) ISIS, Russia, China, Mexico, some of Islamic countries, .... I am also afraid who actually fight in such war. If I remember correctly, he also mentioned the US is always protecting alliance, so next the alliance should fight. I cannot imagine the EU follows him, but then, Japan and Korea are most likely. I hope my imagination is all wrong. But I also feel my hope may be quite fragile.

2016-01-30

How to count zombis in Japanese?

I don't know how to count zombies in Japanese.'' I voluntarily translate mathematics exercises in Khan academy (https://www.khanacademy.org/) from English to Japanese/German.  You can learn anything on Khan academy.

When I translate the following question:
Liliana used 4 dark power crystals to raise 14 zombie soldiers. She wants to know how many zombie soldiers (z) she can raise with 10 dark power crystals...
In Japanese, when you count, you added postfix depends on what you count. I know how to count people: 1人，2人, 3人. But, is a zombie a person? A zombie could be an animal, then, I should count them 1匹，2匹, 3匹.  Wait, is a zombie a dead body? Then I should count them 1体，2体, 3体. A zombie could be a novel ghost, then 1柱，2柱... The question told me they are zombie soldiers. Soldiers are the same as the people, then 1 人，2人, 3人. In the end, I decided to translate them as 1人，2人, 3人, this means a zombie is a person.

I like translation work like this, quite interesting. You can join the Khan academy internationalization for your own language. (https://www.khanacademy.org/contribute)

2016-01-24

How can we make the quality of social media's article higher?

It's been long time since I left a social media. The reason was I could not use my time well on the social media. I think there could be a good way to use my time on it. Today, I watch the following TED talk, and think about other aspect of the social media.

Wael Ghonim: Let's design social media that drives real change
http://www.ted.com/talks/wael_ghonim_let_s_design_social_media_that_drives_real_change
I also felt polarization of people'' when I used the social media. People gathered on a theme/page. Most of the people already like. interested in, or know the subject. They are not completely stranger. If people feel this page is not exactly they ware looking for, they would just leave the page. In the end, I am more interested in a talk with friends at a cafe. Usually I and my friends have some different opinions and I could found something new. Even we found a different opinions, we usually continue to talk and both try to know and understand the difference. But on the social media, some can just logged out or go to somewhere else where no different opinions. That is easy, but no learning, no understanding.

Most of social media has only like/dislike evaluation of an article. With such evaluation criterion, more sensational words or hate speech tend to have higher number of clicks, that results higher score of the article. Because for example, you can easily found like/dislike on a hate speech. This kind of article doesn't help for understanding. One typical such hate speech example is Do not let in a specific religious people in the country'. If this article was evaluated by number of both like and dislike clicks, this could have a high score. That kind of article considered as people are reading the article. This attracts the advertisement market. It's a typical Yellow Journalism strategy.

It is hard to find learning new'' component with like/dislike evaluation. If someone has already liked it, they click like', and not liked it, they click dislike'. If I wrote more sensational lie, populism article, I could got more like/dislike than an article I thoroughly researched. But at the end, I stop reading such articles. This is usually only a short time boom. The left behind is a small specific group of people.

Can we have more quality oriented criterion of an article? Ghonim proposed a criterion, I change my mind a bit/no affect my mind'' instead of like/dislike criterion. According to this criterion, he expects that authors would write more higher quality articles. This criterion is based on what the readers learn. If you change your world a bit, especially you expand your own view of the world, it is leaning. If people learn a new idea, expands to the new area, that would be a high quality article. I can also imagine, I learn something new by this article'' is another criterion.

There is no problem for like/dislike criterion when the subject is a hobby. However, if we need to talk about social problems, this criterion may harm the society. Ghonim talked about this based on his experience in Egypt, 2011. I found this talk so interesting and it surely changed my mind about like/dislike criterion.

I also wish that the social media will use a new criterion, that is based on understandings and conversation among people who have different opinions.

2016-01-23

No virtual machine on Oracle virtual box and Avira

December 2015, I suddenly cannot run Oracle VM Virtual Box (5.0.10) on Windows 7, my desktop machine. It failed to create a virtual machine, the error message is the following.
VirtualBox - Error In supR3HardNtChildWaitFor
---------------------------
Timed out after 60001 ms waiting for child request #1 (CloseEvents).
(rc=258) where: supR3HardNtChildWaitFor
what: 5
Unknown Status 258 (0x102) (258) - Unknown Status 258 (0x102)
I relatively less use the virtual machine on this desktop machine. But when I would like to use Linux, then I need to reboot the machine. This is inconvenient.

I have another windows 7 notebook, but I don't have this problem. Today I found the solution.

The combination of Avira's process protection and Virtual Box cause this problem. Avira announced the real solution will be provided at the release of 9th of Febrary. You can find two types of workaround on the page above. My notebook uses other virus checker from other company and that has no problem.

2016-01-03

My interesting book: Reading Capital'' with the idea of entropy

More than a half year ago, I read Capital'' by Karl Marx in Japanese. I read only a half of the volume 1.  This part is talking about the value of things. My first impression was that this is quite complicated and I didn't get well. But, at one point, I thought that he might be talking about entropy. Based on such wild hypothesis, many part of the book became clear to me.

He wrote that the value of the thing is defined by human thought. Someone thinks a thing has a value. The value is relative. However, all the values are generated by human's labor. Thus, the labor should be the unit of the value. I understand this book in
this way. An example is a value of linen. When a tailor made a shirt by linen, the textile weight or property doesn't change, however, the value (price) has been changed. The value of shirt is generated by labor.

Entropy indicates how the state is in order in physics/informatics. Let's think about cleaning a room. You can collect dust in a room, but the amount of dust doesn't change. However, the room state is in order instead of chaos/disorder. When you put your clothes in your shelf, this state is more in order than when your clothes are distributed on the floor. In this case, the amount of clothes doesn't change. In some sense, the state in order has more value than disorder state. A tailored cloth has more order than textile. In nature, the state is always one direction: order to disorder. Your room only goes to dirtier state and never goes cleaner state if you don't clean your room. (This explanation is ambiguous and not rigorous. If you want to know more about entropy, please look it up.)

When you tailored a cloth from a linen textile, or when you clean up your room, you decrease the entropy. I think Marx wrote that in many different ways. It seems his basic idea is that human labor is the only actor that can decrease the entropy. I would say it is true at that time.  Therefore, he thought the labor is the unit of the value. I think some part of book should be written in mathematical formula, that makes easier to understand his idea for some people.

Assuming this hypothesis (= he was talking about decreasing entropy as a value), I can read the book easily. I thought why he didn't write easier first, but then I realized I learned the recent knowledge. When Marx wrote the book, the idea of entropy is not so common, also not really systematic. There was no easy way to learn at that time. At such time, he thought the value as entropy (or a similar idea) and he introduced such idea to economics. I can imagine that was a revolutionary idea.

This book was published in 1867. If the value is based on how much entropy can be decreased, we can have a simple question using a modern perspective, why the entropy is approximated by a labor time.'' This is too rough approximation. When the industry is based on a simple labor dominant work (as people work in a pipeline in a factory), this assumption might be OK. Everyone works in similar way, so measuring the value is based on the how long a person worked no matter what is produced by the work or who worked. Nowadays this assumption seems not right anymore. Marx might want to criticize the value evaluation by classes. Some noble people got more value even producing the same product. But a skilled person can produce more valuable products than non-skilled person. Creators like artists and authors are good examples. If I and a famous author worked on a writing exactly the same amount of time, the value of the produced books are completely different. If I and an experienced chef cook the same amount of time, the dishes by the chef should taste much better than mine. Moreover, we have now computers and robots. These machines can produce valuable things, which means not only human can decrease the entropy. If Marx saw the nowadays computer controlled factory, I am interested in what he would write.

I only read the half of the first volume, so I only saw the introduction of Capital. I haven't see why the subtitle is Critique of Political Economy'' yet. I would like to read further later. Still I felt I understood better with this idea, so I would like to introduce this idea to you.

One last interesting thing is about the German words Arbeitnehmer (employee) and Arbeitgeber (employer). According to his idea, only the labor can give the value, so the Arbeitgeber (the one gives the work) should be an employee. An employer only takes the value, so the Arbeitnehmer (the one takes the work) should be the employer. He wrote that he expected this mistake will be corrected soon. However, 150 years later, this mistake has not been corrected yet.