Skip to main content

Android 2.2 Froyo on HTC Hero

As you probably already know, Android 2.1 (well known as Eclair) is the last version officialy published for our lovely Hero. With new phones such as Desire (HD) and Legend, HTC obviously has better things to do than keeping their old phones up to date.

However thanks to Villainrom guys, HTC Hero is still alive and kicking. They have various ROM versions available, some of them are based on official HTC build (with HTC Sense), but some of them are more like “vanila” built, with no HTC Sense at all. One of them is Froyd Villain 1.5, which is the one that I’ve decided to play with this weekend.

Honestly, I like to keep things on my phone working, but since I was totally frustrated with inability to do wifi tethering (even with anetShare or wifi tether apps it didn’t work with Mac) I’ve decided to jump into unknown and spend some time playing with Froyo this weekend.

First off, installation is really easy. Just follow these instructions and within half an hour, you should be running brand new Froyo device. First boot will take a while, but be patient it will payoff later 🙂

Now here are my first impressions after few hours of playing with Villain’s Froyo:

Pros:
– It’s incredible fast. Works without any lag and it’s probably 2 or 3 times faster compared to official HTC 2.1 Build.
– It’s much more customizable than official build. There are more tweaks for advanced users but even for “ordinary” users there are more ringtones, wallpapers etc. stuff
– Since it’s Froyo you can opt to install app on SD card
– Wifi Tethering is working (tested with anetShare)

Cons:
– No HTC Sense at all. That means, no HTC Widgets (like cool weather widget for example), no fancy dialer etc.
– Even though it’s pretty stable, it’s still buggy and some things are not always working as expected. For example my official HTC headphones are not recognized at all. Phone reboot solved that problem but still there isn’t any visible indicator showing that headphones are connected. Same stands for charging. I also had hard time to figure out how to turn off spelling and prediction.

Bottom line, I really like it but I also miss HTC Sense a lot, so will probably give it few more days and then try other (Villain) HTC Sense based release which still *should* work faster than official build plus there should be tethering available.

Here are some pics (created with dropcap2 app):

MySQL – NULL values and sorting

Very often we need to sort some data by specific field in db table but in a way that NULL values goes at the end of dataset. Typical example is frontend which displays data from specific table, with sortable links at the top where you can make asc/desc sorting simple with one click of the mouse.

Since I am mostly dealing with domains, I’ve decided to create one MySQL table with few domains, simple enough to show solution for this problem.

mysql> select * from domains;
+----+-------------------+-------------+
| id | domain            | expire_date |
+----+-------------------+-------------+
|  1 | dinke.net         | 2010-01-17  |
|  2 | lampix.net        | 2009-12-26  |
|  3 | blogodak.com      | 2010-09-08  |
|  4 | maestrodesert.com | 2009-09-11  |
|  5 | unexistant.com    | NULL        |
+----+-------------------+-------------+
5 rows in set (0.00 sec)

So problem is, I want to sort data by expire_data field but in a way that NULL field (ie domain which is not regged yet or has expired) always goes at the end. By default NULL fields goes on the top if we sort by acceding (asc) order or at the end if we sort in descending (desc) order.

mysql> select * from domains
order by expire_date asc;
+----+-------------------+-------------+
| id | domain            | expire_date |
+----+-------------------+-------------+
|  5 | unexistant.com    | NULL        |
|  4 | maestrodesert.com | 2009-09-11  |
|  2 | lampix.net        | 2009-12-26  |
|  1 | dinke.net         | 2010-01-17  |
|  3 | blogodak.com      | 2010-09-08  |
+----+-------------------+-------------+
5 rows in set (0.00 sec)

mysql> select * from domains
order by expire_date desc;
+----+-------------------+-------------+
| id | domain            | expire_date |
+----+-------------------+-------------+
|  3 | blogodak.com      | 2010-09-08  |
|  1 | dinke.net         | 2010-01-17  |
|  2 | lampix.net        | 2009-12-26  |
|  4 | maestrodesert.com | 2009-09-11  |
|  5 | unexistant.com    | NULL        |
+----+-------------------+-------------+
5 rows in set (0.00 sec)

