Last 26th of February, I and my colleague Marco have been talking about Grep4J (https://code.google.com/p/grep4j/) at Google Dublin Group (GDG).
Here is a link to the event:
Finally after months and months I’ve found a neat, clear, formatted and even version controlled way of sharing code snippets.
Gist allows you to have language specific formatted code and embed it in any HMTL page or in a free blog like this one.
Here below is an example!
Hope this post helps people out there encouraging them to move all the embedded code that for years we’ve been raw pasting in our blogs, tidy them up and re-add in a cleaner, clearer way!
In the last few days my focus has been on NoSQL DB(s) and REST services.
Points I’m more interested into are:
I found on stackoverflow a very interesting debate on the versioning aspect.
Although exposing the API version in the URI gives great readability and control, I’m still a supporter of the media type field in the header.
I’ve initialized a github project so to realize a few PoC about the subjects I’m studying.
Examples make use of Jersey and Grizzly2 as container for tests. Everything is glued up with Spring 3.0 and built with Maven.
The code includes examples around:
You can dowload the code from github with the following command:
git clone https://github.com/nemo83/webservices.git
Any feedback is welcome.
Last 26th of February, I and my colleague Marco have been talking about Grep4J (https://code.google.com/p/grep4j/) at Google Dublin Group (GDG).
Here is a link to the event:
In my enterprise we recently introduced Test-Driven Development (TDD) as a programming technique for delivering robust and reliable software.
The lifecycle of tasks is the following:
The “To Do” and “In Progress” phases are self-explanatory. When a task goes in “For Review” the developer choose, with a round-robin approach, one of the team mates, and together they review the code in order to ensure quality (eg. check the code is clear, correct design and design patterns, high code coverage). Last but not the least it comes the “Verified” phase, during which the developer ensure that new features behave as expected in System Test.
There have been serveral attempts to make the “For Review” phase appealing, interesting and efficient. After some meeting and discussions we came up with the following check-list.
Even if we, in my humble opinion, perfectly described what should happen in a review phase, when we put it in practice, results were not so exciting as we were expecting.
What you really want to achieve in a code(peer)-review, is to ensure that the code is clear, well designed and correctly tested (in a TDD fashion!). What we were doing was to make the developer lead the review process and tell what the code was doing. Under these circumstances a reviewer would make zero or nearly no effort in understanding what the code was actually doing. Finally the “code coverage check” simply turned into a “check sonar code coverage %”. This could guarantee in really few circumstances that the quality and clarity criteria were met.
Since the TDD approach expects tests to be written before the actual code, why reviews should not be structured in the same way?
Few days after I finished to read the “Clean Code” book, I decided to play a game with a colleague for testing how well I learnt principles uncle bob explained in his book.
I asked him to guess, just reading from a bunch of test classes, what my code would have done. The result was surprising. With only a few variables and methods renaming, my colleague was able to correctly guess what my code was trying to do.
The review process honestly started very slowly because I, the developer, was giving as less hints as possible and was letting my colleague to progress alone as much as he could. Once sorted the initial naming incongruences, the review itself turned into a vivid and exciting conversation.
We agreed that
What I learnt that day is that in order to understand whether or not you wrote clean and well tested code is to simulate somebody to work on your code in a day you’re off. If he/she’s able to do that without ringing you.. well.. you did a good job!
Thoughts on the review process
Have you ever dreamed to have one or multiple password ready to be used just making use of a shortcut?
Well if you make use of ubuntu (even in a VM) here is the solution for you!
xclip is an Ubuntu app for dealing with stuff in the “clipboard”. I order to install it, please execute:
sudo apt-get install xclip
Once xclip has been installed you have to create a file that contains the password.
Eg.
echo"the_password" >/home/[username]/.my_unix_password
There is a Keyboard menu in Ubuntu.
Steps are:
Now open a text editor and press your magic key combination…. now try to paste!
Et voila!
The last thing you want when you work in an agile environment, is to apply agile’s concepts wrongly or don’t apply them at all.
Agile methodologies require the whole organization to act in an agile way where cooperation and continuous feedbacks are the keys of the success.
Although it’s easier to give birth to an agile team at the very beginning of a project, is also true that there is hope to become agile for a team that is still working in archaic and old methodologies.
The journey is long but you will get there, eventually. The most important thing to become an excellent team, is to chase the main road and never pull out trying to get shortcuts that will, somehow, do the job.
For this reason, when the friend and colleague @castigliego came to me with the illuminating idea of collecting stories about “Fragile Software Development” and bad agile experiences, we decided to create the hashtag #fr_agile in twitter.
We would like to make #fr_agile a channel where people tell their experiences about bad application of agile concepts or misunderstanding of agile’s principles and, possibly, the way they got out of there.
This sharing activity might become an incredible source of ideas and knowledge so that readers might be able to identify a smell in their team and be able to get rid of it before it could possibly make some victims.
As in a perfect agile fashion, even in this case communicating and sharing are the keys.
HSQLDB is a 100% pure Java SQL database. I often make use of it when I’m working on proof of concepts or tests.
You can download it at http://sourceforge.net/projects/hsqldb/files/hsqldb/.
In order to run it, it’s required to have a JVM installed and the JAVA_HOME environmental variable pointing to it.
I recommend to create a folder in your home directory (or wherever else) where storing all the files required for your dbs.
In order to start a db instance, simply execute:
java -cp ../hsqldb.jar org.hsqldb.server.Server --database.0 file:mydb --dbname.0 db_name
Where:
A very nice utility application that is shipped with the hsqldb binary is the DatabaseManagerSwing. It’s a simple one but it’s enough to navigate and query your freshly created db. Syntax for starting it is:
java -cp ../hsqldb.jar org.hsqldb.util.DatabaseManagerSwing
DatabaseManagerSwing remembers last connections you’ve created and helps to save plenty of time when you need to switch from a db to another.
This quick, nearly useless, tutorial will come in help with one of the next post I’m going to create.
-Sieze
If you are trying to mount a Windows shared folder that has its name containing spaces you can easily mount it sticking 40 instead the space character:
For example, if the box is at the address 192.168.0.15 and the name of the shared folder is "Name with spaces" you can add the following line into your /etc/fstab
//192.168.0.15/Name40with40spaces /mnt/name-with-spaces bla bla bla
-Sieze
A few days ago I was trying to update the script used to build the application on which I’m working. Together with the build I also wanted to integrate the script so to release the app on test boxes and restart the JBoss instance.
While the stop was working as a piece of cake, the restart of the server was keeping my ssh connection alive, and causing the release script to not finish.
After a bit of googling that the ssh syntax you’ll have to use if you want to send a command via ssh, redirect std out/err, and close the ssh connection:
ssh username@host “nohup command_to_execute > /dev/null 2>&1 > /../log_folder/log_file &”
Hope this will help someone of you out there
-Sieze
Just another WordPress.com site
Yet another Java blog
Cynical ramblings of a 30ish-year-old Latin girl living in Dublin