Wednesday, July 7, 2010

Free Source Code Management Hosting With SVN

A common task to accomplish in order to manage a software project and its source code, release cycle, features, bugs and team work in a proper way is to have a source code management system (SCM) such as those based on GIT, CVS or Subversion (SVN). Sometimes the project must start very quickly and there is not enough time to install and configure a SCM by yourself, so you have several alternatives in the web, some of them are for free and for some others you have to pay accordingly to the size of the project, team members or features available. We have found an alternative that can match the features that you are looking for small projects that have to start right away, it's called Unfuddle, we are using it for a small startup company and it have worked like a charm. You can try it out at www.unfuddle.com

Saturday, July 3, 2010

How to use PHP CLI in windows?

PHP Cli allows you to execute PHP scripts in a system shell and enables you to interact with it sending parameter values.  An example of its usage is Bake (from CakePHP), with it you can create web applications with Model View Controller pattern in a snap only with a database you defined before. The only thing you would need to do in a XAMPP installation is to add the absolute path to the PHP installation to the PATH environment variable through My Computer->Properties->Advanced Settings->Environment variables. My PATH environment variable looks like:

C:\Sun\SDK\bin;C:\Program Files\Nmap\;C:\spring-roo-1.0.0.RELEASE\bin;%MAVEN_HOME%\bin;%MYSQL_HOME%\bin;%CATALINA_HOME%\bin;%ANT_HOME%\bin;C:\xampp\php

Thursday, July 1, 2010

How to create a generic Dao with Hibernate and Spring Framework

When you are designing web applications a common problem to solve is the DAO (Data Access Object) layer. The simpler way to implement a DAO layer with Hibernate in seconds is to use some of the classes that are provided with Hibernate such as HibernateTemplate. HibernateTemplate class simplifies the data access operations when using Hibernate and provides an easy way to handle Hibernate Session objects .The following diagram shows in UML what is the rationale behind this implementation.


Image 1.  UML diagram for a generic DAO.


The solution proposed in this article is based on Spring Framework 2.5 and Hibernate 3.2.x. Let's begin with a business model class called Person, its objects (instances) are going to be used and obtained from a database like Oracle, MSSQL, or whatever JDBC compliant database

Wednesday, June 30, 2010

Rich Text Editor WYSIWYG with Javascript

Looking for a simple way to format source code in the blog, i remembered that it exists a wonderful and useful Rich Text editor in Javascript, it's called TinyMCE, and the best is that is licensed under a Free Software License (LGPL). To see how it works you can visit http://tinymce.moxiecode.com. I have also found a tool to do the same and a little bit faster.

Monday, June 28, 2010

OutOfMemoryError en Eclipse SpringSource Tool Suite 2.3.0

En diversas ocasiones me he encontrado con un error del tipo java.lang.OutOfMemoryError al utilizar Eclipse SpringSource Tool Suite de Springsource (anteriormente Interface21), ocasionado al parecer por la carga del servidor de aplicaciones del STS. Si tienes un computador con un procesador de varios núcleos, puedes solucionar este problema adicionando las siguientes lineas en el archivo STS.ini en la sección -vmargs (que se encuentra al final):

-XX:+CMSPermGenSweepingEnabled
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled


Así luce mi "STS.ini"

-vm
C:\Program Files\Java\jdk1.5.0_08\bin\javaw.exe
-startupplugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
com.springsource.sts.ide
--launcher.XXMaxPermSize
512M
-vmargs
-XX:+CMSPermGenSweepingEnabled
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled

Referencias
http://blog4jose.wordpress.com/2009/02/02/memory-permgen-classloader/

Lidiando con Eclipse: JVM Terminated. Exit Code=-1

Luego de la instalación SpringSource Tool Suite y ver cómo fallaba con constantes errores de tipo java.lang.OutOfMemoryError, volvi a mi anterior instalación de Eclipse, sin embargo, ahora éste me presentaba el siguiente error, sin razón alguna:JVM Terminated. Exit Code=-1

Para volver a ejecutar Eclipse tienes 2 opciones que funcionaron en mi caso:
1. Ubicar el archivo eclipse.exe y luego renombrarlo con otro nombre, por ejemplo: eclipse-nuevo.exe
2. Remover el argumento vmargs del archivo eclipse.ini ubicado en el mismo directorio del archivo eclipse.exe

Este par de opciones funcionaron también para solucionar un error "Cannot create JVM" lanzado al intentar ejecutar SpringSource Tool Suite 2.3.1.

Referencias
http://troyworks.com/blog/2008/06/08/eclipse-jvm-terminated-exit-code-1/