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



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

Webcam test from 4G EEE PC. Gosh, I need more sleep!

Hey, do you know Suzuki makes car? SX4. I certainly didn't know that!

Skype webcam


Picture of skype webcam voip

TuxPaint Sketches


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+.

Wednesday, March 19, 2008

More on eee pc


I did a to enable extra repositories. When I tried to install a program, though, I ran into dependency problem. I'm sure I'm not supposed to update to newer packages, since it may break libraries.

I wish OS designer take notes and allow more systems to use multiple packages/libraries since newer isn't always better. The practice of always overriding libraries is silly in my opinion. It introduces unreliability factor in a system.

BTW, I had to do Ctrl+Alt+Backspace to get my Wacom setting to take effect. Perhaps I modified the wrong file?

Tuesday, March 18, 2008



I did get that little computer. Eee PC. Do you know what this reminds me of? The little Apple //c from Apple Computing. It came out way back in 1984, if I remember correctly. The nice thing about this is that it is compact, light, powerful, and expandable. Storagewise, you can use flash drive and memory card. You can use various printers and even wacom tablet! You can even boot from flash drive, so if you want to try out a new operating system, you can. Try getting Ubuntu on a flash drive!

The first thing I did was to check that the webcam works. The format is Ogg Vorbis. Can I upload this to Google Video? The second thing I did is to go to the web and eeepc wiki site.

Uploaded skype webcam update
fixed Samba, or at least tried to.
Installed wacom tablet! Yay!
downloaded processing, but no good.
Updated virus checker
set webmail, skype, yahoo messenger.

Apparently, python and perl are already built-in. Hmmm... How about pygame? I wonder if it would work? That would be really neat!

It's running Linux. It really is a neat little device. It does burn the battery rather quickly, but I'm not sorry looking at the performance given. I can actually watch various movies. Mpeg, asf, and other formats. Pretty neat! With 8 gig flash drive, you can store and watch a lot of movies!

There will be another model coming out soon with Windows XP. I'm thinking of getting that one as well. The one I have now is 4G (not surf one). The next one would be 8G. That's the one with Windows, although it will still offer Linux ones, as well.

Sunday, March 16, 2008

LifeChess - The importance of being daring.

LifeChess - The importance of being daring.

Being daring and being brave. This is a commonly acknowledged trait associated with male superiority. Witness the movie "Braveheart" starring Mel Gibson, whereupon strength isn't so much portrayed as being brave. Also commonly done is the game where little boys dare one upon another to do brave (often foolish) things to impress others. Yet it is important to distinguish between foolish and brilliance. It is not enough just to be brave. It is not enough just to dare to look in the face of danger and laugh. You must be selective and intelligent in which you choose the manner of displaying your bravery.

Anytime you want to engage in risky behavior, you want to be prepared. You don't want to risk all or nothing unless you have gone so far down that you have no other alternative. People sometimes forget that those daring people really do not take much risk. Yet, often times, it looks as if the people involved is nothing more than a group of daredevils. Nothing could be further from the truth! There is a good reason why plane jumpers carry a spare parachute. Why do mountain climbers has support groups? Cliff climbers carry all those ropes just to be safe. It is important to be daring yet safe. Life last longer that way.

Yet, people do not realize that. Often times, foolish people imitate the activities of the masters, never realizing that what the masters do is very difficult and dangerous. It is only upon hours of preparations and skill building that masters would engage a seemingly risky behavior, except that after all the preparations is all good and done, the danger of tight rope walking is less than that of driving drunk.

If safety is paramount, then why be daring at all? The answer to that, besides being fun, is that sometimes the reward is proportionally higher than a safe alternative. Risk is present in all life's endeavour and it is a fine balance we want to strike between risk and reward. Often, the greatest success goes to the most daring person, all else being equal. It is a desirable quality, then, to stand fast against adversity, to look at danger without fear, and to succeed with greatness, gumption, and gusto.

This also highlights the lesson of Follow Through. Once you set up a motion to take risky endeavour, don't have cold feet! Follow through the action no matter what the consequences! Sometimes, bravery isn't an option. Sometimes, you need to be brave, just to survive. So, prepare, focus, act, and follow through.

The following game was played over the internet. KingHal, playing White, was my opponent. It was late at night when tiredness rule and mistakes are made by both sides. Interestingly enough, when I ran the game with the computer, the computer agrees more with White indicating the soundness of his game. Yet, I won the game due to his blundering. It goes to show that without proper skills and preparation, being daring often equals being foolish. Better to learn that lesson in the comparative harmless environment of a chess board than that of broken bones on street.

