Concurrency in Hudson

August 25th, 2010 No comments

How to organize and avoid concurrency problems in big projects, splitted in multiple jobs and chained to each other in Hudson?

If you have a lengthy process, it will be a good practice to split it in multiple tasks, having each calling the next one, like in the (somewhat simplified) image on the left.

Problem number one: How to avoid Clean and Build (for instance) running at the same time?

As (almost) always, “you have a plugin for that” in Hudson. This time is Locks and Latches, which will let you create a lock, shared by all the jobs you want. Only the job that has the lock, will be executed.

So far, so good, but, where is the problem?

Read more…

Agile Spain 2010 links from Twitter

June 18th, 2010 No comments

Hi, here are all the the links collected from #agilespain2010 posted in Twitter after applying this regex. ^(.*)(http://\S+)(.*)$ plus ordering + plus filtering within a small script.

Read more…

Open ID login with Google App Engine + Django

June 16th, 2010 1 comment

Hi!, this a clean and simple sample test of a web app using Open ID login in Google App Engine + Django.

http://bitbucket.org/deccico/djangoappengine-openid-sample

This application combines with slight modifications, the following projects:

  • Djangoappengine: http://www.allbuttonspressed.com/projects/djangoappengine
  • Django-nonrel http://www.allbuttonspressed.com/projects/django-nonrel – Changes to Text fields to Chars, due to lack of filtering support in the firsts
  • OpenID integration: https://launchpad.net/django-openid-auth – Small change in the login view template, in order to work with standard Cross site forgery protection
  • Python OpenID library: http://github.com/openid/python-openid

Just remember to add {% csrf_token %} within the login form of your own view.

enjoy!

How to calculate the closest point to a segment

June 6th, 2010 No comments

Hi, below there is a little snippet that calculates the closest point to a segment. It is written in C++ but could be easily translated to any other language. Disclaimer: given its age, it use hungarian notation, and some names are in spanish, but it was deeply tested and works ok. ;)
Read more…

Making a simple html editor in C++ Builder

June 6th, 2010 No comments

Back in time, I had to make a simple html editor. It was very easy, by using a simple TCppWebBrowser (wb) and the IHTMLDocument2 interface. You will also need a TMemo (memo1) control. Here is the source code, hope it helps someone :)
Read more…

How to replace a substring using regex in Python

June 6th, 2010 4 comments

The problem: You match a string with your regex, but you need to replace just a portion of it. How could we replace it?
The trick is simple, put the text you want to replace within “()” which means “group” in regex language. If the regex worked, you could replace just that portion by using Python match information, like in this example:

#the first group contains the expression we want to replace
pat = "word1\s(.*)\sword2"
test = "word1 will never be a word2"
repl = "replace"

import re
m = re.search(pat,test)

if m and m.groups() > 0:
  line = test[0:m.start(1)] + repl + test[m.end(1):len(test)]
  print line
else:
  print "the pattern didn't capture any text"

This will print: ‘word1 will never be a word2

The group to be replaced could be located in any position of the string.

Multiline regex pattern

June 5th, 2010 2 comments

Task: Parse a file and capture whatever text appears between a pair of double quotes like the following:

“Catch me”

Not so difficult, you could use the following regex:

“.*”

This will catch any character within double quotes in a group
¿any? Read more…

Using Hudson as a Continuous Integration server

June 5th, 2010 No comments

After researching and learning about Continuous Integration I start evaluating available free CI servers. I tried to be impartial, even though I was tempted to start using CruiseControl, mostly because of Martin Fowler article about Continuous Integration. Next to analyzing an independent feature matrix, I decided to try by my own the three best options, which were the famous CruiseControl, Continuum from Apache, and the (by that time) unknown Hudson…

Read more…

Introduction to Continuous Integration

June 5th, 2010 No comments

Sometimes you got the right people, a good language and frameworks, but working in a project is a mess and nobody knows what will happen when you update the code and try to compile or running any functionality.

When you are working in a team with big and complex systems, trying to accomplish deadlines there are certain issues that you have to avoid. Tired of facing the same problems, some years ago I started researching about Continuous Integration as the key to enter into a new level of quality. Read more…

About me

September 4th, 2009 Comments off

Hello World!

I am Adrián Deccico, an Argentinian system engineer working in Madrid, who enjoys digging into programming, agile techniques and open source in general. I am going to share some random thoughts here.

Nice to meet you :)

Tags: