You are currently browsing the monthly archive for August 2011.
Skills Matter is hosting the first annual NOSQL eXchange this November with 7 action-packed talks planned for a day featuring a mixture of vendors talking about what’s interesting and useful in their stores as well as members from the community who are using NOSQL on their projects.
Speakers and subjects include a keynote Emil Eifrem, Ian Robinson on Neo4j, Dave Gardner on Cassandra, Brendan McAdams on MongoDB, Aleksa Vukotic on CouchDB, Russell Brown on Riak and Robert Rees on Polyglot Persistance.
The London Java Community’s next free event is – The LJC Code Share event on Thursday 25th August at 6pm.
Please see link for details and to sign up – http://bit.ly/ovrmcm
We are happy to announce the LJC Code Share for August. It is the first in a series of events focusing simply on the code. Not writing code, not code tools, but looking at the code itself.
The event is for anybody who cares about the code. You may be a beginner, looking to improve. You might be a grizzled old hacker who want to show how it’s done. We all have something to give and plenty to gain.
We will be reading code rather than writing it. Anybody who has something to share should just bring it along for everybody to see.
Is it an elegant solution you’re proud of? Let us all see it.
Are you facing a particularly knotty problem? Perhaps we can help.
Are you nervous about the code you are submitting for job applications? Get some positive feedback (and perhaps a little constructive criticism).
Do you have some have some other thoughts or ideas? If it’s about the code then we want to hear about it.
The format is open, driven by what people want to share. To help things along we will have a theme and a challenge. This month the theme is “achieving flow” and the challenge is “pulling tables out of a Word document.”
Coding is all about achieving flow. When programming we have to get ourselves into the zone. We have to reach a state of flow where we can hold all of the objects, variables and statements can pour out of our heads, through our fingers and into the editor.
The code we produce also needs to flow through so many forms and states. At one moment a person may be represented by a screen of fields. Then as a set of key-value pairs held in memory or as url-encoded text. Then as an XML document traversing an ESB finally to be bottled for weeks or months in the tables of a relational database. The person is always there, but the forms and representations are in a constant state of flux.
In our code sharing meet up we want to get to the heart of what programming is all about. We need to achieve flow to create code. Code is created to achieve flow. The moments when it all flows freely are the moments we are always seeking.
How do you achieve flow? Do you have some code that flows nicely? What impedes the flow?
Let’s get together and let the sharing flow.
The Coding Challange: Pulling Tables from a Word Document
The challange for this month is Pulling Tables from a Word Document.
Imagine that you have lots of Word documents and those documents contain lots of tables. Write some code to pull the data out of those tables and make them available for your code.
You can save the document in any format provided by Word: .DOC, .RTF, .HTML or any other format that Word will save.
Please see link for details and to sign up – http://bit.ly/ovrmcm
Recently, the London Java Community was elected onto the JCP (Java Community Process) board. The JCP is the mechanism for developing standard technical specifications for Java technology. The London Java Community’s membership on the board enables us to deliver content on upcoming and in-progress Java Specification Requests (JSRs) back to our growing community. It also gives us the unique opportunity to engage people working on the JSR projects and developers who have expressed an interest in contributing. We’re currently trailing the process of adopting a JSR. Although the process has not yet been fully defined, the first example we have selected is JSR-310, an improvement to the Java date system. Last month I presented a lightning talk on the topic of JSR-310 and Java Dates. This blog post will go into detail on some of the current limitations of dates in Java and will discuss how you can get involved in the ThreeTen project. The London Java Community JCP group believes this is an important JSR and will lead to an improvement to all developers using Java. If you are interested in finding out more about the LJC/LCP committee please contact @kittylyst on twitter, or drop me an email for more information.
Dates are a critical part of most software applications. Data models that represent something in the real world nearly always depend on timings or times of occurrence. Originally, Java had the Date class. There are a number of good discussions that have documented the limitations of the original Java Date class. One of the largest issues is that dates are mutable and therefore not thread safe, leading to an immediate issue surrounding scaling out applications that make use of Dates. Furthermore, Date is a DateTime, but confusingly there are also wrappers around Date in java.sql package for this. The functionality in Date and sql.Date are so similar that, especially for new developers, it can be unclear when and where to use each. Finally, there is no support for TimeZones in Java Dates, so building systems running in different regions and converting back to a centralised TimeZone was very complicated before the introduction of the Calendar class.
The Calendar class was added to the language later for TimeZone support and for more complex date problems. The problem with calendar was that it was still mutable, and formatting a date directly from a calendar was impossible – once again pushing the developer to understand the exact details of each implementation and when to use each.
The following code example is from a presentation given at JavaOne several years ago which highlights the above in one code fragment. A simple and readable piece of code shows 6 different bugs:
//Bug 2, 12 dates are indexed from 0 so, in this instance, 12 is out of bounds
Date date = new Date(2007, 12, 13, 16, 40);
//Bug 3, The timezone isn’t the ISO standard and requires and underscore to be correct
TimeZone zone = TimeZone.getInstance(“Asia/HongKong”);
//Bug 4, can’t create a Calendar from a date, you need to use a static instance of and then apply the date
Calendar cal = new GregorianCalendar(date, zone);
DateFormat fm = new SimpleDateFormat(“HH:mm Z”);
//Bug 5 and 6, can’t format on a calendar or a calendar object like this
Joda Time introduced several new key concepts into the Date arena that make working with Date and Times far simpler from a programmer perspective.
- Instant – There is a Joda-Time class of “Instant”. “DateTime” is also an instant, but one that adds getters for the human fields. DateTime is immutable and therefore thread safe. Immediately we have a good replacement for Date.
- Interval – An interval is a time measured from one instant to the another. The limitation here is that both end points are in the same Chronology and TimeZone.
- Duration – Duration is simply an amount of time measured in milliseconds, no timezone or chronology applies to a duration
- Period – A period of time time defined in terms of fields. This is a really useful feature for working with dates from a human aspect. Whilst machines represent underlying dates in long numbers, we still split things down into months, days and hours. Consider saying “one month from now” in February and then saying the thing same in May. Even though the month is the same, the underlying number of days varies. Periods allow the programmer to specify this kind of logic without having to convert to seconds and then add these to the value of the object.
- Chronology – From the developer perspective, a chronology is under-the-hood and is the calculation engine which holds the complex calendar rules. In most cases this, is is ignored as most users will be using ISO Chronology.
- TimeZones – A representation of the TimeZone held within a DateTimeZone class.
JSR-310 builds on many of the concepts that were introduced in Joda Time. However, to have the most robust implementation available for Java, there are some key issues in Joda Time that had to be addressed in JSR 310. So Joda Time is not without its flaws, but this doesn’t mean it shouldn’t be used; it’s currently the best production ready system there is. Stephen Colebourne covers this in his blog.
Human and Machine Timelines – I was born on 29th September 2005, this is a human representation – a Java representation is the number of milliseconds since 1970-01-01T00:00Z. JSR 310 separates the concepts out in the underlying implementation to make intent clear.
Pluggable Chronology – This can introduce unexpected state to the system by its pluggable nature. Consider calling the month of the day, you could get 13 if the chronology was incorrectly set. It is likely that people don’t check this before they make the call. Keeping these things separate is good programming practice leading to better unit testing and fewer curve balls when debugging problems later.
Nulls – The treatment of null values is always up for debate, nulls could be treated as the epoch, rather than a null value. Having this fuzzy behaviour could lead to bugs where you simply didn’t realise that you had passed a null by hiding errors. JSR-310 will seek to treat nulls as exactly that, and not assume they are the epoch.
Internal Implementation – Most user interacting with dates may not realise the depth of the implementation that is required around such a system, for example most people will use standard chronologies and calculations with dates. However, the internal computations are complex, especially when coupled with chronologies and the human machine timelines. Ensuring this architecture is production standard for all users is not a simple task.
In JSR 310 some key decisions were made to move Joda Time forward by reworking some of the design concepts. What the user sees in the Joda time API is the tip of the iceberg. A lot had to change in order to have these design considerations in place.
The main issue that might compromise the inclusion into Java 8 will be around the TCK testing suite, which is likely to be required in addition to the unit tests provided with the current ThreeTen implementation.
The ThreeTen project (the reference implementation of JSR-310) is now on GitHub, so contributions can be made and pulled into the project. ThreeTen is developed entirely in the open and there are still a number of things to be done. Contributions around documentation, testing and performance optimisations are currently up for grabs. One such example would be working out the best way to derive the OffsetDateTime from an instant.
Getting involved is as easy as entering a few git commands and joining the mail group.
JSR 310 is currently one of the key JSRs and any additional community support should help ensure that the project enters the earliest version of Java possible.
If there is one thing you should do this year, it’s go to a technical conference.
Ben had previously written a quick note from our trip to OSCON. It’s hard to explain the sort of impact that a good conference can have on your career and even your life, but we can’t express how much you should go to one in order to gain inspiration, have fun and learn a whole bunch of new stuff you can take back to your workplace.
Here’s a summary of the trip and some links to explore further. OSCON is the largest open source conference in the USA (FOSDEM holds the crown in Europe) and this year consisted of three conferences in one (Data, Java and the main OSCON itself), plus a couple of pre-conferences (Community Leadership Summit and the JVM Languages Summit).
I spent the Saturday before OSCON at the Community Leadership Summit. CLS 11 was a 2 day un-conference organised by Van Riper of Google and Jono Bacon (Ubuntu Community Manager). There were plenty of great discussions about the art form of running communities which are summarised in the CLS 11 wiki at http://communityleadershipsummit.wikia.com/wiki/2011/Notes
Ubuntu, Google, Twitter, Facebook, WordPress, Adobe, Red Hat and many more were all represented here and I got an awful lot of useful knowledge from some of the best community leaders around.
JVM Languages Summit
This one day un-conference was hosted by Stephen Chin, who cleverly roped in our own Ben Evans to facilitate much of the discussion (I suspect Ben was bribed by the great coffee and specialist doughnuts ;-p). There were a couple of really interesting debates about topics such as “What a future programming language will look like” but the hot topic of the day was centred around “language interoperability for JVM languages”. The key difference being that the language designers want their languages to interoperate with each other as opposed to having to go through Java.
This is understandably a non-trivial problem space . Luckily, the room was filled with the Who’s who of the JVM languages world including:
- Charles Nutter (JRuby)
- Martin Odersky (Scala)
- Ola Bini (more languages than you can shake a stick at)
- A bunch of other experts
- Some bemused enthusiasts such as myself.
By the end of the day, some glimmerings of a solution were being thrown about and armed with some optimism from the day, Ben arranged for a round table to hash out the details on the following Tuesday (more on this shortly). It was a great privilege to meet these experts in person and to be involved in a truly interesting discussion on some of the great problems facing the JVM today.
The quality of the talks at OSCON were truly excellent. On the Java side, some of the talks included:
- Some candid statements from Oracle about recent controversial happenings in the Java ecosystem,
- A healthy discussion that Ben and I hosted about the JCP and the future of Java standards
- The always entertaining Java puzzlers from Josh Bloch
- A mesmerizing “Future Java Developer” talk by SouJava which involved time travel!
- Plenty of hard core talks about the JVM, performance, concurrency and more.
On the Monday night the Oscon Ignite talks are always a highlight. You can see these fast and furious talks at http://www.livestream.com/oreillyconfs/video?clipId=pla_2da1e879-afb5-44be-a538-b697ee24c58a). For those of you who want to see the Diabolical Developer again, he makes an apperance at 6:40
JVM Languages Interop
On Tuesday, after the keynote a small group of us representing a bunch of languages including Scala, JRuby, Clojure, Java, Ioke, Seph and more sat down to try and work out some of the JVM language interoperability details. To cut a long story short, the introduction of invokedynamic and MethodHandles in the JVM as part of Java 7 really comes in to save the day and for the first time makes it possible to interoperate between the dynamic languages such as JRuby and the static languages such as Java.
Ben is tracking the efforts to turn theoretical discussuions into reality. For those who want to join him, please contact him via twitter @kittylyst or join the jvm-languages google discussion group. Hopefully as his work on the book wraps up, he’ll be getting more cycles to devote to languages work.
The hallway track
The other amazing aspect of a conference like OSCON is the people you meet in talks, over drinks or dinner, or just randomly roaming the halls. Ben and I caught up with old friends and colleagues, and made some great new connections. A quick shout-out (but by no means exhaustive) to: Jeff Genender (Apache), Selena Deckelmann (Postgres), Aaron Bedra (Clojure), Noirin Plunkett (Apache), Joe Darcy (Oracle), Stuart Sierra (Clojure) and Patrick Curran (JCP) as well as everyone we’ve already name-checked.
And finally, a very big thank you to Stephen Chin and Laurel Ruma – the chairs of OSCON Java. Thank you so much for the invitation to come and participate – and hope to see you again next year.
Some random notes
- Ben and I also helped out with Java 7 hacking workshop (and saw some great ways to make workshops run more smoothly), attended a few great parties (the PuppetLabs party was epic to say the least) and engaged in a monster sized game of chess in the exhibition hall (thanks to some crowd support, I eeked out an honourable draw ;p).
- For those photo fiends out there you can see the mayhem at the Official Photos on Flickr http://www.flickr.com/photos/oreillyconf/sets/72157627279363746/
- Some other reviews of OSCON can be found at http://www.oscon.com/oscon2011/public/content/news-coverage
OK, so that was a long post – but we hope it gives you a taste of why conferences can be career changing (even life changing) experiences. Luckily you don’t have to travel too far for your next conference fix!
We have JAX London 31st Oct – 2nd Nov, which promises (like OSCON) to be an event packed with great talks and a high ratio of speakers/industry leaders to attendees. As Mark Hazell mentioned in a recent mail to the list, it also has a healthy representation of speakers from this community, which really showcases the great support and mentoring the LJC gives.
Later on this year on Nov the 26th (save the date!), we have our very own LJC Open Conference. This little conference punches well above its weight with lots of high quality sessions and is also a fantastic place to give your first presentation at in a supportive environment.
Packt Open Source has this week announced a series of discounts on a selection of its latest Open Source books. Whilst celebrating the summer weather, readers will be offered exclusive discounts off the cover price of selected print books and eBooks for a limited period only.
The Packt Open Source books included in this exclusive discount offer include the concrete5 Beginner’s Guide, Drupal 7 Themes, jQuery 1.4 Animation Techniques: Beginners Guide and the OpenCV 2 Computer Vision Application Programming Cookbook. Additionally, Packt Open Source will be running weekly contests to celebrate the launch of the 2011 Open Source Awards.
“With the launch of the 2011 Open Source Awards and some of the exciting titles published this year, it’s a great time to celebrate and recognize some of the great things in Open Source.” said Packt Open Source Marketing Executive Julian Copes. “Packt remains committed to not only providing the most cutting-edge catalogue of Open Source books, but also supporting and recognizing excellence in Open Source through this year’s Awards.”
To ensure you do not miss this fantastic offer, visit the Open Source Summer Madness home page now, where you can view the extensive list of books included in the offer and find out more information about the weekly contests celebrating the launch of the Awards.
The exclusive discounts are available from 1st August 2011. To find out more, please visit the Packt website.
Martijn and I have been at OSCON 2011 (the O’Reilly Open Source conference – http://www.oscon.com/oscon2011/ ).
It has been an amazing week so far – huge numbers of the leading lights of the Open Source world (not just Java, but from across the industry).
We hosted a panel on the Java standards process and the JCP – there’s a good write-up of it here: http://www.javaworld.com/community/node/8086
We’ve also been busy on the language interop front – we organized an impromptu meeting of language geeks (including committers from JRuby, Scala, Clojure, Gosu and a couple of others) to talk about design of language interoperability features.
Will do a proper write-up of the conference when we get back, as there have been a lot of really great talks and presentations. We’re also hoping to arrange for some of the speakers we saw to come and present to the LJC when they’re visiting London.