White: KingHal
Black: Ramstrong
Date: 2007-10-18
Event: InstantChess - Internet play
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 b5 5. Bb3 (C70 Ruy Lopez - Morphy Defense)
5. ... h6 This is an extremely passive move. The idea is to prevent Ng5. With proper play, Black should not fear this move, but I don't think I can handle the complication arising from Ng5. This is a case of being safe means making a cowardly passive move.
6. O-O Bb7 7. c3 Bc5 This isn't a standard move, but the idea is sound. Both bishop are aiming at the king. Once the center is liquidated, Black has a dangerous attack. As White will need to liquidate the center to press on the attack, this is a good bet to make.
8. Re1 d6 9. d4 exd4 10. cxd4 Ba7 White's game is fine so far. Black is being pushed back defensively.
11. Nc3 Nge7 This is a defensive, developing move, but it is also one of my more cunning move. It looks like I'd castle kingside, when what I really want to do is castle queenside to nestle among my bishops and put the rooks on the opposing king. Again, once the kingside pawns are liquidated, I'd have a dangerous attack on my hand.
12. a3 Qd7 13. Be3 O-O-O The opening preparation is complete. We now enter the middlegame. Black has great attacking potential, yet White has a better game on the account of a more current pressing attack.
14. d5 Bxe3 15. Rxe3 Ne5 16. Nxe5 dxe5 White attacks! Black parries. Advantage: White.17. f3 White has an excellent pawn formation. As I've said, Black will need to liquidate the pawns if he wants to attack.

(Diagram 2kr3r/1bpqnpp1/p6p/1p1Pp3/4P3/PBN1RP2/1P4PP/R2Q2K1 b - - 0 17)

17. ... f5! This move is my kind of move. A daring pawn attack!
18. Kh1? g5! 19. Rc1 g4! While White wastes time dilly-dallying, Black is poised to destroy the pawn chain.
20. Rd3 gxf3 21. gxf3 fxe4 22. fx34 Rhg8 Once the pawn chain is destroyed, Black attacks fiercely. The game is now balanced on a razor sharp point. White is to attack Black, and Black is to attack White.
23. Rg3? This blunder costs White. White would have been okay with d6 attack. Despite all White's preparation, White cowers when he should be courageous. Black's following attack is seemingly effortless, but things could have been hairy for Black, had White been daring.
23. ... Rxg3 24. hxg3 Qh3+ 25. Kg1 Qxg3+ 26. Kf1 Rf8+ 27. Ke2 Rf2+ 28. Ke1 Qg1#

Asus eee pc


My hard disk has a warning of impending failure. I was thinking of getting my next laptop a toughbook, but I remember reading about Asus EEE PC on Popular Mechanic somewhere. I'm glad I checked it out.

It runs on Linux, but staying with the easy mode means you'd never know it. More importantly, you can use the advanced mode and install all kinds of programming goodies, including gnu c compiler, kernel change, and even other OS such as Windows XP or Vista. Vista will run sluggishly.

Good news is that Skype will work with webcam although you'll have to update the software, as does Wacom tablet. Http:// has a comprehensive topic for eeepc. Try looking it up on YouTube. I'm sure you'll like it!

About the only thing is that, instead of hard disk, it uses memory card. Vibration proof, but limited in size. Try getting a 4G (not 4G Surf) or 8G. 8G will come out in Summer for $499. You can get a much better laptop for that price, but not the reliable form factor.

I'm undecided, but I'll probably get a 4G ($399) for now. I can use Linux (Xandros, a Debian offshoot) distro for dev. That would be neat!

4 Ways to be rich


I forgot where I read this, but basically, there are four ways that you can be rich.

1. Luck. You can win the lottery, or found gold in your backyard. You are born a prince/princess.

2. Inherit. Your parent/uncle died and left you millions of dollars. You are part of class action lawsuit recipient with generous disbursement. You marry a prince/princess.

3. Work. You run a business or your company got bought and your boss gives you golden year paycheck to take early retirement. You build a kingdom to be king.

4. Smart. Do no work, have fun, and let time and money work for you.

I don't know about you, but I'm very partial to number 4. :)

Saturday, March 15, 2008

Big Brain DS Weight

It has been 2 weeks, and a few improvements showed themselves. I'm rather disappointed that Get In Shape seems to be maximized, but I do notice that I'm getting better. Better test scores overall.

I get another test score! It went up to 2119. A surprise showing from Coin-parison. I do seem to get better at it. Less guessing, more accuracy. Written Math is still disappointing. Add agency showed promise.

