Sep 21

England beat Aussies in 1 day cricket for first time since 1999

British, Personal, Sport 22 Comments »

Good job lads.

I didn’t know when I would next see someone beat the Aussies. They are too good.

Well, it is great to see that maybe England really is improving, as their results are showing. Watching Flintoff is like watching Botham in the old days, and it is so fun to watch.

This was a great thing to see as I sit around with no energy, being sick.

Sep 21

What is a sign that Spring is taking over your project?

Tech 47 Comments »

It is funny how sometimes Spring gets its way in, and slowly sucks away :)

Woo – this would be really cool. It would enable us to get rid of another config file from Confluence, replacing it with yet another Spring context file :)

Cheers,
Mike

ATLASSIAN – http://www.atlassian.com

On Sun, 19 Sep 2004 11:27:54 -0500, Dmitriy Kopylenko > I've added "org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
> and "org.springframework.cache.ehcache.EhCacheFactoryBean" to the
> sandbox. Please take a look at it with any suggestions and/or comments.
> Now, if we would provide such caching support classes, where would
> they live. Is "org.springframework.cache" top level package
> appropriate with sub packages for different caching subsystems i.e
> "ehcache", "oscache", etc.? If we all agree on the package for caching
> support classes, EHCache factory beans might make 1.1.1
>
> Regards,
> Dmitriy.

Sep 21

High Tech Divining Rod

Tech No Comments »

I was talking with Christian about an engineer who believes in diving rods.

It turns out that a lot of engineers in his business have a diving rod in their trucks, and use them to help out hunting for water lines and such.

I think our industry has a divining rod of its own. Ours revolves around coming up with time estimates.

I have been involved on projects where people use a full, heavy, process to work out the estimate…. and with projects where darts are thrown against the wall. The only way the estimates seemed to get better was through experience which taught people more and more. However every project is different, and normally has different personel.

So, I need to pull out my divining rod to work out an estimate for this next project Adigio is working on…

Sep 20

Spring PropertyPlaceholderConfigurer: A nice clean way to share

Tech 30 Comments »

How many times have you been on a project, and people are talking about where to share configuration data?

Do I use some constants? What about a config file (XML, properties, etc)?

Sometimes it isn’t easy to know what to do, and you sometimes end up with duplicate information.

For example, what if you want to share database information between your code, your ant build, and anything else?

With Spring, you can use their really nice PropertyPlaceholderConfigurer, and easily share a properties file. You can simply share one properties file for all of your build info as well as Spring sharing, or you can of course seperate things out, and have multiple <property file=”filename”/>’s in your build script.

So, the steps for sharing the data:

1. Setup your properties

# DB Info
jdbc.driver=org.hsqldb.jdbcDriver
jdbc.url=jdbc:hsqldb:db/myapp
jdbc.user=sa
jdbc.password=
jdbc.maxConnections=25

2. Setup and use these properties in Spring

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:project.properties</value>
</property>
</bean>

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>${jdbc.driver}</value></property>
<property name="url"><value>${jdbc.url}</value></property>
<property name="username"><value>${jdbc.user}</value></property>
<property name="password"><value>${jdbc.password}</value></property>
</bean>

3. Use these properties in Ant

<property file="project.properties"/>

...

<target name="browse">
<java classname="org.hsqldb.util.DatabaseManager" fork="yes" failonerror="true">
<classpath refid="classpath"/>
<arg value="-url"/>
<arg value="${jdbc.url}"/>
</java>
</target>

Easy as pie. Just another small example of how it is a pleasure to work with Spring. I remember futsing around for hours with how to do configuration with JNDI and EJB. What do you put in <env-entry>’s? Ergh. Not anymore!

Sep 20

All Teachers Left Behind

Personal 60 Comments »

Teachers keep getting abused. It is outragious. We need to make teachers feel like professionals again for gods sake. My wife has spent a LOT of money already this year on supplies for her kids, and this takes the biscuit.

Teachers lose tax breaks for class expenses

