Happy Coding
Sunday, April 17, 2005
  Finally command-line blogging!

I was thinking that blogging from commandline would bring many benefits. For example, I could use powerful vi for editing needs. And I could blog from anywhere that has a ssh connection to my workstation. That is, no requirement of graphical user interface always extends the possibility of usage and convenience. People may think I am a geek too much loving the chars black and white. No! I hate the unstability of using web interface for blogging. Users cannot be delayed! They should focus on their work, not waiting!

Unfortunately, even with google, I feel no lucky of finding any tool available that even comes close to my basic needs. Because all of them claiming using commandline does not support posting to blogger. Due to my latest preference to perl, I tried to locate any module for blogger api. Yes, it does have! Cool..Perl! However,:), the module is not mature enough to support internationalization and some of the minor issues. Furthermore, the important feature of posting with title is even missing. Expecting a full support of new atom api is frustrating.

I finally figured out a simple solution by using blogger's mail2blog service:) It's really amazing if it could be always efficient and stable enough, though. I tackled today a little bit on MIME:Lite and MIME:base64, which elegantly do the job to encapsulate a normal html text into a standard MIME mail package. In one word, I make it:)

Basically my script does the following:
1. invoke vi for editing, and no need to consider a filename 'cause i use a unique value for that. the post title anyway has to be at the first line, no restriction of editing further.
2. after saving, it encapsulates the post you edited to a standard mail package that will be delivered to the specified mail2blog address, i.e. your target blog in blogger.com.
3. actually delivery of mail is done via SMTP. you must provide one SMTP account for this. I tried to use 'sendmail' for delivery, but apparently blogger.com does not accept mails from it, though Gmail server will. I don't know why. Anybody happens to see this post and knows why, please tell me.

Summary: the steps i list above sound simple, but it really takes time to figure out all the problems when you run into sth that you feel it's supposed not to be. most of time it's because of chinese character problem. anybody interested in this small script could ask for it by email.

As test for html and figure posting, I insert a home link here:)

 
Sunday, March 27, 2005
  Java-Gnome: GTK+ / Gnome Apps in Java It's great to know that java-gnome is a good way of building gtk/gnome applications. My previous idea of managing docs turns out to be much more possible now, especially when Gmail client has a java API implementation. Furthermore, for a simple wysiwyg editor, libgtkhtml might be a way of doing that. Fortunately, java-gnome has also an implementation of that. I may also want to integrate blog support to this doc client as one publishing target.

All look like a promising open source project :) 
Tuesday, March 22, 2005
  An idea of managing documentation Writing documents is now quite important for work. I've been always thinking of a better way of documentation management, especially when I need to contiuously update them. If documents are not required to be updated, they can be archived and stored as emails. Correspondingly, the powerful Gmail service would be the best choice for archiving, labeling and future retrieval. However, the most troublesome thing is that quite a few of them need updating, while it is not allowed in email storage.

My idea is quite straightforward, why not use the *draft* folder as the storage space for all docs to be updated. It would be awesome if docs are updatable while they remain all benefits of email service, especially from Gmail, such as labelling for classification. The consequent problem is document editor choice. The editor that Gmail provides has two problems of concern: 1) too simple(only plaintext), no flexible layout due to its page design(we may not expect any possible alteration) 2) potential data loss due to unexpected network failure.

I do think using Gmail's *draft* folder would be a good idea to mantain any kind of documents that require updating. To realize this idea, two updating barriers need to overcome. Are they really painful enough to be worth the effort? I am asking myself...:) After all, hacking into Gmail and client GUI design with good editor support would require wide enough skills and be a definitely hard work... 
Wednesday, January 05, 2005
  midi keyboard 几年前写的一个midi小程序。大部分人可能都觉得midi怪怪的,甚至有些难听,所以也常会看到有人问怎么把midi转成mp3(其实midi2mp3 和rm2mp3或者wma2mp3完全是两码事)。不过几年前我突然迷上了midi 尤其是玩过vos这个游戏之后,总有个念头,要是那些好听的midi可以随意按照我想要的乐器来演奏该多好啊,把刺耳的flute变成柔美的nylon guitar 要是把迷人的吉他曲romance换成piano会是什么效果呢?或者用harp来试试?想想都很有意思。不过我写的这个是当时测试 windows的midi接口玩的简陋的小程序,通过键盘敲击来midi发声,并可以选择不同的乐器(为了简单我就选了4种:piano,guitar, harpsicord, musicbox)。当然有了这个程序也就意味着我那个想法的核心技术问题应该得到了解决(虽然最后我还是没继续写,呵呵,没有sponsorship 阿!)

大家喜欢的话随便玩玩哈:)随心所欲的敲击说不定也可以是一段醉人的旋律哦。。。

注:担心有病毒的朋友大可不必冒险啊,呵呵
http://staul.spymac.net/midikey.exe (20K)
http://staul.spymac.net/guitartone.exe (1.6M) 这个不是我写的,以前网上看到的一个可以播放不同种guitar声音flash.
 
Monday, December 27, 2004
  zzMail.pl - Mail Forwarding (in Perl) I wrote a small perl script which retrieves pop3 mails and forwards them to another address via smtp. The motivation of doing this sounds weird apparently. There are so many mail clients available to perfectly handle pop3 mails. Why am I so keen on torturing myself to do that stuff? In fact, my original idea of doing it is to converge all my mails from different accounts to gmail, which I feel it's so better using gmail than suffering in different mail clients with different flaws. As a final result, I should be able to read my mails only via browser and enjoy all features of Gmail.

