24 April 2005

Visual Basic application.

This weekend, I implemented an application for my friend using Visual Basic 6.0. Check here. Why don't use my favorite programming language, Python? emm... It's in requirement :(. Still need to open manual how to declare variables:

Dim number as Single

How VB return value for function quite unique:
Private Function getCoordinateRight(X As Single, Y As Single)
X = (X - offsetRight) / (offsetEnd - offsetRight) * totalVpp
getCoordinateRight = X
End Function
I just updated my convocation photos on web. Check my photo album.

20 April 2005

Install openoffice-1.1.4 in FreeBSD and take screenshot, xv.

I always got problem to install openoffice from the stable branch. e.g.

%pkg_add -vr openoffice
looking up ftp3.jp.freebsd.org
connecting to ftp3.jp.freebsd.org:21
setting passive mode
opening data connection
initiating transfer
Error: FTP Unable to get ftp://ftp3.jp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/Latest/openoffice.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp3.jp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/Latest/openoffice.tbz' by URL
pkg_add: 1 package addition(s) failed

To install from release branch you can use the:
# pkg_add -r openoffice
as suggested by the handbook, but the problem is it will fetch the openoffice-1.1.2 (I want the openoffice-1.1.4). Today, I solved my problem by:
%pkg_add -v http://oootranslation.services.openoffice.org/pub/OpenOffice.org/ooomisc/FreeBSD/OOo_1.1.4_FreeBSD53Intel_install.tbz
It clearly state in the OpenOffice.org website. Stupid me :(, I'm too much depend on default freebsd package repository.

How to grab the screenshot for the desktop? Use xv :) I know we can use gimp, but I rarely use that app (I don't remember when last time I use gimp, I guess last 2 months). Open xv menu>Grab. I use middle mouse to select fullscreen. Here is my desktop screenshot (in png format). (evilwm, FreeBSD-5.3, gkrellm). I had uploaded to my flickr, but it resize the image and I can't read the words :(. Yahoo photos also will resize the image (layout not good in firefox). The image size in fotopages quite OK, but 'Image Viewing is down for maintenance' message give me bad impression.

18 April 2005

Happy convocation!

Happy convocation to me, Bachelor of Engineering with Honours (Electrical) ! This is the 61st convocation for UiTM.

12 April 2005

Answer for Ruby on Rails

Ian answer's to a tutorial for Ruby on Rails.
A comparison for object relational mapper (ORM) in Java, Ruby, and Python.
Still, 'in between' Ruby and Python? Blog from mikewatkins try answer this question.

Steal this code for validation for email in nevow. Thanks to Tv (from #twisted.web at freenode).

To list files within package in freebsd (thanks to Low):
pkg_info -xL subversion
Can pipe to grep for filtering purpose (e.g. pkg_info -xL subversion | grep svn)

08 April 2005

Setting roundup

Today I set an issue-tracking system, Roundup. I install by package, (/usr/ports/www/roundup) in my FreeBSD-5.3 box. I chose to use postresql as storage backend. I follow this installation guide. Since I use postgresql, so I need to edit roundup/config.ini, [rdms] port= 5432.
To enable postgresql run on port 5432, edit the /usr/local/pgsql/data/postgresql.conf. Uncomment port=5432 and set tcpip_socket=true. Reload the postgresql by
> pg_ctl reload -D /usr/local/pgsql/data/
Check whether port is open or not by:
> nmap -v localhost
my console output:
25/tcp open smtp
80/tcp open http
111/tcp open rpcbind
5432/tcp open postgres
8080/tcp open http-proxy
I can open my Roundup now at http://localhost:8080/roundup/ . Now login as admin (hint: password set after roundup-admin initialise). I got an annoying problem about emel. For timebeing it solve by set [mail] in roundup/config.ini,

Implement form in nevow is unique. They use formless. To create a form, the class need to extend formless.annotate.TypeInterface. For the form elements, check formless.annotate.Choice(), formless.annotate.Integer(), etc. To set validation, I guess we need to extend formless.annotate.Type (hint: check parent class for formless.annotate.Integer ).

06 April 2005

nevow rocks!

This week, I playing with Nevow. I really impressed with the LivePage.

But I think a few things irritate me:
1) Plenty of documentation.
2) It's quite hard for beginner.

My internet connection at home not stable this couple of weeks. :(