We are going to solve this problem by using MySQL IF function, and solution is:

mysql> select * from domains
order by if(expire_date is null, 1, 0), expire_date asc;
+----+-------------------+-------------+
| id | domain            | expire_date |
+----+-------------------+-------------+
|  4 | maestrodesert.com | 2009-09-11  |
|  2 | lampix.net        | 2009-12-26  |
|  1 | dinke.net         | 2010-01-17  |
|  3 | blogodak.com      | 2010-09-08  |
|  5 | unexistant.com    | NULL        |
+----+-------------------+-------------+
5 rows in set (0.00 sec)

MySQL IF function is similar as ternary operator, it returns value of first argument in case when expression evaluate to true, otherwise it returns value of 2nd argument. So in this particular example it returns 1 for NULL values and 0 for the rest, allowing us to have NULL values at the end of the list.

I know that this might sound little bit confusing so we have to go one step further and add another one field in our MySQL table in order to explain what is exactly going on here.

mysql> alter table domains
add column nullorder tinyint not null;
Query OK, 5 rows affected (0.01 sec)
Records: 5  Duplicates: 0  Warnings: 0

then we are going to update values of nullorder field so they contains values of IF expression above:

mysql> update domains
set nullorder = if(expire_date is null, 1, 0);
Query OK, 1 row affected (0.00 sec)
Rows matched: 5  Changed: 1  Warnings: 0

mysql> select * from domains;
+----+-------------------+-------------+-----------+
| id | domain            | expire_date | nullorder |
+----+-------------------+-------------+-----------+
|  1 | dinke.net         | 2010-01-17  |         0 |
|  2 | lampix.net        | 2009-12-26  |         0 |
|  3 | blogodak.com      | 2010-09-08  |         0 |
|  4 | maestrodesert.com | 2009-09-11  |         0 |
|  5 | unexistant.com    | NULL        |         1 |
+----+-------------------+-------------+-----------+
5 rows in set (0.00 sec)

Now when we have nullorder field our first query:

select * from domains
order by if(expire_date is null, 1, 0), expire_date asc;

can also be written in this way:

mysql> select * from domains
order by nullorder, expire_date;
+----+-------------------+-------------+-----------+
| id | domain            | expire_date | nullorder |
+----+-------------------+-------------+-----------+
|  4 | maestrodesert.com | 2009-09-11  |         0 |
|  2 | lampix.net        | 2009-12-26  |         0 |
|  1 | dinke.net         | 2010-01-17  |         0 |
|  3 | blogodak.com      | 2010-09-08  |         0 |
|  5 | unexistant.com    | NULL        |         1 |
+----+-------------------+-------------+-----------+
5 rows in set (0.00 sec)

So as you can see completely the same stuff as first one, except that we didn’t have to create nullorder field.

Of course in similar way you can have NULL fields appear at the beginning of the list (in case of desc order) when you need something like that.

Future of Web Applications, Miami

Tuesday, cloudy day in Miami, not really good weather for the beach, but who cares. Today is FOWA day!

Check in was within 08-09AM in beautiful Adrienne Arsht arena. Checked location on Google maps, it’s just nearby my hotel so no need to deal with car. Arrived just few minutes before 09AM, so after they checked my data they gave me blank pass and pen to write down my name/company on it. As every proud Serb I took the chance to draw Serbian flag there so my geek colleagues knows exactly from where I am 🙂

Inside of hall there was bunch of geeks from all colours and ages … but most of them have one thing in common. They were all armed with a Macbook. I counted like 50 Macbook (Pro) laptops, with only one sad PC guy. I joined the mass with my Macbook Pro and started with some kind of live broadcasting to well known Serbian Development Forum.

Fowa, Miami

Before he started his intro speech, Ryan Carson asked from us to meet and shake hands with each others. Most of us were doing that … “Hey bro, how yo doin’ …” and suddenly robots becomes men. Well done Ryan.

