Tuesday, December 16, 2014

Java: formatting text

Nowadays everybody says learn PHP, Python as first language. I beg to disagree. Don't forget C and Java! I even heard people write forget C and go C++ first. This guy is completely cluless.

C's printf is so useful in text-based things, and it is still needed today... to insert your variables in text. Sure, just add them and it works just fine. Then some guy will say dude Java String is immutable please append with use StringBuffer, and then another guy will say dude, use StringBuilder. Yes, this has to do synchronized or not, like that classic interview question that make some even seasoned java developer wet their pant during interview: Vector vs ArrayList. But it is still clumsy... and printf is nicer, especially if your text to display is some constant. The original Java did NOT have printf... but it got added later a long while ago. And there is this MessageFormat thing that works similarly too.

import java.text.MessageFormat;

public class Test {

 public static void main(String[] arg) {
  int a = 10;
  String name = "John";

  Object[] testArgs = { new Integer(a), name };

  MessageFormat form = new MessageFormat(
    "1. My brother {1} is {0} years old.");

  System.out.println(form.format(testArgs));

  String result = String.format("2. My brother %s is %d years old.",
    name, a);
  System.out.println(result);

  System.out.printf("3. My brother %s is %d years old.\n", name, a);

 }

}

Tuesday, December 9, 2014

My Third Android Phone: Moto G

My first Android phone was a gosh low end very basic one on Froyo with small screen. My first Android programs was developed there. It is crappy in a lot of ways but good for its time.

My second Android phone was a Nexus 4, for about $400. Stylish and cool and good developers' phone that keeps API updated. Shiny stylish. It's got Lollipop (not that it is a super ground breaking update except the long needed flashlight) Alas I cracked the back (but no big deal). Alas that power chord choked the tab so I can't USB (that's still ok cause I can get pics from cloud), although can't code anymore. Alas then part of the screen won't receive clicks! That's the region I use the 9 dot pattern the most. This means: the screen can get worn out. That's... still ok after I changed pattern. but it is now hard to tab on my voice mail's password. and then sometimes it will scroll and tap crazily. Gosh I need a new phone. It has been 2 years.

Shopping for new phone is unfun. The Nexus 5 and 6 are never available on Google Play. The 5 is reasonably priced. But I am sorry, it is matte not glossy? The 6 is very expensive even if it is available. Nexus has curious naming. Originally Nexus 7 and 10 means the inch size. Now that your phone size has bump into each other what is the next one going to be called? Buy it on Amazon? everything I see is International Version No Warranty.

The other one that has great review is the Moto X. Ooh you customize everything! At checkout it is whooping $549.

Get a contract one you will just eventually pay the same price.

The Moto G you can customize too but with exactly 2 options: white or black. Oh but at under $200. it is supposed to be well worth it.

Ok so I got one. first, the 2 metal bars in top and bottom are completely useless. They are not buttons that wake your phone up. It isn't a very light phone like the new IPhone 6 (that's ok). It comes with a "Launcher" that gives you 4x4 icons. Argh! I have been seeing 5x5 for 2 years since Nexus 4. Completely cannot stand it. It is like running Windows 3.1 when the rest of world running Windows NT... and this is not customizable until I downloaded the Apex Launcher. A huge let down by google. It should come out of box give you options to tweak your home screen and apps display.

I did not need to download such thing for Nexus 4.

When I migrated to Nexus 4... I think all my apps got installed. Hey Google Play knows what I downloaded. Nope. In new phone I got to download each one.

And the Moto G did not even come with a charger that you can break into USB? Even a freaking feature phone has that so it can be charged on a computer! No headphones not even an extremely cheap one.

Bright side: the colors are vivid. Camera is fairly decent. Nice and Loud. Better than not able to click on certain regions.

Soon I may be ready to come back to Android Development.

Wednesday, December 3, 2014

Sophomore's dream

So I came across this interesting named equation in this faboulous book Mathematics Devotion.(in its Appendix). This is the Sophomore's Dream:

Oh you can turn any definite integral into a summation like that? (no, just happens for those cases listed above).

Its proof is gloriously documented in here: http://en.wikipedia.org/wiki/Sophomore%27s_dream

It is kinda unfortunate I actually don't know/recall all of its proofs ingredients... I think I've seen it all. But that proof is way cool.

As the wiki says, oh there is the Freshman's Dream that erroneously says (x + y)n = xn + yn.... for poor freshmen who don't know the binomial theorem. High school freshman should know about the binomial theorem.

But I am not so sure if there are too many (college) sophomore know all the ingredients for the Sophomore's Dream...

The Mathematics Devotional book is fabulously written with great math quotes (but without the hardcore equations) and great looking "eye-candies" of computer generated pictures of fractals and other things.

This is for those who truly enjoys mathematics.

There are too many bullies out there portraying math as nerdy geeky with ugly kids wearing broken glasses taped together. Those who know and enjoy math do not look like that. Hollywood needs to treat science and math with respect. I need to see those math themed movies portraying mathematicians as protagonist.

是可忍、孰不可忍

The Chief Executive of Hong Kong is not able to take this Occupy Movement (Umbrella Revolution) anymore!

News link: https://hk.news.yahoo.com/cy-是可忍孰不可忍-222013941.html

You may or may not like him, but he is able to quote Confucious here.

See its origin: http://www.confucius.org/lunyu/ed0301.htm.

This means: he is not going to take this anymore. Now the police runs out of patience and there is now more police violence against the protestors, and some may be fighting back. Hong Kong is getting increasingly chaotic, but still better than tanks running over.

As I predicted now they are going on hunger strike and they are simply just hurting themselves. My new prediction these young people will simply give in to food and the whole thing will end with nothing changed.

So the 2 month standoff only created chaos and little will ever change, so we just have to BEG the people in power to be a bit more caring for people who don't have a future... Come on, housing is too expensive! But is choosing your own government head and occupying the streets going to get prices cheaper?

So I feel sad for Hong Kong.

Thursday, November 20, 2014

Rolle's Theorem on Scientific American

Good to see the little remembered Rolle's Theorem in Scientific American. A Proof of the Math Fact of Rolle in Short Words. Yes, if you have taken calculus, you have seen it.

The title suggests a short quick proof, oh the challenge is using just in one-syllable words. It still can be longer and more complex than it should be in one syllable words?

Now the Rolle's Theorem actually says something SIMPLE. See this picture again.

Look, in x-axis. mark two positions a and b. Then draw a line from a to b (without going backward or lifting your pen, or you mess the meaning of a function or mess with the requirement being continuous). To land on b, you must have a point c where you are at the highest point or the lowest point, that's when derivative = 0. Or you can do a flat line in which everywhere derivative = 0, in which everywhere is a c.

Ok, what I just mentioned is informal. The language of math requires more formal. Don't like it? Well going to a formal party requires a tuxedo too.

This one is easy to visualize. Why bother make a theorem for this? Because we need to name it as a step to prove something not as obvious.

What's the big deal of Rolle's Theorem you say? It is "a special case" or it can be extended to become the "Mean Value Theorem".. which is a crucial step needed for the Fundamental Theorem of Calculus.

Oh and such British accent to say naught. Isn't that supposed to come from Scientific American?

Wednesday, November 19, 2014

Can Barbie do Computer Engineering

The book titled Barbie: I Can Be a Computer Engineer is saying the opposite. Oh she is inept and needs his (male) friends' help in the game.

Ok, just what's wrong with having an idea and have someone else turn to a real game? Sometimes it is the idea that counts. People liked Pac Man and Tetris for its game play not the nuts and bolts of its code, right? Many inept people get paid more telling people what to do than people who actually know how to make things happen. Is Barbie better off telling Steven and Brian to do something rather than get hand dirty?

