Monday, March 28, 2011

My Android Apps live on Android Market

My 3 apps are now on the market!
https://market.android.com/search?q=Joseph+Mak&c=apps

To sell apps on the app market, you need an google account (of course), and you need to pay $25.

Your apk files need to be signed, here is details:
http://developer.android.com/guide/publishing/app-signing.html.

But first you have to export your app as unsigned first. See here for details.
http://forum.xda-developers.com/showthread.php?t=492822

Google requires you to have a BIG icon: 512x512 and at least 2 screenshots, with specified dimensions, one acceptable format is: 320x480. So use the emulator get some screenshots and zoom it to be the right size.

I have a new blog for exclusively for android:
http://josephmakandroid.blogspot.com/

Thursday, March 24, 2011

Sorting

In my first job out of college, one day I was told to query some data... and SQL was new to me. Gosh, computer science without knowledge of database is not so adequate for work because people want data, not determining if your algorithm is O(n2) or O(n log n), or if your problem is NP-complete or not. The ORDER BY clause saved me from pulling out the quicksort algorithm.

Fast forward many years, one day I take a look at some source code of a colleague (JSP file) and found the BUBBLE SORT algorithm!
What a surprise... Ok, that data is not from SQL so the ORDER BY clause can't help us here, but... buble sort on the presentation layer? this is not good strategy.

Ok, before you boo on the Bubblesort algorithm as poor O(n2) algorithm, let me tell you this: the quicksort is also O(n2) and a lot more ugly to write on your own.
Bubblesort is perfectly fine if your items to sort is not a whole lot.

The beauty of java is that many things are implemented for you already. How about Collections.sort? Stuff your items in an ArrayList, provide your own compareTo and voila.

I recently found out there is also Collections.shuffle too. This is ideal if you have to implement something like a card game.

So many objects so many methods within each... How do you learn them all?

So many new toys, some are here to stay, some are temporary hype.

Perhaps there ought to be continuous education program for people to stay updated. Perhaps it may be good business idea to open "tech update" classes...

Do I blame that colleague for being STUPID? No, as long as the code works.
That colleague was just not informed.

Sudoku Generator

I am impressed with this Sudoku Generator. And the python source code is right there.

You can generate puzzles on the fly in HTML, PDF or PostScript.

A LONG time I wrote a Sudoku solver (in java)... by recursion trial-and-error backtracking like solving the Eight Queens puzzle.

Being able to solve Sudoku classify yourself as a real programmer from a handwaving-ppt-generating, don't-really-know-any-programming "architect". Architects earn my respect if they can do-the-talk. Example: please don't talk web-service if you can't actually implement one.

Coming soon: I may turn that python into java and crank out my own puzzles.

Tuesday, March 22, 2011

AT&T again

I remember the day I had my FIRST cell phone. Cell phones were available for a long time I just didn't need one... my philosophy was this:
if you can't find me at home and can't find me at work, chances are: you don't need to find me. I got answer machines in both places
One day the weather was bad I made it to work and a cell phone company come to my company for promotion... gee, I could use it to call for help if I get stuck in snow.
So I got a phone, and it is in my glovebox. Thankfully I never needed it to call emergency.

The plan was 50 minutes a month.

I had it for several years. Then cell phone market exploded, my phone becomes a dinosaur.
Then AT&T becomes SBC then later I became a Verizon customer, and by then I needed to upgrade the dinosaur to something cool at the time.
My philosophy has changed: don't call me at home or at work, call my cell.

Verizon dares to not work well in places I needed most. I ditched it altogether and went with T-mobile for its mobile-to-mobile free feature.

Unlike some people I don't upgrade phones until they are broken... with the exception of my Android phone for programming on it.

Oh now AT&T takes T-mobile, and I will soon go back to AT&T. As a customer, all I care is... am I able to get calls, and is it affordable.

Nintendo 3DS and Street Fighter IV

Handheld gaming devices get more powerful than ever. The new Nintendo 3DS is demoing at the lobby of my workplace... specifically I played with Street Fighter IV.

It has been a LONG WHILE since I played any Street Fighters... I used Ryu to fight Dudley and beat him fairly easily and then it says, "thanks for playing the demo".

Ooh there is a slide switch to go from 2D to 3D without wacky glasses. I sense depth in the background. With 4 buttons, how do you do FIERCE punch/kick? Ah, the buttons are pseudo buttons in the lower half of the LCD.

Buttons are necessarily for games, especially fighting games. It is not fun without them, but I wasn't able to execute the Super... This is something the IPhone and Android CANNOT match.

I am impressed with graphics ability... and SFIV plays like SFII, with fancier graphics...

But a gaming device.... is a gaming device. The phone is more versatile, I am afraid that even with nice graphics and nice game play, people will just go to play BeJeweled on their phone.

The kids? they have plenty of games on the phones and ITouch too, if they can put up with touch screen and no buttons. I am afraid the Nintendo 3DS won't sell like hotcakes.

I'd like to play the real SFIV on PS3, but I am not going to shell out money.

Monday, March 21, 2011

文章修訂

I saw an interesting article in news regarding editing a news article...

The author suggested some way to make things better, but I BEG TO DIFFER.

The revision just pretend to read more like classic but not fit today's style. That's just my opinion.

Monday, March 14, 2011

Pi vs Tau

Happy Pi Day at March 14.

It is interesting that π made it to news headline.

Pi is to be CELEBRATED. There is so many interesting things about this number.

Oh and pi is "under attack" as the news article says. Take a look at this Tau Manifesto.

Yes, yes, 2π is in a lot of formula, and by setting τ = 2 π you can tidy up a lot of formulas.

Well, π comes naturally to Archimedes... Circumference over diameter. Yes, it is quite natural to measure by diameter. Have you ordered pizza by radius?

So &pi = C/d ever since, and besides minor frustration over extra 2s in the formula, there is no need to throw away all the textbooks out there with tau.

The world has already gotten used to π

When Mother Nature Roars

Everyone should take a look at some videos of the Japanese earthquake/tsunami. It swept away cars and houses like toddlers destroying lego structures. It is more powerful than Godzilla monsters imagined in the Japanese TV shows... yet there were no Ultraman to save them. The only thing fortunate about this is that it did not hit even more populated areas such as Tokyo. (But I am sure financially it would.)

When mother nature roars we are so little powerless beings. It is not over yet... that nuclear plant anxiety... it is going to be very difficult in the days ahead in Japan.

Suddenly the blizzard of 2011 in Chicago is so small an incident. Mother Nature just barely coughed, not roared.

According to Plate Tectonics, the earth is moving... and earthquakes happen when it decides to move. Are earthquakes getting more frequent worldwide? Before you conclude, read stats here.

We are powerless beings.

But you can help by donating to help those in needs.

The next natural disaster can happen to you.

Monday, March 7, 2011

Subway surpasses McDonald's

There are more Subways than McDonald's. Yup, see details here.

Subway sometimes is so expensive. The breads may tear your throat apart. It uses way more plastics than it should be... I usually don't go to Subway.

For me, Subway is too many steps to order, follow a line, what you like, choose toppings... I like numbered combos. I prefer Chipotle for get-in-line-choose-your-topping food.
For subs, Potbelly is better than Subway, even Jimmy John is better.

So I find it surprising for it to surpass McDonald's.

Wednesday, March 2, 2011

Gas passed $4 a gallon

Whoa, gas is now more than $4 a gallon!
See here for details.

Soon it will be this:
.

Time to dump your car and go for a hybrid car? But they cost thousands more...