==========================
== Timoteo Ponce's blog ==
==========================

Git svn dcommit, interruption recovery

git svn
As usual, I was doing all my work in my local copy(Git) of a SVN repository, when everything was stable and pretty, I started pushing everything to the central server. But in the middle of the operation the network was shutdown, some of my commits couldn't be pushed and my working tree was a mess!!. "Ok" - I said - "I just have to point to HEAD again... which was the commit number? Read more...

External merge-diff - Git on windows

windows git
To configure and use Git in a Linux environment is quite easy, but if you are working in a Windows system, things get a little bit complicated. I use MsysGit which is a great port to win32, and as a merge/diff tool I use WinMerge (I can't stand KDiff); to work with WinMerge as 'difftool' and 'mergetool' you could do this: - First, create a wrapper script for our 'difftool', save this file as 'diff-tool. Read more...

Which pattern is this?

patterns java
I've been working in a component with some singularities, one of them is his incremental behavior. To make it clear: When a feature is almost complete (or completed), some other features arise. This is really annoying if you have implemented everything for an specific use (never do this, I've learned in the bad way) if needs to be changed to work with the new stuff. One of the things that I needed to do is to create/fill/validate different objects; I started thinking: " Read more...

Hace un año

Hace exactamente un año, sufrí junto a mi hermano un accidente que hubiese sido fatal de no haber contado con las personas indicadas en el momento dado. Sobreviví no gracias a Dios o algun tipo de voluntad divina, fue gracias a mi hermano y a la gente que lo ayudo. Doy gracias a ellos y elijo no recordar a aquellos que nos ignoraron. Tambien expreso mi profundo respeto por la familia Chavarria, que perdió a su único hijo en este incidente, ojala esto nos recuerde el valor de la vida.

Jakarta HttpClient , POST request

post httpd java
This library contains a set of very handy utilities for HTTP interaction, in this occasion, I'll show you how to create a POST request: final String url = "http://localhost:8080/eco/management" public void sendRequest(Map<String, String> parameters) throws DigestException, HttpException, IOException { println("Sending request to : " + url); HttpClient httpClient = new HttpClient(); PostMethod method = new PostMethod(url); for (Entry<String,String> entry : parameters.entrySet()) { method.addParameter(entry.getKey(), entry.getValue()); } final int status = httpClient. Read more...

Setting environment variables with perl

perl script
Usually I work with different environments on different projects, this means that sometimes I have to change system variables and references in order to work in a different project. To avoid this repetitive task, I've created a few PERL scripts to make my life easier. Changing environment variablesWhat I did was to create a script that receives as a parameter a file name, this file contains a set of environment variables to set. Read more...

Get metadata from JPA entities

jpa
I needed to extract a column length from a EJB-JPA Entity configured with annotations, this is how I did it: import javax.persistence.Column; import javax.persistence.Entity; @Entity public class Person { @Column(length=30) private String firstName; public static void main(String[] args) throws SecurityException, NoSuchFieldException { Object person = new Person(); println(person.getClass().getDeclaredField("firstName").getAnnotation(Column.class).length()); } } Solution source

GIT - Working with a SVN repository

git svn
Git a SCM created by Linus Torvalds and currently mantained by Junio Hamano, is a distributed revision control system very simple and extremely powerful. For those people who want to test this system (me included), and comes from a SVN environment, there are some utilities (included with GIT) to interact with SVN repositories. In my case, I have a copy of a project fetched from the SVN repository, and for local development I use a branch called 'development'. Read more...

Joda Time - Difference between dates

programacion java
In order to calculate a difference between dates, I've found many problems: Leap years.Minute, seconds differences between months and years.Months with different amount of days, etc. And I was not going to develop all this, right?. Somebody must have already done this, so, I started searching. The result was Joda-time, a very handy library that is being used in projects like JBoss Seam. With this library, my work only was to use it, so, if I wanted to calculate date differences, I just have to:

Monodevelop, following the river

mono monodevelop
Mono is a free implementation of .Net standard for Windows, GNU/Linux and some other platforms. Is compatible with .Net and has called my attention since its creation, I just needed the motivation of Miguel de Icaza to get into this. As I'm not a .Net developer, I wanted to learn it using C#, that looks like Java, but I wanted to start with Mono because of the portability feature, applications can run in different environments, and that's a lot. Read more...
Previous Page 12 of 16 Next Page