La Vita è Bella

Monday, January 10, 2011

Purge Strikes Back to Android!

A Little Bit History

Back in 2005, after graduation from college, I got my first job at TrendMicro. After I got paid for enough money, I went to the store and brought a Palm Treo 650 home. That's the dream phone of that time. It have good hardware spec and more important, PalmOS.

My Treo 650 was broken at 2007. The radio module is died. So I can't use it as a phone, but can still use it as a PDA. I've made a nature choice: bought a Treo 680 to replace it. The reason is quite simple: it have PalmOS inside.

But the bad thing is I lost my Treo 680 at the end of 2007, left it on a table of a restaurant and never got it back again. This time I didn't buy Centro (but I recommended it to my then roommate :P). I decided to try something new. So I bought a Symbian phone (Nokia E51), Symbian looks like something comes from Stone Age compare to Palm OS. Then I bought a Windows Mobile phone (Sony Ericsson Xperia X1), but realized later that I do hate Windows Mobile. I bought a Samsung Galaxy (not to be confused with Samsung Galaxy S) at 2009, as I thought Android was mature enough to use. And I do love Android! But the lack of support and upgrade from Samsung makes me unhappy.

Finally, Google released Nexus One and I ordered one at the first time. This becomes the first phone after Treo 680 that I'm still happy after using it for half year, and I'm still happy with it while it's nearly a whole year already for now.

But...

But there's still something I missed from Palm, like "Purge":

Purge

(I dug out my broken Treo 650 today, blow away the dusts, insert the battery, and it still works! so comes this photo.)

"Purge" is a simple feature to do the cleanup work: delete all old messages older than N days. Yes Android is much more powerful compare to Palm OS in the old days, and it can keep "almost everything" (actually for SMS, it will keep only the recent 200 messages per conversation and automatically delete old ones by default). But I don't like to keep too many meaningless "everything", I prefer the old Palm way.

So I took the last weekend to make Purge Strikes Back!

Purge Strikes Back!

YOU HAVE BEEN WARNED!

Something I must mention is that for SMS deletion, I used some undocumented API. What did this mean? It means that this app may or may NOT work for you. It may or may NOT work as you expected. It may DELETE ALL YOUR SMS even you didn't mean to. It works on my Nexus One with Froyo and system Message app, it may not work with other phones, Android versions or Message apps. And it may break anytime even it works fine for you now. You take it totally on your own risk.

The call log deletion is implemented with system API, which should works fine, but I took no responsibility for your unexpected data loss, either.

So you'd better BACKUP YOUR SMS BEFORE TRYING IT. Personally I'm using SMS Backup + to do this for me and it works fine (it also backups call logs, too). There may be better ones but this is a choice you can consider.

Again, YOU HAVE BEEN WARNED!

How to Get It

Download it from its GitHub repo. It's free. You can also get the source code there, licensed under GPL v3.

I'll publish it to the Android Market in the coming days.

What to Expect in the Future

Acknowledgement

Some UI elements took from another awesome open source Android app Financisto, which is licensed under GPL v2.

Link

project homepage



tags: , , ,

23:53:07 by fishy - opensource - Permanent Link

no comments yet - no trackbacks yet - karma: 7 [+/-]

Wednesday, October 13, 2010

Say "Goodbye and Thank you" to POPFile

POPFile is an awesome mail classifier works as a local POP3 proxy. It's written in Perl and use a web UI so it can run on any platform.

I started using it back from about 2004. First I use it to filter spams, later to filter work mail, personal mail and important mails apart. Time moves on, as I stop using POP3 on Gmail, the main job for POPFile became to picking not-so-important script generated reports from other work mails (combined with Thunderbird filter based on "X-Text-Classification" header).

As I also use Gmail for work mail now at Google, I have only a few POP3 accounts that rarely get some non-spam mails. So it's finally the time to say goodbye to POPFile. As a record, here's the final statistics for my POPFile history, since Jul. 2007, the last time I reset the stats:

Messages classified: 135,631,
Classification errors: 910,
Accuracy: 99.32%

That's very impressive result. Thank you POPFile for so many years of service. If you are still using POP3 account, you should try it right now!

BTW, I always hope Gmail can auto label my mails, just like POPFile. Finally we got priority inbox, but that's not enough for me.



tags: , , ,

22:54:43 by fishy - opensource - Permanent Link

no comments yet - no trackbacks yet - karma: 17 [+/-]

Sunday, October 11, 2009

Modified Pwitter to support 3rd party twitter API

Pwitter is a good open source Twitter client for Mac. I just added supporting for 3rd party twitter API to it to make it better.