If Doreen Seelig pocketed all the money she has spent on classroom supplies over 35 years as a teacher — the printer cartridges, the paper, the pencils and the paperback books lent to her Venice High School students — she figures she would have a new car by now.

Now, as the new school year gets under way, the burden on Seelig and other teachers around the country is even heavier.

Because of a budget crunch, California has suspended a tax credit that reimbursed teachers up to $1,500 for classroom supplies. Meanwhile, a $250 federal tax deduction for teachers that helped defray out-of-pocket spending expired this year.

Sep 20

Finding too many bugs in a close area

Tech 2 Comments »

I caught a virus (a real one, not a computer one) while travelling around on a damn plane last week.

I have been drugged up and out for the count over the last couple of days, and when I woke up for a bit I had a Bruce Tate moment.

I started to think about writing an analogy of writing bugs, and getting this bug in a plane. Then I thought better of it ;)

What DOES bug me though, is the following:

Why are planes bloody hot when you get in them? The A.C. never seems to kick in until you are in the air. Are they just too cheap, and wait until they suck in air from around them? It drives me nuts!

Well. Back to sleeping off the damn bug :(

Sep 20

RE: It’s not about one-liners

Groovy, JavaScript, Perl, Ruby, Tech 3 Comments »

I agree with Cedric.

The “best” programming language, doesn’t mean the one that creates the lowest wc -l.

I actually always found myself writing quite “verbose” Perl code, for example.

However, I do feel that languages such as Ruby, Groovy, and yes… even Perl allow me to get closer to the zen of “expressing everything I want, and need to get across… but not more”. Every operator/method tells me a lot.

For example. Compare the code for taking out some text from a string:

Groovy:

name = “Dion ‘Sick Boy’ Almaer”
name -= “‘Sick Boy’”

and in Java? ergh.

Sep 16

Closures in C# 2.0 (Did you hear that Sun?)

Tech 378 Comments »

Since we know that Sun will change its mind if it see’s a feature being added to C#… maybe we will see closures added to Java soon (Java 6?).

Joe Walnes ported the Ruby closure code from Martin Fowlers latest entry on the subject.

Let’s looks at one:

Ruby

def managers(emps)
return emps.select {|e| e.isManager}
end

C#

public List Managers(List emps) {
return emps.FindAll(delegate(Employee e) {
return e.IsManager;
}
}

I would love to have this in Java. I would love it even more if:

delegate() isn’t needed

Sep 16

Sam Pullara moves on from BEA

Tech No Comments »

BEA keeps bleeding good folks (although they still have a few so don’t worry ;).

Sam Pullara has left, and is going on to be:

an EIR (entrepreneur-in-residence) position at Accel Partners (http://www.accel.com), a venture capital firm in Palo Alto. There I will work on developing a new company, investigate possible investments, and consult their portfolio companies.

Good luck Sam. I hope you still have some time to play with Groovy, and I hope we meet up again at some point… maybe at a Poker table ;)

Sep 16

RE: JUnit, Test your behavior not methods

Tech 1 Comment »

KT has written about JUnit, Test your behavior not methods.

I definitely feel this one. It seems that there is a flow of cause and effects that we run into in our world:

  1. Someone comes up with a good idea
  2. The idea is spread
  3. The idea gets tweaked along the way
  4. Mass adopters follow the letter of the warped idea, and not the thought behind it

When I look at that flow, I could be talking about a lot of things. For example, Religion :)

Where does this fit into unit testing?

Well, the idea of doing unit tests is obviously a good one. Test Driven Development is also a great tool that we can use to get good designs, and less bugs.

However, it has somehow been warped in many dev shops. In these shops they take the LETTER of the idea “build unit tests == good” and focus on making as many unit tests as possible. Their code coverage tool helps make a game out of this. “I have got 80% coverage”.

However, who gives a monkeys about your coverage compared to the QUALITY of your damn tests. It is easy to use a tool, or manually, create tests for every method and branch, but most of the tests are crap!

I would rather have less coverage (and at areas where I think I really need them) which have really smart tests of behaviour (not just passing nulls and seeing what happens).