Saturday 31 October 2009

Lift web framework and Scala programming language talk

Slideshow on Liftweb, not the best presentation but it is good place to start.

Introduction to Scala for Java Developers

For people from Java and thinking about trying Scala

Pragmatic Real-World Scala

Scala Programming for the Real-World

Monday 23 February 2009

Free Accounting Software

I have found totally free accounting software and it called Free Accounting. (Obviously)

Anyway, you can click at the link here to download the software directly.

However, to make sure it is full functional after the 30 days trial period, you have to do the following. The built-in registration function is not longer working, so don't use it.


1. Click on one of the following links in order to download updated Free Accounting in zip file (2,8 MB) or executable FreeAccounting.exe file. (6,9 MB)

2. Save the file to your Desktop.

3. If you have downloaded FreeAccounting.exe.zip, first, extract the file to your Desktop (if you use operating system under Windows XP, please, download and install archiver for this).

4. Copy FreeAccounting.exe from your Desktop to the location where Free Accounting is installed (usually it is C:\Program Files\FreeAccounting\).

5. Once the file is extracted, right click on your Desktop and select New -> Shortcut from the context menu.

6. Click the Browse button on the first step of the Create Shortcut wizard.

7. On the Browse for Folder window navigate to the location where you copied FreeAccounting.exe file (which is usually C:\Program Files\FreeAccounting\FreeAccounting.exe) and select the FreeAccounting.exe file.

8. Once the FreeAccounting.exe file is selected, click the OK button.

9. Click Next on the step of the Create Shortcut wizard.

10. Give name to the Free Accounting shortcut (for example, 'FreeAccounting') and click the Finish button.

11. Double click on the FreeAccounting shortcut on your desktop in order to run Free Accounting version which will not require registration.

Then you are done and enjoy.

Monday 16 February 2009

Using PostgreSQL in JBoss AS as default database

In refer to the document on jboss.org, ChangeDefaultDataSource. Here is the simplified version.

By default, JBoss AS is using Hypersonic as the database. Although Hypersonic is good for development purpose but in the production environment, it is way more stable to use the enterprise level database, such as PostgreSQL. In this posting, we will discussing switching to PostgreSQL as the default database for JBoss.


To get started, first download and installed both JBoss AS and PostgreSQL. In our example, we are using JBoss AS 4.2.3 and PostgreSQL 8.2.

On PostgreSQL
  1. In PostgreSQL, login as postgres and create new user "jboss" with password "jbossrul3"
  2. Create new database "jbossdb" and assign owner to "jboss"
On JBoss AS
  1. Delete hsqldb-ds.xml on <JBOSS_ROOT>\server\default

  2. Copy postgres-ds.xml into <JBOSS_ROOT>\server\default\deploy\ from <JBOSS_ROOT>\docs\examples\jca

  3. Edit postgres-ds.xml to put in the appropriate value
    <datasources>
    <local-tx-datasource>
    <jndi-name>DefaultDS</jndi-name>

    <connection-url>jdbc:postgresql://localhost:5432/jbossdb</connection-url>

    <driver-class>org.postgresql.Driver</driver-class>

    <user-name>jboss</user-name>

    <password>jbossrul3</password>

    <new-connection-sql>select 1</new-connection-sql>

    <check-valid-connection-sql>select 1</check-valid-connection-sql>

    <metadata>
    <type-mapping>PostgreSQL</type-mapping>
    </metadata>

    </local-tx-datasource>

    </datasources>


  4. Add the following entry into <JBOSS_ROOT>\server\default\deploy\jms\jbossmq-destinations-service.xml, if you are planning use custom queue. You can named your queue to the appropriate name, I am naming it as mpgateQueue
    <mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=mpgateQueue">
    <depends optional-attribute-name="DestinationManager"> jboss.mq:service=DestinationManager
    </depends>
    <depends optional-attribute-name="SecurityManager">
    jboss.mq:service=SecurityManager
    </depends>
    <attribute name="MessageCounterHistoryDayLimit">-1</attribute>
    <attribute name="SecurityConf">
    <security>
    <role name="guest" read="true" write="true"/>
    <role name="publisher" read="true" write="true" create="false"/>
    <role name="noacc" read="false" write="false" create="false"/>
    </security>
    </attribute>
    </mbean>

  5. Delete <JBOSS_ROOT>\server\default\deploy\jms\hsqldb-jdbc2-service.xml

  6. Copy <JBOSS_ROOT>\docs\examples\jms\postgres-jdbc2-service.xml into <JBOSS_ROOT>\server\default\deploy\jms\

  7. Now, startup the JBoss AS, it should automatic create the required schema in PostgreSQL under jboss user and everything should be good to go.
Good Luck.