Monday, June 30, 2008
Contemporary romance
Me and my wife are both at home. I am sitting reading blogs upstairs, my wife is sitting surfing the Internet downstairs. She calls me on the cell phone to find out what I am doing. How can we make it even more "moder"? Ah, of course... :)
My kids sang to Don Sinety!
A few years ago, I (and the whole family) went to Mystic Seaport, CT, and we heard Don Sineti singing. I bought to buy a CD of his, "The Dog Watch". And my kids absolutely fell in love with his songs! They liked "Frog Went a'Courtin'", and they liked "Three Men Went a'Hunting", but they absolutely ADORED "The Tattooed Lady". They learned it by heart, and sang it all over the place (company permitting).
Well, this year, we went to Mystic again, and we fond Don, and the kids sang the Tattoed Lady to him! He laughed his head off! It was the highlight of the day. And the next day, the kids gave a rousing rendition of that same tune at the Kids' Workshop. I was very proud!
Well, this year, we went to Mystic again, and we fond Don, and the kids sang the Tattoed Lady to him! He laughed his head off! It was the highlight of the day. And the next day, the kids gave a rousing rendition of that same tune at the Kids' Workshop. I was very proud!
Smart Car
So I've seen one of those Smart cars in a strip mall parking lot. The thing is loudly proclaiming one of two things: either "My other car is a minivan", or "I don't care to have kids and will end my days alone in nursing home". And I think the later is far more likely.
The popularity of Smart Car in Europe goes a long way to illustrate their demographic problem....
The popularity of Smart Car in Europe goes a long way to illustrate their demographic problem....
Saturday, June 21, 2008
Adventures in plumbing
We had a drain in one of the sinks that would not work. Three different plumbers looked at it, and no one could figure out why it is so. It drained fine when the flow of water was low, but then, as I increased the flow and the water overwhelmed the drain hole, it would start making bubbles, and stop draining.
Clearly, the problem was in ventilation. For the water to drain, air needs to be provided to take its place as the water goes down the pipe. Not enough air was the problem. But how to fix it? One of the plumber cut in a vent with a one-way valve to let the air in - no dice.
Finally, one day the faucet broke. The little plastic nuts that held it to the sink cracked in two. I procrastinated for a while, but recently I finally got around to replacing it.
Now, here in the US, it seems that when you buy the faucet, you also get the drain pipe that goes from the drain in the sink to the elbow under it. Seems like a waste to me, but I guess it allows for matching the faucet and the ring around the hole. Since my old faucet was chrome, and the new was chrome too, I debated with myself whether I should just leave the old drain assembly alone. I was glad I did not.
Turns out, the plumber who installed the drain first was an incompetent SOB. In every sink I ever seen (even the ones in Russia) I noticed a presence of a hole in porcelain, high up on the edge of the sink. I always thought that the hole was for "emergency drain", in the case we plug the normal drain and forget to turn off the water. Well, I was wrong. Turns out, the hole goes through the body of the sink, all the way to the big drain hole, and joins it. The drain hole assembly is not a solid pipe - it's got 4 huge cutouts on each side. Through these cutouts the hole on the side of the sink delivers - air! - for the water to go down. In my case, the left-handed baboon who installed the sink filled the entire drain hole with the plumber putty, plugging the little hole on the side that provided the ventilation. And the 3 or 4 plumbers who saw it since could not diagnose the problem.
Of course, after I replaced the drain assembly and cleaned up the vent hole, I now have a perfect flow in that sink. But I still deplore the level of skill in our local handymen. One of those who saw this sink was a plumber with 20 years of experience! And no one could figure out what's wrong. I really expected better from US workers. Do they not care about customers? Do they not care about their own craft? Pretty disgusting...
Clearly, the problem was in ventilation. For the water to drain, air needs to be provided to take its place as the water goes down the pipe. Not enough air was the problem. But how to fix it? One of the plumber cut in a vent with a one-way valve to let the air in - no dice.
Finally, one day the faucet broke. The little plastic nuts that held it to the sink cracked in two. I procrastinated for a while, but recently I finally got around to replacing it.
Now, here in the US, it seems that when you buy the faucet, you also get the drain pipe that goes from the drain in the sink to the elbow under it. Seems like a waste to me, but I guess it allows for matching the faucet and the ring around the hole. Since my old faucet was chrome, and the new was chrome too, I debated with myself whether I should just leave the old drain assembly alone. I was glad I did not.
Turns out, the plumber who installed the drain first was an incompetent SOB. In every sink I ever seen (even the ones in Russia) I noticed a presence of a hole in porcelain, high up on the edge of the sink. I always thought that the hole was for "emergency drain", in the case we plug the normal drain and forget to turn off the water. Well, I was wrong. Turns out, the hole goes through the body of the sink, all the way to the big drain hole, and joins it. The drain hole assembly is not a solid pipe - it's got 4 huge cutouts on each side. Through these cutouts the hole on the side of the sink delivers - air! - for the water to go down. In my case, the left-handed baboon who installed the sink filled the entire drain hole with the plumber putty, plugging the little hole on the side that provided the ventilation. And the 3 or 4 plumbers who saw it since could not diagnose the problem.
Of course, after I replaced the drain assembly and cleaned up the vent hole, I now have a perfect flow in that sink. But I still deplore the level of skill in our local handymen. One of those who saw this sink was a plumber with 20 years of experience! And no one could figure out what's wrong. I really expected better from US workers. Do they not care about customers? Do they not care about their own craft? Pretty disgusting...
Tuesday, June 17, 2008
I thought this was a doctored picture...
A judge like this cannot possibly be objective. How he got his position I don't know, but if he has a modicum of respect for the law, he should just resign. Of course, he has no respect for the law, or he would not be hanging those pictures in the first place. To the likes of him, the law is just a cudgel to bludgeon opponents into submission.
Deeper view of evolution and intelligent design
To continue the line of thought started here: Another remarkable thing about the cdk007's computational experiment was his setup of components and heredity rules. As he (she?) says himself, you need "living" component to have an evolution. It's not quite clear what "living" means in the context, so I get to interpret it my way: capable of forming useful combinations spontaneously. The very nature of the elements has to be designed (there is that word again) to allow for combinations that are useful in certain circumstances. For example, we could add glass spheres containing sand to the set of elements, and then we'll have an evolutionary path to sand clocks. Without such spheres, our time-measuring creatures can't survive in a harsh acid environment, for example.
Which brings me to my less defensible and more important point. When you think about an infinitely intelligent being as your "intelligent designer", you have to conclude that for it there is no difference whether to think one step ahead and just create organisms, or think a huge number of steps ahead and create the elements that organisms will be made of, or think an almost infinite number of steps ahead and create the physical constants that make all the elements possible, or, ultimately, think the truly infinite number of steps ahead and create an infinite number of layers in the phisical world, all of them discoverable by science, all of them explaining one another, and all of them set up just so for intelligent life to emerge.
I admit this is rather fanciful, but without this idea, what you have is essentially random world. And how do you explain the amazing coincidence that the biological object developed for not falling out of trees was usable, unaltered in its biological essence, to comprehend the mysteries of the smallest and largest things in the Universe? What gives us the confidence that our scientific problems are all solvable and worth struggling with?
Which brings me to my less defensible and more important point. When you think about an infinitely intelligent being as your "intelligent designer", you have to conclude that for it there is no difference whether to think one step ahead and just create organisms, or think a huge number of steps ahead and create the elements that organisms will be made of, or think an almost infinite number of steps ahead and create the physical constants that make all the elements possible, or, ultimately, think the truly infinite number of steps ahead and create an infinite number of layers in the phisical world, all of them discoverable by science, all of them explaining one another, and all of them set up just so for intelligent life to emerge.
I admit this is rather fanciful, but without this idea, what you have is essentially random world. And how do you explain the amazing coincidence that the biological object developed for not falling out of trees was usable, unaltered in its biological essence, to comprehend the mysteries of the smallest and largest things in the Universe? What gives us the confidence that our scientific problems are all solvable and worth struggling with?
Saturday, June 14, 2008
Intelligent design in genetic algorithms
Recentluy, with the help of Programming Reddit, I found this YouTube video: "Evolution IS a Blind Watchmaker".
The aothor, cdk007, purports to show that Intelligent Design hypothesis is false. Mind you, at the very best he proved that that hypothesis is not necessary. However, in reality, the video illustrates two different, less important ideas: "genetic programming is hard", and "Intelligence hides in strange places".
In my programming life, I am periodically tempted to employ a genetic algorithm. And every time this happens, what stops me is the very hard task of writing the selection function. The hard part is keeping your ideas of what the answer should be out of your selection function. If you write it in such a way that _your_ solution gets advantage just because it's yours, you may as well code your solution directly.
This is what happened to cdk007. His stated selection function is "better measure time". However, then he goes on to give survival advantage to pendulums over other combinations of gears and rods. He even says: "Pendulums swing at a regular pace, therefore they can be used to keep time". Well, pendulums are very useful, but from the perspective of the Blind Watch Maker, this fact is not known! Pendulum not connected to any springs just hangs there motionless. From measuring of time point of view, this is no better than a spring that simply unwinds. In fact, it's worse, because at least the spring can be used as a sort of sand clock without sand.
So here is the real selection function: anything that moves is better than things that do not move. Things that move at an even pace are better than things that move fast at first and then slow down. Things that move at the right pace (say one rotation a minute) are better than those that are too fast or too slow.
The challenge would be to re-write the selection function on these lines, and see how many generations the clocks will take to emerge. If the code was in Python, or any other language that has a free environment, I'd do it myself. As it stands, I'll send an e-mail to the author. And then may be I'll have to do it myself anyway :) .
So in this particular case, the intelligent design was hiding in the selection function. You see, no one doubts that combination of mutation and selection can produce dramatic changes. You only have to look at any dog to get a proof. The problem with evolution is that it's hard to imagine how complex systems arose, thee systems that had to be composed of multiple mutations, where each individual mutation was indifferent or even detrimental to survival. The clock problem illustrates that the selection has to have knowledge about the future in order to produce the desired results.
There is even more interesting point in the clock video - the point of intelligence in the set of components. I'll consider it in another post.
The aothor, cdk007, purports to show that Intelligent Design hypothesis is false. Mind you, at the very best he proved that that hypothesis is not necessary. However, in reality, the video illustrates two different, less important ideas: "genetic programming is hard", and "Intelligence hides in strange places".
In my programming life, I am periodically tempted to employ a genetic algorithm. And every time this happens, what stops me is the very hard task of writing the selection function. The hard part is keeping your ideas of what the answer should be out of your selection function. If you write it in such a way that _your_ solution gets advantage just because it's yours, you may as well code your solution directly.
This is what happened to cdk007. His stated selection function is "better measure time". However, then he goes on to give survival advantage to pendulums over other combinations of gears and rods. He even says: "Pendulums swing at a regular pace, therefore they can be used to keep time". Well, pendulums are very useful, but from the perspective of the Blind Watch Maker, this fact is not known! Pendulum not connected to any springs just hangs there motionless. From measuring of time point of view, this is no better than a spring that simply unwinds. In fact, it's worse, because at least the spring can be used as a sort of sand clock without sand.
So here is the real selection function: anything that moves is better than things that do not move. Things that move at an even pace are better than things that move fast at first and then slow down. Things that move at the right pace (say one rotation a minute) are better than those that are too fast or too slow.
The challenge would be to re-write the selection function on these lines, and see how many generations the clocks will take to emerge. If the code was in Python, or any other language that has a free environment, I'd do it myself. As it stands, I'll send an e-mail to the author. And then may be I'll have to do it myself anyway :) .
So in this particular case, the intelligent design was hiding in the selection function. You see, no one doubts that combination of mutation and selection can produce dramatic changes. You only have to look at any dog to get a proof. The problem with evolution is that it's hard to imagine how complex systems arose, thee systems that had to be composed of multiple mutations, where each individual mutation was indifferent or even detrimental to survival. The clock problem illustrates that the selection has to have knowledge about the future in order to produce the desired results.
There is even more interesting point in the clock video - the point of intelligence in the set of components. I'll consider it in another post.
Monday, June 9, 2008
Java Collections Hell
I've been doing some coding in the bowels of JBoss J2EE system. One of those day I'll write a Daily WTF post on the wonders of 6-layer system that takes 5 people to adjust anything. For now, I just wanted to mention this particular piece of Java Hell.
void addList(List list)
{
// do stuff
}
void doValuation(List instruments, int[] thingsToCompute)
{
addList(instruments);
addList(Arrays.asList(thingsToCompute));
}
Here is the question: what gets passed to the addList in the second call?
List? Silly you. Compilation Error? How dare you!
List
Nice Java!
void addList(List
{
// do stuff
}
void doValuation(List
{
addList(instruments);
addList(Arrays.asList(thingsToCompute));
}
Here is the question: what gets passed to the addList in the second call?
List
List
Nice Java!
On fairies
So there we are, going home from Kung Fu Panda. Michael has an exited news - he lost a tooth during the movie! And he was happy to see a "compliment to fat people" (his daddy is not the thinnest man in town). Naturally, the conversation turns to Tooth Fairy. Daniel, ever a realist, tells Michael and me that Tooth Fairy is indeed your parents, in our particular case probably Dad (me). Michael counters that he just does not care, Tooth Fairy is more fun. Daniel, exasperated, asks - is the allowance is also delivered by a Fairy? And then inspiration strikes me. Yes, says I. The allowance is delivered by
Fat and Hairy
Allowance Fairy.
Much hilarity ensues.
Ain't I proud with myself :)
Fat and Hairy
Allowance Fairy.
Much hilarity ensues.
Ain't I proud with myself :)
Monday, June 2, 2008
Feeling of Lispness
I freely admit that I am no Lisp programmer. I just admire Lisp from afar and theoretically. And yet recently I managed to experience a Lisp-like and C-like approach in certain code - all while staying in C++.
At work I deal with some nasty mess written 15 years ago for X Windows, using GUI toolkit that nobody remembers any more. It was initially straight C, but now has a lot of C++.
I am trying to implement a GUI testing support for that beast. Some pretty cool idea, even if I do say so myself - I'll write it up later. In any case, the GUI toolkit has no concept of a "standard" listbox. Each listbox is completely custom, drawn from opaque ClienData for each cell.
To extract strings that my testing toolkit can handle, I had to somehow intercept the drawing routines. All 200 of them. Preferably w/o disturbing the existing code. So I came up with this ingenious schema of moving the drawing code into a body of a class, where the drawing functions would be class methods. I felt it to be somewhat like a manual version of a Lisp program, code operating on code and changing it.
However, since that was C and C++ and not Lisp, the actual implementation was smelling worse by the minute. Completely unhappy with the mess I created, I went to a coworker for advice. He, being a simpler man altogether ('simple' as opposed to 'easier', the right kind) suggested that I should intercept calls to drawText in the common library used by 99% of our list boxes. So now I install a callback in one place, and no code changes are needed anywhere else. Perfect C-style solution for the C environment. No Lisp feeling at all, but it's beautiful.
At work I deal with some nasty mess written 15 years ago for X Windows, using GUI toolkit that nobody remembers any more. It was initially straight C, but now has a lot of C++.
I am trying to implement a GUI testing support for that beast. Some pretty cool idea, even if I do say so myself - I'll write it up later. In any case, the GUI toolkit has no concept of a "standard" listbox. Each listbox is completely custom, drawn from opaque ClienData for each cell.
To extract strings that my testing toolkit can handle, I had to somehow intercept the drawing routines. All 200 of them. Preferably w/o disturbing the existing code. So I came up with this ingenious schema of moving the drawing code into a body of a class, where the drawing functions would be class methods. I felt it to be somewhat like a manual version of a Lisp program, code operating on code and changing it.
However, since that was C and C++ and not Lisp, the actual implementation was smelling worse by the minute. Completely unhappy with the mess I created, I went to a coworker for advice. He, being a simpler man altogether ('simple' as opposed to 'easier', the right kind) suggested that I should intercept calls to drawText in the common library used by 99% of our list boxes. So now I install a callback in one place, and no code changes are needed anywhere else. Perfect C-style solution for the C environment. No Lisp feeling at all, but it's beautiful.
Subscribe to:
Posts (Atom)