Filed under automation, code on December 2 | 0 comments
This article is a must read:
http://timothyfitz.wordpress.com/2009/02/10/continuous-deployment-at-imvu-doing-the-impossible-fifty-times-a-day/
The discipline and the level of automation to be able to continuously deploy new code is inspiring.
It may sound impossible to do right now but I think that once you start taking the first step on this path you will not want to go back. This is a lot more fascinating than the current type of testing I see done on my code. It is also more fascinating to think that you can deploy new code easily all the time than having to go through all the paperwork that I am seeing all the time.
FASCINATING!
Filed under code, python on November 26 | 0 comments
Learning Python is a lot more fun than I anticipated.
I think that the fun comes from a no expectation mentality and that everything I do with python is currently simple and helps greatly to automate some boring tasks.
I am not sure that I can complain about the fact that from one version to an other the changes are sometimes drastic and being able to understand and find the differences is sometimes more work that I would like. This issues comes from the fact that RHEL5 has Python 2.4 and that my other platforms have Python 2.7.
Today I was trying to understand how to pass a datetime to a xmlrpc server and some functionality was introduced in 2.5 (allow_datetime). It took me 20-30 minutes to understand why it was not working on RHEL5.
As any good learning I am making many errors in small scripts so I hopefully avoid when the real apps come around.
Filed under code, java on July 23 | 0 comments
I spent a little bit of time to figure out how to find the jdk version used to compile a java class. On the site stackoverflow they have a great example of java code that can get this information. Unfortunately that did not resolve my problem so I will have to hunt down a bit more on why I get this:
Exception in thread “main” java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Filed under code on April 15 | 0 comments
Laziness is quite the creative motivator sometimes.
So I have this application that accepts syslog messages and process them to generate daily stats.
The glitch with the current way the code works is that it has hard coded separator for the messages. Just one hard coded separator. It may have worked somewhat fine for a period of time but since I have been monitoring the situation I can say that it is dropping quite a few messages every day because of that limitation.
While looking at the code to determine the scope of the change I was getting less enthusiastic to address the issue as I was discovering more and more places with the hard coded value.
I put that aside and found something more fun to do for a few moments.
Then I started to get motivated by laziness…
So the current idea is to parse the syslog messages that it gets and replace the different seperator by the one that is hard coded. This requires the least amount of energy to get it fixed. What I am not sure is how much technical debt am I accumulating with this idea.
Filed under code on March 26 | 0 comments
I am reading these articles about cloud infrastructure and how much ondemand power you can get for your application and batch processing. So easy and convenient.
Does this raw power at pennies make the programmers less efficient? Lazy?
Does it matter?
I will answer yes to both questions. I think that it makes programmers lazy because you don’t have to face the consequences of your laziness. What does it matter that it takes 10% more time because you did not optimize every line? 50%? 90% when the cost is a couple of dollars a day?
Yes it does matter. I inherited an application that the previous programmer did a very good job at putting up and maintaining while he was with us. Now that I took over I have a hard time seeing all the moving parts but as I have to fix and change things I can see wholes in certain places. Lately I have found the code that produces the last 6 months quick view of performance. It goes through the last 6 months of data and does a daily average. Every day. So the code needs the last 6 months of data to be present on the server to go through it over and over to produce a single file that has a 2 lines difference from the previous day. I takes 4 to 5 hours each day. Can it get any funnier? The management answer to this issue was to throw more disk space at the issue since the batch processing is done at night and does not impact the system. Hard disks are cheap.
Imagine this application in the cloud and management asks for a 12 months history view. Everyone would have said no problem we need to provision an other 300 to 400 Gb of space and change 1 configuration file. The cost is minimal.
I personally want to address it in the code and get this optimized. Do you think I am getting any time dedicated to this issue? I am too costly for that option to make sense.
Because I am on physical hardware in our own data center it does matter and it will get addressed by fixing the application. We are restricted since we can’t had any drive to the server. If this application was in the cloud it would not get any attention?
I can see both sides of the coin and the reasons for the business to make the choice it would but I still think that fixing the application is what need to be done. The technical debt that this has cannot simply be ignored.
Filed under code, java, software on September 3 | 0 comments
This is not the first time I do this and it is on the edge of embarrassing except this time I knew I had tools to get me out: lose the source code to a java application.
I have this application that was done a year ago and I guess that in the rush to get it to production I forgot to import the code in SVN.
A year later we have changed a few things and now I have to change a few lines in the code and add a method to it.
I remembered using a command line tool under Linux to decompile but since I could not remember the name of it I had to search for it. In the first few results of my google search for “java decompiler” came this site:
http://java.decompiler.free.fr/
I tried to install the JD-Eclipse but I don’t see how to use it so I simply downloaded and used the JD-Gui for Linux and it works beautifully. I can see my source code in the .class file in 2 seconds and now I can easily change it. This is so convenient.
Filed under code, java on August 18 | 0 comments
Saw this article from a twit and I am unsure how I can do all these:
http://codemonkeyism.com/generation-java-programming-style/
Interesting and if I do any code with this I will post an other entry to let you know how it went.
Filed under code, java on June 9 | 0 comments
I have to read a bit more on the subject but this article was interesting since it shows how to do in Java what Apple Cacao does with the MVC model. I find this twist to be easier to understand.
http://java.sun.com/developer/technicalArticles/javase/mvc/
Filed under code, java on May 5 | 0 comments
http://odi.ch/prog/design/newbies.php
This explains a few things that should be done differently if you want your application to perform well. Very interesting!
Filed under code on February 9 | 0 comments
When looking at java garbage collection logs you only get logs with a time stamp in seconds from the start of the JVM. After a few days of running the JVM it is difficult to remember when it started and when is the event your are looking at from. I was looking for a quick way to calculate the time. Python has some nice facilities built-in to help with that task. Here is what I do from the command line to figure out the last time it was started:
[bash]$ python
>>> from datetime import datetime
>>> from datetime import timedelta
>>> datetime(2009,2,9,10,48) – timedelta(seconds=159565)
datetime.datetime(2009, 2, 7, 14, 28, 35)
The datetime object is initialized with the date I want. In this case it was February 9, 2009 at 10:48. The timedelta object is initialized with a number of seconds but it could be days or min.
Very quick and convenient.