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):

Steve Jobs Keynote Cloud Keywords

As Mac fan who always stays late at night to watch Steve Jobs Keynote after every big Apple Event, I always thought that having “Keyword Cloud” with most frequent words that Steve Job’s use during keynote would be very interesting to see.

Unfortunately we still don’t have anything like that, but someone put short (180sec) version of latest iPad keynote, and it’s really interesting to compare that with short version (90sec) of Steve Jobs 2008 keynote. I’ll leave keywords to yourself, it’s not very hard to figure ;)


Latest Keynote (iPad Announcement) in 180 sec


2008 keynote in 90 sec

MySQL: Deleting with Left Join

Today I had to deal with one huge table and cleanup all data where foreign key doesn’t have it’s primary key match in original table, just to remind myself how sub-queries in MySQL are terrible slower than joins.

I have some script which generates domains from typos, so I have one table with original domains (master_domains) and other one (result_domains) with generated typo domains. Basically something like this:

mysql> describe master_domains;
+--------+------------------+------+-----+---------+----------------+
| Field  | Type             | Null | Key | Default | Extra          |
+--------+------------------+------+-----+---------+----------------+
| id     | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| domain | varchar(255)     | NO   | UNI | NULL    |                |
+--------+------------------+------+-----+---------+----------------+
2 rows in set (0.07 sec)

mysql> describe result_domains;
+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| id        | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| domain    | varchar(255)     | NO   | UNI | NULL    |                |
| master_id | int(10) unsigned | YES  | MUL | NULL    |                |
+-----------+------------------+------+-----+---------+----------------+
3 rows in set (0.01 sec)

Table result_domains has master_id which is foreign key reference to primary key (id) in master_domains table. Since I also have other scripts generating domains without typos (which store result_domains.master_id field as NULL), today I simple wanted to get rid of those masters without proper master_id reference in result table or in other words those master domains where result_domains.master_id is NOT NULL.

With sub-queries you could write query easily with something like this:

delete from master_domains where id not in
(select master_id from result_domains_frontend)

It is good habit to always run select query before deleting big number of rows (just to make sure your query is written correctly) so I tried select query first:

select * from master_domains where id not in
(select master_id from result_domains_frontend) limit 10

However, it took several minutes to run without any output so eventually I’ve decided to stop it. I know that sub-queries are much slower than joins, so decided to do try removal operation with left join.

Left joins are actually perfect weapon to find rows that exist in one (left) and doesn’t exist in other (right) table. They also have one big advantage over sub-queries – they are performing much faster, plus they are backward compatible with old prehistoric MySQL 5.x versions. However delete syntax is little bit tricky so after few trial and errors eventually I came out with this query:

delete master_domains.* from master_domains
left join result_domains_frontend
on master_domains.id=result_domains_frontend.master_id
where result_domains_frontend.master_id is null ;

And voila after a while it came up with result:

mysql> delete master_domains.* from master_domains
left join result_domains_frontend
on master_domains.id=result_domains_frontend.master_id
where result_domains_frontend.master_id is null ;
Query OK, 270558 rows affected (46.58 sec)
mysql> 

MySQL: Moving table from one db to another

To move one table from one db to another, you can create new table (create table foo_new like foo) in db where you want to move table and then copy data with insert into/select query. However there is much easier way which is especially handy when you deal with big tables.

As you probably aready know, there is easy way to rename MySQL table just by issuing rename clause in alter statement:

ALTER TABLE foo RENAME TO new_foo;

You can also use RENAME TABLE syntax like this:

RENAME TABLE foo TO new_foo;

Now, when you need to move table from one db to another, all you have to do is to specify it’s current db and new db name as table prefix. For example if you want to move table foo from current db to new db you can issue queries like these:

ALTER TABLE currentdb.foo RENAME TO newdb.foo;

or

RENAME TABLE currentdb.foo TO newdb.foo;

Btw there is important difference between ALTER and RENAME statements in a way that with RENAME you can rename more than one tables at once. This comes handy if you want for example to swap names of two tables:

RENAME TABLE table1 TO temp, table2 TO table1, temp TO table2;

It’all about YOU!

Today I wanted to watch the latest Motorola Droid review video, stuff that I got on twitter marked with #android hash tag. However on the very beginning of video I noticed very effective Yahoo! commercial … it’s something about YOU!

Since I recently became HTC Hero owner and watched plenty of their stuff, immediately got “Deja Vu” effect. It didn’t take me long to find this page, which represent the latest HTC ad campaing.

Although it is great to know that both Yahoo and HTC are following recent trends so they threat YOU (us) as important guys, I really wonder how come they come up with almost the same message and logo at the same time? Please let us know who was stealing from whom?

« Previous Page Next Page »