First guy on the stage was Jason Fried who were talking about their Getting Real philosophy. Without much noise and any presentation screen behind, he mentioned plenty of good advices regarding productivity, sales, future prediction etc.
Jason complained about giving away software for free, because food is not free, our cloth is not free, our car is not free … so why in the world software you made should be free?

Jason (37signals)

After Jason Ajaxian guys (Dion Almaer from Google and Ben Galbraith from Mozilla) took the stage. Their speech was much more interesting to me, with plenty of effective screens behind, describing what is going to happen with browsers in the near future. In one word – revolution, which is going to get current Ajax based applications even more usable with usability closer with those that we have on OS X (they frequently used Mac examples).

Ajaxian guys

After Ajaxian guys, Dan Theurer from Yahoo took the scene. Unfortunately his presentation file was corrupted so somehow he did his speech too fast. Also without presentation slides behind it was really hard to track his speech so many developers took the chance to play with wireless and at the end it seamed that Dan couldn’t wait to move away from the stage which was kind of shame.

After the morning break there was probably the most effective talk made by Joe Stump, lead developer of Digg-a.

Joe Stump

Joe used ingenious slides with him and his brother pics from their childhood in attempt to present developers as lazy, moody and egocentric guys (come on, we all know that it is completely the true), and how to make compact and productive team from them.

My favorite quotes:

Developers are EXTREMELY lazy.

Jedi are rare guys

(finding senior programmers is not easy – demonstrated by picture of kid with light Jedi like sward in hand).

Joe Stump on Code Repositories

After they ended Aza Raskin from Mozilla took the stage to tell us about all those great little things Mozilla Lab is preparing for us. He was talking about Ubiquity, kind of Firefox add on which would allow you to do many things, like changing content on pages you’re visiting often (like you could easily replace Google logo with your own ad), and many other things. Unfortunately backed guys screwed it again so Aza also stayed without his presentation and had to leave the stage and finish it at the end of show.

Aza Raskin(Mozilla)

After lunch break Joel Spolsky made an interesting and funny talk, where he talked about programmer’s efficiency, setting working environment, office stuff etc. Like Jason, he also mentioned interruption as one of the biggest enemies of programmer’s productivity. He claims (and I totally agree) that every developer during his working day usually has about 2 or 3 hours of “total focus” in which time he is 100% focused on problems he is solving. During that period developer usually doesn’t feel the time (2 or 3 hours pass like a snap). Noisy environment, phone ringing, even going to the toilet are the worst enemies of every programmer.
That’s why big companies that are paying attention to those stuff (like Google) are trying to keep developer’s focus as long as possible with ie. keeping his snack near by, the same with toilet and even shower booth 🙂

Talent

After Joel, some very effective (but personally not so interesting) talks was made by Dave McClure and Alex Hunter from Virgin. And after pause there was another one “talk show” with Joel, Jason and Caron, after which Francisco Tolmasky from company 280 North took the stage.

Francisco made great workshop with Cappuccino and Atlas tool. By using Atlas – kind of point and click tool started from the browser on local host, he used point and click interface to create an feed reader application in like 3 minutes! After that he did the same for iPhone platform. I liked whole thing except the fact that you don’t have ability to do kind of “synchronization” between iPhone and Web project (things are kept in separate files). I even took a chance to talk with Francisco after the show about that, who was BTW the only speaker I had a chance to meet personally.

Francisco Tolmasky

At the end there was Gary Vaynerchuk’s talk who somehow acted like a Eminem, he talked loud and fast, sometimes cursing, screaming … I could say almost crying 🙂 Don’t have enough time to repeat everything Gary said, so if you have a time, here’s the video of his talk 🙂


Gary Vaynerchuk at FOWA Miami 09 from DamianVoltes.com on Vimeo.

At the end we were invited to visit the party on Nikki Beach which as far as I can tell many developers did. Free beer provided by Microsoft … you could hardly find something more attractive 🙂

Me on Nikki Beach

My Personal pics from FOWA conference

P.S. This is English translation of FOWA Conference report made originally in Serbian. Now when I got back to my sucky homeland, I managed to translate it completely. Hopefully you enjoyed.

