Wednesday, December 21, 2016

4 Terror Attacks in 2 Days

There are 4 terror attacks in 2 days.

Almost too many to even read about and keep track of... the world is getting unstable! Allepo crisis isn't over yet and you got a guy running truck into crowd, shooting ambassador in public, suicide bombing... all within a couple days... close to Christmas when the world is supposed to sing and rejoice.

Is this coming to and end? I am afraid not. More of these will come and no solutions in sight. Is Bomb the sh*t out of them going to work? Look America you elected a guy who says that. Does it sound like a plan from someone with some wisdom?

Tuesday, December 20, 2016

Election finally over

The 2016 Election finally ended. Trump still win.

Despite all that recount vote effort, 2.9 million more popular votes, Hillary still lost. Most electors (how do they get selected?) simply go with what they were supposed to vote for based on winner-take-all rule for your state.

See here http://www.nytimes.com/2016/12/19/us/politics/electoral-college-vote.html for more wackiness of this election. What? Ron Paul got a vote? What? John Kasich got a vote, even Bernie Sanders got a vote. They aren't even running. Those other 2 candidates Johnson and Stein didn't get any (and should probably remain that way). Those deviant electors are doing something completely useless.

So this is it, America. We have to give Trump the presidency.

Next item is the inauguration on Jan 20.

There are people jumping up and down in joy celebrating Trump's win saying he is God chosen and all that and saying their prayers answered.

Getting global warming denier as head of EPA... getting the oil tycoon as secretary of state? There are still people jumping up and down praising God for Trump victory.

Friday, December 9, 2016

Reacting to React.js

I've heard this too many times: "I've used React.js and Angular and I liked them." Ok... Angular... I mean Angular 1...I've looked at it before. Angular 1 is now passé. Now there a completely different animal known as Angular 2. Yes, completely different.. that requires a Microsoft created (surprised?) Typescript thing. Check that out https://angular.io/docs/ts/latest/quickstart.html.

Angular 1 is actually not too bad... but as with some other javascript framework the goodness of chrome debug and Firebug will be tossed as so many things are done behind scene for data-binding and magic substitutions taking place.

Now let's look at React.js. It has some wacky looking JSX that mixes HTML and somewhat C++ like stuff, and basically requires Nodes.js (so does Angular 2) and need to install a lot of stuff. See https://www.tutorialspoint.com/reactjs/ for a tutorial.

I fail to share enthusiasm. Big learning curve.. what's the benefit? And it requires a server (like Node.js). Look if you do that much on server side why don't you go hefty server side with Java (or .NET). Waita minute this isn't exactly a MVC framework like Angular... it is for breaking your thing into "components". See http://blog.andrewray.me/reactjs-for-stupid-people/. (uh hem, who are you calling stupid?)

So this isn't something I need now (probably will never need). But I needed to look it up so I understand what people are talking about.

Wednesday, December 7, 2016

Lorem Ipsum

You have probably seen "Lorem Ipsum" text. Dummy non-sense text used in demo webpages and stuff... See https://en.wikipedia.org/wiki/Lorem_ipsum for glorious details about this.

There are plenty of Lorem Ipsum generators out there. But if you want more interesting dummy text, you can try these.

Another interesting but not-so-dummy text is "The quick brown fox jumps over the lazy dog". You may have seen this in font-choosing dialogs. That's one sentence using all 26 alphabets. Impressive. Not sure if any other sentence out there with this amazing property.

Thursday, December 1, 2016

How do you backup?

I haven't figured this out yet... how do you backup all your photos?

Solution 1: Get it on external hard drives they are so cheap now. Problem solved. good bye.

Solution 2: Throw it up on the cloud. Problem solved. good bye.

Solution 3: Make some CDs. (Not going to spend hours and hours for that, won't consider)

1) Yes, external hard drives are so spacious and cheap now. But they don't last forever, yes they will probably last at least a few good years. Now how can I have some redundancy, like copy everything from drive 1 onto drive 2. Good old

diskcopy a: b: 
from DOS? My Windows 10's Explorer won't even honor cross drive copying if your folder is more than a Gig or so. (It will just not respond to the drag). But it is cumbersome to have to keep copying as you get more things on drive 1 to want to duplicate in drive 2. There are external drive cloners like you plug in two hard disks (like Atari cartridges) and clone ... but is there anything that duplicates USB external drives? The world needs a device that offers 2 usb slots, a button, and boom, duplicate it for me. (Haven't found this yet)

2) Everyone offers you free storage on the cloud. Google Drive, Microsoft One Drive, dropbox, etc. But it is just a few gigs. You need at least a few hundred gigs if you have a few years of photos. The cost isn't that high but still is some money. See https://www.cnet.com/how-to/onedrive-dropbox-google-drive-and-box-which-cloud-storage-service-is-right-for-you/.

But some may not be comfortable to put all your private photos on the web. There are various backup tools out there to automatically sync your computer to the cloud... again, putting everything you have on the cloud? But all at a cost... there are some free tools but I am afraid of malware.

How do you backup your stuff?

Monday, November 14, 2016

Windows update: infinite restart

Maybe starting as far as Windows 95, once a while it nags and nags for updates. Yes even you Mac users out there get almost daily nags too.

Ok, go ahead, clicked on the reboot button and let it do its things. The next morning the computer is off. Ok, turn it back on it says "Restoring to previous version of Windows" and bleep a DOS box comes briefly and went away and again it is restarting and tell me the same message over and over.

I heard people have this problem and now seeing this myself. Windows restarts itself indefinitely during installing an update! http://answers.microsoft.com/en-us/windows/forum/windows_10-performance/infinite-reboot-loop-after-w10-anniversary-update/7df8ca18-ce03-4643-aa73-5a517eef067a. Actually it isn't installing update but failed install and trying to revert and got into infinite boot loop.

Now I *deserve* a reason why the update failed and *deserve* to have computer back in order. Even if this fail, just why is it infinitely restarting? And... HOW do you go to safe boot now? F8? Nope didn't work. Banged banged banged on it.

