These day I have drawn many pictures based on the Bible’s stories. I like it very much, but I like to write about my experiences in programming, too.
Yet these days I had nothing special to write about it, which means my work went very well.
“Thank God” – I don’t know whether I could use this word in pure meaning, or it should be ironically used. In your world of christianity, the existence of God and Jesus would be so fundamental in your lives, so there might be various meanings to call Them. So I use my own word to thank God: “Kamisama Arigatou Gozaimasu, my work had been zu well to write something here.”
Today I had indeed a difficulty to understand a block of a source code which were provided by Google Android development team in the development kit.
It was like this: the reason the image is a bit too small is that I don’t intend to write in detail about the source (the code is from ApiDemos.java in Android SDK sample).
This block was so complicated, because it included many of a peculiar pattern, like:
x = y == z? v:w;
It means, if y equals z, x is assigned with the value v, otherwise with the value w.
In the above block this pattern was used iterated, cascaded, or in many ways. For example:
if ( ( x != null? y:0 ) == z)
It’s meaning is dependent on whether x is null or not null.
In the case x is not null, it means “if( y == z )”.
In the case x is null, it means “if( 0 == z )”.
Well, I might wrote wrong, because such expressions were so complicated, and now I am quite tired after struggling with them.
The block contained in this way so many “if” sentences, which meant if some part of the sentences was used, some of the other part became completely unused. If those unused part were hidden, the whole block would be easier to understand.
So I took the method below:
(1) I took a screenshot of the source code in the editor, as I show the one above.
(2) Opened it in a painting software.
(3) Magnified it larger.
(4) Using a colored brush, drew lines on unused part of the block, corresponding to each case:
In some case,
Thus I managed to understand the whole block.
I drew those lines manually, using the mouse. What I liked to say today’s post is: it was an analog way which was more effective for my study on computer. Yes, it was quite analog, except that an LED display was used instead of paper.