Now some ladies are going to be fired up because girls are portrayed as weaklings who can't code. Certainly not true.

People writing Barbie books ought to know better?

Now, what will people think if she needs help from her female friends? um, let's say Anne and Jane?

Now, about "computer engineering"... Is it programming little game involving puppy doing little tricks? To me it has something to do with things like circuits, logic gates, adder, multiplexer things and much more. How many jobs opening on that do you see on these low level things? almost none. How many jobs to do little database programs, little websites? much more.

People writing Barbie books ought to know better.

cos b

I chuckled at this (old) math joke:

You don't get it? tan b, what is it? sin b / cos b of course. You're dividing a quotient... so to simplify, flip the denominator and multiply it! Dividing means multiply the reciprocal. Ah, so the sin b cancelled and you get... cos b (or Cosby).

Do not say this is some nerdy joke. There is nothing nerdy about this.

Ok, I am sure a lot of people out out there don't get it and then say they hate math and then say what's the use of it. Yes, no one asked me to find the sin or cos or tan of anything. But I am proud to know their (simple) relationships.

Yes, that's an old picture of Bill Cosby. Now he is back in the spotlight.. and there are rape allegations against him and this is not the first time. Oh my. He was the Cliff Huxtable that everybody liked. There may not be anymore DNA evidence and there will be smartie lawyers who say well why you waited that many years and all that.

However, there is an absolute answer of he did it or not. If this is true, how horrible. If this is false, how horrible to accuse. Both cases aren't so good outcome.

Thursday, October 30, 2014

Computers and Tyranny

I don't like tyranny. If there is just exactly one way to write programs for your system I don't like. Like if you must have a Mac to write a iPhone app I don't like that. You can use Android JDK and whatever machine you have for Android app. I like that better.

If there is exactly one manufacturer that builds your machine I don't like that. Macs are made by Apple only. I prefer openness like the PC. You can pick your motherboard, memory, hard disks etc and build your own system. But I think nowadays people are going for very affordable laptops and don't bother building own systems.

Windows is not the only thing that runs on your PC either. You can run flavors of Linux. I like that. I like freedom. Can Macs run an OS made by someone else? (Yes, by clumsily running some Windows emulator)

Requiring an OS specific key on your keyboard is also tyranny. You mean I cannot shut off machine without calling the Charm Bar with Windows-C? Not like.

.NET Programming. Nearly impossible without Visual Studios. and you have to learn a new version every couple years? Tyranny.

Java programming. Use any IDE you can find, some are free, all sorts of plugin available for free, all you need is a JDK freely downloadable. I like that.

Wednesday, October 29, 2014

Surface 3 vs Macbook air

Microsoft's homepage features head-to-head comparison between its Surface 3 and Macbook Air. And of course Microsoft's site will declare its product victorious.

Microsoft claims its snapping of idiot Metro apps as multi-tasking. But other than that... the comparison is somewhat valid. Yes, Surface gives you a pen, yes, the Surface give you touch screen and the Mac doesn't. Not everyone needs the Pen... in fact, unless you are a cartoon artist or some sort of designer you don't need that pen? I have yet to find a reason to touch screen, really... But yes, the Surface 3 is a LOT of improvement over its predecessors. It is great that the aspect ratio is now not as oddly long. It is now lighter too.. a product now actually worth considering. But waita minute, why are you not getting a laptop for less money? and... why are there crowds and crowds of people at the Apple Store and nearly no one at the Microsoft Store?

I've read some Surface reviews... there is simply no way to open it up to change/fix anything. The battery is being glued and hard to unscrew it to change any component within. So after you buy it hope all goes well. (But I am not sure how to upgrade/change/fix anything in Macs either)

If the Surface 1 is as good as 3 then Surface has a chance to win. See, people already turned their back on you given the poor RT device and previous Surfaces

To the people who came up of Windows 8. Admit it. You blew it. You messed up. Do you admit you are a LOSER now? that Metro thing didn't catch on and that Start button is needed to come back in Windows 10. Do you admit you are a loser now? the idiot long aspect ratio is being fixed. Just look at what 8.1 gives reveals how idiot 8 was. 8.1 now give you a way to turn off at the Start page... now it has essential things like clock and calculator like Windows 3.1 had (even Windows 1.0 had those I believe).

My Windows 8 begs me to upgrade to 8.1. First it wasn't at the Windows Store when it was supposed to be there months ago. Now a blue bar begged me to upgrade every now and then. I tried. I downloaded but it can't run. Windows 8 frustration continues.

Monday, October 27, 2014

Unpleasant Experience with Apple TV

I am glad my previous company uses Mac... so I get to know what Macs can do, otherwise I live under a carpet. So there is the Apple TV product. No it is NOT an actual TV but a little box that you connect to your TV show you can theoretically show stuff on your mac devices onto your TV. It can even hook up to the store where you can buy movies and songs online (pretty expensive if you ask me).

Setting up is a breeze. 2 wires. 1 for power and 1 for HDMI cable. Can't get easier than that. Good.

Now, how do you show things there. Ok, set up your Wifi password so you are on same network as your device. Ok, the remote control is a bit hard to select the letters but still barely usable (thanks to the idiot design of the enter button in middle, so close to the direction buttons). I hope I don't lose this small thing. So far so good.

Now how do I make things show? On the mac, System Properties -> Displays. Where the heck is the AirPlay monitoring option that I am supposed to have. Oh ok, perhaps my mac is too old.. Ok, what about the IPad 2? It isn't that old. It is running on IOS6 but so what. It is supposed to work.

Google search for answer of course. EVERY google search end up in this unhelpful doc. http://support.apple.com/kb/HT5209.

The ridiculous option is inside ITunes, where you would expect it to be somewhere in System Properties. And it is already idiotic to double tap on the home button to switch task thanks to the idiotic one-button-simply-is-not-enough design.

Dude I DO NOT see that Mirroring On Off switch there.