Now I got an HP. And that has a F11 System Recovery mode. Need to bang bang bang on it too during the reboot loop. How are you supposed to know? (glad I can google in my phone). Then there is a couple options to recover.. Hit on it. Boom went right back to infinite start loop.

After the 2nd time my computer is back to order with original Windows 10. (Whew! It worked)

The next day.. waita minute the login page is a bit different. And then it says... you are upgraded.

Why do users need to endure this? Why did it not successful in the first place? Too many things in life that you will never get answer.

BTW, I am STILL not getting a Mac even if I cannot get the machine to work again.

Now I do not have Windows CD with shiny stickers... am I supposed to make bootable USB sticks nowadays?

Friday, November 11, 2016

Election Map 2016

This election map from New York Times offer excellent details from the election: http://www.nytimes.com/elections/results/president.

If you look at votes by county... There are a LOT of red counties even Hillary still won the popular votes.

What I don't understand is: why isn't the electoral vote bar either red or blue? What is this gray section? They are not still counting votes I hope?

So it is the "majority" of American throughout the land wanted Republicans... felt neglected by 8 years of Obama that are putting Trump as president. Wait a minute, how come those who voted for Obama didn't come out to vote Hillary? Why is the turnout so low? See http://www.cnn.com/2016/11/11/politics/popular-vote-turnout-2016/. This is the election that everyone should go vote down Trump but they shrugged.

It is going to be a dramatic chapter of US History. I only hope we are not going into World War III.

Wednesday, November 9, 2016

Most unbelievable election

The result are in. Trump Wins. 279 to 228 Electoral Votes. (as of this post)

