Friday, October 31, 2008

IBM Article: Java's new Math

I saw an article about how Java beefed up its java.lang.Math:

http://www.ibm.com/developerworks/java/library/j-math1/index.html?ca=drs-

The author agrees that the Pythagorean Theorem is important, "...that this equation shows up a lot more than in just right triangles". Um, those things that the author listed, are right triangles.

I get OFFENDED by this statement: "The naive approach (for hypotenuse) would look something like this"

public static double hypot(double x, double y){
return Math.sqrt (x*x + y*y);
}

There is nothing naive about it!
The author showed some hardcore C code for Java in bit shifting. I prefer the "naive" approach.

The author griped about log vs. ln:

"Sadly, the Java language's (and C's and Fortran's and Basic's) natural logarithm function is misnamed as log(). "

Um, computer science tends to call the natural logarithm "log". Because common logarithm is of no use in computer science. After all, common logarithm and natural logarithm differ by a constant, so it doesn't matter in order of complexity (yes, that big O notation). log x = ln(x)/ln(10). (go ahead, punch in calculator if you don't believe me).


I see little use of defining hyperbolic trig functions. They are defined in terms of the exponential function. how often does anyone need hyperbolic trig functions?

There is no need to define cubic roots either. x1/3 = exp( 1/3 ln (x) ). So all you need are ln and exp.
How often do anyone use cube root?

Thursday, October 30, 2008

Trig

The election is getting closer! Everyone has seen close-up coverage of the candidates, their VP, and their families.

So the name of Sarah Palin's youngest son is Trig. More people from the English-speaking world are now choosing their own names instead of pulling names from non-villian characters from the Bible.

Interesting name. It reminds me of the long forgotten subject of most people: trigonometry. Not sure if the Palins are thinking the same.

Although "trigonometry" is a long and formidable name, it is such fundamental subject: the study of triangles, right triangles in particular.

2 points determine a line; 3 points determine a triangle (and a plane). It is so fundamental. If you have 4 points you don't know for sure what you get.

In trig, students get introduced to functions, such as sin, cos, tan. They are more interesting than linear or polynomials they encounter in their high school algebra.

The side lengths of right triangles are dictated the Pythagorean theorem. The functions sin, cos, and tan have so many interesting relationships. If you spilled your favorite drink on your calculator and destroyed your cos and tan buttons you can still figure it out.

cos θ = sin (90° - θ) and of course, cos θ =sqrt(1-sin2θ)
tan θ = sin θ / cos θ (so you can figure out tan using sin)

That is just some very basic identities. I don't know why θ is so popular in naming angles. Please, please, Chinese/Hong Kong foreign students, don't pronounce it as thee-da.

What I think is way cool is that the derivative of sin is cos, and it is not super obvious how to derive this.

Sine/cosine can also be represented by a series:

sin x = x - x3/3! + x5/5! - x7/7!...

cos x = 1 - x2/2! + x4/4! - x6/6!...

That is Taylor series derived from calculus: alternate signs, odd powered, divided by odd factorials for sine, even powers and factorials for cosine... interesting isn't it?

Wednesday, October 29, 2008

Windows Defender

What comes to mind when you hear "Defender"? If you are around long, perhaps the classic 1980s video game come to mind. That game was quite remarkable... with a scanner and interesting story line for its days.

Ok, classic arcade is another topic, I am talking about Windows Defender: Microsoft's anti-spyware program.

I was recently hit by some Trojan horse thing! Although my McAfee detected it, give me an alert every 10 seconds but failed to remove it!

Oh my, gosh so many anti-this anti-that programs, I am not so familiar with, what do I use? Gosh what if it whacks my internet connection? what if it starts to delete stuff or do other wacky things? Ok, I DO have backups of priceless pictures and my programs at an external drive.

So I went to Microsoft's site to see if they offer anything free. Oh they do, it is the Windows Defender... Installed it and it WORKED. Oh mine, this is a big improvement over their DOS MSAV thing. Thanks Microsoft! Ok, I rarely say that.

Waita minute, it is Microsoft's stuff that is so vulnerable to attacks.

Monday, October 27, 2008

Dunkin beats Starbucks

Ads all over the place: Dunkin beats Starbucks. http://www.dunkinbeatstarbucks.com.

Waita minute, I see grammar parser error. Third person singular rule violated. Should it be dunkinbeatsstarbucks.com?