Ace 2119g An investor! 45 platinum

Category Activity Easy Norm Hard
Coin-parison 471 472 *538
Add Agency 373 *421 *423
Written Math 358 410 448
Shadow Shift 430 *471 *520
Get in Shape 573 717 700
Match Maker 393 452 483
HeavyWeight 512 543 480
PathFinder 461 473 566
Boneyard *428 459 473
Sound Bites 348 411 455
Flash Memory 392 422 401
MemoRandom 524 507 507
Missing Link 390 *463 604
Cube Game 593 *658 547
Animal Lines *386 492 508

9 improvements.

Friday, March 14, 2008

3 Steps to Financial Freedom


The title of this entry is "Financial Freedom", not "Rich Beyond Your Dream" Is there a difference? Yes there is!

Being rich means you have a lot of money, or material. Who is the richest in the U.S.? We can say Warren Buffet, but I don't want to be like him. He makes billions each year and all he has to show is a modest house and an airplane. Okay, a JET plane, but the point is that for all his billions, he doesn't know how to have fun. Richard Brandon, OTOH, is all about fun. He understand that money is a catalyst. A means to an end, not an end itself. I'd like to be more like Richard Brandon, except for all the management I'd have to do.

Clearly, then, being a CEO of Fortune 500 company isn't for me. But remember that the goal isn't to be rich. The goal is to be financially free.

What is financially free? It is to have no worry about money. It means that your income exceeds your expenses, WITHOUT YOU HAVING TO WORK. That sounds like something to look forward to in your later years, but you don't have to! You can do it now. Well, keep your day job for now. We'll get to that later.

Now I should tell you the 3 steps that you absolutely must do to be financially free:

1. Develop Personal Discipline: This is something that you must have in order to succeed. Without it, you are doomed to fail. The good news is, you can tailor your approach to suit your personality. Remember: "You are what you frequently do" Aristotles, so develop a winning habit, and you're half-way there!

2. Keep a journal: This is something I can help you. Lots of personal finance expert tells you to track expenses, which is great, but they don't really tell you how. In the end, most effort are either falls short, or a complicated mess that is soon abandoned. I was guilty of the latter, but now I have several levels of spending records for you to choose from.

Keeping a financial journal is of paramount importance, that without it, all hope is lost. With it, you can almost get away without budgeting.

3. Invest Wisely: This is where most people look at the jumble of investment option, and give up. It can be very, very complicated very, very quickly if you let it. Don't let it! Once you know what is important, you can narrow the list tremendously. In this, I should say that having a Wish List is extremely useful. What are the things you want to buy if you have a million dollars? Write it down! That is your million dollars wish list. That is what is important to you. Don't let any financial expert tell you you need a million dollar house in New York if your dream house is a dirt floor cabin in the middle of nowhere.

Thursday, March 13, 2008

Taking Care of Your Money Problem


So, I was just browsing the magazine stand, and in this one, I saw Real Simple magazine, with subtitle "How to solve your six biggest money problem." If you've read my earlier post, then you know I've been commenting on how people are in credit crunch problem paying their cards ahead of mortgage. Well, one of the steps suggested under "I spend too much" is "Try cash." I can tell you that cash is overrated.

It is true that it is impossible to spend more than you earn, but that doesn't mean you can't blow your budget. I still remember taking out a week's allowance on Saturday, and on Tuesday, I looked at my wallet and saw $12 left in it. How can I possibly survive the next 4 days with 12 dollars? I can't, so I just pull an extra $200 out again.

"I save too little" : open up IRA and/or 401k. Contribute the max amount. Any extra goes toward your wish list.

Target-date fund is a new term I should be checking. Money market fund is another you should be checking. Index fund definitely need checking.

"I need a budget": Maybe. I've been able to get away from budgeting for a while, though. Rather than counting your pennies, I subscribe the "Ever increasing balance" money management style, and it seems to work well. Of course, I don't spend money all that much. I'll have more to say to this.

"I need to develop a financial plan": yes, you do. However, it need not be overly complicated. Your million dollar wish list is sufficient. What's that? You don't have a wish list? Well, then, start one!

Looking through the cases, it is interesting to note that the best woman is the one who earns the least. Monthly expenses? $2058 per month, which is close enough to my $2250 per month. Actually, my target is $2000 per month, but as you know, indulgence does have a price. That was with $400 debt repayment plan. So it's even better now. Well, maybe not, since I travel so much.

The point is: more money doesn't mean more money if you spend it all! Personally, I only spent a maximum of 25% of more money, but usually much less.

Wednesday, March 12, 2008