Wait! Hillary has more popular votes! 59,729,015 is more than 59,509,990. (Hillary didn't win by much) Nope, only electoral counts.

There were only FOUR other candidates who had the same fate: See http://www.factcheck.org/2008/03/presidents-winning-without-popular-vote/.

Now Trump will FOREVER remain in US History. There were polls right before election that Hillary has a few points lead. And many articles about Trump needed to win a lot of swing states to win... and he did. Much better candidates like McCain and Romney didn't win as many swing states. How does he do that?!

Not get along with your own political party and still win? Talk about grabbing women by p____y and still win. Have a fraud university and still win. Make all sorts of outrageous comments and still win. Skip paying tax and show tax return and still win. Sexually assaulted dozens of women and still win. What is going on here.

This isn't a close one like Bush vs Gore in 2000. It was a big win.

That private email server bothers Americans that much? or simply voters have no clue.

Boom stock tumbles (but came back up, why?), world in fear. And you give the guy access to all the nuclear weapons. If we have them why don't we use them.

Yes, this is a dark day for America. I'm like yeah-right you are moving to Canada? People talk about but rarely ever actually do anything dramatic.

Now, now... is the plan elect him first then impeach later to get rid of him for good?

Thursday, November 3, 2016

Congrats to the Cubs

The Cubs did it! They won the World Series! http://www.chicagotribune.com/sports/baseball/cubs/ct-cubs-win-world-series-sullivan-spt-1103-20161102-story.html

After 100+ years of drought they did it! (after a rain delay that is).

Excellent come back... after a 3-1 deficit, even without the home-court-advantage. I watched only a few minutes on a couple games... lots of waiting. Mostly 0 to 0 inning after inning. And in one game, boom there was a home-run with 4 points! Baseball can be full of surprises but you gotta wait (and see them spit).

Now I have seen victory for just about every Chicago sports team: Bears, Bulls, Sox, Blackhawk, now the Cubs. Waita minute... it is ... the World Series? Did any other country participate? No. When the Bulls win, they call themselves World Champions too. Is it really true that nobody else in the world beat American teams?

Congrats Cubs. You have made a lot of Chicago people happy.

I may even buy Cubs shirts to celebrate this once in a century event.

Tuesday, November 1, 2016

Wifi password difficult math

Oh this little news caught my eyes. http://www.upi.com/Odd_News/2016/10/28/Restaurant-trolls-customers-with-complex-WiFi-password-equation/7471477682949/

Do I know the answer? NO. Cause I don't know what it is asking for.

But this is no math question here... It (merely) says the probability of getting m >= n/2 is.. the sum of the individual trials at 0.25 success rate... so? what are we trying to solve for to get the Wifi?

Take a look at another riddle like this, in words "The probability of getting more than or equal to 3 in a dice roll is the probability of getting a 3, or a 4 or a 5, or a 6". Just what's the password then? You don't need to get wifi in this place. Go to another place.

Thursday, October 27, 2016

Apple: Stop taking away stuff

You have heard about and perhaps seen the new IPhone 7 which looks almost EXACTLY like its predecesser (ok, better camera and an idiot click sound on the home button), except for one thing: no more headphone jack. Oh what's the rationale behind that? Some say that audio jack is old technology therefore need to go. Yet to hear how good is that comma-shape headphone (which you know you will lose eventually).

Now look at new Macbook. What is new virtual key bar thing?

Oh my, no Function Keys? no Escape key?! http://www.theverge.com/circuitbreaker/2016/10/25/13409258/apple-new-macbook-pro-no-escape-key.

How do you use things like vi and emacs without it? yes function keys... are not that useful... but they were once programmable buttons. But nobody programs them now because nearly nobody writes stand-alone programs... just programs running within a program like within a browser.

Taking out things needed things is uncool. Diehard fans may call it "courageous" to "lead the industry" by removing stuff they think is no longer useful. Yes that audio cable is needed. Yes "ESC" button is needed. The diehard fans and just blindly use whatever Apple give them.

Good news is: I-will-not-use-the-Mac. Go ahead. take EVERYTHING out.

Monday, October 24, 2016

Spring things

Yes I know Spring got easier nowadays. Once upon a time I looked at the Spring Tools Suite (STS). Omg Spring has so many things (See the Projects page). Here is one thing that may deserve your attention: Spring Boot.

Once upon a time there is a guy leaving the computer and I ask hey how to build-compile-your-code-over-here. And it turns out to be a Spring Boot app and gosh I never even heard of this. So this is a as-quick-as-you-can Spring application. You don't need to create a WAR file and deploy on an app server like tomcat! It is all built in. (No more fool around with creating a blank app (that itself is hard to do without an IDE like eclipse, fool around with the servlet mapping, hijack it... make your classes with all sorts of odd annotations, fight maven dependencies to make war and then deploy).

I admire those who put tutorials on the web. I admire those who put entire project source code even more. I am able to get a great Spring Boot app running from https://springframework.guru/spring-boot-web-application-part-1-spring-initializr/. Great stuff. Even has a database hooked up for you with CRUD operations. It would take many hours to do if you have to do this by hand.

Now, the world likes APIs. If you do web apps, most likely you write your API with java to have your front end call by AJAX... and API gets messy and undocumented. Especially when you have sloppy or smart-but-sloppy colleagues who never comments anything. Every API call ought to be documented unless it is obvious what it does.

http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api is pretty helpful. (Although I hope there is a entirely downloadable thing here too). Swagger is pretty awesome... It generates javadoc-like things on the fly for you and you can even try your API right there on the swagger-ui.html.

So now I have a Spring Boot thing ready for new MVC project, ready with API documentation.

Thanks to awesome helpful people who put examples out.

Exercise your right to vote - although outcome won't change

Once upon a time, I left my phone's GPS Location on. I don't turn it on unless I need its GPS to save battery and nobody tracks where I am, ok? And then it figures out I live in Illinois and it gave me a reminder: online voting registration was going to end soon! (and it has ended)

Oh I didn't go any place for registering. Waita minute I registered during last election and that voter registration card still in my wallet...perhaps I don't need to? I pulled it out and it says... 2012. Yes I only go to presidential elections. Didn't vote for anything in 2014 or other minor elections. Dang am I going to miss voting for Decision 2016? (The answer is no, I am still registered according to the online checking). You can look up yourself in https://ova.elections.il.gov/RegistrationLookup.aspx.

Ok, Illinois by any measurement is a solid blue state. Hillary will win Illinois and its 20 electoral votes. (You can save your trip to the booth). Seems like only those living in swing states get to decide who is the president, especially Ohio and Florida.

Although doesn't really matter, you can still be a small gosh small part of US History by tell someone YOU ARE FIRED by adding a count onto the popular vote.

Monday, October 10, 2016

Come on, yahoo

Ok the year was 1995. The internet was new. Websites were pure HTML and at most you have little CGI perl thing to handle a post... Netscape 1.0 was the only browser in town... and just about everyone set yahoo.com as the homepage. It was a web catalog... It had links to newborn websites as it helped people navigate around the world wide web. and yahoo email was one of the first webpage based email around...

So at an old workplace people go hey let's get an yahoo account for chatting. The year was 2001 and my yahoo email was generated and has '2001' on it... I like it never ask me to reset password I found it annoying needing to do so. Until... oh yahoo has been HACKED. See this old news. What to do? change your password of course.

But. I. Can't.

Go to the Account page, change password, it takes me to some AT&T page and nope, can't change password there.

What gives?

Why is it going to AT&T? just plain wrong. and plain does not work. Ok, I don't have any credit card info there or anything so I don't feel threatened. (I would worry a bit more if this is a shopping site like amazon)

People say yahoo is not able to keep up.. and therefore losing ground. Yahoo's search is alright... but google does it better with less annoying ads (and therefore nobody uses yahoo search now). Yahoo maps was pretty cool until google's map is even better and therefore no one uses yahoo maps now. It is unfortunate.

Yahoo even has its own library to do javascript/css! See http://yuilibrary.com/. Nope. Nobody even heard of it. People just do jquery and other things. (and YUI is dead now)

Yes, lots and lots of business lessons can be learned... about rise-and-fall of business. Even smart people can't save it... cause there are even smarter people out there? I'll continue to use your free email service yahoo... I still read your newsfeeds. I am still your user. But waita minute, how come I cannot reset that password...

Monday, October 3, 2016

Pascal legacy continues?

The guy who invented Turbo Pascal and C# now has another thing: Typescript that "compiles" into javascript. See https://en.wikipedia.org/wiki/TypeScript.. that is the basis of Angular 2.

So all the OO Aficionados who wants javascript do some OOP can do so now using Typescript translated into javascript. (well, raw javascript does support some OOP just not the keywords that C++/Java developers are familiar with). See https://learnxinyminutes.com/docs/typescript/.

There is also this NativeScript that gets me a bit confused now: https://www.nativescript.org/using-typescript-with-nativescript-when-developing-mobile-apps. Now cross platform mobile apps can be in somewhat Pascal like?

Here is the quickstart guide for Angular 2: https://angular.io/docs/ts/latest/quickstart.html.

Ok this isn't exactly Pascal like... A lot of new syntax here. Pascal/C was simple... Even javascript is fairly straightforward.

Now something that translates/compiles into javascript... why don't I write javascript directly?

Seems like nowadays you MUST install Node.js npm thing to install anything these days. Command-line thing, boom crank out skeleton-but-hard-to-understand-things. Why can't people produce something that is more straight forward. Excuse-me how do I run it?

After taking an initial look, it doesn't seem like programming mobile apps is any easier now.

Tuesday, September 27, 2016

Who won the first debate?

I watched part of the presidential debate yesterday. Every American should take the time to watch Hilary and Trump go head-to-head against each other the first time. This is an interesting moment in US History.

Now, besides interrupting a few times Trump did not do as bad as I thought he would do. There was moment of cheer: if Hillary would release those emails from the personal email server he would release the tax returns. Now both must have something to hide here. Yes, go to the fact checkers and see for yourself who tells you more truth.

Hilary clearly appeared more calm and in control... and that is needed as president.

But who won the debate? That depends on what survey you are reading. Some survey say Trump won. Others say Clinton won. I say Clinton won, but not by too much. What do you say? That's why every voter should watch the debate. You ultimately get to decide at the booth. However, if you live in a solid red or blue state... your single vote probably does not matter.

The polls are tight between the candidates... there really is... a chance for Trump to win. (But I still predict Hilary victory)

Now, 5 living presidents, including former Republicans George Bush and George W Bush do not endorse Trump. That says a lot here. (However, I am sure they support Jeb instead).

Wednesday, September 21, 2016

School with no textbooks

When I was in Chicago Public Schools, there were books. Even they were old ones used for many years. They were free. Public school is a blessing. It was close to the start of the '90s and the latest chapter of the US History book was about Nixon elected president. Well, the topics about the colonists, Civil War is kinda fixed so it is ok to have not-so-updated books. And classic are still classics, we still read a thing or two from Mark Twain or even Shakespeare in the textbooks. And grammar books contains the fixed list of usage and stuff... written down in the form of book that can be studied from. They need to be written down in some fixed place... books. Not loose photocopies.

Nowadays Chicago public schools provide NO books. You get a photocopied packet maybe and some workbook maybe... but no textbooks. No that's money saving. Oh my gosh, Students have NOTHING TO STUDY FROM? You can't read a chapter or two ahead of the lesson... you can't read a discussion about how certain things work. Can't read anything about the important history from a book. All you get is idiot common core math useless techniques.

There is NO EDUCATION. Just send the students away from home to get free lunch is all we care about.

Go to a private school you say? Well I don't have astronomical amount of money for that.

Ok perhaps everything inside the ipad? Not all schools focus on them. And if they do they over do this. There should be GOOD books on text, not lame games, not read-for-you-out-loud-on-the-speaker-so-you-don't-have-to. That promotes laziness. You just HAVE to read some paragraphs yourself.

Students. Need. Books.

But bookstores are closing. No one buys books nowadays. I think the world can use great education materials on the ipad... standardized.

Thursday, September 8, 2016

Hopeless American Politics

With an obviously wrong choice for president and another choice full of scandals... one choice is obviously lesser evil and yet the polls is still within a few percentages.

On the ballots, however, there are more candidates other than those from the 2 major parties. Their chance of winning is very, very, very slim. Face it: none. Impossible.

Now here is this clueless candidate who dares to ask the interviewer: "What is Aleppo?"

What a shame. Most elementary school students probably know if they pay any attention to any news.

All we have are lousy candidates and not one true leader among the 320 million people?

Iphone7 is more important than anything else?

So IPhone7 made huge headline yesterday on top of everything else, including Trump/Clinton, Zika, ISIS, and anything else that matters.

No I am not an Apple fan, won't bother to even find one and look at it. But the most outstanding feature is: there is no more headphone jack.

You are supposed to use the wireless headphone like a long comma. A bit weird looking if you ask me. You're bound to lose them. Wireless thing is a lot of you-probably-don't-understand complex stuff that may put you in even more risk of radiation stuff. So you are just going to dump your still working 5 and 6 and go with this 7? There is no need to get a new phone if yours still work.

But a new product above news of everything else? Now that's insane. There are many things that matter more.

Monday, August 8, 2016

4th Android phone

I am not a lavish guy who change phone every year or so other than I-want-a-fancier-phone. I need a good reason to do so.
1st phone cheap cheap one: just too small too old.
2nd one is Nexus 4: part of the screen stopped receiving tabs
3rd one is Moto G2: nice budget phone but I cracked screen. My fault. and I continued with this for months

My new one is a long waited Moto G4. Supposed to be king of budget phone.

The camera has a whopping 13 meg camera. Supposed to be good. Eeew Nope making a bit fuzzy pictures, worse than my Moto 2 versions ago. Not all the time but enough to be annoyed.

Ok, sent it back for an exchange with everything in box back. I am supposed to wait 10 days... but nope. waited more than 14 days.

Did I get an exchange? I don't know. Look the same to me. 0 explanation of what was done. All I know is the unopened new charger is robbed.

Did the quality improve? Not really.

So I am putting up with this phone. Other than camera.. this phone works great. Lean and mean.

To prevent crack again I bought a great glass cover which supposed to protect it. Phones should come STANDARD with such protection.

Thursday, July 28, 2016

Augmented reality silly gaming

Yes, you have all heard of Pokemon Go... that take the world by STORM. So many people have downloaded and played this game (I haven't). Ooh it makes use of map and give you little monster to catch as in "Gotta Catch 'Em All"? Great fresh idea.

Of course you won't see me play this 'cause its very idea is stupid to me.

Now you see people in virtual reality helmet/goggles as they play with virtual or augmented world... Covering your own world and present another world right in front of your eyes is denying reality... I won't go that far in gaming.

But if this is taken the world by storm... it is something worth thinking about. Can I make something that take the world by storm?

And people (especially kids) go crazy with their world of whatever-craft... constantly building things... for what purpose? Too many kids are too much into these things.

And while peaking at some kid's phone. Saw some Batman themed fighting game that is more elaborate than the latest Street Fighter. So graphically intense... and without a joystick/joypad... I don't think I can even control those things.

Yes, small amount of gaming is good. It help you relax and sharpen your eye-hand-coordination and even a great social tool to play with your friends. But too much of it is insane.

Such games nowadays are such triumph of programming ability. Your highest paid friend with software-director-awesome-title probably cannot even make a space invader game.

Thursday, July 21, 2016

Java convert time zones

Yes, Java time (before Java 8) is a pain. Java 8 totally redo this but I am still at Java 7... and of course no time to learn it. People have been struggling for years for its foolishness with the Calendar object and stuff.

And if you deal with international things... timezone difference is going to be a headache. The world does not do day light savings time on the same day also.

Here is a great little util to convert between time zones... from String to String.


import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class Testing {
    private static String convertTimeZone(String datetime, String fmt, 
String timeZoneFrom, String timezoneTo) throws Exception {
     TimeZone defaultTimeZone = TimeZone.getDefault(); // save your default time zone
     TimeZone.setDefault(TimeZone.getTimeZone(timeZoneFrom));
                   
        SimpleDateFormat sdf = new SimpleDateFormat(fmt);
        Date d = sdf.parse(datetime);

        sdf.setTimeZone(TimeZone.getTimeZone(timezoneTo));

        String result= sdf.format(d);
     TimeZone.setDefault(defaultTimeZone); // reset default time zone back
        return result;
       
    }

   public static void main(String arg[]) {
     try {
      System.out.println(convertTimeZone("2016-08-21 18:50:00",
"yyyy-MM-dd HH:mm:ss","UTC","Asia/Hong_Kong"));
      System.out.println(convertTimeZone("2016-08-21 06:50:00",
"yyyy-MM-dd HH:mm:ss","Europe/London","UTC"));
     } catch (Exception e) {
      e.printStackTrace();
     }
    }
Check out time zone strings around the world. https://www.mkyong.com/java/java-display-list-of-timezone-with-gmt/.

Tuesday, July 5, 2016

Happy Independence Day

Such excellent stuff. https://mathwithbaddrawings.com/2016/07/04/we-hold-these-mathematical-truths-to-be-self-evident/#more-4802 I especially like:


Seen that in probability... That means A and B are independent events.
I am glad this year no one blow their arms off. But I think fireworks should be banned. Go watch professionals handle it in Navy Pier, ok? Do not need to risk blow yourself up.

Tuesday, June 28, 2016

Perfect article about "Perfect Day"

I saw an awesomely written article http://blogs.scientificamerican.com/roots-of-unity/49-ways-to-celebrate-the-most-perfect-day-of-the-year/.

So 6/28 is also known as Tau day... for those who write month first and prefer to use and write manifesto with τ = 2π and not π... So their formula is C = πτ. No, I am not a Tau enthusiast. π is around for so long let it be, ok?

Now, 6 and 28 are both perfect numbers. Their factors add up to it. The factors of 6 is 1,2,3. add them up ah you get 6. Mathematicians like "neat" stuff like that and assign names and come up with all sorts of properties. And they entertain and challenge each other like "is there infinitely many perfect numbers.", "how to find one", etc. Well, 28 is another one (uh hem, verify it is perfect by sum the factors of 28 up... leave to reader).

The article listed out a few more neato perfect number facts and about prime numbers (wish you can click on it). Such interesting refresher of the number theory course I took a long time ago.

Stuff with more intellectual matter ought to be passed around, go viral, with everyone standing up, clap their hands and say Euclid and Euler are such great genius.

The only idiot things that go viral these days are SIMPLE so called math problems that stumped mathematical incapable people.

Look here is this problem again: http://hellogiggles.com/math-problem-algebra/, and DUDE, what's the algebra part?? This is ELEMENTARY SCHOOL ARITHMETIC.

Friday, June 3, 2016

Why Windows Phone not popular?

Windows Phone has shrunk down below 1%. Details here.

Now, just why doesn't Windows Phone catch on? Why the world cannot use the 3rd type of phones besides Android and Apple?

I watched some forums and most say that's because there aren't as many apps out there. Some say there isn't a wow factor in the hardware (except perhaps a better camera). Some say too late to join the market. Some say take too long to get other phone's features (such as notification).

But I want to say... all because Metros sucks. Single color tile with white words with single color simple icon is just uglly to look at. The thick border looks like HTML table border=5. Pure ugly. And it "lives". Live Tiles just blink on you. They aren't alive. They are just confusing.

The phones look so blocky rectangular. How about rounder edges? Also they are so plasticy. Part of the cool factor of iphone is looking metalish.

Metro sucks, causing Microsoft immense failure on Windows 8 and on phone market.

To win. Need something EXCITING, pleasant to look at features. Time to TOSS METRO!

Friday, May 13, 2016

Differential equations mistaken as terrorist script

I am sure you heard of this interesting news about a woman thought the professor sitting next to her on a flight is scribbling terrorist script as he was working on some math (differential) equation. See here.

It is unfortunate that the actual equation being worked on is not shown on any news media... perhaps that hand handwritten math was kinda hard to read... it is perfectly fine only the guy working with it can read it... but mistaken as terrorist scripts? It must be really sloppy. Or that lady's math ability is really limited.

Ok, differential equation is no beginner stuff. That ordinary dy/dx derivative notation is already difficult for many people... You can blame Leibniz on that... perhaps f'(x) is better. The professor is probably doing some elaborate partial derivative things with that cursive d which make it more terrifying to look at.

This stuff is really beyond my math ability. I have only seen some very basic ordinary ones and yes I forgot all of it, even though I have taken a "C" or "300" level course on it. All I remember is if something fall in a certain form you can use some specific solving tricks.

Friday, May 6, 2016

Children tale on money

While reading a children's book about money for fun I discovered this fairly tale bank:

Ooh where can you find 5% interest nowadays? Today a savings account is more like 0.1% interest. Come on kids, do that division... just how small is this interest rate now? You don't get 5% even on a Certificate of Deposit for 10 years with $100,000.

Now once upon a time... that interest rate WAS true. The author is not entirely lying.

Why the heck interest is SO low these days? That means: got to invest and risk losing or leave it there to see your money evaporate in inflation. Good luck.

Is there ay children's book about this incredibly low interest nowadays?

for-looping dates

Thanks to self-less people in StackOverflow... learned another new trick.. looping through java.util.Date. http://stackoverflow.com/questions/4534924/how-to-iterate-through-range-of-dates-in-java. No I don't use java 8. If you let people use lambda stuff they go crazy with it.
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = formatter.parse("2010-12-20");
Date endDate = formatter.parse("2010-12-26");

Calendar start = Calendar.getInstance();
start.setTime(startDate);
Calendar end = Calendar.getInstance();
end.setTime(endDate);

for (Date date = start.getTime(); start.before(end); 
    start.add(Calendar.DATE, 1), 
    date = start.getTime()) {

    // Do your job here with `date`.
    System.out.println(date);
}
..and yes, Java pre-8 date handling is incredibly clumsy. Can't do anything unless you put it into a Calendar. Why can't java.util.Date have the ability to do that?

Wednesday, May 4, 2016

Indiana clears path for Trump

Indiana primary ended. Cruz still don't win. Drops out. Cruz + Carly didn't work either. The other guy who has even less support than Cruz dropped out too. No more obstacles for Trump. He is the Republican nominee. Despite all that insulting remarks Trump make... He still wins. There are genuinely people, lots of them, who believe he can make America great again.

As I long predicted... it would be Trump vs Hillary and Hillary would eventually win. She had her issues but clearly better choice than Trump.

A "viral" math problem

http://www.davidwolfe.com/answer-viral-math-problem-japan/

Uh hem, what's so viral about this? What's so hard about this? All elementary school students should be able to do this... Order of Operations is defined exactly to avoid ambiguity. Only 60% Japanese people can do this? That's pretty low.

What about Americans?

When you have an arithmetic expression to evaluate you don't go for the calculator first. You see if you can do it in-your-head first. 3 ÷ 1/3? Flip that 1/3 and multiply (divide fraction means multiply by its reciprocal). Ok it is 9. 9-9. boom. gone. Answer is 1.

Thursday, April 21, 2016

AWS Summit

I attended the AWS Summit this week at McCormick Place.

So Amazon is much more beyond buying stuff on line... Its Amazon Web Service cloud thing is really worth looking into. Ok ok it has been around for a while but they have many new things now. There are so many things that they have to arrange free workshops with thousands of attendees giving out free coffee and donuts and sandwiches to attract you to listen to them talk how their stuff can help you.

It is now beyond hosting machines and databases... you can even write a stateless method to run without any servers now... Amazon also offer many more streaming stuff too.

I attended 1 day summit. Nothing to lose. Free food. Free toys given by people dying to talk to you about what their company can offer (mostly hey-i-know-how-to-secure-your-stuff-on-cloud). Nicely ran. A ton of people directly you where to go. Of course for an hour or so you can only get brief talks. It is unfortunate that there are multiple topics on same hour and you can only go to one. They keynote was nice... and had many thankful customers praising AWS. There was even a free lab that you can go play. I was able to follow its PDF to create a server and write a little php hello world. Yes, many stuff is a bit anti-intuitive. You have to use the fairly unpleasant looking Putty to include some private key file to remote login to the linux box... You can even talk to AWS experts directly... they stand around all day at a bar with chess and checker and foosball. Yes it is a bit of geeky land.

Do I get something out of that? A bit. Just get to hear some buzzwords is nice. But will need to dive deeper to appreciate what it can do. But it will cost you some $ to experiment... you get to pay what you use.. It is not like you get the java jdk and experiment all you want without paying a dime.

Tuesday, March 15, 2016

A pi day problem

Came across this problem:

https://www.theguardian.com/science/2016/mar/14/can-you-solve-it-the-pi-day-puzzle-that-will-spin-you-in-circles for π day

It has been a LONG time I ever even attempt to prove anything.

Prove the red area is same as blue area. (Yes it is quarter-circle and semi-circle) So yes, you are dealing with area and that formula A = π r2 is useful here.

Of course, I am able to prove it without looking at the solution.

It is a pleasure to do little proof like this... you get some givens... Ok you tell me this... this means... that... Oh in another place you tell me this... this means some other things. Link them together you will get the conclusion.

What's the use of it you say? Nothing too useful. But it is exercise of the mind... to see if you can link things together.

Every high school sophomore should be able to do this!

Friday, March 4, 2016

A pleasant example of calculus

There are so many complains of what's-the-use-of-math beyond the 4 basic operations and perhaps fractions.

Here is one answer: you get more powerful tools to explain things, such as why days are getting longer in a hurry, as featured in this pleasant article: http://www.forbes.com/sites/kevinknudson/2016/03/04/the-days-are-getting-longer-in-a-hurry-calculus-explains-why.

Look, calculus may look ugly, but as the author say, "it is just formalism". The ground breaking concept of limit really isn't that hard. (But it definitely gets hard when you drill on the formalism part).

And for those who thinks calculus 101 is hard. It is ELEMENTARY, pre-requisite, baby stuff, even for a undergraduate level curriculum.

It is perfectly ok to be uneducated and uninformed.

Thursday, March 3, 2016

Metro bashing (again)

So Windows 8 has these terrible full screen Metro apps that is supposed to be "Modern". Terrible terrible full screen crap. When I had Windows 8, these use to just boom, close for no reason whatsoever, but restarting them generally will bring it back to action.

Upgraded to Windows 10. Metro apps no longer go full screen. Now that's good. And they don't crash anymore. They still suck at least they don't crash for a long while.

Minesweeper. boom. gone. Solitare? gone. Chess Titan? gone.

But Windows 10 came with the extremely popular Candy Crush Saga! This isn't just look for match as in Bejeweled. It is a lot more challenging and yes, addictive if you get started. It requires both luck and some thinking as you have limited moves to get rid of those candies covered by sticky jelly.

Alas, after days of playing to reach past level 100. Boom. This Metro app stops working. No error messages. No, don't blame Candy Crush. It isn't the culprit.

Not just this Metro app. Most other Metro apps such as News that worked stopped working also in such COWARDLY WAY. No error messages. Things closed right away. Metro apps aren't even in c:\program files.

Apparently I am not the only one having this issue.

Ideas from the web include:
1) Run some Power Shell script to re-register the apps. See here. Nope didn't help
2)

sfc /scannow
See here. Nope. didn't help either. It just says it can't fix it and tell me to look at some idiot tells-you-nothing log.

I thought my bashing of Metro ended with Windows 10. Nope.

Microsoft: This. is. RIDICULOUS.

Monday, February 29, 2016

Getting music on speakers

If you have music on your phone and Ipod device... how do you hear them? Headphone of course. How about out loud?

A bluetooth speaker of course... Some of these are quite expensive. How about in your car, using your car's stereo?

I believe modern cars now have USB ports so you can plug in your phone to charge it and play music out of it. I am not too sure.

If you have an older car, you can try 1 of two things. 1) AUX mode 2) FM Transmitter. http://science.opposingviews.com/connect-iphone-play-car-stereo-7998.html

