Skip to main content

Posts

Showing posts from 2015

Never too late to learn computer: What does it mean 8GB on my USB stick?

Introduction I recently help some people who said ``I don't understand how to use my computer, but I want to do something.'' I found these people have interesting questions. So I write them that story here.
What does it mean 8GB on my USB stick? Some of my friends work on a social movement. They want to study something, they want to tell something to people and they want to discuss about it with others. For example, what is nationality of children when a couple married internationally? Are there any rights differing with others? They want to study these questions themselves. Usually it is deeply connected to their life.
Here is a woman, who researched on a certain subject. She got a video materials and she wanted to share it with others. ``I don't know how to do that, but I want to show these materials to some people.'' This time I have a chance to help her. What she wanted was to show this video to around 30 people by a video projector.

She told me a compute …

Egon the rabbit and me: Refugees

I: These days, a lot of war refugees are coming.

Egon: If you talk about nothing can help human being, I had enough from you. You could live like rabbits. You could live like clever dolphins.

I: When I think about the cause, yes, nothing can help human being. The people who made the cause don't care at all at far distance. I just think about connection with me.

Egon: You have any connection with refugees?

I: Refugees are enormous chance for this country, at the same time, they are huge danger, too. This country has the aging problem, decreasing population problem. If 800,000 refugees could be the positive power for this country, this country would have huge success. If they join to the industry of this country, contribute to the knowledge, pay tax, pension, medical insurance, ... what a enormous chance. On the other hand, if they became just a burden, that would be a huge problem.

Egon: Human always fail since they are stupid. Even they know it, they will fail.

I: I think this is …

Egon the rabbit and me: Inconvenient brain

``If the school year was a month, I would be 25th grade.'', said a eight  years old girl to me. ``Yes, if a month had four weeks, and a week was the school year, what you will be?'' But she has already lost her interest. I usually found her idea interesting.

I: Egon, do you love someone?

Egon: Love? What does it mean?

I: ... It's hard to explain. If I love someone, I care someone, I wish this someone is all right, I wish this someone is happy.

Egon: If that is the love, maybe I love everything.

I: I love someone. But not everyone.

Egon: Why not?

I: I don't know. If I love a woman, I wanted to be with her. But not all women.

Egon: I see you love someone, but why you want to be with her?

I: I don't know why. But usually if I love someone, I want to be with someone.

Egon: Sounds good.

I: I don't know. Actually it's not good in case that someone whom I love doesn't like me. A few women honestly told me that is disgusting and two women made it clear …

Egon the rabbit and me: The wonder of finding an invisible planet (3)

Part 3 I: We could continue the story about cage. I actually think thorough it. However, I haven't had a clear idea on it yet. I would like to back to the story about finding invisible planet. How the wonder changes to a great thing.

Egon: ...

I: A person found the ``Things fall down'' and ``how the planets move'' are based on the same rule. People calculate the orbit of planets, they found every planet follows the rule. Someone found a new dwarf planet by a telescope, it also followed the rule. At least people could not find a planet that doesn't follow the rule in the solar system. When a better telescope was created, the telescope found a new planet, still the planet follows the rule. People started believing ``Things fall down in the universe.''

Egon: You, or human being observes the universe and found the same rule many times. No exception could be found.

I: Actually they found an exception. One planet doesn't follow the rule exactly. Its orbi…

Egon the rabbit and me: The wonder of finding an invisible planet (2)

Part 2 I: Something rings a bell. Why I don't feel wonder for finding an invisible planet by the law of gravity. One reason may be because my world has been a little bit expanded. However, I don't think that is enough large. I feel there still is a huge world that I don't know yet. So I hope I am not such arrogant that I think I know everything and thus I don't feel wonder anymore. I think I learn a little bit, so the wonders became knowledge. Some wonder and magic has changed to some great things, knowledge.

Egon: ...

I: I didn't find these knowledge by myself, I just learned. I hope I understand them, not just memorized them.

Egon: ...

I: It's not exactly accurate words, but the law of gravity is all about ``Things fall down''. Human being observed the universe for a long time, literally a few thousand years. And people found ``Things fall down'' in many places in the universe.

Egon: Human being accumulate such knowledge for a long time.

I: W…

Egon the rabbit and me: The wonder of finding an invisible planet (1)

Part 1
I feel peace when I sit beside Egon. He is just eating leaves of carrot. I talk with him. In reality, I may just talk with myself. Still I feel there is a conversation with him.

I: One of my friends told me, ``It's a wonder that mathematics and physics find an invisible planet by computing something. It's like a magic.''

Egon: ...

I: Actually I don't feel wonder. It's great we can find a planet, but I don't feel it as a magic.

Egon: ...

Egon usually doesn't answer a topic which he is not interested in. I thought he was not interested in this topic, but, actually not.

Egon: Thinking something wonder, it is great, I presume.

I: Humm, well, there is the law of gravity, and if you think it is real, finding an invisible planet is not a magic. It is a great thing, but not a magic.

Egon: Not that. The greatness of thinking wonder. I think you saw a lot of wonder or magics in the world when you are a child.