Mt Rushmore


Passing through Wyoming. I feel like I'm on top of the world!

I also passed by Mt Rushmore. It was located just north of Custer, SD. I actually didn't go in since it doesn't look like it's open. Out of season, maybe? Anyway, you can just see George Washington's profile from the parking lot. Crazy Horse if I remember correctly.

Also there's a wax museum. "From George W. to George W.", proclaimed the sign.

Lots of Bison statues and bears, too. There's water park, indoor range, and other entertainment venues. Didn't go to Sturgis, though. It lies West at I-90 exit 32.

Monday, March 10, 2008

Some cool web sites I go to

Ludumdare is a challenge for all those game programmers outthere to just hash/hack/bash out a computer game very, very quickly. Check out the pygame also. Build your own level section.

Freefall is one very clever comic strip. Ideas are original, scientific, and very funny! Note: Robots aren't 3 laws robots because those 3 laws robots works at EPA!

Do you think you know how to draw? Think again! Check out the workshops, they are excellent! Subscription is a must for those serious sci-fi/fantasy graphic artist.

Water into Ice


Well, actually, more like soda into ice. Note that the soda bottle is unopened, and all liquid. Then I open the bottle and pour, but futile, since the soda has turned into icy slush! There's no trick photography. I actually don't know how this happens. This is slightly different than super-cooling effect, turning beer/water into ice.

I believe that the soda is near freezing point and that opening the bottle lowers the pressure quickly enough to tip it into freezing state. Notice that not all liquid turns into ice as it is with super-cooling effect.

Trying out the super-cooling effect would be nice, too. I should try that sometimes.



I was rolling down I80 highway in Nebraska when I saw quite a lot of birds in the air. They're not in any usual flocking pattern, or any pattern for that matter. It was quite a sight. So much for algorithmic flocking pattern.

I also went through a tornado. You know, that inverted cone shaped wind. Not much of a tornado. About 50 feet diameter and about 3 times tall. When I first saw it, I thought "Geez, those birds sure fly low!" Except those weren't birds, but pieces of cardboards. It was quite a surprise going through it.

I wish I have a high-res camera with zoom, so I can take pictures of these. Hmmm, not a bad idea.

Monday, March 3, 2008

Big Brain DS weight

Not much improvements this week, but Memorandom got a surprise following. There aren't that many activities that allows extra large scores to be had. I'm still getting better across the board. I definitely notice a faster brain speed. There have been times when I was thinking, followed by guessing 15 minutes have passed. To my surprise and delight, I found out that only 3 minutes have passed! It makes me want to keep practicing more and more.

Ace 2083g an investor. 45 platinum

Category Activity Easy Norm Hard
Coin-parison 471 472 513
Add Agency 373 391 421
Written Math 358 410 448
Shadow Shift 430 452 504
Get in Shape 573 *717 700
MatchMaker 393 452 483
Heavy Weight 512 543 480
Pathfinder 461 473 566
Boneyard 403 459 473
Sound Bits 348 411 455
Flash Memory 392 *422 401
Memo Random *524 *507 *507
Missing Link 390 456 *604
Cube Game 593 588 547
Animal Lines 381 492 508

6 improvements this week.

Spring is here!


It's an unusually warm day yesterday. I saw so many bikers out! Kawasaki custom made an appearance, ridden by a foxy lady. Lots of cruisers, ridden by lots of people, but couples are out quite a bit. There was a red scooter and an old style Triumph Speedster. The bikes tell me what's popular and that is cruisers. No standards or sportsbike in evidence. A few touring bikes made some appearance, but the bulk of it are cruisers.

What worries me, though, is that the people don't wear helmets. They wear shades, jeans, and t-shirts. That's it. Knowing that accident can happen anytime, that is risky behaviour. I know it's not comfortable wearing all those armors, but freak accident can happen to anybody. Recovery, in case of broken bones, takes anywhere from 6 weeks to 6 months, depending on the severity of the injuries. That's a long time! Can your finances withstand income interruption for that long?

If the news is valid, then the answer is no. People are defaulting on their mortgage to pay off their credit cards. They are in essence, trading their home for consumer debt. That's a dangerous habit to get to. I firmly believe that if you make more than $36,000 dollars per year, then you have it made. If you make that much and you still live paycheck to paycheck, then you are doing something wrong.

Anyway, I do enjoy the warm weather, so warm that maximum AC isn't sufficient. I also start to notice birds flying north. I guess when Daylight Saving begins, it will officially be here. Can't wait.

Bye bye snow! Bye bye leafless tree! Hello sunshine, nice and warm!