Monday, May 19, 2014

Google honors Rubik's cube

Wow, google's logo turned to a Rubik cube that you can actually play.

This must be some exotic complex html5/javascript thing that is beyond what most people can ever handle. Now even I actually *CAN* solve a Rubik cube using the simplest layer-by-layer method... it is hard to execute on 2D. The Rubik cube itself is amazing. This doodle is amazing. I am very impressed.

I don't know a good way how to capture a swipe...not so sure which axis am I supposed to tweak. YEARS ago I had a Delphi app with OpenGL that I can draw a z=f(x,y) graph. Some effort was put to turn it to Android and unfortunately OpenGL is kinda hard (In Delphi I had some library thing that made it easier). Every Android site/book I've seen give whirlwind examples just works and hard to actually pick out reusable code...Oh well, the world is not waiting for that.

Since the Rubik cube... it seems no other no-battery-required toy ever catch on with such world wide attention. Everyone is playing with their little phones now.

Friday, May 16, 2014

Terrible news.. slash and death

Terrible news here: http://www.cnn.com/2014/05/15/world/africa/sudan-christian-woman-apostasy/ A Sudan pregnant woman sentenced to 100 slash + death sentence because of her Christian faith.

I can imagine believers who have the (precious) freedom of religion pray pray and pray but alas the Lord is probably not going to launch angels to save her like saving Peter. Hey He didn't save all the martyr starting with Stephen (look him up in Book of Acts).

You hear this from the news... and perhaps still a chance to save her if someone is able to tell the Sudan government to stop. Can some diplomat or UN do something? I sure hope so.

Remember the 8 "beautitudes". See Matthew: 5:10: "Blessed are those who are persecuted because of righteousness, for theirs is the kingdom of heaven." and I am sure many people can locate dozens of verses in the Bible about expect to be persecuted in name of Christ. So why be surprised? This happens and happened throughout history.

Waita minute, it does not have to be this way. First, the all powerful being can do something.... But who am I little being to tell Him what to do? Somebody is going to say HE DID! and point to Daniel and the lion den. Can we get a more modern example?

Can somebody buy this little argument: if A is the only god and B is the only god then they are the same (capital) God? Then what's the big fuss about? But who am I little being to tell them this.

So I hope some diplomat or UN do something. Don't give them food aide until you release her!

Dear God, while you busy listening to prayers about this woman... there are 200 other young women kidnapped... can you do something? Only God's almight multi-tasking can listen to all these prayers.

Tuesday, May 13, 2014

#1 Job for 2014... Mathematician

Check this out: The best (and worst) jobs for 2014.
Mathematicians is the #1 job! I find this hard to believe. That mid-level income is fairly impressive: $101,360. And high income and outlook, and low stress!

A tenured professor make much less than they should be: just a humble $68,970. Any one of these are probably more sophisticated than your typical more-money-making co-worker.

But I challenge you to see if you can find such mathematician job. (go to dice.com for example, you search for 'math' and it will give you just a few programming/financial jobs). Nobody pays you for solving simple stuff that you can learn in school (unless you go to teaching I suppose, but look at how much does the prestigious tenured professor make)

I think those have interest in math just MUST also have interest in something else: programming, financial stuff, engineering, etc.

The genuine purity of pure math belongs to those who are real real good (belonging to the professor/research track). You must be top of the top (and I am hell no not).

Think you can be a mathematician? Don't let people discourage you. Take some advanced math classes. That "pre-calculus" is not advanced, ok? Even elementary calculus is not. Those are child's play. I am talking abstract algebra, number theory, differential equations etc. And those are just the beginning. Still survive? Good for you!
Those people who study the real advanced stuff may find themselves in lonely land... not too many people outside your field will have any clue what they work with. Try explaining the greatness of the Green's Theorem to a high school student to see what I mean (I bet you don't remember/know what that is unless you just came out of that calculus 3 final).

Much of the rest of the world can't tell me the significance of the quadratic formula. Nor able to tell you where the 1/3 comes from in the volume of the cone: 1/3 π r2 h. (Hint: spin a little line segment (slope = r/h) about the x-axis with that disk method is one way).

"Mathematicians" being the #1 job? But where are the jobs? Can I find such job to apply? If there is one I probably don't have enough skills. But hey I know far more than most people I encounter.

Monday, May 12, 2014

Hammer and Nail Interview

Check this out. A tough interview question here: http://www.businessinsider.com/ceo-asks-candidates-this-trick-math-question-2014-5

"A hammer and a nail cost $1.10, and the hammer costs one dollar more than the nail. How much does the nail cost?"

If your answer is $0.10 for the nail. Sorry, you are wrong. Probably no job offer. Bye.

Now this question may not be realistic, because for around a dollar you can only buy a toy hammer.

This is a tricky question because you may mentally split up $1.10 into $1 and 10 cents. If you say the nail cost a dime, oops 0.1 + 1.1 is 1.2 not 1.1.

I think the candidates may do better if the cost is some odder value such as $2.30. But then the nail will become too expensive.

Now, I admit. My first instinct was $0.10 too then soon I realize it isn't correct. And I know how to find the answer for sure, but so should all high school freshmen.

Look, first step is to assign variables. h=hammer, n=nail. Write down the information you know.
"A hammer and a nail cost $1.10". So h + n = 1.1, and.
"hammer costs one dollar more than the nail" , h = 1 + n.

