Wanted for GIT to ignore some files

April 16th, 2009

I am developing a project in Flex-Java using Adobe Flex Builder. I am using GIT for versioning control. GIT takes control of every change I have made in the source code from the las commit. However I don’t want GIT taking care  of changes in .swf and .class files. I am concern about the source code and not the end-binary-result.

Each time I make a change in a .java or .mxml file GitX displays for a possible commit all the generated related files. Which I would like to avoid.

I found this article called Configure git to globally ignore files which become very helpful to solve this kind of situation.

Git

Using GIT

April 16th, 2009

Using GIT for version control system is really very easy. The best guide I found of how t use Git is website Git for the lazy. I was surprise how easy to use GIT is. If you need another place to check for how to use GIT you can try Everyday GIT with 20 commands or So

The use of GIT become even easier  with tools like GitX. It is a Max OS X application which provided the possibility to see the the changes history and also commit the current changes to GIT. How it worked? Basically  after making the changes in your code go the Commit View of GitX. It will show the new changes you had made. Choose what changes you want to commit into GIT. Include your message, and click in the Commit button. And this is it. You can go to the History Browser to see how your code had been growing.

GitX – Commit View

GitX – History Browser

Another tool which I have not yet tested but looks nice is github. The advertise strength of this one is social coding.

Git

Eclipse with Tomcat

January 4th, 2009

I am going to use Eclipse for development. Because I am also going to use Flex I installed Flex Builder 3 which is actually a  version of Eclipse pre-configure by Adobe to contain Flex. I try to update Flex Builder with the necessary plugins, and also connect it to Tomcat. This is quite difficult task as I found while searching for help on the internet. The common advise I found to avoid complications is to have installed Flex Builder, and also Eclipse. So, I have both of them. 

To install Eclipse is a fact to go to the Eclipse website and choose the package you want to install and follow the instructions. 

To use Tomcat as a web server for the projects created with Eclipse I follow the instruction found this article: Eclipse WTP and Tomcat Tutorial. This article includes a link to a explanatory screencast. Eclipse IDE can start, reload, and stop Tomcat, and the projects become web application spaces automatically. It also allows to create ‘WAR’ files in order to deploy the application in another server.

Following the article instruction I found some problems. The first one was related to a message which Tomcat was displaying while starting. The message is: INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path. The article OSX: The Apache Tomcat Native library… was not found on the java.library.path help me to solve this problem.

The next problem was related to Tomcat and the context properties. I solve this with the indications found in this article: WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property

Another problem was related to the code in the example servlet ‘HelloWorld’. The tutorial will use this line of code: 

PrintWriter writer = response.getWriter();

This will display the error: ‘PrintWriter cannot be resolved to a type’. This is solved by adding this code in the ‘import’ part of the file:

import java.io.PrintWriter;

I have Eclipse now using tomcat.

Eclipse, Installations, Tomcat, Workstation

The web application space

December 31st, 2008

One of the easy options to start developing in tomcat is to start drooping files in the <Tomcat Home>/webapps/ROOT folder. However, if you are planning to create deployable applications (.war) it is better to create a web application space in to tomcat. The process is not complicated, I found great help reading and following the indication in these web articles: Deploying Web Applications to TomcatDemystifying Tomcat 4’s server.xml FileHow to Create a Web Application in Tomcat Sever? 

In summary what it is necessary to do is the following:

  1. Create a folder for you new application in the <Tomcat Home>/webapps/ folder. Lets call it ‘newapp’.
  2. Inside newapp create the folder ‘WEB-INF’.
  3. Inside WEB-INF create the folders: classes and lib.
  4. Also create a file called ‘web.xml’ and put the following text in it: 
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
    
    <web-app>
    </web-app>
  5. Open to edit the file <Tomcat Home>/conf/server.xml and add the node <Context path=”/newapp” docBase=”newapp” debug=”0″ reloadable=”true” /> as a child of  the node <Host> and save it.
  6. For testing purposes create a file in <Tomcat Home>/webapps/newapp called test.jsp with this code in it: 
    <%
    	String message="Hello world!";
    %>
    <%= message %>
  7. Open you favorite internet navigator go to http://localhost:8080/newapp/test.jsp
  8. You have now a new web application space in tomcat.

