on Friday, 19 September 2014

Problem

I have an archive compiled with properties pre-defined within, but they need to change as I promote my build through the different stages of the SDLC. One example could be with a connection.xml that has URLs pointing to different databases.

Gradle already offers some great solutions such as keyword expansion and ant token replace, but both methods require the token to be in a predefined format. The expand() solution looks very similar to groovy string interpolation and looks for ${..}, whereas ant replace tokens looks for @..@.

Solution

The solution here was to pass a closure to filter which is called for every line of the filtered file. The closure performs some simple processing using the MapFilter() class and its MapReplace() method. An example is shown below:


There's more ...

You may have noticed that this example also includes a lot of meta-programming. This was just my first dip into the world of meta-programming. In this example the metaclass simply intercepts every new call to map filter and returns the original map filter instance.
on Monday, 19 May 2014
myFile.toURL() deprecated The fix to this is quite simple:
on Wednesday, 23 April 2014



I have recently been working on writing a Gradle plugin for the popular SoapUI functional testing tool. To make things easier I decided to port the maven plugin rather than reinvent the wheel. I've been working predominantly in IntelliJ, and for some reason it didn't flag any dependency failures.

I felt the time had come to add the project to CI and was surprised to see the build failed. I have been employing test driven development so had expected test failures but not dependency failures.

To resolve the issue I first had to establish what was causing the problem; running the 'gradlew dependency' task helped nicely! The output below is quite clear:



Simply changing the dependency to a later version fixed my issue.
on Tuesday, 28 January 2014
This snippet will produce a zip archive that includes the artifacts of the subprojects.
on Monday, 20 January 2014
Here's my interpretation of the following presentation from Daniel Kahneman.

Thinking fast, and slow - Daniel Kahneman

What do you see as the key points?

System 1 is our fast thinking self, the one that makes decisions based on intuition, is influenced by emotions, uses tacit knowledge, and operates out of habit.

System 2 is the part of us that analyses situations, considers alternatives, plans for the future, and does the math. Whenever we find ourselves pausing to consider something carefully, its like switching from autopilot to manual mode; our analytical mind takes over from our intuition and works out rational choices.

What are the pros and cons of System 1 and 2?

System 1 is intuitive and moves easily, adjusting rapidly to changes. It has a lot of experience in its speciality areas and is comfortable trusting its expertise and intuition to guide actions.

System 2 analyses situations before acting. It knows that the best decisions are those based on evidence. System 2 would run experiments, gather data, and weigh the impact of various choices before making a decision.

System 1 proved its weakness with the baseball riddle. There was a moment where system 1 assumed it knew the answer but was incorrect.

System 2 is slow and less effective in agile situations.

How do you get the best out of both?

Modifying a mindset will require deliberate effort and considerable time as with breaking any habitual characteristic.

What are the challenges for you - what should you watch out for in tackling PoD challenges?

I am heavily driven by System 1 and don't often weigh the impact of various choices before making a decision. I'm hugely passionate about driving technical change, but often get blinded by my experience and sometimes provide a solution before fully understanding the problem.
What are your views on the clip?

The most interesting part of this clip was how captivating Ken was during this presentation. He used humour to get his point across instead of ranting. He commanded attention within the first few moments of being on stage and held that attention until the end.

What do you see as the key points?

School had a pretty lousy system for recognizing talented students.

Does it resonate - if so, how ?

Research has shown that talent is not something people are born with; it is something that is developed over time with hard work and diligent practice. Once students are “tracked” as low-potential, they will not be
assigned challenging classes, as Gradillas discovered. Tracking can start very early and be based on little more than a student’s command of English. (Jaime Escalante and Jack Dirmann, “The Jaime Escalante Math Program,” Journal of Negro Education59, no. 3 (Summer 1990): 407–23)

Will you do anything differently as a result of watching it?

I think its important to nurture creativity in the same way as academia. However, its important not to force one on the other unwillingly.
on Friday, 10 January 2014
This is a fun one - how many times have you been close to a deadline and the customer asks you to squeeze another feature in, the delivery manager commits to it and we're all working till midnight to make sure the feature is delivered? Well, for this one we like to use the term shoehorn - is it ironic the delivery manager got one in his xmas cracker this year?