LOOK! I can send ITunes music onto the TV (so I can use the TV's speaker to listen, that's good). LOOK! there is even an icon on youtube that let me send video into Apple TV. (however, not all site's videos can be sent to Apple TV)

But where is my Mirroring option on the Ipad?

I want to HOLLER to Apple

I just don't think I'll ever find out in my life. What, you want me to bring the Ipad to a "genius" bar at an Apple Store? What if it can connect to Apple TV there but not my house? I need to invite these blue shirt people to my house? Toss it, let's see if there is anything else I can do on the mac. The goal is use the TV to watch things and use its speaker, ok? This is not a demanding request now that I paid $100.

Somewhere I read a help doc that says use Air Parrot for older macs. This is not free... but it worked INSTANTLY. The Mac without the AirPlay option can use Air Parrot! Mission achieved. Waita minute is it because the Mac is old that it doesn't have such technical capability? Simply a lie. Then how come Air Parrot can?

It asked for just $9.99. for a working product I don't hesitate to pay the money it deserved.

It is extremely unfriendly to put that option on ITunes and only if you are lucky you get to see the icon. If not? then you are just out of luck. No explanation. It freaking SHOULD be in System Properties, and let me see an error message or two if something don't work.

I really am not an apple fan.

Friday, October 24, 2014

Hea

You may have seen this term "hea" floating in Hong Kong describing someone who is lazy, relaxing and not so enthusiastic.

It feels weird that this term seems have no written form. But there is. See the Wiki Dictionary for this term here.

Of course, I look forward to finish watching this very interesting TV series: 老表,你好hea!.

"Hea" is exactly the behavior we do not want as a student.

Is this today's students general overall learning attitude? It is quite sad if that is so. And is this today's teacher's attitude toward teaching too?

Students, in order to succeed in anything, this "hea" attitude needs to be out.

Wednesday, October 1, 2014

The Only Numbers You Need To Do Math - Business Insider

Great, another math related article from Business Insider. See http://www.businessinsider.com/numbers-you-need-to-do-math-2014-9?op=1.

8 special numbers to do math? Ooh what are they?

Oh they are: 0, 1, -1, 1/10, sqrt(2), π, e, i

The author simply introduce the number sets... why doesn't the author bring out a Venn diagram or the Russian dolls? He even got the natural numbers wrong. Look, the natural numbers are 1,2,3,... counting the natural way. Have you seen a baby start counting with 0? 0,1,2,3,... are non-negative whole numbers.

Natural numbers, then add 0 to it, the negative numbers, fractions, irrational, transcendental, imaginary.

That's high school student knowledge rehashed as some business article?

And the author didn't bother to show the glamorous Euler identity linking 5 of the numbers above? I am a bit disappointed.

Hong Kong political protests

Hong Kong is in the spotlight... it is in middle of protest... demanding selecting their chief by popular vote and not the 1200 member committee.

This was part of the agreement when China taking over the Hong Kong... this is that "2 systems" part.

Now, please, please re-watch those Tiannamen Square massacre video tapes. Tanks! Bullets! The government can crush you.

Hot blood is not afraid of tanks... give me liberty or give me death you say?

I'd like to remind you. Even the US President is not by popular vote. You can win popular vote and lose electoral vote and still lose. This is a wacky system that no Americans are protesting (they probably should). Even the founding fathers were not in favor of popular votes... why? (go ask a good US history teacher you may get some possible answers).

Now, is a popular elected chief going to make everyone happy, solve all of Hong Kong's problems? I am afraid... not.

Now... do the countries with popular vote elected presidents all run perfectly? Waita minute, over the 100+ years of British rule how come no one demanded electing their own governor?

That housing market need to be more affordable... and if the price ever comes down the poor guys who paid for expensive house will complain... Someone will always complain.

Why has Hong Kong be so successful economically? It's got that freedom, low tax, and all that... (ask someone who knows a thing or two about why a free economy works well) It also has an education system that make kids need to work hard...

So Hong Kong should be preserved... keep that lassez-faire, keep that traditional Chinese (I'm flying back to Hong Kong to protest on the streets if they force simplified Chinese onto it).

I do not want to see Tinannamen Square in Hong Kong, but look, it CAN HAPPEN. The kids won't go away. The government won't back down. Think... "ha, what the government going to do about it?" I was exactly thinking that in 1989. Then comes the tanks.

Tuesday, September 16, 2014

CPS: your neighborhood is classified

In the Chicago Public School system, the city is divided into 4 socio-economic tiers. See http://cpstiers.opencityapps.org/. This map tells you where the richer, more educated people are and those who are poorer. Where you live may affect which school your children can go to.

The ideal world should be this: everyone goes to their neighborhood school. It is easy to get there... should be able to go on foot. Who needs to sing the wheel-on-the-bus? What if your neighborhood school is struggling with ultra low scores year after years and 90% of a single ethnic group? Now, really, failing scores of previous year should have nothing to do with first grade students just entering into a school? But if statistics is of any value, those school that show failure as far back as there was record just likely to fail also even if you send your smart child there.

So in this system, here is what parents do: take their 5-year-olds to tests of arbitrary things and the score will have lasting effect of their life. Can't-go-to-good-school most likely mean failure for rest of life, some are afraid.

Look, what if my 5 year old just won't cooperate with the tester? Just what sort of reading and math ability do you expect out of a 5 year old? To get to a relatively good school you need to get score of 99%+ and a good lottery number. Close to mission impossible for most, I believe.

Alternatively, you can also put up with outrageous expensive private schools, or move to an outrageous neighborhood so a good school is your neighborhood school (which will take you without lottery and test)

Waita minute, that is a wacky system. how come so many of the schools do so poorly, especially the school around my neighborhood?. Do the teachers do anything?

Answer I heard: it is the union. Poor teachers get paid even if they don't teach anything. And poverty have the vicious cycle of poverty->poor school grades->more poverty. Oh now that's sad. Waita minute then why is there any good school then? How do the winning schools work? Oh and there is magnet and charter school types too... adding more complexity...

Spring MVC + Hibernate

I found this CRUD example and got it to run locally on tomcat:

http://www.journaldev.com/3531/spring-mvc-hibernate-mysql-integration-crud-example-tutorial.

with local database of postgresql instead... I needed to put the postgresql jdbc jar onto tomcat's lib, and change that servlet-context file. Also need to update the CREATE TABLE statement as follows for postgres:

CREATE TABLE Person ( "id" serial, "name" varchar(20) NOT NULL, "country" varchar(20) DEFAULT NULL, PRIMARY KEY ("id") );

A running example is worth more than a thousand (if not a million) words.

Thanks to the gentleman who wrote that article. Thanks for writing that maven file. hard to crank that out from scratch. All that configuration files needed... thanks to spring.

Wednesday, September 10, 2014

Scribble Revisited

In school we learn simple programming... Ok, nowadays maybe Java. I was learning C and C++. And in the "real world" back then, Visual C++ was hot new item back then. Programming in Windows was HARD in those days. And Microsoft Foundation Classes (MFC) is supposed to be there to save the day? You may have remember this Scribble example. Gosh did I panic: real world programming is so hard and ugly!

See http://groups.engin.umd.umich.edu/CIS/course.des/cis400/vcpp/scribble.html.

Download that source code and see how UGLY and DIFFICULT this mess is. SO MUCH work to get a scribble going.

HTML5 can do it in so few lines and so straight forward. See http://fahadmustafa.wordpress.com/2011/06/20/scribble-app-with-html5/

Wednesday, August 20, 2014

Depression Kills

The death of Robin Williams sparked world wide mourning, tidal waves of tributes and special magazine issues dedicated to the great comedian/actor.

I especially liked President Obama's tribute, highlighting Robin's various roles:

Robin Williams was an airman, a doctor, a genie, a nanny, a president, a professor, a bangarang Peter Pan, and everything in between. But he was one of a kind. He arrived in our lives as an alien but he ended up touching every element of the human spirit. He made us laugh. He made us cry. He gave his immeasurable talent freely and generously to those who needed it most — from our troops stationed abroad to the marginalized on our own streets.

He was able to make huge crowd of audience to laugh... except himself. Who can understand the pain he's been going through?

He has a very successful career, probably plenty of money, and a loving family. I can see why some people get depressed without a good career, without money, and without a loving family. Oh he has early Parkinson’s... anxiety and depression... Life is just getting too hard for Robin Williams.

He is not the only celebrity ending his own life. This is quite sad.
Doctors and medicines cost tremendous amount of money but still of no help. That's sadder.

Just what can alleviate sadness? I suppose the best thing would be talk it out with friends who are good listeners. But be kind to them. Don't keep repeating your concerns (which to your listeners are simply not concerns). Friends don't just tell them to shut up.

Don't have one? now that's probably the saddest.

Monday, August 18, 2014

Formula found on a Children's book

No, I found a formula not a children's math book... but a children book about HEAVEN.

Here on earth, one way to get to know God is by studying His creation. In our forever home, we will have all the time and tools we need to discover, to explore, to experiment, to create, to design.

Ok, I agree with that first sentence.
Look at that picture, there is the Combinatorics formula. n choose r = n!/ (n-r)!r!. What is this other formula?

Ok, just why is this here?

Now is it formula a creation item? You say so? How come I don't see that in the list of things God made in first thin pages describing the Creation week?

Now, where in the Bible does it say you get to have time to discover, experiment, to create and design?

If heaven is there and you can get there, you get to praise the Lord endlessly and not need to even bother to combinatorics. That formula is human creation (and it is actually pretty easy to derive this yourself).

I think it is scary to put words in God's mouth.

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.

Monday, June 30, 2014

The Uber Conference

I attended the Uber Conference in Denver.

This is the first time I ever attended a company-paid conference... There was a full day workshop that cost $300 alone. It was incredibly costly at more than $2500. Plus hotel of gosh $155 a night if you have the discount. ($200+ if you don't). You will also need car rental to get from the airport to the conference... The total cost is a LOT of $. Unless you are extremely rich you will not want to pay for such education/vacation on your own.

Employers! You really should pay your people x-$4000 and then say you give them $4000 for training expense. The conference is really an employee empowerment... and your employees may probably use less than that each year. You get to hear experts share their knowledge... however, for an hour-and-a-half sessions it is hard to go deep. There were many sessions going on at the same time, so you must choose 1 of many in each time slot.

This means: even if you pay a lot of $, you will not get very deep understanding unless you actually go deeper on your own. And sometimes it is just a lot easier if you get to hear a human talk about things than go through things on your own.

There were some lecturers that I really like. Like going back to school with your favorite professor. The guy gives notes as he goes and put on a shared google doc. The guy even used complex numbers as test case example and then used eiπ = -1 as test case and that immediately strikes a chord with me.

There were a couple sessions I did't like: there was a mean looking guy who don't explain wacky acronyms and the demo shown was a video. The guy didn't even type commands on the keyboard. If you are mean looking I don't care really what you have to say.

There was one guy who can draw a lot of laughter but I don't even know what's so funny.. and I need some slides so I can follow along especially if you don't speak perfect English. It is not radio you know. I want something to look at. I do not understand why that guy get high marks.

Oh there was a session on hardware (Arduino and Raspeberry Pi) and all you show me is a picture of the various ports that I can easily look up myself and show me some blinking lightbulbs? and code already all typed up and running. Didn't get much out of that. People pay thousands I expected a bit more. Little computers... can I make it to play ppt file all day attached to a monitor? Can I attach some wheels and make a toy RC car... Can I turn it to a MAME machine? (apparently somebody have done this one)

I also get something out of what tools people use. I see maybe 80% Mac and 20% PC. and I only saw a couple Windows 8 (I can easily tell by their Start button or lack thereof). I did not see one Surface (that thing is supposed to replace your laptop, yeah right). Many tools (the installations) run only on Mac/Linux! Seems like java developers prefer the Mac. People like SubLime as editor on the Mac... This is the only editor that I know that let you choose files on left pane and show you text on right plane.

Notable sessions I went to:

  • Spring workshop - Spring got easier! That Spring Tools Suite is worth checking out if you do Spring for a living. Look you can just do new->Controller and things will be cranked out for you and it is even easier to do this in Groovy.
  • Groovy - every java developer should take a good look at this. It makes java lot simpler and even fun.
  • Gradle - making builds... makefiles, then ant, maven, now people do gradle... It is interesting to see people got fed up with one thing will then create another.
  • Angular - it seems easy to create a one-page ng-app! But I am a bit nervous so many things behind the scene. I want to see the onclick events and stuff but they are hidden from me.
  • Go - no, not the traditional oh-my-deep-and-difficult board game, the google programming language. This thing has no classes! But you can still do interfaces and stuff and its strength in concurrency. Go whacked the while loop and do-while loop and go with for-loop only.

Basically anything created by Google I have some interested in, ok perhaps except the glasses. I wish I have time to listen to Scala. The designers of Java and Groovy all endorsed Scala! The groovy creator guy even says he would have never created Groovy if seen Scala.

Look, nowadays you need to embrace functional programming and closures. It used to be totally separate paradigm from OOP. Semicolons after each statement are now so passé.

This clojure thing (didn't attend the talks) is like completely LISP! I am glad I remember my LISP things: car, cdr, cons... and of course lambda.

Long live Pascal! Go and Scala like Pascal-style type on the back, unlike C/C++/Java. People do miss writeln in Pascal with println.

The conference makes learning a bit easier because there is a live human being telling you things that you can find on the web... though they have only able to scratch the surface of each topic. Nothing replaces you hands-on working with things for some time.

The conference is like 95% male and 5% female. This is the first time I see long line in the men's room and no line in the ladies room. All presenters use Mac computers.

This is a programmer's vacation. I enjoyed this conference.

Wednesday, June 18, 2014

More Street Fighting

An update of Street Fighter IV is coming! It is the fourth update. I still have not played on one... not willing to spend money on a new gaming system just for this. But I actually should be able to play on the PC... but my graphics card probably can't handle.

More new characters and old characters join. Now there is Hugo, Elena and Rolento.... and I welcome Poison as a playable character! Even without playing for real I can still see some youtube videos in action.

Those super finishes are such awesome animations. Lot more new elements to the game... but still familiar.

Check out Oni, oh my, he is a even bigger badder Akuma!

Big list of characters!

What happened to Alex? He is supposed to be the new main character starting with SFIII. Guess no one liked him. Many of SFIII characters are in. But I don't like the brothers Yun/Yang. I want the Urien/Gill brothers instead!

I lost count on the number of releases since Street Fighter 1 in 1987.

Wednesday, June 11, 2014

IM GM

Instant Messenger is great. I started using it since the beginning. It lets you communicate quickly and quietly even if you are talking to someone who sits next to you. I watch such tools evolve... now onto phones.

More than one people have greeted me with "Hello GM"

Now I did not know I got promoted to "General Manager". Ah it was followed by a question, so I suppose that person wants a better chance of getting an answer so greeting me with glorious title.

Then I realize, oh it must be "Good Morning". How sincere is such greeting.

Then at the end I was greeted with "TY".

My mind already associated "TY" with this guy from Pit Fighter.

So I suppose to really thank someone you should spell it out.

Should I say "SY" at the end of conversation? To mean "See ya" or ... you decide what it can stand for.

Wednesday, June 4, 2014

Perhaps your math education is just shallow

I came across this interesting book review here: http://blogs.scientificamerican.com/roots-of-unity/2014/05/31/how-not-to-be-wrong-book-review/

This chart here captures my attention:

All the math that most people ever had, including that complex looking integral on lower right are shallow stuff. This means, most of you haven't seen any profound things yet. Those on the upper right are difficult and profound. I guess I have to read the book to see what's simple and profound.

Now I have something to say about sin 2x = 2 sin x cos x.

Seen this? All high school students should have. This follows immediately from the Addition Formula: sin (x + y) = sin x cos y + cos y sin x. Remember! sin (x + y) is not sin x + sin y! Don't believe me? Compare sin 90° vs sin 30° + sin 60°. (I specifically chose choices so that you don't need a calculator) Grab a scientific calculator if you don't even remember your special triangles.

Now the proof of the Addition Formula is actually not so straight forward. Draw a right triangle, split an acute angle to x and y.. and assume you know sin x and sin y. Trying to determine sin (x + y) (which is opposite over hypotenuse of that triangle you just drew) is going to be over-your-head for vast majority of people....even for many sharp high school students. Now even if you get that... what if your angle is greater than 90 degrees? Ok, I assure you the Addition Formula still holds for every real x and y. This is not so straightforward. That is why the proof should be in your book. This is why this formula deserves a box around and even worth remembering (I did since high school). Sure, look it up on the web if you're interested.

The author is putting this in same category as 1 + 2 = 3. I would move that to higher up in the shallow-profound axis.

For that integral in lower right... to evaluate that my first intuition would be u-substitution. Alas, does not work. Probably need to try by-part or trig-substitution (and I won't bother actually trying to evaluate this problem from thin air). So yes this is complicated... but still shallow. Most people's entire math education is just shallow... unless you are in graduate school or a professor.

I probably won't ever get out of the "shallow" quadrants... and that's totally fine. At least I understand my shallow topics.

Tuesday, June 3, 2014

Santa Barbara Rampage

Another shooting in America... this time a 22-year old frustrated at not getting a girl... or friends, "rotting in loneliness".... this is his revenge to the popular kids.

He even wrote a long 140 page manifesto which give people (psychologists, news reporters) lots of materials to study from. Not all mentally disturbed shooters can do that. It is unfortunate that people who get this email didn't contact the police in time that could have prevented such tragic shooting.

First, this is tragic... and it probably all started with the divorce of his parents.

and unfortunately the professional help he has been getting aren't helpful enough.

But the more tragic aspect of this is... he is able to get guns... powerful ones. The only fortunate aspect of this incident is that number of death can be higher.

So sure that will generate some talk but nothing would be done. Don't be surprised at all if there are more shootings like this. I am sure he is not the only person rotting in loneliness. You can be the next victim. Even if 99% of the entire population is wiped out still nothing will change. Sorry, your right to live < others (crazy and not crazy)'s right to own guns.

The world should set its expectation straight.

Here is MY manifesto.

  • If you are 22 and have not dated anyone it is perfectly fine. You are JUST 22. Even at 30 and 40 is still fine. Even after that is still no reason to start shooting.
  • Hollywood is featuring every college student having sex with every other college student and just... wrong.
  • You go to school for an education... other things can come later.
  • You are certainly not alone not meeting your Miss Right by the end of college.

Parent of the shooter: do you regret the devastating effect of your divorce?

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.

Wednesday, April 30, 2014

Government says: Don't use IE

The government says don't use IE... any version from 6 to 11. See here. So if you are reading this with it. STOP. Open up Chrome or Firefox. (or your phone, ipad, etc).

Now, article says from 6 to 11... so is IE 5.5 safe? Using IE and get infected is hardly anything new. But are Firefox and Chrome completely safe from other things? I doubt it.

Should you just dump IE and go with Chrome or Firefox? Many people give a resounding "Yes". See here for instance. That ActiveX thing is too easy to misuse.... that standards support is poor, and it is painful to debug a broken IE page when it supposed to work. That F12 tool stinks compare to Firebug and Chrome.

So, perhaps listen to the government this time. Dump IE. Especially idiot die hard corporates stuck on IE7 and not allowing people to install other things.

Ouch a black eye for Microsoft. Wipe that grim off your face, Oracle. Not too long ago Homeland Security say don't use java also. See here

Monday, April 28, 2014

Atari 2600 ET unearthed

Look! The legend is true...Atari E.T. cartridges found at the dump! Details here.

This is a very interesting economics lesson: over production... over predicting demand. and even the market leader can fail.

Ok, 30 years ago there was no internet. If you want to play a game you must own a physical cartridge. And... Atari was pretty much the only game console in town. Its graphics ability is so inferior to games you play with quarters... But given Atari was the only game console even if the game sucks if you want to play you need to put up with it. That Pac-man only face left or right and the ghosts flicker.

Now that home games catch up the arcade industry is totally dead. No one will pay quarters to video games now. But modern games are too immersive you got idiots-who-needs-a-life play all day long.

There was a big 1983 video game crash. Well that wasn't for ME. Most people already played enough and tired of those games but I have not get my hands on it before 1983 unlike the spoiled kids. I spent quite some hours with ancient Atari games until maybe 1986. I did remember seeing a lot of E.T. cartridge available.

E.T. is generally considered the worst game of all time... While it was not super fun, I do think it is not the worst game ever. I was able to finish this I remember. My vote for worst game would be that Swordquest. You basically walk around and have no idea just what you're supposed to do. ok, it is Atari, such low powered machine by today's standard... you just can't expect this to do too much. That Space Invaders and Missile Command were quite successful? But they were so simple! E.T. and even SwordQuest actually has better graphics and have some depth.

Ok I got a question? why dig the garbage for the millions of dumped cartridges?

If you want to play old Atari games, go to atariage.com.

And for those title-inflated senior programmers, architects, software directors who say Atari games suck. I challenge you to write a Pac man game. Even with modern computer with a ton of memory most probably don't even have any clues to where to even start. The Atari has a only few K of memory to work with, for the record, so it is fairly amazing to make a playable game on those old systems.

Tuesday, April 22, 2014

Middle Aged Mutant Ninja Turtles

The Teenage Mutant Ninja Turtles are back... with toys and stuff and a movie on the horizon. No, I was never a big fan of the ninja turtles. It is another 80s TV series that are dormant for years and coming back with Megan Fox like the Transformers. Now if you were really a teenager watching the ninja turtles in the 80s... now you are a middle age guy. Perhaps it may be even better idea to have the turtles grow and introduce some new younger turtles. Even if you do, it will be hard to tell them apart. The TMNT becomes Middle-Aged Mutant Ninja Turtles now.

Now this series has martial art theme wrapped in originally sort of cute turtles... now with increasingly darker theme it seems. So this is a kung fu movie in disguise.. and kids, those weapons are dangerous. But people just like to see action.

It is interesting phenomenon that new movies often need to revitalize old ideas from previous decades, perhaps aiming for middle age guys bringing their kids to the movies. Oh that TMNT video game is extremely difficult (along with the Simpsons too). It is just impossible to go long on a quarter... and gets repetitive if you keep pumping quarters in.

It seems that the TMNT story can be limited... there are just 4 (and no more turtles). Yes there is April and the si-fu, but hard to introduce new characters (like the Transformers can)

Yes you punch bad dudes, rescue the girl, eat pizza... what else?

Thursday, April 17, 2014

SFII CE: Verifying number of possible matches

It was 1992 when the Street Fighter II Champion Edition (CE) came out. The ad in gaming magazine says "It is Boss vs Boss". Wow, now you can see who really can use Guile. (But Guile's power has toned down ever since). Now you can use that M.Bison flaming pyscho crusher! There are other things that forces the game to change... how does Vega do that climbing move when you don't have a cage on every stage?

Look, there is a number on the game cabinet. "78 possible matches".

How do you get that 78? You have 12 characters to choose from, and you use 2 at a time.... and order does not matter (Ryu vs Ken is same as Ken vs Ryu).

That sounds like the need for Combination, with n=12, k=2.

Well I am playing with Ryu, I am not going to bother calculating this.... and 20+ years went by. Ok, it isn't hard to carry this out even without a calculator. The big (n-k)!=10! just cancels out. So you have: 12×11/2 = 66. It is not 78.

Oh did the Capcom guys have it wrong? or did I have it wrong? Look this is a real-life math situation. If you are to draw that cabinet art and your boss ask you to put the number of possible matches you need to do such calculation.

Ah look at the ultimate feature on the lower right: Ken vs Ken! 66 + 12 mirror matches = 78 possible matches! It feels great to solve a problem (like verifying an answer for an odd number question from the back of text book)

Now, can you figure out the number of possible matches for Super? (16 total). Oh in Super-Turbo there is this Akuma! I may wait another 20 years to carry out such calculation. So I am going to use the textbook trick: leave-to-reader.

Wednesday, April 16, 2014

HeartBleed

It is hard not to hear about HeartBleed and its logo. Every where you look: news, company bulletins and emails... it is everywhere.

This is the a bug in SSL with a catchy name and somewhat scary logo... This is the very foundation of security of the internet. Most people will have no idea what this is. Yikes it has been out for so long, just how many passwords are taken? Ok, even if it does not get fixed, how many people actually know how to steal data? Fortunately, not many. There are just so many not-so-sophisticated people out there. But unfortunately it doesn't take too many sophisticated hackers to steal your data and do some damage.

Great coverage of this in Wikipedia: http://en.wikipedia.org/wiki/Heartbleed.

Oh this is... C!

Oh, these OpenSSL guys write their own malloc and free? and oh, this is a bounds checking issue.

It is entertaining to read these code changes: See here.

Now there is some 1 + 2 thing...(probably has to do with particular bits) and pointer madness. I am glad I am not assigned to fixed this.

Such important code... is it properly tested? Alas, if they work with typical QA that I have seen, they will probably ask: "how do you test this". For the record: No bus drivers ask me how to drive a bus. Some will even ask "Did you test this? where is your unit test plan." I hope you work with better ones.

Now is there more vulnerability to this code? I hope there are ethical experts out there who really tested this (and not turn a bug into hacking profit)

Tuesday, April 15, 2014

Divergent Series

If you tour around bookstores or pay attention to the movies... you will see nowadays kids read the Divergent series. Kids have strong demand of good reading materials... They yearn for it. This sure is encouraging for novelists. Now I don't have a clue what this is about other than it must be some teenage heroes and heroines saving the day somehow. (Isn't that an element of just about every story?)

Some teenagers may also encounter a different type of divergent series... You guessed it. A series of numbers when you add them up do not total to a specific number. It "escapes to infinity" as some say. Excellent coverage right on wikipedia: here. (and I actually understand so little of that to be honest)

Now just why the heck do we care of a series converges or diverges. One reason is this: so you can make some use of calculus 101. See here. I find this the least interesting topic of calculus. Yes, you don't need this in "real-life".

But it IS interesting that the harmonic series: 1 + 1/2 + 1/3 + 1/4 +... diverges. Each number gets smaller of course but this is not coming down fast enough to converge as in 1 + 1/2 + 1/4 + 1/8 + ... And in the old days people don't actually have computers that you can write a little summation loop to verify yourself. Here do a little for loop and add 100 items to see for yourself.

One Fish, Two Fish, Are you sure?

You may have seen this (popular) Children book:

While this isn't much of a story some kids may find this book interesting.

Ok, look at its title, just HOW can a book get the title wrong. The number two demands plural.. so it should be two fishes!

I argue with my 4 year old that it should be fishes but I stand corrected. Both fish and fishes are ok. See here. Can you think of another word that has multiple plural forms?

Thursday, April 10, 2014

Responsive Web Design

Heard people talk about "Responsive Web Design"... at first had no idea what they are talking about. Isn't all web site supposed to be responsive? Who would design something that is not responsive and just show the hour-glass icon?

Then later I saw some job opening having that as a bullet. Now that makes me look up what this is.

Oh so it is some style techniques so it responds to what type of device you have. After all, a web page nowadays can be seen on various browsers and also tablets and phones and you want to show things differently.

So you need some clever css techniques. Here is that landmark article: http://alistapart.com/article/responsive-web-design

More in depth discussions, for example: http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/#more-75660

Did you just say "how the heck am I supposed to know?" That's a good question. Usually I focus on coding and let somebody else worry about styles. But I need to have some idea what people are talking about.

Tuesday, April 8, 2014

Goodbye Windows XP

I've read SO MANY "Tech news" article on the end of support for Windows XP. And in most of these articles there are reminders saying Microsoft has made Vista, 7 and 8 since XP. (You must live under a rock if you don't know) So update or virus will get you.

Now if you really bought a machine in early 2000s... you probably need a new machine altogether. You get a decent machine for less than $500. Unthinkable price when XP was first out. You can turn your old old machine into Linux... or just to play old games.

Now, are Microsoft's patches invincible? How many XP machines get infected even if they have all the patches? Even with latest anti-virus running you still can get virus. In general you just DO NOT surf the wild web on Windows machines... too risky. Go only to well known sites. Try a more robust thing such as Android or Chromebook. There is NO registry for virus writers to hack.

Oh and they say 95% of the ATM machines are Windows XP.

Now are the ATM on the web? I suppose they make some webservice call to update your account somehow. Are banks doing anything about it? Doubtful Well they are not adding some smart card chip in credit card for more security. If it cost them money, even little, banks won't do it.

I thank Windows XP for years of faithful service. the oval start button was a eye-opener. It used to be a boring rectangle from Windows 95/98/2000. See, that upgrade worked well. People get prettier stuff from 95/98. It was a positive upgrade eXPerience.

Wednesday, March 12, 2014

Missing plane

So the Malaysia to Beijing plane just... vanished. No distress signal, no explosion reported, nor anything that can detect its whereabout. The stolen passports add new mystery.

Could it be a some terrorist act and a bomb that went off that instantly destroyed the plane? Could it be the communication system got turned off? It is not likely a terrorist event... as terrorists should have demanded something or make a statement? But yikes, this is insanely close to the Kwunming incident... so that probably should not be totally ruled out.

Could it be picked-up by a UFO? and it will eventually release it? Could it got into some sort of space-warp and ended up in another space-time? Ok I know it isn't likely.

But I got a suggestion for the designer of the black box flight recorder... How does installing a permanent GPS device sound??

Thursday, March 6, 2014

Free Wifi

Came across this on a shared Facebook link.

Ugh, gotta solve something ugly to get a password?!

But waita minute there is really nothing to solve here. This is looking the Fourier Series of a function!

This is basically saying rewriting a function as a sum of whole bunch of sine and cosines.

See here for the bottom of this post.

And sadly, I still don't know much about the Fourier Series. I know electrical engineering students need to know this (and still can't find electrical engineering related work after graduation). This stuff is beyond the scope of me being able to read-about-and-learn-on-my-own.

It seems like there are certain knowledge that must be learned through a person and not from dead text. Just what is the human factor? I supposed that it is that I can STOP the human teacher for additional questions if I get lost, or have the teacher draw some pictures or give me an example... something dead text cannot do.

Monday, March 3, 2014

On Math Common Core

Saw some griping about the "Common Core" in education on Facebook.

Rant in progress..... Common Core I HATE YOU and your dumb freakin rules! Thanks to the "brilliant" people who created this ridiculous curriculum my son has no idea what the heck he's doing! I'd love to see them work out these math problems they way our kids have to! Why isn't the way I was taught good anymore? How am I suppose to teach my son how to do word problems when they want the solutions to look so backwards! Example of math homework:

Since I do not know this gentleman I am not going to respond to him and all his friends.

Yes, this "new way" is ridiculous.

Oh here is one gentleman explaining just what this "new" way is doing:

The new way is demonstrating how to add from 12 to 32 by easily understandable smaller steps which are either to next 5s or 10s and lastly to the destination number. Then the added numbers are finally added to get the answer. The way makes sense, isn't it? At least it shows how to get from 12 to 32 by smaller steps
Look folks, math is timeless. There is no "new" or "old" way to do any problem. The goal is to solve the problem, and get the answer.

To the gentleman who tries to explain the "new way", thank you. But these aren't "easily understanding smaller steps". Line up the digits, subtract: 3 - 1 = 2. What smaller steps do you need? And if I ask you to subtract 1000 - 10 are you going to add up your intermediate "easily understandable smaller steps" of 5's and 10's?

In math, we prefer quick method when possible, and the "old fashioned" way is quick.

To the parent: If I were you I'll go challenge the teacher to give me some merit of the "new way". Otherwise the student should just use whatever ways to get the answer. The student should be able to remain using the "old fashioned" way. If the teacher do not agree I'll go to challenge the principal.

To the student: I would pull out the good old number line and explain: subtraction means how many steps you need to jump from 32 to reach 12. You can jump one long jump of 20, or jump little jumps like the "new way" is doing. The idea is to find out how many jumps was needed. Nothing beats the number line in explaining addition/subtraction.

Monday, February 24, 2014

Keeping up with Java

Check out the java version running on your machine. Go ahead, bring a prompt out.
java -version
Chances are: you are still using 1.6.something (or earlier).

Here is a link to Java's version history on wiki: here. 1.7 has been out since 2011. Look at all those security fixes needed.

Here is a good slideshow of the 1.7 features: here. There are "syntactic sugar" to do number literals... case statements that can use strings, combining Exception handling, and a bunch of new things most people probably don't need often...

1.8 is around the corner (March 2014). Lambda! That define-things-on-the-fly "calculus" of functional-languages can do is finally here. People just love to define functions on the fly. Many java-like languages added it on their own and now Java has incorporated it onto itself. Read about it here. The idea is "innovate" (translation: steal from other frameworks and languages and incorporate them as standardization)

Syntax nightmare ahead, you know people will go wild with it. Where is the word lambda? I at least see it in LISP.

Wednesday, February 19, 2014

Obama on Art History

This is an interesting read: Obama mocking Art History degree. See here.

A lot of young people no longer see the trades and skilled manufacturing as a viable career, but I promise you, folks can make a lot more potentially with skilled manufacturing or the trades than they might with an art-history degree,”

He continues:

Nothing wrong with [an] art-history degree. I love art history. I don’t want to get a bunch of ­e-mails from everybody. I’m just saying, you can make a really good living and have a great career without getting a four-year college education, as long as you get the skills and training that you need.

It really is not so intelligent to mock art history degrees. You know there will be objections from those who study it. But the president has a point. If you only know art history and have 0 interest or ability in anything else you better be really really good so you are able to fight with thousands of other art majors to land on a professor position to teach another generation of art history majors. (substitute art history with any major of your choice). You MUST have skills that employers want to hire, or able to start a business.

Is the job statistics showing the however-many-percent unemployed art history majors college graduates? It is not. Art History majors are far more likely to find work than those only with a high school degree or less, though their work may not be art history related. I am not sure if you can major in manufacturing, don't remember seeing that in my college catalog. Even if you can, if the factories are not here what do you do with that manufacturing skill if anything real is learned?

Now it is important to realize you don't have to work with things you major in. A liberal art education... merely give you something to work study in that very limited few years of college.

Those who want to give up college because its too expensive and a degree gets you nowhere ought to think again... Was you high school education decent enough?

A Genius Problem?

Saw this on LinkedIn. Well I am not going to bother inserting my answer to the thousands of entries. No one is going to read it, it may be a bait to collect your info to send you junk mail or whatever.

This does not take any genius to do, but the mathematical conscious even first grader should say, dude, 2 does NOT equal to 6, 3 does NOT equal to 12. Nonsense nonsense. And you ask me what does 9 equal? It is simple:

9.

End of problem. Q.E.D. (how do I insert a square icon like most math book does?)

If you want to use describe a pattern... you can say f(2)=6, f(3)=12... The tricky part here is to note 7 and 8 are skipped so it is a trap. So the pattern here is f(x) = x*(x+1), and the answer perhaps the author is looking for is f(9)=9x10 =90. But the CORRECT answer is 9.

Is someone applauding? Who is the author of the question? What is the right answer? I will probably never find out. Good news is: it actually doesn't matter.

Tuesday, February 18, 2014

Snake handling pastor died of snake bite

So a pastor died handling snakes. See here.

No, not because he is trying to save somebody but he regularly handles snakes as a test of faith... and his faith didn't work. He died. But I hope his faith of going to heaven works better.

I am sure some people would take this opportunity to mock Christianity as being stupid... like failing to predict end time not too long ago.

Here is the Bible Verse that killed him, almost at the end of Gospel of Mark: Mark 16:17-18

"17 And these signs will accompany those who believe: In my name they will drive out demons; they will speak in new tongues; 18 they will pick up snakes with their hands; and when they drink deadly poison, it will not hurt them at all; they will place their hands on sick people, and they will get well.”
Note: this isn't at the end of other 3 gospels.. only Mark mentioned this.

Paul and Peter (and some others) were able to drive out demons. Are there any more to drive out today?

Here is something safer to try, put hand on sick people did that work? Of course not, else we put the doctors and hospitals out of work. Well Paul and Peter can. Is he able to speak new tongue? Has he tried deadly poison? If he did he is probably not here much earlier to handle the snakes. See if that didn't work why would he think snakes won't hurt him?

But special power should have come to accompany those believers as indicated in those verses. Where is that power? Thy of Little Faith?!

Poor guy, here is an important footnote he missed! [The earliest manuscripts and some other ancient witnesses do not have verses 9–20.] See here. Those lines are ... forgery!

But I think he missed Jesus's point. His main idea was verse 15: go into the world and preach the gospel... and not serpent show. This is consistant throughout the NT. Paul, John and Peter don't go around in snakes in their hands, don't they? The pastor should have looked at this verse: 1 Corinthians 10:9 "We should not test Christ,as some of them did—and were killed by snakes."

Friday, February 7, 2014

Let's not always blame the education system

I came across with the following comic:

Oh, wahahaha you are judging an elephant and a fish the ability to climb.

First, wait a minute, Is this really an Einstein quote? It may not be. See here.

Is the education system really doing this to kids? Testing ability to read some text for comprehension and do some math problems is not fair? So what kind of system does the author of the comic suggest? I don't know if Einstein ever suggested one.

The education system should attempt to teach something from the tests. After a standard exam such as Iowa, SAT or ACT, solution should be given as well as an analysis of what you did right or wrong so the students learn something. Some amount of testing can be a good thing... a motivation to study things.

Is it really that everybody is a genius? I beg to differ. What do you call Einstein when most other lesser beings don't even have a clue how Newton's laws work? There are some exceptionally smart people we call genius. And there are people who are not as smart... and there are those...who are stupid. I am sure you know some of those.

Tuesday, February 4, 2014

Texas Drops Algebra 2

I never liked Algebra 2/trig/pre-Calculus... It has some boring topics... dragging too long to reach calculus.

So I was excited to see the headline of Texas dropping Algebra 2. Is it because they are jam packing the slow paced Algebra 1 with some trigonometry and some useful things to get kids ready for calculus earlier? Oh it is not... it is to "focus on career and vocational training" and that "Algebra II is so difficult that it was forcing many students to drop out before finishing high school. "

Now if you have to drop out because of Algebra 2 you need a good teacher or a good tutor. That class needs to be modified so you don't need to do stupid factoring of some 5-degree polynomials you pull out from thin air. Look, you will need that to score well in SAT and ACT. Kicking algebra 2 off is lowering your already low requirements.

Math is a cumulative subject... waita minute, are the kids dropping out because they can't even work with fractions while taking Algebra 2? Perhaps the problem is at the earlier grade levels.

Those textbooks perhaps need to be revisited to be more clear and interesting. Topics may need to be revisited to eliminate some not so useful things... If you can't solve some simple equations there is just no way you can have a decent education in any science.

Are you going to say, dude I have never used sin, cos, tan, nor solve a system of equation in my life. Let me tell you this dude, I know how to do this (and much more), I had decent science classes in school requiring these, and I feel encriched. Those who are uninformed and uneducated simply miss out.... and that's actually is ok. A strong nation needs its people educated and enriched. We don't need to be a strong nation and you don't need to be enriched.

Monday, January 27, 2014

Bill Gates plays chess... and loses in less than 2 minutes

It is great to see chess in the spotlight. So the world's richest man Bill Gates... vs the young world champion Magnus Carlsen. Take a look at the game here. And if you want to see move-by-move analysis. You can see here. Yes, that bishop is a wrong move. Why castle close to that approaching queen? It is kinda curious why Carlen bring out the queen so soon as that is usually not so recommended.

Now having a lot of money does not imply chess ability. But Gates actually plays better than some people I have seen (poor me need to play/watch such games). Now Carlsen is a world champion. Challenging a world champion is is like knowing to dribble a basketball ball and try to challenge Michael Jordan... It is like able to punch and then try to challenge Mike Tyson. You get the idea.

Gates' chess ability... may be able to win level 2 or 3 in Chess Titan from Windows 7. Where the heck is Chess Titan in Windows 8? Argh! Gone!

One wrong move can cost you the game. This is fact of life in chess. Perhaps in the business world too (and that disastrous wrong move for Microsoft is Windows 8!)

If the news item is about Carlsen playing with another grandmaster level guy, even if the game is truely awesome not too many people really cares... most are just interested in how Gates play. But it is nice to see chess in the spotlight. Look there is a reason why this game is still popular to this day.

Thursday, January 23, 2014

Goodbye Sears

Sears used to be mighty. Decades ago that was like THE department store to go to for everything... for appliances and just about everything else. The once tallest building in the world bears its name. It occupied the CENTER of Chicago at State & Madison. But that store is closing, probably soon running out of business altogether. News here

How can such mighty department store fail? My guess would be it isn't keeping up with the rest of the world. The styles of its clothing are too old school. Its appliances are old school. Well the entire retail business isn't doing so well as people buy stuff online now... It is inevitable. But for things like appliances I prefer to see the real machine.

I feel sorry for the 160 hourly employees... they can apply for a new glorious career at another Sears or... K-mart.

The article says, "State Street is performing at the highest level that it has in decades." Oh yeah? I never see as much crowd in State St as in Michigan Ave. Though Block 37 is nice but it is more than half empty.

Now this is why I am not a financial dude, why does the stock go up when this appears to be bad news? Oh CPS will occupy that building... and I wonder why. Would it be smarter for another retailer to come pay more rent? Another reason I am no financial dude who understands this.

My guess for the next goodbye will be... Radio Shack. Why they have so many stores and just how many little radio controlled toys they can sell to keep afloat?

Wednesday, January 22, 2014

Can you really learn Algebra 1 in... 24 hours?

Saw this book in my periodic math section bookstore tour. Can you really learn Algebra 1 in... 24 hours?

If so, why are high school students taking entire year (ok, 9 months) to learn this... and most don't even learn it well. I flipped through this book. Excellent stuff. You'd hope your textbook was as good. I do recommend high school students to take a look.

Look folks, it does take more than 24 hours to Algebra 1. Students need some time to practice a bit to get comfortable because going to next topic right? I suppose you need at least a day or two to practice factoring a tri-nomial? and a few more to get comfortable with the notion of (linear) functions even of 1 variable?

Yes, I do believe the (probably American only) high school math curriculum is dragging way to long. 4 years of high school cover so little and too many students simply just FAIL even their curriculum is so easy.

But 24 hours is... too ambitious.

I'd say a more realistic time frame may be... 3 months?

Wednesday, January 8, 2014

Goodbye Dominicks

The once mighty Dominicks Finer Foods is going to be gone soon. Go to one while it still remains open. Take a picture if you like to witness the end of an era. How sad. The Chase branch within has already been closed. Those nice-looking-young-blue-shirt folks are gone forever. A handful of elderly Dominick clerks still remain in the stores. There are so very few merchandise left. The whole store just look depressing.

Once upon a time, I saw it sells green onion for a whopping $1.50 a batch. I predicted "the end is near" Look at that fruit section. Not many people there buying anything. How do you compete with others? It is just too expensive. And its water spray system sprays at everything, even at gingers? You don't need to.

Once upon a time, I went to a human cashier, without a sticker on that napa, the guy flip flip and flip his code book and then ask me "what is it?!". Waita minute I thought Dominicks is supposed to be "people who know their food"?

Dominicks wanted to know your phone number every time you buy something to keep track of you like the NSA. Refuse to give? You will have to put up with even more outrageous prices without the-"Fresh Card". Even if you keep track of everything I ever bought you still run out of business. I suppose Dominicks can remain alive if it cuts its prices to attract more customers, cut its 24 hour into close-at-midnight-to-save-some-money. But I am sure they rather throw away food, close their doors, than cut price.

Looking forward for its new reincarnation as Mariano's. It is survival of the fittest. I feel sorry for the elderly folks who work there for perhaps decades.

Tuesday, January 7, 2014

Chi-beria

A new term for Chicago: Chiberia... combinging Chicago and Siberia.

It has been a long while (if there ever was) that cold weather caused closing of schools for 2 consecutive days. For many people, they can work-from-home. The last time Chicago get this cold people were using 56K modems I suppose so it isn't so possible.

Cold weather plus a foot+ of snow isn't very fun. Stay warm and safe. Wind chill at -40! Is it Fahrenheit or Celsius you asked? Answer: it doesn't matter. See my note here. Every algebra 1 teacher should take this as an opportunity to teach a real-life lesson of x-y axis... Here is a real application of x and y!

Friday, January 3, 2014

Watching people play chess on an elaborate chess set

Ok so I visited a shopping mall and delighted to find two people playing chess on an elaborate set (not those sad looking cheap 2½" king set that I once owned).

If someone is going to invest that much money on that I suppose they must be decent players. I hope to see a great match. Great players often take time to think about each move. Ok they move pretty fast, good, let me what we got here.

Ooh, a white bishop is taking position to catch the rook... come on black, move it! Nope black didn't. But did the bishop take the rook? Nope it made a useless move with another piece that deserved to be marked with "??". Ok a queen moved, but moved into a square that it can be taken. Boom. queen taken. That player didn't even frown. A queen sacrifice for a checkmate? Nope, as if nothing happened. The player just keep on losing pieces. Ok, a white pawn is pushed up two spaces next to a black pawn right on that same row. Ideal time for en passant. Nope, black didn't do that, probably never heard of it. That row of pawns are all torn apart and the guy still wants to castle... ok there is a bishop looking at the path of that one square that the king is moving through ok? so castling CANNOT take place. At that point I can't hold myself and told the player he can't castle there.

I am glad I was not told to "get the heck out of here". That game ended soon. and next game starts, and one player even wasn't sure where to put the queen. How hard is it to remember black-queen-on-black-square and white-queen-on-white-square? I am at least glad the lower right corner is indeed white. Ok, another game started, after pushing a couple pawns as first move, a knight did not jump toward the center but jump to the edge. What type of opening is this?

The whole idea of any game is for enjoyment. If these players enjoy playing like this it is perfectly fine. It is great that they still play with things not requiring electricity. Just about everybody play on their phones with something nowadays.

Ok do I sound like a good player? I am NOT. I am forever humbled by the chess games I have on my phone.