You can have a little device that translates your phone's songs into FM signal via Bluetooth and your car can pick up FM signal as if you are playing FM radio! Now that's pretty amazing. Gee, I wasn't aware of AUX mode so I bought a FM Transmitter thing.

What about the IPod Mini? I have a now-old model... it does not play sound outloud by itself without headphones. Oh it does not have bluetooth. I used to have a simple Sony clock that have the 30 pin thing so you can just plug that in to play but it STOPPED working! Sony used to represent QUALITY but no, it stopped working. How unfortunate

So I bought another speaker. It has NO status lines. It got lights but NO words. Ah it requires bluetooth! But IPod Mini has no bluetooth. Wait there is a little audio cable that I can use but the thing DOES NOT PROVIDE SUCH cable. How frustrating. But ah, my FM transmitter has one. and the speaker needs to press hard to turn on. Not a one touch turn on. WTF. The fact that it has no little LCD screen telling me what it is doing is frustrating.

Friday, February 26, 2016

Chicago hopelessness: crime and CPS

Election, election, election. Everybody seems to only care about the election these days... Trump continues to dominate the headlines. But don't let him overshadow things that really matters, like life-and-death.

In Chicago, some promising innocent person getting killed by stray bullet...may occupy 1 day of headlines and that's it. The news will soon be eclipsed by other killings and of course other remarkable Trump remarks.

It isn't looking good in Chicago here. See http://crime.chicagotribune.com/chicago/shootings/. Last year there were close to THREE THOUSAND shooting victims, and it is only February we already have 430. If you look at the chart it is a lot more killings than last year. And look. Even if it is half as last year still 1,500 shootings ok? Something needs to be done here.

I don't get it... we fight crime with... some computer/statistics thing? https://www.dnainfo.com/chicago/20160225/downtown/cpd-sticking-with-compstat-expanding-it-keep-tabs-on-cop-complaints. I am not so sure how that helps.

Big Brother approach should be here. Security cameras should be in every corner of the troubled neighborhoods. Propaganda posters saying if-you-shoot-we-shoot all over the place. Yes, some degree of freedom to be traded for more security. If CPD is so uncapable we need the National Guards or the army. And of course there is no money to mobilize troops to secure the streets.

Ok, crime statistics database is out there... how about crime solving statistics? Do killers ever get caught?

And Chicago Public Schools is threatening strike again. Kids on street aren't helping crimes. Dang, what do they want? They want more money less students. http://www.forbes.com/sites/scottbeyer/2016/01/18/amid-fiscal-collapse-chicago-teachers-union-demands-pay-raises/#746d34d67213. They already make $14,000 more than average city residents with a graduate or professional degree. Yes, it is insane to have 40 students. But if you need smaller class size you need more teachers and that will make your paycheck smaller you hear? The solution is infinite amount of money.