It is possible to have many web application spaces in tomcat.

    Tomcat

    PHP to PDF

    December 23rd, 2008

    I had the task to populate a PDF form using PHP. There are many ways to do that, here is a very interesting one. However in my case the PDF form I need to work with had a part which was a graphic form included in the PDF. When the PDF was printed it did not look nice, acceptable but not nice.

    Because I wanted to learn how to create a PDF file with PHP I investigate for another way. I found a nice article about Generating PDFs with PHP which uses PDFLib. I didn’t decided to use it because it is a commercial product and the free option they offer (PDFlib Lite) is limited. I didn’t like also because is necessary to compile the library plus other related task. I am comfortable compiling software but in small projects this is to much I think.

    I wanted a free and fast option, so after searching and testing I become comfortable with FPDF. This is a class which is just add to the php code and you are ready to create PDFs. It is very easy to learn. I also found FPDI. This is a free class which allows to  import existing PDF documents into FPDF in order to add more elements to it. 

    I accomplished the task using this process:

    1. Design of the form using InDesign (CS4) to look exactly as the original millimeter by millimeter.
    2. Save the form as a PDF file.
    3. Create the PHP file.
    4. Load of the PDF file into FPDF using FPDI.
    5. Add the information text using FPDF functions in the specific places.
    6. Generate the new PDF file.
    7. Test in the navigator.
    8. Finish.

    The examples include in the FPDF and FPDI websites are self explanatory for all the necessary coding.

    PHP

    Git : Fast Version Control System

    December 20th, 2008

    An important area in software development is Revision control or Version Control. The most known software used for this kind of control, among others, are Concurrent Versions System (CVS) and Subversion (SVN). I was analyzing both of them trying to decided for the most convenient. A friend shared with me this interesting article: SNV vs CVS. I was almost deciding for SNV when I discover GIT.

    What called my attention is that Git was initially created by Linus Torvalds for Linux kernel development, according to what I found in wikipedia. This informations is also interesting:

    Several high-profile software projects now use Git for revision control, most notably the Linux kernel, Samba, X.org Server, Qt (toolkit), One Laptop per Child (OLPC) core development, Ruby on Rails web framework, VLC, Merb, Wine, SWI Prolog, DragonFly BSD and the Android mobile platform.

    There is available an OSX Installer for Git: git-osx-installer, and also a Git Eclipse Plugin.

    To install GIT in OSX is a matter of downloading the .dmg file and run the installer package found in it.

    Useful Link: 

    - Eclipse Git plugin installation

    A Tour of Git, with Java and Eclipse

    Git, Installations, Workstation

    Ant in Workstation

    December 18th, 2008

    Apache Ant is a Java-based build tool which Tomcat uses to deploy web applications. More info here: http://ant.apache.org. The steps I used to install Ant in the MacBook are:

    Download ANT from http://ant.apache.org/bindownload.cgi .
    Extract the Ant files into the folder you want to install it.
    Add the Ant /bin path to you ~/.profile file. In my case I added this line:
    export PATH=/Users/italoosorio/Tomcat/Ant-home/bin:$PATH 

    I am installing everything related to Tomcat development in my home/Tomcat folder.

    Helpful link:

    - http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/

    Ant, Installations, Tomcat, Workstation

    Tomcat in Workstation

    December 18th, 2008

    I decided to continue using JAVA as a programing language. I am using my laptop as developing environment, so I needed to install Tomcat in it. I followed the indication found in this web page: Installing Apache Tomcat 6 on Mac OS X Leopard. A summary of the steps used are the following:

    Set the JAVA_HOME environment variable

    Adding in the file ~/.profile the folling lines and restart the terminal:
    export JAVA_HOME=/Library/Java/Home
    export CATALINA_HOME=/Library/Tomcat/Home

    Download and install the Tomcat binarie

    Download Tomcat from the Apache Tomcat 6 Downloads Page
    Change directories to the folder where you want to install Tomcat.
    Create the Tomcat directory and set an appropriate owner and group:
    > mkdir Tomcat
    > chown <username> Tomcat
    > chgrp admin Tomcat
    Change directories to the newly created Tomcat directory and unpack the tar.gz files
    > cd Tomcat
    > tar -xvzf ~/Downloads/apache-tomcat-6.0.x.tar.gz
    Create a symbolic link that will always point to the current version Tomcat directory
    > ln -s apache-tomcat-6.0.x Home

    Edit tomcat-users.xml configuration file

    Change directories to the Tomcat configuration directory
    > cd Home/conf
    Edit the tomcat-users.xml file
    > nano tomcat-users.xml
    Add the following before </tomcat-users>, where <admin> is the administrator name you assign and <password> is the password. 
    <user username=”<admin>” password=”<password>” roles=”standard,manager,admin”/> 
    Save the tomcat-users.xml file and quit the editor

    Run and Test

    Change directories to where the Tomcat startup scripts are located
    > cd ../bin
    Remove the .bat scripts and .exe executables
    > rm *.bat *.exe
    Execute the Tomcat startup script
    > ./startup.sh
    Test in you navigator entering http://localhost:8080
    To stop Tomcat execute the strip shutdown.sd
    > ./shutdown.sh

     

    I am not planning to have Tomcat as daemon process, I wan to activate it manually.

    Installations, Tomcat, Workstation

    Welcome!

    December 18th, 2008
    Comments Off

    This blog was created with the objective to log my experiences while developing at SWAU. This will include the software and/or hardware I am using, the installation process, and my opinion result of my investigation of playing with them.

    You are welcome to give your feed back and share you experience which can help me to achieve my goals.

    Uncategorized