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.