There will never be enough money to satisfy unending needs. Can parents contribute a little to hold off a strike? Look at what you're teaching: walk off job if not happy. Is this the right value to put onto children?

Thursday, February 11, 2016

Riot in Hong Kong

People in Hong Kong were rioting. This is the biggest conflict since the Umbrella Revolution where people blocked streets protesting against the unfair voting system for their own government official.

A riot, especially around New Lunar Year is rare and troubling. Some details here for example.

Bricks thrown at police... Shots fired in air. The protestors were beat up and arrested. Hong Kong people feel increasingly being oppressed. The freedom that they have enjoyed under British rule is diminishing. Bookstore owner selling banned books in Hong Kong mysteriously made disappeared by mainland cops crossing the border. No one can do anything about it. That previous Chief Executive guy is full of corruption and still not charged yet. Mainland is even pushing for destruction of basic things like reading and writing traditional Chinese and speaking the native Cantonese.

It really is naive to believe Hong Kong can remain its way of life as youngsters increasingly feel hopelessness. Only the richest can afford housing and they work the longest hours.

My facebook feeds are covered with riot pictures along with words describing the hopeless situation there. The future is quite grim over there.

How come Macau don't seem to have as much issues?

It is unfortunate that really, those with bigger fist rule. Hoping mainland be kinder to Hong Kong please.

