Monday, April 7, 2008
Iowa Harvest
Monday, March 31, 2008
Programming for Beginner
I saw this Linux Format Special promising beginners to program, among other things, web browser, text editor, news readers, and web servers. While those aren't really that hard and quite doable, I was rather skeptical that a beginner can do all this in the rather thin format the magazine promises.
It turns out that most of the programming projects is what I call "LEGO Programming". Cut and Paste. Drop in packages and libraries. While there's nothing wrong with LEGO Programming, it isn't something you say in the same breath as "a programming wizard."
Sorry to be harsh here, but using packages and libraries ranks below cutting and pasting code. Even cutting and pasting code is pretty low on the scale. So don't think just because you can use a "60 megabytes Microsoft Visual C# Express" suddenly makes you a programming wizard. I'm not saying you can't be a professional with it, just not a wizard. Actually, though, I've seen more "script kiddies" professionals than not. Probably due to the need of those technical school to pass on certificates to whoever walks thru the door.
I still remember the time when us computer programmers were men. And we were REAL men. We don't eat Quiche. And the women were ... Practically non-existent. Looking back at it, probably because we men were lacking and any potential target means we hit them hard and fast whenever one present herself. They don't last til next day, if they showed up at all. But hey, that what we men do.
Anyway, the thinking of a computer programmer is different than that of a designer. LEGO Coders merely built a program using existing pieces, but not something new. That's not computer programming! Take a look at this code (p. 66):
3 letters or letters or less = 0
between 4 and 5 = 3
between 6 and 8 = 5
between 8 and 12 = 7
more than 12 = 8
Any computer programmer can tell you that the specification is bad. So is 8 a 5 or a 7? The code makes it clear, but the specification needs rewrite.
if (pwd.length>3 && pwd.length<6) strength+=3
else if (pwd.length>5 && pwd.length<9) strength+=5
else if (pwd.length>7 && pwd.length<13) strength+=7
else if (pwd.length>12) strength+=8
You can see the overlapping ranges. Better is this way:
if (pwd.length>12) strength+=8
else if (pwd.length>=8) strength+=7
else if (pwd.length>=6) strength+=5
else if (pwd.length>=4) strength+=3
It's not rocket science. Simply by re-arranging the checks, we can clarify the logic tremendously and save computing cycles to boot. This is a common rookie mistake. I say rookie because it's not that hard and experience will eventually let the rookie know the efficient way to do things. That is computer programming.
Sunday, March 23, 2008
Death by Stingray
So, a woman got killed by 500 lbs Stingray that leapt out of water in Florida. I didn't know that stingrays, spotted or not leap out of water, but apparently they do. Better be careful venturing out of water next time and bring a bigger boat. Remember that wild life ARE wild.
Friday, March 21, 2008
Lottery
I bought a lottery ticket today. I know the odds of winning is terrible. What's more, the jackpot is a paltry 2.4 million dollars. But I have my reason and that reason is, I saw a falling star last night. It was a good one, too.
I think I managed to say "Win Lotto Jackpot" before the shooting star petered out. Well, maybe just "Lotto Jackpot" without the win. Thanks to my big brain, shooting stars falls slower, so it's enough time for me to think of these things.
Anyway, I decided to just get some tickets. Who knows? Maybe I do get lucky.
Speaking of payback, lottery isn't a good deal. In fact, it is terrible! You don't actually get 20 million dollars. You actually get 1 million dollars a year for 20 years. There's a quick pay off option, but it will get you only half.
So you only get 10 millions out of it. Plus you have to pay tax, so 7 millions left. Not a bad deal for cheap tickets, right? Well, considering that prize money is only half the ticket money, that 20 million jackpot comes from 40 million dollars worth of ticket. Imagine that. You put in $40 million dollars in investment money, and only get $7 million back. That's a pretty lousy rate of return.
Another form of luck would be slot machine. That one is also bad, but as far as gambling goes, it is one of the better return of investment out there. Blackjack is the other, but let's talk about slot machine.
I once put a dollar into a penny slot machine, and got 6 dollars back. The temptation to put in a hundred was enormous, I can tell you. Later on, I would discover that the way to play these slot machines is to force the odds.
Let's say you havethe odds of 1 in 10,000 to win the jackpot. Well, you put in 10,000 tokens to play. Then you win the jackpot, the amount of which is hopefully more than 10,000 because other people have played in it.
That's why people put in 2000 dollars in a session and why penny slot machines are popular. You can make money with this. Of course, once in a blue moon, you ran out of money before you win the jackpot. That's the nature of the game. That's how casinos make money. The more money you put in the more chances you'll win and some other losers lose money. If you only put 1 dollar in, may as well kiss it goodbye.
Back to the lottery. How do you win? Well, you wait until the jackpot goes to $100 million dollars, then you go to the lottery office. You say, "The odds of winning is 1 in 12 million. Here's 12 million dollars. Get me the jackpot." In all probability, they'll throw you out. But if not, then the jackpot goes even higher, to your glee.
Of course, you're not the only one. Lots and lots of people jumps into it, and purchase more tickets, and lotto betting programs. The jackpot probably would grow to 240 millions in one week.
When you win, do you win the whole 200 millions? Of course not. You share the jackpot with other jackpot winners, which probably be 20 other people. 240 millions divided by 20 people means you get 12 million dollars. Minus taxes. 8 millions left. So you lose 4 million dollars out of the deal. Plus you have to wait 20 years to get it.
Well, a fool and his money are soon to part. :)
Thursday, March 20, 2008
Video Test
Hey, do you know Suzuki makes car? SX4. I certainly didn't know that!
TuxPaint Sketches



RAMSTRONG
The neat thing about My EEE PC is that it is compact and portable, and also quick to boot and shutdown. The other thing is that once I attached a Wacom Graphic Tablet on it, it works great as a quick doodler! The unfortunate thing about it is that aside from the lack of good built-in paint program, I have forgotten how to draw.
That's not strictly true. What is true is that drawing on a Tablet, and seeing the result elsewhere, such as the computer screen is equivalent to drawing blindfolded, which means, I don't know how to draw! First effort was, how to put it mildly, total junk. Fortunately, I have been active with BigBrain Academy DS with its Connect the Dot program. I use that to spring board to my skill on the tablet. It also helps a lot that the stylus can be detected somewhere above the pad itself.
So, what happens is that I can practice my drawing skills, and that involved, among other things, tracing existing pictures. You can see the result, pretty good, if I may say so myself. That was from ImagineFX Manga edition. Highly recommended reading. Robbie the Robot is a standard character I use whenever I want to doodle. The line in black was traced. Other colors was original. I really like that frog.
I'll probably be posting more about how to draw. It involves a few practice exercises plus lots of repetition, more like 1000+.


