Wednesday, June 25, 2008

Date/Time in Postgres

There are 2 operations that we might play with the date/time type in
postgres:

1. Input a Date/Time: Postgres fully supports iso-8601 for Date/Time input and other formats. We can specify timezone directly in the inputs, for
example: "2008-06-25 15:30:40+08", "Jun 25 14:30:40 2008 ICT".

2. Store/Retrieve a Date/Time:
- If the date/time type is "with time zone", the internally stored value is always in UTC with GMT coordinates. An input value that has an explicit time zone specified is converted to UTC using the appropriate offset for that time zone. If no time zone is stated in the input string, then it is assumed to be in the time zone indicated by the system's timezone parameter, and is converted to UTC using the offset for the timezone zone.

- When a date/time *with time zone* value is retrieved, it is always converted from UTC to the current timezone zone, and displayed as local time in that zone. To display in another timezone, we have to specify "AT which TIME ZONE".

- When a date/time *without time zone* value is retrieved, if we specify "AT which TIME ZONE", postgres will treat the original stored date/time value in local timezone, then calculate the different between local timezone with the specified timezone and the date/time output is in that specified timezone.

Note: local timezone, server timezone or system timezone are one.

Additional links:
1. http://www.postgresql.org/docs/8.0/static/datatype-datetime.html
2. http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html
3. http://www.timegenie.com/timezones.php

Read more!

Saturday, January 12, 2008

Readmore...

Once you've got everything in your template, just save the changes and republish.

Read more

Read more!

Saturday, December 22, 2007

Flock Blog Post?

Posted successfully!

Read more!

Sunday, January 07, 2007

Having problem with serial communication

As I'm working on an embedded Linux project, I use Ubuntu 6.10 Edgy Elf for host against the PPC target, TQM860L board. I have to support remote serial console in my firmware. Everything is on progress, and it's time to write a program that can handle read/write through serial port. For easy to test, I wrote it on my host machine, but no matter how I tried, my serial line didn't work anymore.

Read more!

Read more!

Thursday, January 04, 2007

Linux - Ubuntu

It's been about 4 months since I decided to use Linux as *exclusive OS*.. Yeah, no Windows, no dual-booting, no virtual machines... And it's time to review what my thoughts about Linux :">.

Yeah, I'm sorry to tell you, Linux is an OS that's not suitable for noob :))

I'd used Linux several times before, not really from 4 months ago. Hix, I have to use it for doing my Uni's assignments. I still can remember what I lived with: a computer with only 800x600x16x60 screen (it doesn't support my VGA), no Starcraft, no music, nothing... Then everything went worse when I tried to increase the resolution: X Window fails...

All the things I got is just a solid black screen called "console"... Huhu, what I dealt with that circumstance is switching back Windows :p... Of course, this doesn't settle an end dot of using Linux, I myself still want to be "pro" in Linux, thus I tried to setup coLinux (http://www.colinux.org) in order to boot/use my Linux partition directly in Windows (I didn't use VMWare because of memory need). During that time, I learned how to setup & use VNC, X-Window server, KDevelop, Qt Designer... Yes, everything on Linux worked smoothly as well as my Windows plodded steadily :(.. I don't remember exactly, but I got rid of Linux not longer than 1 month after that :)).

Hehehe, back to now, what can I say about using Linux? Confidently talk: "dirty easy" :))... I think I can do it well on my own (of course, with my friend, Google :">).. Now I understand what called "boot loader", "kernel", "root file system", "device", "module"... Many thanks to "Building Embedded Linux" & "Primer of Embedded Linux" :">... Eehh, wait, don't shout at me :))... well, well, well... I've known, I'm just an amateur, my knowledge and skills are not enough, but I'm still learning more.

Currently, I'm using Ubuntu 6.10 Edgy Eft, my FC5's just been gone :p... Choosing & switching among distros is not hard for an amateur anymore, isn't it? :)), everything is the same, "ghẻ vẫn hoàn ghẻ" :))... Indeed, the distros, they're not important for my working, all I need is an environment with shell & common commands (yeah, I'm not afraid of solid black screen anymore, even I prefer console to GUI - an affected footprint by bro. Tha`nh lo^ng vi.t)... but what wrong with a distro that fully supports my hardwares likes Ubuntu?... Nothing! And it's reason why I'm using Ubuntu now.

E'c, I must go now.

Read more!

Friday, February 10, 2006

On The Web Blog

On The Web Blog:

SWT, JFace, and RCP

Java
I've been playing around with SWT (Standard Widget Toolkit) lately. And it looks very interesting. It allows creating a Java app with the look and feel and responsiveness of a native app. If you use a Java SWT application on Windows, it operates just like any other Windows app. The main example is the Eclipse platform itself.

SWT has a bunch of widgets and creating a simple app is not too bad. But, to make development a bit easier, there is JFace, which is a set of SWT helper classes.

Eclipse has the Visual Editor plug-in that allows visual editing of apps. But, I've found it to be quite quirky. It's certainly no comparison with something like Visual Studio, but when it works, it's not too bad. The widgets properties editor is convenient. But, I find myself mostly just running the app to find out what it'll look like.

And to make app development even more powerful, there is RCP (Rich Client Platform). This sits on top of SWT/JFace and makes it easy to create Eclipse plug-ins or full-blown Java apps. As a matter of fact, Eclipse was refactored in version 3.0 to be a RCP program.

General:
SWT - Answers.com
SWT - Eclipse
SWT/JFace API

Tutorials:
SWT Creates Fast, Native-looking GUIs for Your Java Apps
SWT Programming with Eclipse/a>
Use SWT for data entry
Understanding SWT Layouts
Getting Started with Eclipse and the SWT
List of more tutorials

SWT/JFace Examples:
Java2s

Visual Editor:
Visual Editor Project
VE FAQ
Build GUIs with the Eclipse Visual Editor project
Eclipse Wiki

Forums:
EclipsePluginCentral
EclipseZone

RCP:
RCP home
RCP Tutorial

SWT and JWS:
Using Java Web Start with SWT
Deploy an SWT application using Java Web Start

RCP and JWS:
Eclipse Webstart Deployment
Support launching from JWS (JNLP)
WebRCP

SWT Editors:
Visual Editor
Jigloo
SWT Designer
V4All

Applications written with RCP:
RCP Applications
OpenTime
Kadosu
Jmoney
NomadPIM
PojoeditorRCP
zdt

SWT Libraries:
TWIST

Read more!

Sunday, January 22, 2006

Have you started the JMapEditor project yet??

It's started... on progress ;-)...

Read more!