Wednesday, February 10, 2016

Outrageous Supreme Court Decision

Many things including Supreme Court decisions are debatable... but not when it comes to things that concerns everybody... the climate.

Just what do these guys want: protect the coal industry? See here: http://www.theatlantic.com/technology/archive/2016/02/the-supreme-courts-devastating-decision-on-climate/462108/

Have these coal pollution point right at these guys' face please.

Yes it hurts the coal industry, but in the long run if right actions not taken now... the world is DOOMED you hear?

Waita minute just how does check-and-balance work again? How do you overturn a Supreme Court Decision to protect humanity? Wait for these guys to die so the president to appoint new ones?

Friday, January 29, 2016

Pretty Print JSON

Sure, online JSON Formatter is nice. Try this one here, for example: https://jsonformatter.curiousconcept.com/. It helps you understand your JSON. However, if your JSON is redicously large you need to make your own beautfier.

Json simple's JSONParser and Google's Gson can help you. First you need to find some jars.

Here is a simple Java program
import java.io.BufferedReader;
import java.io.FileReader;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
 

public class JSONPretty {

 public static void prettyPrint(String jsonString) {
  JsonParser parser = new JsonParser();
  JsonObject json = parser.parse(jsonString).getAsJsonObject();
 
  Gson prettyGson = new GsonBuilder().setPrettyPrinting().create();
  String prettyJson = prettyGson.toJson(json);
  System.out.println(prettyJson);

 }
 public static void main(String[] args) {

  if (args.length!=1) {
   System.out.println("USAGE: java JSONPretty [data.txt]\nwhere data.txt contains lines of JSON\n");
   return;
  }
  
  try {
 
   String fileName = args[0];
   BufferedReader readbuffer = new BufferedReader(new FileReader(fileName));
   String strRead;
   
   while ((strRead=readbuffer.readLine())!=null){
    prettyPrint(strRead);
   }
   readbuffer.close();
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
 

}

Thursday, January 28, 2016

Android: here I come again

Just installed the Android Studio. http://developer.android.com/sdk/index.html.

Now it is off Eclipse. Why? Everyone seems to hate Eclipse saying it slow and crash. NO. Eclipse works for me just fine. I still love it. This IntelliJ based thing is much like Eclipse only people complain less.

Ok, let's see what we got here. It installs... but the emulator won't run. Saying Intel HAXM hardware acceleration thing needed. Tried to install that. It simply won't install. Fortunately there is way to get around... See this stackoverflow link. You can create a non Intel..an ARM emulator thing. Yes it is slow.

When I last worked with Android for fun... It was close to THREE YEARS AGO with version 2.2 Froyo API level 8. Now we are at API level 23 Marshmallow. Yes, a lot to catch up..but I STILL do not have a new app idea yet. (Don't suggest outrageous things like make it mow your lawn). My last app idea was a toy piano that let you play a few notes (no match against gosh excellent piano apps out there).

I can probably modernize my old apps... but I still make absolutely 0 money on them.

Wednesday, January 27, 2016

Google beats Go

I am not surprised. Computer program beats human in the game of Go. See here.

Go is an incredibly complex ancient game with simple rules. I won't even attempt to play this gosh-so-hard game. Everyone ought to try to get a taste of how hard this game is.

Something complex needs a tireless computer to do. But is this program written with the Go Programming Language?

What's the next thing computer wants to beat?

Do you feel threatened that computers will take over the world? Look at this, now robots can cook. See here.

Ok, do not, ever, give robot guns, Ok? Robocop in the movies only please.

Tuesday, January 26, 2016

Most hated programming languages

Came across this article about programming languages that programmers hate.

Yes I agree with much of this article. Those who have not seen PERL do not know the evil of it. C++ is absolutely ridiculously complex. Now now, that public static void main method in Java is just a bit mouthful.

Yes, it can be a bit clumsy especially its wacky Date and Calendar classes... also wacky awkward in all this File Stream stuff... But java has so many good useful libraries. For those who like a cleaner more interesting version of Java should look at groovy.

Yes, VB.NET stinks big time. Why aren't you using C# instead if you are stuck with (or have chosen) the Microsoft platform.

Yes, PHP seem like a toy... and I don't think I will ever need Python when I have java around. Uh hem, the author actually liked Python.

Ok I need to add: Objective C on this list. Even more horrible than C++ and it is superset of C? Ultra wacky syntax. But if you need to program Apple things natively, once upon a time you must use it.

Haven't seen Swift in action yet but it looks much, gosh, much more approachable.

Here is an observation: if something is hard, it will get easier later. Apple programming is one example. So is Windows programming. Windows SDK is hard. MFC is intended to make it easier, still damn hard...until .NET things come along with C# (which just stole from Delphi)

But nowadays javascript is the king... all sorts of javascript libraries out there. Think you know it? It can get incredibly difficult when people go crazy with it. People love...and hate javascript.

Thursday, January 7, 2016

CSS unselectable text

Came across a strange requirement... some text on the webpage should not be selectable, as in some EULA text. Ok this is stupid. Alt-Printscreen? Take out phone and take screenshot? You just can't protect your text. Also view-source too.

But CSS let you do this. Found a stackoverflow link that shows how. Try below:

<style>
.noselect {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
 </style>

Selectable text.

Unselectable text. I have class="noselect"

Wednesday, January 6, 2016

Article about 1 (on January 1)

I saw this quite fascinating article about 1 on January 1. http://www.forbes.com/sites/kevinknudson/2016/01/01/the-ubiquity-and-utility-of-the-number-1/.

Are you convinced yet? 0.9999... (infinitely many 9's) IS 1. Not getting close to, but IS 1.

The ratio sin(θ)/θ tends to 1 as θ goes to 0. The author is avoiding the typographical difficulty of the limit notation... Yes you have seen that in calculus and this thing is quite useful because it helps proving the derivative of sine is cosine...

Yes! I remember the clever trick needed to do the integral of secant x.

People will go to great depth to solve problems such as integrating things. In real life do you need? Probably not. But it is accomplishment to able to integrate that.

One can probably say a ton more about the number 1. Ok let me just add 1 thing. This is only (positive integer) number that is neither prime nor composite!

Tuesday, January 5, 2016

7th row of Periodic Table completed

Look! New elements are found! The 7th row of the Periodic Table is completed! http://www.theguardian.com/science/2016/jan/04/periodic-tables-seventh-row-finally-filled-as-four-new-elements-are-added.

Look at what the Nobel laureate say about this: "To scientists, this is of greater value than an Olympic gold medal”.

Just how do they discover elements? They smash particles together many many times and the new elements last for a fraction of a second. http://www.latimes.com/science/sciencenow/la-sci-sn-new-elements-20160104-story.html

It takes several months to try this smashing experiment roughly 10 quintillion times. And we’re not always successful,” she said. At most, it will work about three times in 10 quintillion tries, she added

All that work... for a fraction of a second of the new big elements... is there use of those? If there is of any use, better use that in that fraction of a second.

This is olympic gold medal for science... but I fail to share the enthusiasm.

I never quite understood the periodic table: why is the periodic table not in a perfect box? Why is there 2 extra rows that needs an asterisk... Electron configuration I guess. Chemistry has always been over my head.

And of course, there are different world within the proton... the quantum world that only your PhD friends have a clue or so.