Look, you got 2 equations and 2 unknowns, you got a system of equations. And this one is easy. Just substitute that 1+n in second equation into first equation. So 1+n+n=1.1, boom knock 1 out of both sides. 2n = 0.1, so n = 0.05. The nail costed a nickel.

Now the good math student would verify this answer. So the hammer costs $1.00 more so it is $1.05. Add them up you have $1.10. (How do I insert a little square icon?)

Did somebody say Algebra I is useless? It can be job offer vs no job offer.

And if the job interview ask me something like you got a river and you need to move missionaries and cannibals. I WALK OUT. I don't need this job.

Friday, May 9, 2014

Aesop Fable: Ant and the Grasshopper

The Aesop's Fables are treasure chest of great stories for kids. Alas, Aesop was actually a slave in ancient times. It is so incredible that humans enslave other humans and perfectly ok with that for centuries. Ok that's another topic. It is incredible that Aesop the slave can come up with so many great stories. They are MAGNITUDES better than other shallow rhyming wacky stories for kids.

I want to talk about the Ants and the Grasshopper. Yes you probably heard of it. The grasshopper sings and plays all day while talking to ants who are busy collecting food for the winter. Yes winter came and the grasshopper is sorry having no food around.

The moral of the story: there is virtue in hard work, duh.

So when adults tell this story, they may ask the kids audience: so you want to be the hardworking ant or the play all day grasshopper? Did you say "ant"? Now remember your answer.

The version I had say after the winter, the grasshopper learned lesson and know better next year. According to some scientific things I read, grasshoppers actually do not survive winters... they just have eggs waiting to be hatched in spring. Poor grasshoppers have no parents to tell them that they ought to save up food. Ok, that's the grasshopper's life. But we are human here.

Look folks, winter means "retirement". Sounding like some banking guy for a moment: are you saving enough for retirement?

Now ants have no rents or property tax to pay, nor gas/electricity/water utilities. They only worry about food. Ants also don't have outrageous healthcare bills to pay either.

Did you say social security? well it is going to run out when you retire.

"Winter" is something quite horrible to think about. If you don't think about it at all you are singing and playing like the grasshopper. Did you say you want to be ant or grasshopper?

Here is one good thing being human, ants can't put their corn kernel somewhere and have it magically multiply like you can put money in bank and earn interest. Alas, nowadays banks pay so little interest (nearly none).

This means: even if you work hard and save like ants, you still don't have enough to retire if you rely on savings alone as inflation will eat them like locusts. You are working like ants and still be a grasshopper...unless you have a successful career with a ton of $.

This means: 401k is a must. But they can tell your "total return" is -3000% when you retire and you can't do much about it. Invest in the volatile stock market? You can lose money you know.

It is hard to be a winter-surviving ant.

Tuesday, May 6, 2014

A debatable Einstein quote

While waiting around at a local school I picked up this interesting book that sadly is just tossed at a corner in a small pile of abandoned books: Who was Albert Einstein. Now this is just a very small book targeting elementary school readers, far more accessible than a full coverage version such as this one: here.

This Walter Isaccson one is probably very well worth reading but I got intimated by its size. Sorry. Back to the small one.

I got captivated by this quote in the little book:

There are only two ways to live your life. One is as though nothing is a miracle. The other is as though everything is.
Did Einstein actually say that? This quote is actually debatable (probably false), according to some sources. But this is still a good question. I think that children book should only put certain Einstein quotes.

So for you: is everything a miracle? or nothing for you is a miracle?

If everything is a miracle you get to appreciate the world full of wonders. Ooh that electricity let you power that toy car! Just how does electricity work? (Einstein wondered that as a child according to that book) There are many more wonders.

If nothing is a miracle, you just go on your path of life eat-work-sleep cycle until your body wears out. Sad isn't it.

Even if you explore all the wonders of science your body still wears out. At the end of it, both ways to live your life is pretty much the same?

There are many more things in that little book that I think some kids should find it interesting.

For those who has some interest in science, I encourage you to read some Einstein. Some of it is not impossibly difficult to understand. When you read Einstein, you may wish you know more "mathematical apparatus."

Friday, May 2, 2014

The most popular programming language

Oh this may surprise you, it is not the ubiquitous Java.... It is Python. See here.

and Java has -11%. Not sure why people are running away from Java.

Look at job openings. Do you see a lot of Python openings? I don't. You probably can find more Java/C# jobs. But just programming language IS NOT ENOUGH. All of these languages give you different ways to do conditions loops etc.. but people want the frameworks! Spring and/or Hibernate! No experience no talk. A fundamental problem here is how do you get the experience when you don't get to work with them for real.

And Python is most popular among new learners? See here.

And I fail to share the enthusiasm. Python is a somewhat like C. Where are your parentheses? Where are your blocks? I am so used to braces and blocks.

I think a more preferable approach is start with C, then go to "the better C" (I'm like oh yeah?) C++. Then head to Java so you truly appreciate its improvements over its granddaddy C and its daddy C++. Then head to C# to appreciate power of the must-have Visual Studio in Windows land. Drag buttons drag fields set onClick event make it do something.

Yes, Python's interpreter provides instant feedback but I think I would prefer Groovy instead if I need such thing.

Windows should REALLY come with a programming language out of box like DOS (and other old computers that) comes with BASIC in 1980s. Include Visual Basic or C#! Let people easily crank out programs to appreciate their computer's power. Yes I know it is free download but what a hassle. Sure. you can write a html/javascript program on Notepad and use your browser to run truly lean-and-mean-and-portable code. But I can't make it read my own local files for instance.