You can get my patch here or my build here.

There's no GUI for setting 3rd party twitter API address. Instead, you need to change the configuration file. You can use either Property List Editor or the Terminal "defaults write" way. Here's an example:

$ defaults write com.aki.Pwitter twitter_https -bool NO
$ defaults write com.aki.Pwitter twitter_base "teewt.yhsif.com"

To restore the default settings ( https and "twitter.com" ), you can just delete the custom settings by:

$ defaults delete com.aki.Pwitter twitter_https
$ defaults delete com.aki.Pwitter twitter_base

It's useful when you can't connect to twitter.com directly, like me in China. Enjoy it.



tags: , , , ,

22:06:13 by fishy - opensource - Permanent Link

no comments yet - no trackbacks yet - karma: 30 [+/-]

Tuesday, August 12, 2008

Note: how to delete an error calendar in Lightning

As Bug #428274, I can't accept any meeting requests sent to my work mailbox, and have to add the meetings into Lightning manually. This is really annoying. As the bug got fixed, I decided to upgrade Lightning to a 0.9pre nightly to get it working.

After upgrading, the following error dialog will greet me every time I start Thunderbird:

The error message after I upgrade Lightning to 0.9pre nightly

I googled this error message and found that it was caused by the incompatible extension ThunderBirthDay. OK, delete the calendar should fix it. No! The calendar was hide from Lightning's calendar list!

Fine, downgrade Lightning and then remove the calendar should work. But unfortunately, Lightning 0.9 have changed the storage format and can't downgrade to 0.8 anymore.

So how to delete that calendar? Maybe I should delete the calendar direct from Lightning's storage. According to the official FAQ, it's stored as an SQLite database file.

Under Thunderbird's profile directory, I got a "storage.sdb" file. I tried to use the command line sqlite to open it, and it works:

$ sqlite3 storage.sdb 
SQLite version 3.5.0
Enter ".help" for instructions
sqlite> .tables
cal_attachments              cal_metadata               
cal_attendees                cal_properties             
cal_calendar_schema_version  cal_recurrence             
cal_calendars                cal_relations              
cal_calendars_prefs          cal_todos                  
cal_calmgr_schema_version    cal_tz_version             
cal_events                 

The "cal_calendars" table seems to be the one I'm looking for:

sqlite> select * from cal_calendars;
1|storage|moz-profile-calendar://
2|thunderbirthday|moz-abmdbdirectory://abook.mab

Yes it is! so I need to know how to delete that record:

sqlite> .schema cal_calendars
CREATE TABLE cal_calendars (id INTEGER PRIMARY KEY, type TEXT, uri TEXT);

OK, then this should work:

sqlite> delete from cal_calendars where type = "thunderbirthday";
sqlite> select * from cal_calendars;
1|storage|moz-profile-calendar://

It DOES work!

Now my Thunderbird is quiet on starting.

But, the guys in Lightning really should give a chance to delete calendars that aren't compatible. I should file a bug for it. I've filed Bug #450121!



tags: , , ,

00:51:44 by fishy - opensource - Permanent Link

3 comments - no trackbacks yet - karma: 11 [+/-]

Monday, May 26, 2008

Miao cancelled

I've started the Miao project one year ago, aim to build a smart pinyin input method for Mac. But I just got a new job 2 weeks after I started this project. This is quite a busy year, and I haven't really wrote much code for it.

A month ago Yong Sun from Sun begin to port SunPinyin to Mac, and now it's more than just works. I'm satisfied with the Mac port and use it everyday. As the Miao project is scratching my own itch, and I'm not itchy anymore, I should call it a day.

Sorry for anyone who waits for Miao, but I'm not going to reinvent the wheel.



tags: , , , , , ,

20:29:46 by fishy - opensource - Permanent Link

1 comment - no trackbacks yet - karma: 9 [+/-]

Sunday, December 02, 2007

Yet another NP_Trackback hack

I've got an email from my host administrator to warn me that one of my MySQL table consumed lots of system load, and the table is nucleus_trackback.

But I haven't got any "real" trackbacks, so they are all spams, and more accurate, crazy spams, that simply too much to overload my DB.

So I have to wrote this patch to add an option to NP_Trackback: drop blocked trackbacks directly. After enabled, trackbacks that blocked by NP_Trackback (failed spam test or no link) will not be stored into the DB.



tags: , , , , , ,

12:35:40 by fishy - opensource - Permanent Link

no comments yet - no trackbacks yet - karma: 16 [+/-]

Sunday, September 16, 2007

Patches to make NucleusCMS plugins multi-blog ready

