Tuesday, January 15, 2013

How to display 0.00 insted of null in ireport



Just send the value from openERP to ireport as string.

for example in python code ( I mean parser function)

...

record['fieldname'] = double if double else "0.00"


or in ireport you can use this expression instance of double field

($F{field}!=null) ? $F{field} : "0.00"

credit : http://forum.openerp.com/forum/topic29491.html

Sunday, January 13, 2013

.bashrc not load when start new session with tmux



One day, I installed some framework and it modified my .bash_profile file and alsol I don't know tmux correspond to that. My problem is when I create new session the directory link it's not color even before

it have color. So I guess it's problem .bashrc it doesn't load when I create new session in tmux.

But now I found the solution how to solve it like this:

First go to you home directory i.e : ~/user

At the end of your .bash_profile file, put this . ~/.bashrc

Close that file and type this command source .bashrc then try to create new session in tmux again.

Saturday, January 12, 2013

Tick & Tip speed up ubuntu 12.10

go to this link
http://www.upubuntu.com/2012/06/11-tips-to-speed-up-computers-running.html

Enable Hibernation on Ubuntu 12.10



1. Testing if hibernate work in your computer by type this command below

$ sudo pm-hibernate

2. If it work try command below

$ sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

3. Add this content to your file

[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

4. save it and close and reboot your computer



credit : http://nikunjlahoti.com/2012/10/31/enable-hibernation-on-ubuntu-12-10/


Monday, January 7, 2013

Error connecting to the server: FATAL: password authentication failed for user "postgres"

psql: FATAL: Ident authentication failed for user "username" Error and Solution

by on August 19, 2008 · 23 comments· last updated at August 19, 2008
Q. I've installed Postgresql under Red Hat Enterprise Linux 5.x server. I've created username / password and database. But when I try to connect it via PHP or psql using following syntax:
psql -d myDb -U username -W
It gives me an error that read as follows:
psql: FATAL: Ident authentication failed for user "username"
How do I fix this error?

A. To fix this error open PostgreSQL client authentication configuration file /var/lib/pgsql/data/pg_hba.conf :
# vi /var/lib/pgsql/data/pg_hba.conf
This file controls:

  1. Which hosts are allowed to connect
  2. How clients are authenticated
  3. Which PostgreSQL user names they can use
  4. Which databases they can access
By default Postgresql uses IDENT-based authentication. All you have to do is allow username and password based authentication for your network or webserver. IDENT will never allow you to login via -U and -W options. Append following to allow login via localhost only:
local all all trust
host all 127.0.0.1/32 trust
Save and close the file. Restart Postgresql server:
# service postgresql restart
Now, you should able to login using following command:
$ psql -d myDb -U username -W


credit : http://www.cyberciti.biz/faq/psql-fatal-ident-authentication-failed-for-user/

Friday, January 4, 2013

Change the number of workspaces


Change the number of workspaces

  1. Go to the dash and open the Terminal.
  2. To change the number of rows, type the following command, changing the final number to the number you wish. PressEnter.
    gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ vsize 2
  3. To change the number of columns, type the following command, changing the final number to the number you wish. PressEnter.
    gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize 3

Friday, December 14, 2012

How to solve problem

I have worked for 2 years in position it developer with different partner and I met a lot of problem in which also I found a lot of  solution.
One thing that I notice is the step to solve the problem as I will explain below.
1. we should know exactly what is the problem why it's became like that.
1.1 the method to find the problem is : unit test, compare code , find another example nearing our target if found apply that.
 2. thing of the solutions ( a lot of choice a lot of solution )  that we can solve easy and less coding.