Ok, As you can see too many "s" without space is hard to read. Ok, the grammar parser forgives Dunkin.

Starbucks: much stronger taste, more expensive, and strange terms: tall, grande, etc, where "tall" means small.
That adds a bit of a class I suppose.

Starbucks focuses on coffee, Dunkin's original focus is of course donuts. I am not eating those expensive snacks in Starbucks... Donuts are getting much more expensive now!

Comparing coffee... I think I like Dunkin too over Starbucks.

But most Starbucks have nice couches and nice environment to read some newspaper or chat with your friends.
One time I saw some guy with a professional set of chess with roll-up board waiting for his friend to come. That's a great place for games...

I think college students will find it a great place to do homework with wifi around. When I was in college 56K modem was a luxury item (which I don't have!). Oh I didn't have a laptop either :( Even to this date I don't own one.

But both are quite expensive! I am sure the world can use another great coffee place at a dollar a piece for a small coffee. Still great margin in there. Look, I can buy a BIG can for about 10 bucks and it makes lots of cups. But I KNOW, all coffee are not the same.

Financial Tsunami

Lots of people are calling the current financial crisis a "tsunami", including Alan Greenspan.
These folks run out of terminology to describe the current situation.

That 2004 Tsunami killed tens of thousands of people.
That was bigger casualty than many wars or terrorist strikes or earthquakes.

I heard of there are some poor folks with heart problems died because of worrying over the financial crisis. Besides that, has anyone else died?

This is wrong comparison.

Ask some Hong Kong financial analysts, they say "folks, this is worst than SARS."

Was that guy a SARS survivor who couldn't breathe?

I think calling it a tsunami or compare with SARS is a bit overboard.

Look folks, money is outside the body (a standard Chinese proverb). If you bet your life time saving on the stock market you need to check your strategy.

It truly hurts if you or your loved ones are hurt or sick and hurts even more if your doctors drain your life time savings.

With descriptions by experts saying "It's a tsunami. It is worst than SARS. It is going to last", this is going to be a self-fulfilling prophecy.

I will only get scared if FDIC collapsed and everyone lose their life time savings. Hope that won't happen(!)

Do you think if every man, woman and child with a savings account demanding up to their $100,000 or whatever the upper limit is, all at the same time will the FDIC able to handle it? So don't line up draw up crowds to go to your bank to demand money all at the same time!

I think that FDIC is like "government inspected" chicken label, only serve to comfort you.

Many people already start to lose jobs. I will be scared if I am out of work for months.

Is there anything a regular person can do about this "tsunami"? Nothing. So don't need to be scared.

Although the 2004 tsunami was horrible, there were many great efforts to raise funds to help those who lost everything, showing the remarkable positive side of human. Many people voluntarily donate.
Efforts to help failed banks... I am not sure if we can compare it the same way. My tax money involuntarily donated in those billons.

Friday, October 24, 2008

Huge Disgrace

NU Kellogg students got drunk and threw stuff at Sue, the Rex fossil at the Field Museum, at a field trip. (Why bring the students to this elementary school favorite destination?)

Here is the Tribune news link.

Yikes, they even vomit on themselves. Not even rowdy high school students do that.

As a prestigious school, this is a huge embarassment. When I was NU undergrad, some students even get drunk and fell off the lake or fell from roofs of those Greek lettered frat houses and DIED.

What happens to rowdy students who can't behave in high school? They get suspension or even kicked out. What do you do with adult students?

School suspension probably of no use. I would kick them out.

Monday, October 20, 2008

Chinatown on Fire

Recently Chinatown is in the news, twice, with fire.
First, the little museum was burned.
News Link

Then, the Penang restaurant was also burned.
News Link

Fortunately there is fire station right there in Chinatown, and they did a fantastic job of putting out the fire fast.

Penang is one of the better, more distinguished restaurant there (although that sushi isn't that great, and that chicken rice declined in quality recently). I hope they open again soon, with better food.

I remember one additional fire instance from Chinatown... It was the destruction of State Farm and Hong Min...

Forutnately no one was hurt.

A truck was also turned over (probably at high speed) at the 55/Cermak exit on Sunday. I guess it wasn't big deal enough to be on the news.

Thursday, October 16, 2008

Debate 3

Before the debate, I read about that this is going to be an exciting new format. Not podium, not townhall, but face to face sitting down in round table. Oh so it is actually the typical Meet-the-Press format. (The table isn't exactly round.)

Everyone's general observation is this: McCain is angry; Obama is calm.

McCain's attempt to associate Obama with former terrorists and stuff backfired. Negative ads are poor tactics.

When McCain tries to jab Obama, he smiles. When Obama jabs McCain, his eyes roll, as if you forgot to put detergent in your laundry before you hit start.

Patience is a virtue, especially as the country leader and perhaps world leader position.

Whose plans are actually going to work? Is the plan that each candidate propose actually good or bad?
It is hard to tell. Joe the Plumber is going to be better off with which candidate?

What I see is this: both candidates TOGETHER, along with the president, are not able to get that 700 billion dollar bill passed the first time. After all, the president is not the king. It takes cooperation from the whole congress too.

It takes the entire government to agree on things before anything can be passed, and I am afraid neither candidate can do that.

With less than a few weeks remaining, McCain's poll score doesn't look that good. That election map shows Obama may already have 270 electoral votes needed. Perhaps it is time for America to completely change course. But I am afraid that we won't be able to change, because it takes more than the president.

Wednesday, October 15, 2008

Vanished Money

Finance news says so many billions has vanished as the market drops worldwide.

Hmm, just where did the money go? Did the money exist in the first place?

There are people in Hong Kong who were mislead into buying some strange "investment product" and LOST life savings as Lehman Brothers go bankrupt. The big print says "low risk! high interest!". The fine print however says "high risk." They demand government help and the government says "well we can't use tax money to reimburse your investment loss". The bank crooks point to the fine print and says sorry you lost, this is high risk. These poor folks only hope is to use lawsuit to try to get their $ back if they can find a lawyer to crack through their disclaimer.

Even if your $ depreciates over time, it won't VANISH completely. It is best idea to hold some cash. Don't put ALL your lifetime saving into anything.

Wednesday, October 8, 2008

Notable items from Bookstore

1. New Head First books

Visited bookstore again and saw a suprising new Head First books
I saw Head First Physics and Head First Statistics! This series of book has extended beyond computer programming into general sciences.

This unique series is like those For Dummies books, filled with interesting people icons and handwritten notes and often try to be amusing.

However, I don't like this approach very much. I perfer a slightly more serious approach, in programming as well as science.

2.
Guide to Essential Math: A Review for Physics, Chemistry and Engineering Students


What comes to mind when you hear "Essential Math"? This really mean different thing to different people, depending on your age and level.
It could be basic arithmetic if you are an elementary school student or some algebra/geometry things if you are in high school.
Of course for most people, it is +, -, *, / and %, fraction and decimal. (That's it)

This book is for college engineering students. The introduction is most interesting.

So the author was a new professor who couldn't wait to share with his students the profound subject of quantum physics. After a few minutes in his lecture a student
raised hand and asked: what is this curly thing? The object in question was the partial derivative symbol: the cursive d. (I like to call it the flipped-6). Then the author found out some of his students don't know some very basic things such as 1/(x+y) is not 1/x + 1/y,
ln (x + y) also is not ln (x) + ln(y), so he decided to write a book.

The back cover features a young man in a scared facial expression with equations printed all over the place in the foreground.
I recognized some of these equations... Ah, the limit definition of the derivative is there.

The author seems to be frustrated because the students should know the basics.
How come students don't retain any knowledge?
How do these students even get to those advanced science/engineering classes?

I am glad I know a good portion of the math featured in that book. But I am still not ready to tackle quantum physics (and I am not going to).

Friday, October 3, 2008

I am impressed with Paulin's performance

Watched some of Biden vs Paulin debate and I was impressed. Paulin is articulate, charming, warm, and she smiles to the camera throughout. It is huge contrast to McCain who don't even look at his opponent nor the audience. Yes, she is also well prepared and handled the debate very well.

I didn't watch Katie Couric's interview. According to what I read, she didn't do that well in previous interviews.

Joe Biden did fine, pretty much what I expected. Surveys says Biden "won". I beg to differ.
At the end of the debates the families come hug them, much like winners of Wheel of Fortune. Hmm, how come Obama and McCain didn't come?

But remember it is Obama or McCain that America is going to select.

The VP is a backup, and the Constitution gives it one job: to vote when there is a tie in the Senate.