I was struggling to find a good multi-blog system to replace LifeType used on buddie5.com in the past few weeks. I've tried Movable Type but didn't feel satisfy with it. Finally I found that NucleusCMS, which is used here, have good support for multi-blog, so I think it's the solution for me.

Although NucleusCMS itself have good support for multi-blog, as it's mainly used as a single blog system like WordPress, nearly none of the plugins considered the multi-blog situation.

So I made patches for the plugins I used, to make them multi-blog ready.

These patches generally move some option from global to blog, so that every blog can have its own setting. And for some plugins that have an admin area, I also filtered the things it can admin to avoid security risk.



tags: , , , , , , , , ,

22:06:35 by fishy - opensource - Permanent Link

9 comments - no trackbacks yet - karma: 94 [+/-]

Sunday, June 10, 2007

Farmr

farmr is a GreaseMonkey script.

It's purpose is to recover some image source URL that was f'ed by some firewall, with the URL with web proxy.

I used the web proxy code from gladder, credit to gneheix.

For Camino users that can't use GreaseMonkey directly, you can use GeekMonkey.

Enjoy it and f' back.



tags: , , ,

11:43:18 by fishy - opensource - Permanent Link

no comments yet - no trackbacks yet - karma: 16 [+/-]

Saturday, May 19, 2007

Add emacs mode line support to vim, and call for help

UPDATE: sfiera took this project over so please head to his github page for this project. Thank you for the awesome work, sfiera!

Different editor configurations, especially tabstops are always pain for co-work. So if everyone uses vim, you can specify some vim instruction to override one's vim configuration in your file, just like:

// vim:tabstop=4:

And if everyone uses emacs, you can also specify emacs mode line like:

// -*- tab-width: 2 -*-

But what about make vim to read emacs mode line? I've wrote a script to do so.

As I didn't use emacs at all, I don't know which instructions can be specified in the emacs mode line. I just wrote a handler for "tab-width" as an example. If you are familiar with both emacs and vim, please help me to add more handlers into this script.

After more handlers added, I'll submit this script to vim.org.



tags: , , , ,

02:25:41 by fishy - opensource - Permanent Link

3 comments - no trackbacks yet - karma: 121 [+/-]

Monday, May 14, 2007

Miao: (will be) a new smart pinyin input method for Mac OS X

Why another pinyin input method?

The answer is simple: the current pinyin input methods on Mac doesn't satisfy me. I'm going to scratch my own itch :P

ITABC (comes with Mac) and Pinyin Module in OpenVanilla isn't a smart input method; QIM is smart but it's a shareware, and a expensive shareware (USD 19.99 or RMB 69.00, but only for one major version free update); FIT is smarter than ITABC and free (for charge), but is not smart enough and I don't like some of its feature but can't turn them off.

Miao will be a smart pinyin input method, designed for people who likes to input a whole sentence once. It will learn user's accustoming and finally become a essential tool in inputing (after some training).

The idea and feature

I won't focus on pre-train dictionaries, just like Sogou Pinyin or Google Pinyin. My focus will be on "learning"

For each sentence you input, it will record the words within the sentence, including continuos words and non-continuos words, and calculated for probability.

Continuos word probability will be used to auto-learn new words, that is, if there's a high probability that two known words will comes together, they will be formed as a new word.

Non-continuos word probability will be used for candidate word sorting. The word with the highest probability will get ordered first. As a instance, for the pinyin word "yaoming", if the sentence comes with "huojian"(火箭/Rockets), "maidi"(麦迪/McGrady), it's more likely to be "姚明"(Yao Ming the NBA player); If the sentence comes with "can"(惨/misery), it's more likely to be "要命"(Kill me!).

The license

It may be licensed under GPL or BSD license, it's not decided yet. But I can assume that it will be certainly free, as freedom!

About the name

"Miao" is the pinyin of the Chinese character "", which just like "meow" in English, is "the characteristic crying sound of a cat" (from Oxford American Dictionaries).

It's a pinyin input method, so I choose a pinyin word as its name :P

Other informations

I should write it as a module for OpenVanilla, instead of stand-alone. The reason is that I'm not going to reinvent the wheel. I want to focus on the learning algorithm, but not the system interfaces. And this may make it easier to port into other platforms, for example Linux.

The project homepage will be http://oaim.yhsif.com. I'll start it soon, any contribution, e.g. codes, ideas or artworks, are appreciated.



tags: , , , , ,

16:30:55 by fishy - opensource - Permanent Link

8 comments - 1 trackback - karma: 18 [+/-]

May the Force be with you. RAmen