I: ...

Egon: If you lost your sense of wonder,…

Cover the bad 2015

Today I would like to introduce our new product, ``Cover the bad 2015 (model: black).''


I know, you think this is just a normal duct tape, but this product will improve your quality of life.

When you see this kind of sticker, that expanding a hate, it is not good  for your healthy mind. I know you pay the tax, you pay the pension for the elders, ... You wonder why someone returns the words like this. You must be shocked!

Now you can use ``Cover the bad 2015 (model: black)''. Let's cover it like this.

How is that? Your pocket has a room for ``Cover the bad 2015 (model: black)''. For fashionable person like you, we have various models: red, yellow, orange, gray. Try it out today!

Egon the rabbit and me

``Do you have a voice?'', I spontaneously asked a rabbit, when I was reading a economy book. ``It seems people's productivity is increasing, the world population is saturating, why does the world still have a lot of problems?''

The rabbit was looking at me. His name is Egon. Today is Stig's first day of school. ``You don't know why?'' Egon said so, or maybe a part of me told me as Egod told me. I answered, ``Yes, I don't know. I can say human being is stupid, but, that answer doesn't help me even if it is true.'' Egon kept silence, so I thought it was some audible hallucination.

I looked at the cage. ``Is your cage too small for you?'' I asked Egon.

Egon: ``It's small. I rather want to have large one. How is yours?''

I: ``... Mine? I don't have one.''

Egon: ``Don't you see yours? You made it yourself, and you put yourself in it. As far as I know, only human being does that.''

I: ``Do you me…

Semi-automate timing generation method of video subtitles

Abstract I voluntarily work on for free mathematics material translation for everyone. I have three main tasks in my workflow of this work: 1. script translation on a srt file, 2. dubbing the video, 3. subtitle generation. I found the subtitle timing generation is a time consuming task, so I want to reduce this. When I generate a subtitle, I already have the translated script and its video sound. So, I try to use these data to semi-automate the subtitle timing generation. This time I use the YouTube's transcript function to generate the subtitle timing. This can reduce the time of timing generation task. I implemented a srt file to text file conversion script since YouTube's transcript function requires text format data. YouTube's transcript function performs  not only the timing generation, it also edit the lines (put some newlines). Therefore, I implemented subtitle line concatenation script, too. One experiment shows that whole manual work took 4.5 hours to generate th…

70 years later

July 25th, 2015, we gathered in front of the building, that Harry S. Truman ordered to use atomic bombs. We made lanterns with praying we never use the atomic bombs again for killing. I feel praying only cannot solve anything. But I start praying and I would like to tell others there are some people who pray that.


Learning Scratch (2)

My last blog entry, I briefly talk about what is Scratch. There are ``events'' and that is the trigger of the program. In this article, I would like to talk about one of my students who made a character animation program by Scratch.

Scratch provides key events. When I push the right arrow key, then ``right arrow key push event'' is triggered. When that event happened, I add 10 to the x coordinate of the cat. This means, when the right arrow button pushed, the cat move to the right for 10 steps. If I add more programs like the up arrow moves the cat to upper direction, I can control the cat position by the arrow keys. This is a cat control program.

Today, my student used a dragon. He wrote the same program with the cat. Then, the cat and the dragon move exactly the same way. Of course they should. A current computer is very fast, very precise, and very stupid. It does only what the developer wrote. My student asked me, how he can make the dragon faster. I answered, incr…

Learning Scratch (1)

I teach Scratch [1], a computer programming language, to 10 to 12 years old students from last year. Sometimes they show me an interesting creative idea. I would like to write one of them here.

Before I explain what my students did, I will explain what is Scratch. First I will explain it in a conceptual way, then with an example. If someone can understand a conceptual explanation, he/she can apply the idea to many cases, but this is a bit difficult since their understanding must be deep. An explanation by example is rather easy to understand since it is shallow, that means you don't know it is still true in other cases. So there is a trade-off.

Scratch is a computer language, but also a programming environment.  In the environment, the developer writes event driven programs to control many sprite [2] characters. You can think each sprite character an object. Each event invokes a program and each program runs in parallel.

Maybe this explanation doesn't make sense for whom has n…

Inter process communication by a shared memory

I made an experience for an inter process communication using a Unix shared memory on a host. I look up on the Internet, but I could not find a good example code. In the end, I found some explanation articles, some Stack overflow threads. (I might do something wrong when I search...)
Some pages suggest to use shmem_open() and mmap(), that is the POSIX direction. I think I can believe the discussion, so I implemented it the following way.
The basic idea is the following: A process creates an shared memory area using shm_open().  To identify the shared memory area between processes, we use an identifier string (e.g., ``identifier''). (On Linux environment, You can see via /dev/shmem, e.g., /dev/shmem/identifier .)All processes map that shared memory are to main memory using mmap(). When we succeeded mmap(), we obtained a shared memory pointer (shared_ptr).The processes can communicate via shared_ptr.When we finished to use the shared_ptr, remove the map using munmap().One of the…