Back to english

This is my first post in English after very long time. If I don’t count the one related to curl http client class update, I haven’t written anything on my English Blog since august 2007!

Unfortunately I had very good reason for doing that. My daughter got sick, very sick. She have Leukemia (ALL), so since October 2007 my life was twisted upside down. We had to move to Belgrade where she started with chemotherapy treatments which was really hard with plenty of complications and life treating conditions. With so much time spent in hospital and other related obligations, I really didn’t have spare time to deal with my Blog, neither to be honest i felt like writing anything about programming etc. I wrote few post on Serbian since than, but most of them were not related to programming or anything Web Dev alike.

Anyway few weeks ago she is done with intensive phase of chemotherapy, we’ve back home to our home town and it seams like things are moving back to normal. She is not done with therapy thought since Leukemia treatments last several years, but she have good chances to fully recover so we are trying to be positive and act like everything is completely normal.

Speaking of that after really hard year for us I decided to do something for myself and finally get one Apple :). I spent some considerably big amount of money to get one MacBook Pro. I even made unboxing gallery on Flickr, I guess after you drop like $2k USD for something you really want to save that moment for later. Now when I have it for a month almost I think it is worth the money. As a matter of fact I think it’s price in Europe (which is at least 33% bigger than in USA) is appropriate for what you get, while in USA I would consider it cheap 😉

Anyway, in next months other than usual LAMP stuff you can expect even text about Mac OS X applications, Darwin etc. For example my company use some socks5 proxy/public key setup to access to servers, which was pain in the ass to setup on Mac. I plan to write about things like that. And last but not least, I’ve already booked conference pass on FOWA conference, so I really feel my English should be improved to higher level. Maintaining English Blog should help I guess 🙂

Why 09/11 Happened to USA

Few days ago I watched on history channel an documentary about Berlin Blockade in 1948. On Jun 24, 1948 Soviets started total blockade of Western part of Berlin, with goal to spread their control over whole city. All communitations were blocked, and citizens of West Berlin were faced with lack of food, medicine and fuel for upcoming winter.

American response was quick, and starting from Jun 25 they launched a massive airlift using both civil and military aircrafts that flew supplies into the Western Berlin. Aircrafts were fly by volunteers, mostly by experienced WWII pilots who flew day and night, sometimes without sleep. Landing on improvised Berlin airport was very hard (especially during bad weather) – many brave pilots died during this mission.

One of the pilots involved in this mission was Gail Halvorsen. One day during pause between two flights he gave a few sticks of chewing gum to some children watching the planes from outside the base. Wanting to give them more, he promised to drop more candy from his plane the next day. And really, during next flight, soon before landing Halvorsen dropped candy attached to parachutes to children below.

His actions were soon noticed by the press and gained widespread attention. A wave of public support led to donations which enabled Halvorsen and his crew to drop 850 pounds of candy. By the end of the airlift, around 25 plane crews had dropped 23 tons of chocolate, chewing gum, and other candies over various places in Berlin. The action may have had a substantial impact on the postwar perception of Americans in Germany, and it is still pointed to as a symbol of German-American relations.

Yesterday was 09/11, 5 years after terrorist attack on United States. I see many people are looking for cause, why that happend to USA, why USA was picked as a target and why USA is no longer an icon of freedom in modern world.

Not sure about all causes, but I am sure that one of the reasons is that US advocated their freedom in Vietnam, Cambodia, Iraq, Serbia etc. with bombs and not with candies.

Started blogging in English

Few days ago I’ve decided to open english section on my blog. Thanks to Gengo wp plugin, I was able to separate english from serbian posts, then I translated some of old post from Serbian edition (mostly programming stuff).

Why am I doing this ? Well, since I started blogging I put great effort to write several programming tutorials, but found that these don’t have such a big audience here in Serbia. Since I got really good feedback from few people that were read them, and really wanted to offer those stuff to greater range of people, I’ve decided to put some little more effort, and translate them to english. Hopefully they will be usefull for someone, feel free to send in comments 🙂