However, the main challenge is that free accounts of yahoo, hotmail, and even my university exchange system don't provide mail forwarding service. What's more, hotmail and exchange has no POP3 access available. Fortunately, there are some ongoing open source projects for webmail like "hotwayd" which behaves as a POP3 agent/gateway for translating httpmail protocols. Except that I can only access my exchange account via OWA or outlook or Evolution, other accounts are all able to be acessed via POP3.

At the beginning, I checked some popular tools "fetchmail", "getmail" for my purpose of retrieving mail and forwarding to another account. But unfortunately none of them perfectly meet my need, or I happened to miss their potential ability of doing that. Gradually, I found it looks pretty easy to use Perl for handling POP3 and SMTP, nothing better fit myself than doing it on my own.

However, there are two main issues in using Perl for POP3/SMTP. The first one is POP3 retrieving without duplicate dowloading, where UIDL helps out here. The other one is SMTP with proper authention method support, where Mail::SMTP_auth.pm module helps here.

I share my source code here for your free usage, modification, or redistribution. Please use it at your own risk. Strongly encourage you reading the source code before using it.

P.S.
Probably MS Outlook is the most powerful mail client in this world despite of its underlying reasons for the "powerful". It supports almost all internet mail protocols, with which you probably don't need anything else. However, people, especially in the open world, hate it somehow. I decide to seek for better solutions to release myself from outlook's "powerfulness".

 
Sunday, November 14, 2004
  zBlogger - A blogger client http://zblogger.blogspot.com
I've been learning quite a few stuffs to build my own blog client. just for a change of my brain after heavy research;) after this, i've got to go back to research immediately. graduation pressure is over head!

 
Saturday, November 13, 2004
  163 Photo Batch Upload I'm not an expert of Java but fortunately doing TA about it this semester. But why not take it as a chance to go a little further in this popular language? Here comes my exciting Java program after several days of independent self-studying and developing :) I've got a relatively complete view of Java developing ... from language features, supporting libraries to Swing design with threads for user interface. ......

The program is called "163 Photo Client", which provides a basic photo upload functionality. Today you may find plenty of online gallery services over the Internet, such as Yahoo Photo, WebShot, 163 Photo (a Chinese site), ... The most exciting feature you have noticed is that Yahoo now provides "unlimited storage"! With its efficient upload plugin, you can upload efficiently as many photos as you can. But as your payoff for all these desirable features, you are not able to download the uploaded photos in its original resolution, which is quite unacceptable sometimes.

Fortunately, I found there is an operator, 163, in our country providing such a brilliant service, with full resolution download and unlimited photo upload! It almost meets all my requirements. But it's always true that nothing could happen so beautifully and free of charge in this world. 163 does not provide any upload tool as yahoo. Users have to upload their photos via endless clicks in their web browser and unbearable waiting until it's finished before uploading the next. I guess it's where 163 poses an implicit restriction on the "unlimited" upload. That's where my motivation of this program comes. It automatically uploads all photos you decide to upload with no extra user interactions, which releases you from being tied to upload a number of photos at a time.

Main features of "163 Photo Client":

  1. login to your 163 online gallery account, and maintain a login session as you usually do in a browser. the difference is now that you don't need to open any browser.
  2. retrieve your existing albums.
  3. create a new album. chinese encoding is supported if your system can display chinese, even in an english platform or other language.
  4. add all your photos together to the queue before uploading. you can specify different target albums that the photo is supposed to upload to.
  5. threading design of GUI makes more user friendly and responsive.

Current Limitations:

  1. at present, this functionality has a limitation, i.e. it will only retrieve up to 16 albums.
  2. no native executable binary available, for example, windows platform. only system-independent java archive, which is typically enough for those systems with java installed.
Screenshots:







Download Link (password enabled zip file)
Note: I am sorry that the program is only available for friends testing at this phase due to several reasons. The main reason is the worry that unlimited usage of this program potentially causes 163 to notice this issue...;) I don't think they will be happy to hear that there are thousands of uploading robots working day and night, but no users even offer a mouse click on their site. haha.


 
  发现自己其实还是 写了蛮多程序的,从大学以来。晚上一路回来的时候想,要是写些关于自己以往的以及将来想写的程序的东西,应该也蛮好玩。。。过两天就从我最近研究的blog client写起吧。。。 
Saturday, June 12, 2004
  ZZ Messenger Service what a cry! i lost the code of the server side...so only client side screenshot is available. and no further demo is possible. anyway, it should go into history le. there is old chinese saying: if nothing goes, nothing will come.


 
  L compiler - An undergraduate coursework as a coursework for compiler theory. the goal is to design a compiler for L language, a simple one only for this course and study purpose. it has all basic data types and condition clause, loop , switch, ..., and but it's not object oriented and doesn't support subroutine or function. this compiler starts from code scanner, semantic subroutes assignment, and to the tetrad data. i also made an interpreter for the tetrad data, which reduces the effort to make it into 8088 assembly code, but reach the same goal for compiler correctness testing. the final binary after compiling can run natively in the interpreter. furthermore, i also realized a simple ide with syntax highlighting, but with no debug, and the interface is very similar to vc. even after a few years i checked it back, finding that so strong a,haha.


 
(Sometimes lost, but content after all) 写程序有时候可以让人着迷到废寝忘食,即便无利可图,也乐此不疲。Happy coding重在happy,而happy的不是coding本身,而是倾注创意实现灵感的点点滴滴 ……

My Photo
Name:
Location: Singapore
ARCHIVES
June 2004 / November 2004 / December 2004 / January 2005 / March 2005 / April 2005 /


Powered by Blogger