Thursday, July 31, 2014

Funny Programming Jokes

Heard the following that made me chuckle
A programmer had a problem. He thought to himself, "I know, I'll solve it with threads!". has Now problems. two he
There are 10 types of people in the world: those who knows binary and those who don't.

Tuesday, July 22, 2014

Fascinating Windmill Move

Ok, don't laugh at me looking at a kid's chess site.
This is a fascinating game and there is nothing real kiddy about it.
See this link: http://www.chesskid.com/article/view/torres-windmill-attack. This is an example of a windmill attack.

See that white bishop in the picture below. It is getting pinned. Looks like black can safely take it with the pawn. Not so fast, it is white's turn. Can you spot the awesome move that makes white knock out black's pieces repeatedly like a windmill?

Got to see the demonstration on the link above.

Monday, July 21, 2014

Some useful java/javascript tools

There are many, many java/javascript tools out there. Here are some that I recently came across.

JSoup: http://jsoup.org
So you can use server side java to parse HTML and do something with it, such as look for a particular paragraph in an html page on the server side.

Mustache: this thing is a client side template and you can use javascript/ajax to fill it up.
Tutorial: http://coenraets.org/blog/2011/12/tutorial-html-templates-with-mustache-js/

GSON - Google's Java api for json
See https://code.google.com/p/google-gson. Turn your Java objects to JSON, and turn that JSON String back to Java...useful for tossing stuff from server-side to client-side. Another one is called Jackson.

Now, just how in the world can one keep up with the many tools people come up with.

Friday, July 11, 2014

Brilliant marketing by Coke

Saw a couple personalized Coke 20 oz bottles...

This is the Share-a-coke campaign. I think this is brilliant fresh idea. You see personalized cups, magnets etc... they don't catch on because you don't need so many mugs and magnets. I have not ever seen this on soft drinks...it may just work.

It probably cost some quite some money to tweak the bottle labels. but it can become collectors' item. And I would imagine there are Mr. Nice Guys go from store to store to find a bottle for his Miss Right.

Can't find it? You can still make a virtual bottle.

Now, let me remind you, Coke is actually not so good for you with that much sugar. 20oz of it is more than anybody's daily allowance! If you do drink Coke, this should not be an everyday drink!

Thursday, July 10, 2014

9 courses for college

See the The 9 Courses You Need To Take In College from Business Insider. I agree with most of the list.
  • Public Speaking - absolutely! But this one may be hard to score high and what is or is not a good speech is somewhat subjective. My lecturer records my speech and gosh I don't want to watch myself talk. You WIN if you can speak well in public.
  • Chemistry - somewhat agree. but a high school level class may do just fine to get a basic understanding...
  • Personal Finance - unfortunately my college doesn't offer this, but can probably be an chapter of another class (to understand that power of compound interest)
  • Critical Thinking - yes, students should be encouraged to be able to think. But how do you actually teach such thing (going into never ending philosophy debates)
  • Calculus - the merit of calculus teaches you break down a complex problem? I beg to differ. More later.
  • Professional Writing - absolutely! students need to write!
  • Computer Hardware and Science - absolutely! just programming is not enough. Get to know the logic gates and at see a 7-segment little circuit working!
  • Foreign Language - yes! so you appreciate English is actually easier than many foreign languages... fewer accent marks, fewer rules, etc.
The little section about calculus on that article I tend to disagree... breaking down a problem into smaller pieces is basically in every subject you encounter... not just in calculus. And estimation? what part of calculus focus on that? oh you mean Newton's (brilliant!) method?

Calculus is a huge leap from any previous high school math courses including the shy pre-calculus curriculum. I am against calling it "college algebra" . "Algebra 2" or even "misc math" sound fine :) That epsilon/delta and boxes of Theorems with names like x.y is just too daunting for most. Besides me, has anyone write a book without naming Theorems chapter.number that give little meaning? I do believe calculus can be offered more informally as an option (omitting glorious details of epsilon delta, and skim on details of some glorious proofs).

Just let them know we are dealing with rate of change and hope people get comfortable with the perhaps daunting notation of dy/dx that looks like a fraction but not really. Did you say it is not a fraction then what the heck are you doing with that dx in that integral with respect to x. Oh why are you letting dv = something in integration-by-part? Lot of comforting assurance of "it is just notation" is needed throughout... But the idea is: let student polish their problem solving skills through calculus. Calculation not rhetoric!

So yes, calculus should be among those courses that students need to encounter in college... because it is such triumphant human intellectual achievement. I wouldn't call someone fully educated if not seen calculus. Through perhaps daunting problem solving you get to use your brain to develop problem solving skills. When the Fundamental Theorem is introduced the class should stand and applause... as it free you from the trapezoid rule and other techniques in collecting the sum of little shapes under the curve.