tag:blogger.com,1999:blog-77663042024-03-06T08:25:15.500+00:00counterpointtimhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.comBlogger49125tag:blogger.com,1999:blog-7766304.post-15132132247008710542011-06-03T15:23:00.000+01:002011-06-03T15:23:54.553+01:00Anaphylaxis<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB7RTxZzx3QE3HcesEfbXFsW0JIi7skzmPykrwO5rTzlWovXJK3-tz84kH4znmZtG8m_eBj2Umdtq4ih4GWonIqaHLbQEySK41BDwbQ3W6zdF8qoxy4H8Q-6IO6dYJa_zq7qQwSg/s1600/finger_bee.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB7RTxZzx3QE3HcesEfbXFsW0JIi7skzmPykrwO5rTzlWovXJK3-tz84kH4znmZtG8m_eBj2Umdtq4ih4GWonIqaHLbQEySK41BDwbQ3W6zdF8qoxy4H8Q-6IO6dYJa_zq7qQwSg/s1600/finger_bee.jpg" /></a></div>Not sure if I mentioned it already, but I don't really like the taste of honey. I keep bees because they are fascinating creatures with highly complex behavior, both individually and as a colony. The mixture of practical and theoretical skills required to keep honeybees well appeals to me.<br />
<br />
Of course, when you say "bees" people immediately think "stings", probably before they even think of "honey". I have all the protective gear, but inevitably as a beekeeper you will get stung now and again. I find that autumn is the worst time of year; understandably perhaps as the bees are protecting their stores built up over summer with little prospect of replacing them before going into winter.<br />
<br />
Most stings are harmless enough. Full coverage clothing means that the bee's stinger does go in far, and if it is far enough for me to notice I can take it out easily. However, recently I had two different episodes where the reaction was a bit more dramatic.<br />
<br />
In one case I was carrying a hive full of bees to move it to another apiary. The entrance was sealed-up, but a couple of bees were hanging underneath looking for the way in, and took exception to my hand being there nearly squashing them. I got a full dose of venom in my finger, which was un-gloved as the bees were sealed in, right? Rather than drop the hive with 50,000 more bees inside I just had to grin and bear it.<br />
<br />
The normal response to a bee sting is short intense pain followed by localized swelling, redness and swelling, and a wheal around the sting site lasting about a week. The reaction is localized to within ~10cm of the sting site.<br />
<br />
My reaction was a bit different. Within ten minutes I had a severe pounding sensation in my head, dizzyness, itchy rash (ironically called "hives") over my whole body, swelling in my armpits and groin, and a feeling of pressure on my chest. Bugger! I had to lie down, took a triple dose of anti-histamines, and waited about six uncomfortable hours for it to pass.<br />
<br />
The second time I was mowing the lawn quite close to the hives, and I guess one bee took exception, and without warning stung me on my temple. Bees usually will give you a warning by "head-butting" you a few times, and irately buzzing round you -- this one just went for it! The result was a similar whole-body reaction.<br />
<br />
I'm not big on medications, but the thought has crossed my mind about what would happen if I was careless enough to get multiple stings simultaneously. So I've now got an <a href="http://www.anapen.co.uk/index.php?option=com_content&view=category&layout=blog&id=2&Itemid=11&lang=en">epinephrine autoinjector</a> next to the other bits and pieces in my bee kit.<br />
<br />
The best description of <a href="http://www.resus.org.uk/pages/reaction.pdf">the recognition and treatment of anaphylaxis</a> I have found is published by the Resuscitation Council (UK).<br />
<br />
Provided you watch and listen to what the bees are telling you, then with proper handling and the right protective equipment, getting stung should be a rare occurrence for a beekeeper. I'm still learning.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com1tag:blogger.com,1999:blog-7766304.post-39949996291674012302010-10-11T22:09:00.002+01:002010-10-11T22:49:26.405+01:00IBM and OpenJDKIBM and Oracle are going to bring their combined resources together to <a href="http://www.oracle.com/us/corporate/press/176988">collaborate in OpenJDK</a>. The natural question arises about what this means for the <a href="http://harmony.apache.org">Apache Harmony project</a>.<br /><br />Apache Harmony has always been clear about the goal of innovating on a <span style="font-weight: bold;">compliant</span> and <span style="font-weight: bold;">compatible</span> implementation of Java SE. It's also common knowledge that Apache have been <a href="http://www.apache.org/jcp/sunopenletter.html">requesting a compatibility test kit license</a> for a number of years, and that a suitable license has not been forthcoming. There's little prospect of that situation changing.<br /><br />So what's best for the Java ecosystem? I believe that compatibility is vital, and rather than risk divergence the right thing is to bring the key platform development groups together on a common codebase. Lessons learned on Project Harmony will be of value to OpenJDK, and I know there is immense mutual respect between the IBM and Oracle engineers.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com4tag:blogger.com,1999:blog-7766304.post-11744604209583026472010-08-16T05:13:00.003+01:002010-08-16T05:32:28.364+01:00Java trap not yet disarmedThere is already plenty of opinion written about the <a href="http://regmedia.co.uk/2010/08/13/oracle_complaint_against_google.pdf">Oracle vs. Google action</a>. As a member of the Apache Harmony project I'm an interested bystander in this story, since Android's runtime core libraries come from Apache Harmony. To date, Apache Harmony have not been notified of any involvement in the lawsuit.<br /><br />Carlo concludes in <a href="http://carlodaffara.conecta.it/?p=478">his blog entry</a> "the open source credibility of Oracle, already damaged by the OpenSolaris affair, is now destroyed" -- and that is the real shame here. Oracle's use of patents in this manner is not good news for anyone in the Java ecosystem who is promoting or using Java as a free and open runtime platform.<br /><br />Having multiple competing implementations of a specification, that are ultimately held to account for claiming compatibility to the specification by a rigorous test suite, is a good thing.<br /><br />As is widely known, Apache Harmony has been denied access to the Java SE compatibility test suite in <a href="http://www.apache.org/jcp/sunopenletter.html">a long running dispute</a>. That situation did not change with Oracle's acquisition of <a href="http://www.marketwatch.com/story/oracle-buy-sun-microsystems-74">"the most important software [Oracle has] ever acquired"</a>. This new action, coming less than six months since the acquisition completed gives me concern for the future of OpenJDK as being the place where Oracle openly and freely advances the most important managed runtime commons.<br /><br />Contributors to the OpenJDK project have already assigned joint ownership rights to Oracle via the Sun Contributor Agreement. Oracle alone has ownership of the entire OpenJDK codebase.<br /><br />Apache projects are structured differently. There is no such grant of joint ownership to a single entity, and therefore it would be impossible for a single entity to take control. Apache Harmony is a patchwork of contributions, owned by the community and available to consumers under a liberal open source license. Furthermore, the Apache license has terms that explicitly handle Patent rights (see <a href="http://www.apache.org/licenses/LICENSE-2.0">Section 3</a>), and so it is clear to consumers that they have a license to use any Patented contributions.<br /><br />I hope Mark is wrong when <a href="http://gnu.wildebeest.org/blog/mjw/2010/08/13/oracle-tries-to-destroy-free-java-now-what/">he says</a> that Oracle are on a "quest to destroy the free Java world" because the only conceivable Java world is one where you can get Java wherever you want it under the freedoms of an open source license. However, it would appear that <a href="http://www.gnu.org/philosophy/java-trap.html">the trap</a> is not yet fully disarmed, and at least one implementation may be starting to move in the wrong direction.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-10257210032281231532010-01-21T11:03:00.004+00:002010-01-21T11:23:34.370+00:00Oracle += Sun<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQroPwV7b1sHFJvwEBXzjdGAuYi3AszipxzHnW5ZiHSnaGmpM7rCZ5l8pMqWRfykeSaSUasf6VU1HekTSapjezkM_0pVPh1C-5tIgKFu2ttpkVqC2ZikRcb-n5DnBTNtzUmWR1AQ/s1600-h/sunset.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 100px; height: 100px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQroPwV7b1sHFJvwEBXzjdGAuYi3AszipxzHnW5ZiHSnaGmpM7rCZ5l8pMqWRfykeSaSUasf6VU1HekTSapjezkM_0pVPh1C-5tIgKFu2ttpkVqC2ZikRcb-n5DnBTNtzUmWR1AQ/s200/sunset.jpg" alt="" id="BLOGGER_PHOTO_ID_5429150576412962498" border="0" /></a>Well, it took its time coming, but reports are that the acquisition <a href="http://online.wsj.com/article/SB10001424052748703699204575016561637563060.html?mod=WSJ_hpp_LEFTWhatsNewsCollection">has been approved</a> by the EU today.<br /><br />I expect a number of Sun employees will be <a href="http://digitaldaily.allthingsd.com/20100118/eu-poised-to-approve-oracle-sun-deal/">opening their mailer with trepidation</a> when they get into work this morning. Its the end of an era for a big name in the industry, but a great opportunity for a new era in the Java ecosystem.<span style="font-size:78%;"><a href="http://www.flickr.com/photos/paulmoody"><br /></a></span><br />Congratulations and good luck to all those involved.<br /><div style="text-align: right;"><span style="font-size:50%;"><span style="font-size:78%;"><a href="http://www.flickr.com/photos/paulmoody">Sunset photo by Paul Moody</a></span></span><br /></div>timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com2tag:blogger.com,1999:blog-7766304.post-73300056227736975772010-01-07T15:44:00.004+00:002010-01-07T16:08:06.290+00:00Dear Santa ...<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGrv3HM4Ds_uQTQ0gLTFc5ik802UOg6CaqtXhyvjDIWe3tenKnWoqlwV3JPEg01X_G79ABbShY_VwgRd_uAe0Vv4nu8hmlEWyNhV5S6lNrH-o_S0Qs1AM8qMkONqnnPc9mu-TqDg/s1600-h/Clipboard01.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 140px; height: 19px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGrv3HM4Ds_uQTQ0gLTFc5ik802UOg6CaqtXhyvjDIWe3tenKnWoqlwV3JPEg01X_G79ABbShY_VwgRd_uAe0Vv4nu8hmlEWyNhV5S6lNrH-o_S0Qs1AM8qMkONqnnPc9mu-TqDg/s200/Clipboard01.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5424025175969044402" /></a>Thanks for the socks and all that, but my G1 is nearly 18 months old now and I was thinking about getting a Nexus One.<br /><br />The first problem was that trying to go through the order process using FireFox doesn't seem to work.<br /><br />Every path after the 'Continue' button results in:<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiXMHFIJzqyx2fvCVEkxy4SHDBpDtLznyvBbmcFLj29KLY0GuNY5WXSS0O2QYN57GYwLvnoTpbkc8I6LISPKMhNlzp6-FM3778dn2zCFLAHKgPM3YppiwLsXe7DBS4tYF1i02o9A/s1600-h/Clipboard02.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 48px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiXMHFIJzqyx2fvCVEkxy4SHDBpDtLznyvBbmcFLj29KLY0GuNY5WXSS0O2QYN57GYwLvnoTpbkc8I6LISPKMhNlzp6-FM3778dn2zCFLAHKgPM3YppiwLsXe7DBS4tYF1i02o9A/s200/Clipboard02.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5424025898827654050" /></a>I had assumed that the system was busy, but the problem lasted a long time, so I tried with IE, and hey presto it works.<br /><br />The next 'problem' is that the phone is sold via the US, and as Google are right to point out, that means the sale incurs an import duty when it comes into the UK.<br /><br />Rather than stumping up the $529 (~=£330) our American friends pay for the phone, delivery included, I was now looking at...<br /><br />$529 for the phone<br />+ $19.99 for a UK charger<br />+ $29.65 shipping<br /><br />with UK Sales Tax on the total at 17.5% and a 6.5% import duty on all that, which makes it <span style="font-weight:bold;">~$725</span> (i.e. ~=£453). Ouch.<br /><br />For the difference I can almost fly to the US and pick it up myself!timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com4tag:blogger.com,1999:blog-7766304.post-30166299654923075662009-12-31T14:31:00.005+00:002010-01-07T10:26:19.831+00:00Lucky New YearI went to <a href="http://www.google.co.uk">the Google home page</a> today, and clicked on the "I'm Feeling Lucky" button without anything in the search box.<br /><br />The result was a page with countdown in seconds,<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHzjj3JF-X4LE-gUnPGBXWBa0WN5_qaPC7tSvNhc9Pr2YPXPBNmWXrx_j-6XvNZzwtGIbh-OEM8x-t-FVXozvUu5fTqMoTJdgSIOPAXVZBZ92n9OAeXKOqFZYjIwqtbpTxCfSjHw/s1600-h/google.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 163px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHzjj3JF-X4LE-gUnPGBXWBa0WN5_qaPC7tSvNhc9Pr2YPXPBNmWXrx_j-6XvNZzwtGIbh-OEM8x-t-FVXozvUu5fTqMoTJdgSIOPAXVZBZ92n9OAeXKOqFZYjIwqtbpTxCfSjHw/s200/google.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5421408610886950162" /></a><br />a quick arithmetic shows it's counting down to the New Year. So somebody is expecting 2010 to be lucky!<br /><br />UPDATE:<br /><br />Now the New Year has arrived, the same empty Lucky Button press gives some 'fireworks'!<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL-nlt07pe0EOAZNQ1Fhx2Mitik5ml7alvPn1N9BnaY0WRa2GsSzA1HkMb4QJ7geKQbEZXQG9oFF2fKsonwrk3HAIuKwHsJnIEEFKLuokUFUe2759c1RUvV-s5vUihK13fer6Ryw/s1600-h/Clipboard06.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 154px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL-nlt07pe0EOAZNQ1Fhx2Mitik5ml7alvPn1N9BnaY0WRa2GsSzA1HkMb4QJ7geKQbEZXQG9oFF2fKsonwrk3HAIuKwHsJnIEEFKLuokUFUe2759c1RUvV-s5vUihK13fer6Ryw/s200/Clipboard06.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5423942140612854530" /></a>timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-3135538402790437442009-09-16T10:45:00.004+01:002009-09-16T11:40:10.034+01:00Programming sockets using temporary portsIn <a href="http://tellison.blogspot.com/2009/09/improving-parameter-checking-in-apache.html">an earlier posting</a>, I showed where there was code in <a href="http://harmony.apache.org/">Apache Harmony</a> that had some unsafe parameter checking logic, and I gave a pattern for how to do it right.<br /><br />Another "anti-pattern" that I see recurring in the Harmony test cases is around client-server socket programming. The typical scenario is that the tester wants to exercise some socket code, so they spin up a new Thread to act as the server, and run the tests on the main thread. The tester either picks a port that they assume will be free, or use some horrible code that tries to find a free port:<br /><span style="font-family:courier new;font-size:85%;"><pre><br /> /*<br /> * Returns a different port number every 6 seconds or so. The port number<br /> * should be about += 100 at each 6 second interval<br /> */<br /> private static int somewhatRandomPort() {<br /> Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));<br /> int minutes = c.get(Calendar.MINUTE);<br /> int seconds = c.get(Calendar.SECOND);<br /><br /> return 6000 + (1000 * minutes) + ((seconds / 6) * 100);<br /> }<br /></pre></span><br />Guessing port numbers like this is simply awful and hopeless. Once the port has been established, the poorly written test case opens a server socket to accept connections in the server Thread, while to get the timing right the client goes into a sleep for a while to give the server time to start up. Apart from the fact that the code is going to fail intermittently, it means the test case always takes a minimum length of time to execute as it spends time sleeping.<br /><br />There is no need for guessing ports or separate threads. In Java, just like other programming languages that expose the underlying platform's TCP/IP stack behaviour, binding to port zero instructs the stack to allocate an <a href="http://en.wikipedia.org/wiki/Ephemeral_port">ephemeral port</a>.<br /><br />Furthermore, server sockets have a listen backlog queue capable of remembering 50 outstanding connect requests by default. Here is a example of simple client-server code using an ephemeral port and a single thread to exchange a simple message over TCP/IP sockets.<br /><span style="font-family:courier new;font-size:85%;"><pre><br /> // Set-up<br /> ServerSocket server = new ServerSocket(0);<br /><br /> Socket client = new Socket();<br /> client.connect(server.getLocalSocketAddress());<br /><br /> Socket worker = server.accept();<br /><br /> // Do some stuff<br /> client.getOutputStream().write("Hello world!".getBytes("UTF-8"));<br /> byte[] buffer = new byte[1024];<br /> int length = worker.getInputStream().read(buffer);<br /><br /> // Tidy-up<br /> client.close();<br /> worker.close();<br /> server.close();<br /><br /> System.out.println(new String(buffer, 0, length, "UTF-8"));<br /></pre></span><br />Hopefully the code is simple enough to understand without further comment. I'll just point out that the server socket is created with an argument of "0" to mean the listening socket should be opened on any network adapter, with a stack allocated port number, and supporting up to fifty pending connections. Then the client connects to the actual interface and port that was used using <span style="font-family:courier new;font-size:85%;">getLocalSocketAddress()</span>.<br /><br />The same simple example can also be written using the NIO APIs, which requires passing <span style="font-family:courier new;font-size:85%;">null</span> to the <span style="font-family:courier new;font-size:85%;">bind()</span> method, like this:<br /><span style="font-family:courier new;font-size:85%;"><pre><br /> // Set-up<br /> ServerSocketChannel server = ServerSocketChannel.open();<br /> server.socket().bind(null);<br /><br /> SocketChannel client = SocketChannel.open();<br /> client.connect(server.socket().getLocalSocketAddress());<br /><br /> SocketChannel worker = server.accept();<br /><br /> // Do some stuff<br /> client.write(ByteBuffer.wrap("Hello world!".getBytes("UTF-8")));<br /><br /> ByteBuffer readBuffer = ByteBuffer.allocate(1024);<br /> worker.read(readBuffer);<br /> readBuffer.flip();<br /><br /> // Tidy-up<br /> worker.close();<br /> client.close();<br /> server.close();<br /><br /> System.out.println(Charset.forName("UTF-8").decode(readBuffer));<br /></pre></span><br />Of course, the simple examples still ignore a few return codes and exceptions that should be considered to make the code safer, but the purpose here is to show the structure for tests and applications that need to use sockets to exchange information.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com1tag:blogger.com,1999:blog-7766304.post-4883999198825724132009-09-07T16:43:00.005+01:002009-09-07T20:50:13.586+01:00Shoddy reporting from El Reg :-(<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDJiSCduNirtyf5COk9X-1NxByAN0rEsJrolCIKjTxc_q01u21kLdgtm7i6KJGJl863k_lDSvFwFmgrB7V_OKqSLCiLbK15A2VNJdF2R9GENe9Uan6cxVAJgFcR4sWazP4PyFbbg/s1600-h/Clipboard01.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 69px; height: 66px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDJiSCduNirtyf5COk9X-1NxByAN0rEsJrolCIKjTxc_q01u21kLdgtm7i6KJGJl863k_lDSvFwFmgrB7V_OKqSLCiLbK15A2VNJdF2R9GENe9Uan6cxVAJgFcR4sWazP4PyFbbg/s200/Clipboard01.jpg" alt="" id="BLOGGER_PHOTO_ID_5378756769656372978" border="0" /></a>I stop by The Register website quite frequently to keep up on the gossip, and quite enjoy their laid back reporting style, but the September 4th article titled <a href="http://www.theregister.co.uk/2009/09/04/sun_oracle_java/">"Oracle should relax Sun's Java Community control grip"</a> was a very poor piece of reporting.<br /><br />It hit my radar with the reference to Apache Harmony, where Clarke writes:<br /><blockquote>For all its evangelism - and its initial decision to open source Java - Sun has refused to open the TCKs, infuriating and frustrating the open-source community.<br /><br />This has led to accusations that Sun is hindering - not helping - open-source Java projects such as Harmony from the Apache Software Foundation (ASF), backed strongly by IBM.<br /><br />While Apache's has been able to build an implementation of Java Standard Edition under Project Harmony thanks to the opening of Java, Harmony cannot be certified because the TCKs contain proprietary code the open-source code cannot touch. Harmony, therefore, remains stuck in a limbo of having been built but being uncertified.</blockquote>Unfortunately this just serves to illustrate that Clarke doesn't understand the situation, or history, around open source Java SE.<br /><br />Apache have never asked, or expected, Sun to open source their TCKs. While that would be a fine outcome in itself, there is no reason why Sun cannot maintain their tests as proprietary code and make them available under a variety of license terms as they do with other Java specification test suites. Apache <span style="font-style: italic;">have </span>asked for license terms that allow the code we have written to be released under an open source license, that is to say Apache will not entertain restrictions placed on our code that passes the TCK.<br /><br />http://www.apache.org/jcp/sunopenletter.html<br /><br />Furthermore, Apache Harmony and GNU Classpath existed well before OpenJDK, so it can hardly be said that OpenJDK was a prerequisite to alternative implementations being created!<br /><br />The story attempts to cover a great deal of ground, the possible effects of the acquisition, the Apache dispute, JCP reform, and so on -- each of these is a major story in itself and this shoddy attempt does each a disservice.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-63688056113085437282009-09-07T13:28:00.005+01:002009-09-07T14:59:35.732+01:00Improving parameter checking in Apache HarmonyI'm going through some <a href="http://harmony.apache.org">Apache Harmony</a> code at the moment, and spotting a few places where there is a common pattern of code that needs fixing.<br /><br />Consider this method:<br /><span style=";font-family:courier new;font-size:85%;"><pre><br /> public synchronized int read(byte[] target, int offset, int length) throws IOException {<br /> if (length + offset > target.length || length < 0 || offset < 0) {<br /> throw new ArrayIndexOutOfBoundsException();<br /> }<br /> if (0 == length) {<br /> return 0;<br /> }<br /> ByteBuffer buffer = ByteBuffer.wrap(target, offset, length);<br /> return channel.read(buffer);<br /> }</pre></span><br />Can you see the problem?<br />Hint: the parameter checking in the <span style=";font-family:courier new">if()</span> statement is wrong.<br /><br />The original author rightly wants to ensure that the <span style=";font-family:courier new">offset</span> and <span style=";font-family:courier new">length</span> represent plausible values for the data to be put into the buffer; that is, the method should not attempt to place data outside the bounds of the '<span style=";font-family:courier new">target</span>' byte array.<br /><br />The problem is that in Java, like a number of other languages, <a href="http://java.sun.com/docs/books/jvms/second_edition/html/Concepts.doc.html#17876">(int) values overflow without any exception being thrown</a>. In the code above we are checking for illegal values by computing (<span style=";font-family:courier new">length + offset</span>) and throwing an exception if it is greater than the buffer's length. This ensures we don't "write off the end" of the <span style=";font-family:courier new">target</span> buffer. However, if the sum overflows an <span style=";font-family:courier new">int</span> representation then it may indeed pass this safety check, and permit a value for <span style=";font-family:courier new">offset</span> or <span style=";font-family:courier new">length</span> that is too large.<br /><br />As a practical illustration, consider that the '<span style=";font-family:courier new">offset</span>' actual parameter value is <span style=";font-family:courier new">Integer.MAX_VALUE = (int)2147483647</span>, and the '<span style=";font-family:courier new">length</span>' value is, say 42. In this case the sum of these positive values is a negative value '<span style=";font-family:courier new">(int)(2147483647 + 42) = (int)-2147483607</span>' so the less-than test passes and the method is broken!<br /><br />The fix is to avoid the sum, and convert it into a subtraction, e.g.<span style=";font-family:courier new;font-size:85%;"><pre>if (length < 0 || offset < 0 || length > target.length - offset) {<br /> throw new ArrayIndexOutOfBoundsException();<br />}</pre></span>Now we can be assured that there will be no <span style=";font-family:courier new">int</span> overflow. The <span style=";font-family:courier new">target.length</span> cannot be less than zero, so the subtraction can only produce values in the range <span style=";font-family:courier new">(0 - Integer.MAX_VALUE = Integer.MIN_VALUE + 1)</span> to <span style=";font-family:courier new">(Integer.MAX_VALUE - 0 = Integer.MAX_VALUE)</span>.<br /><br />I know this is not news for Java developers. Josh Bloch and others have been highlighting the problem for a number of years, yet I've found about four places in the code so far that exhibit this potential problem. They'll all be fixed in time for the next milestone build.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com3tag:blogger.com,1999:blog-7766304.post-9620697822234575792009-07-08T22:44:00.000+01:002009-07-08T22:44:00.750+01:00Queen introduction<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimLuZPh7b5iMiMbVbMqT37oVhmKZ6t7pBWqnPOtzhBwarnjsb-MYFIhhwdswpWHXMDqzYHzIg2P0FUGKW2jNXQMeTNxGbBYhgWU6W-rc20fyUgt_255HjpLrzq-h8r5ZXnl2ULhw/s1600-h/IMG_0225_s.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px; height: 150px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimLuZPh7b5iMiMbVbMqT37oVhmKZ6t7pBWqnPOtzhBwarnjsb-MYFIhhwdswpWHXMDqzYHzIg2P0FUGKW2jNXQMeTNxGbBYhgWU6W-rc20fyUgt_255HjpLrzq-h8r5ZXnl2ULhw/s200/IMG_0225_s.jpg" alt="" id="BLOGGER_PHOTO_ID_5356055029536717074" border="0" /></a>I got two new queen bees in the post a short time ago. They come in normal padded envelopes via Royal Mail. The postman was wondering why the envelope was buzzing!<br /><br />Within the envelope each queen and her attendants is protected in a 'puzzle cage'. The cage has some candy to to keep the queen alive, and since the queen never feeds herself there are worker bee attendants to feed her and keep things calm during travel. If you look closely you can see the queen bee on the right, she has a green dot on her back showing she is the latest 2009 model.<br /><br />To introduce a queen you can either use the puzzle cage they came in which has knock-out tabs enabling the bees to walk out one the candy is consumed, but I used a Butler cage. The Butler cage is a simple wire cage permanently blocked at one end, and which you seal at the other end using newspaper and elastic bands.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifJrEB1UWyfodveh9z6Mq-P9JVUI1043PfLzE2esQAas60BGuHErKoOdJieiTbrkkOSyI1nuk2xlURujZgbZn3gOj3NmeQoVOJKwtHl5WvMVusWe6Ph_LSYRAuBDqO1vUVh8z0VQ/s1600-h/IMG_0226_s.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 150px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifJrEB1UWyfodveh9z6Mq-P9JVUI1043PfLzE2esQAas60BGuHErKoOdJieiTbrkkOSyI1nuk2xlURujZgbZn3gOj3NmeQoVOJKwtHl5WvMVusWe6Ph_LSYRAuBDqO1vUVh8z0VQ/s200/IMG_0226_s.jpg" alt="" id="BLOGGER_PHOTO_ID_5356057130395634658" border="0" /></a>The knack is to take the queen out (let the attendants fly away) and put her into a separate cage. I did it on a sheet near a window since the queen may well fly off too, and at £20 each you don't want to loose her! The attendants will sting, but the queen doesn't sting you so you can pick her up by her thorax and pop her in.<br /><br />After carefully putting the queen into the Butler cage and sealing it up it is ready to go into the hive. Opinions vary, but I take out the old queen about two days before introducing the new queen. The period of queenlessness makes the workers more inclined to accept the new smell. I kept the old queen in a jar with some attendants and candy in the case the introduction failed and I needed to back out of the procedure.<br /><br />As you can see from the photo <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXgWBaienHu4PVbaZE6ORe3O0Z9RlUnr9P_bZFjvIn8xRIE7sNIkDwarn-Y3KzXWMriAN-UL5QXRdvatOt_NlJN8IVj6gv8YODBfNOL32TR0nwm55zOQ9GtVgdN6V919dZrHRuuQ/s1600-h/IMG_0254_s.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px; height: 150px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXgWBaienHu4PVbaZE6ORe3O0Z9RlUnr9P_bZFjvIn8xRIE7sNIkDwarn-Y3KzXWMriAN-UL5QXRdvatOt_NlJN8IVj6gv8YODBfNOL32TR0nwm55zOQ9GtVgdN6V919dZrHRuuQ/s200/IMG_0254_s.jpg" alt="" id="BLOGGER_PHOTO_ID_5356058811946078610" border="0" /></a>I have put a short nail in the cage's block so that I can push it into the comb. It is put in position so that the newspaper end of the cage is centred on the middle frame, right in a patch of brood where the workers would expect to find the queen.<br /><br />The receiving colony's workers can feed and lick the queen through the cage, but if they try to attack they cannot ball her in there, and she can retreat into the newspaper end if they try to sting her. Over time the new queen pheromone permeates the colony and the workers will be ready to accept her.<br /><br />The queen is eventually released by workers eating through the newspaper, and I gave two pin pricks on the end for them to get hold of with their mandibles.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruNM6kIhChouQcyjL9Q90DF3um_69Ir-vKZWrz0HXmVw20yJHBd-XRLzsw7UUTrQ9sxS19yxumsiEXoT7nCatF-R6JJzVDkvSgiePUYfA9n3tr9oz4wt-5nDbRj51nHaRsoDSRw/s1600-h/IMG_0258_s.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 150px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruNM6kIhChouQcyjL9Q90DF3um_69Ir-vKZWrz0HXmVw20yJHBd-XRLzsw7UUTrQ9sxS19yxumsiEXoT7nCatF-R6JJzVDkvSgiePUYfA9n3tr9oz4wt-5nDbRj51nHaRsoDSRw/s200/IMG_0258_s.jpg" alt="" id="BLOGGER_PHOTO_ID_5356061219126595346" border="0" /></a>Once the cage is in place another recommendation of Professor Ratnieks is to heavily smoke the colony. Not sure if that is a distraction technique or simply another way to mask the new incoming smell. I put in loads of smoke so that the bees were fanning furiously.<br /><br />Then leave the colony alone for at least two days. After that time I checked to ensure the queen had been released, and removed the cage. The new queen was wandering over the comb without a care in the world, probably quite oblivious of her travels through the postal system a few days earlier.<br /><br />I left them alone for another week, then looked again and there were eggs a plenty, so she was working away happily. Some people report as low as 50% success rate at introducing new queens. I only did these two, one into a colony that had been queenless for a while and the other where I removed an existing queen. Both worked for me so I'm happy with that.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com2tag:blogger.com,1999:blog-7766304.post-90258901380285685282009-07-08T12:02:00.002+01:002009-07-08T12:33:38.809+01:00Organised volunteerismAs part of a longer discussion on a private mailing list[1] <a href="http://intertwingly.net/">Sam Ruby</a> wrote a succinct description of the <a href="http://www.apache.org">Apache </a>volunteerism ethos. He wrote:<br /><blockquote>"The prevailing attitude within Apache is that releases will be done when they are ready, and that such releases will contain only the functions for which there exists volunteers who have an interest in doing the work. At times, there are people who would prefer a more predictable schedule and specific function. There are organizations which provide such assurances. This isn't one of them."</blockquote>This resonated with me as a participant in the <a href="http://harmony.apache.org">Apache Harmony</a> project which is undertaking a full implementation of the Java SE specification. There are some modules that attract lots of attention in completeness and performance (such as the core LUNI, beans, security, and so on) and others that don't attract so much effort (such as Swing, print, and RMI).<br /><br />I'm totally fine with that situation since it represents the technological equivalent of the <a href="http://en.wikipedia.org/wiki/Adaptive_market_hypothesis">adaptive market hypothesis</a> of financial markets. In our world, people will tend and care for code that is important to them, and the other code by definition is not so important to people.<br /><br />I've been a contributor to numerous open source foundations and working groups with different styles of working, and there is no "one true way" -- having a variety of organizations with different styles of working ensures that there is going to be a place for a wide variety of people to be comfortable innovating in the advancement of Java technology.<br /><br />I'm comfortable with those who want to make some code open, and keep other code to themselves. I object to those who claim there is only one way to behave, and try to enforce that on others through restrictive licensing or organizational rules.<br /><br />[1] Sam kindly gave me permission to take that quote and make it public.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com1tag:blogger.com,1999:blog-7766304.post-50720134551100794612009-06-22T11:43:00.002+01:002009-06-22T12:14:04.213+01:00WebSphere Application Server for Developers<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www-01.ibm.com/software/main/img/com/ws-mark-title-235x50.gif"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 235px; height: 50px;" src="http://www-01.ibm.com/software/main/img/com/ws-mark-title-235x50.gif" alt="" border="0" /></a>IBM's <a href="http://www-01.ibm.com/software/webservers/appserv/was/">WebSphere Application Server</a> (WAS) is the company's flagship Java EE 5 product used in production environments worldwide.<br /><br />As you would expect for a product representing over 10 years investment from Big Blue, it comes with <a href="https://www-112.ibm.com/software/howtobuy/buyingtools/paexpress/Express?P0=E1&part_number=D55W8LL,D55WJLL,D51JXLL,D55WQLL,D55WELL&catalogLocale=en_US&Locale=en_US&country=USA&PT=html&S_TACT=none&S_CMP=none">a license fee</a> to match. However, if you are willing to forgo formal support, and can live with the developer license offered, you can now download the full application server at no cost!<br /><br />The <a href="http://www.ibm.com/developerworks/downloads/ws/wasdevelopers/index.html">"WebSphere Application Server for Developers"</a> package for Windows or Linux is available as a download directly from IBM. Bear in mind that WAS weighs in at 788 MB, so downloading over a 1.5Mbps connection is likely to take about one and a half hours.<br /><br />Go and grab it, and try your software out on a runtime that matches the production environment. In place of formal support there are WAS developers answering questions on <a href="http://www.ibm.com/developerworks/forums/forum.jspa?forumID=266">the open newsgroup</a>.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-66206104448071559692009-06-15T12:14:00.004+01:002009-06-15T13:02:16.835+01:00JavaOne 2009<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSUvabLX63DP0Ybil50uYQ60D-QczgojgsYsChY0DzHT_r0tsamzdjfT48NVVvZCaYiiH8scldGgjH2aFxJiH0CLwK_MI5BV1WuETUFWNlh4ZinbapDlW01D40KQDRkT42-AI-BQ/s1600-h/duke.png"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 100px; height: 125px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSUvabLX63DP0Ybil50uYQ60D-QczgojgsYsChY0DzHT_r0tsamzdjfT48NVVvZCaYiiH8scldGgjH2aFxJiH0CLwK_MI5BV1WuETUFWNlh4ZinbapDlW01D40KQDRkT42-AI-BQ/s200/duke.png" alt="" id="BLOGGER_PHOTO_ID_5347523008054088914" border="0" /></a><br />The attendance figures put around for <a href="http://java.sun.com/javaone/">JavaOne 2009</a> state that there were "around 15,000" people at the Moscone Center -- hmm, that seems generous and it certainly felt a bit quieter than previous years. Not altogether unexpected with the economy impacting on travel, maybe people avoiding large congregations over concern of flu, and so on.<br /><br />The main hall was arranged slightly differently, with the stage set up at the 'side' of the hall, with large back drapes hung across each end. Ushers did a good job of corralling people to the front, and there was a noticeably large representation from Sun themselves.<br /><br />Like last year there was much talk of Sun's proprietary technology called "JavaFX", with demos of JavaFX running on a disparate variety of hardware (set top box, TV, phone, desktop). There was discussion of Java performance, as realized by the contributions made from new machine advances from Intel. Of course, it wasn't called out that the <a href="http://j9tr.blogspot.com/2009/03/ibm-j9-specjbb2005-results-used-in.html">Nahelem numbers</a> were published on IBM's Java implementation! There was a demo of the new Java market place where Sun, like others, are aiming to reproduce the success of an iTunes style store front to end users.<br /><br />There was not much talk about Java SE 7 (Jonathan Schwartz did mistakenly announce it's availability, but was corrected by his Chief Engineer on stage the next day), and not much talk about OpenJDK or the JCP which were prominent topics of calls for community participation in previous years. NetBeans was also notably absent from the opening session.<br /><br />The opening session was concluded by a moving 'good-bye' speech from Scott McNealy and a symbolic hand-over to Larry Ellison. During the hand-over Larry gave a challenge to the OpenOffice team to rewrite in JavaFX. He also said that Sun could be expected to produce notebooks running a Java-based OS in competition with Android.<br /><br />Later in the week <a href="http://java.sun.com/javaone/2009/general_sessions.jsp?pid=24589759001">I gave a demo</a> of the <a href="http://harmony.apache.org/">Apache Harmony</a> runtime during the IBM general session. I showed Harmony running Eclipse and developing the NIO module using the Eclipse PDE, then went on to show Harmony running Geronimo and the Roller blogging webapp. Craig Hayman had slides of Harmony running the WebSphere eXtreme scale server too. With the existing modular architecture of Apache Harmony, it is trivial to build right-sized runtimes for each of these.<br /><br />Many people have speculated that this may be the last JavaOne conference, but I don't think so. It is a well organized shop window for Sun/Oracle, and while it remains important to associate Java the ecosystem with a particular vendor I believe that the marketing event will survive.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com1tag:blogger.com,1999:blog-7766304.post-70430226586202024722009-04-02T11:32:00.002+01:002009-04-02T12:06:40.258+01:00Not so fast Dagastine<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://download.intel.com/pressroom/kits/xeon/5500series/images/092085-006.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px; height: 200px;" src="http://download.intel.com/pressroom/kits/xeon/5500series/images/092085-006.jpg" alt="" border="0" /></a>Earlier this week David Dagastine was <a href="http://blogs.sun.com/dagastine/entry/java_rocks_intel_nehalem1">quick off the mark reporting</a> HotSpot as:<br /><blockquote>"the fastest, most reliable, and most widely deployed, <i>open source</i> Java Runtime in the world"</blockquote>running on an Intel Nehalem. Unfortunately a bit <span style="font-style: italic;">too</span> quick, since he didn't wait for the results to come in from IBM's J9 VM which <a href="http://j9tr.blogspot.com/2009/03/ibm-j9-specjbb2005-results-used-in.html">posted a faster result</a> as reported by Derek (who is, allegedy <a href="http://duimovich.blogspot.com/2009/03/we-are-fastest-and-probably-best.html">8-10% better looking</a> too)!<br /><br />The HotSpot results were partially attributed to improvements in the class library, which David (when challenged by Mark Wielaard) tells us "need additional work to integrate into OpenJDK, but that work is in progress now" -- I assume that they are in the same queue as the <a href="http://tellison.blogspot.com/2008/12/bops-tree-hugging-and-safe-wagers.html">TreeMap performance changes </a>that are apparently in the process of being contributed back to <a href="http://harmony.apache.org/">Apache Harmony</a>.<br /><br />So today "Sun Java powered by the HotSpot Server VM" is <span style="font-weight: bold;">not </span>the fastest and <span style="font-weight: bold;">not</span> open source. Looks like some catching-up to do again.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com4tag:blogger.com,1999:blog-7766304.post-58161423861117644152009-03-21T09:26:00.002+00:002009-03-21T09:32:39.095+00:00For best results ...<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJwcyPG2rlZy-8PTgrTWEsysPV_jeUs9zsYYsyt-H48Hclz7xavCYRbUvaXvYcGvh1tAIIX2zWpgj0AlFJxL4NnqTfhyphenhyphen8cewO_ounnZi88ItAK6hDIajuWPttsAo-1CdFDW71cYw/s1600-h/1237232718579.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 300px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJwcyPG2rlZy-8PTgrTWEsysPV_jeUs9zsYYsyt-H48Hclz7xavCYRbUvaXvYcGvh1tAIIX2zWpgj0AlFJxL4NnqTfhyphenhyphen8cewO_ounnZi88ItAK6hDIajuWPttsAo-1CdFDW71cYw/s400/1237232718579.jpg" alt="" id="BLOGGER_PHOTO_ID_5315570360242461954" border="0" /></a>This sticker was on the back of a Jeremy Clarkson DVD in Sainsbury's!<br /><br />Remember to remove all outer packaging first.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-43223070182243904942009-03-20T21:40:00.003+00:002009-03-20T21:49:13.503+00:00Sun welcome at EclipseCon<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.eclipsecon.org/2009/q/gold/sun/sun170.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 170px; height: 85px;" src="http://www.eclipsecon.org/2009/q/gold/sun/sun170.jpg" alt="" border="0" /></a>I'm delighted to see that Sun are Gold sponsors of <a href="http://www.eclipsecon.org/2009/home">the EclipseCon event</a> next week in Santa Clara. It's sure to be a great event, and encouraging to see Sun able to demo their Eclipse support for Solaris, Glassfish and JavaFX.<br /><br />I wonder if <a href="http://eclipse-ecosystem.blogspot.com/2006/03/netbeans-comes-to-eclipsecon.html">the Netbeans girls</a> will be back again too?timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-9683830606063535642009-03-19T15:36:00.006+00:002009-03-19T15:57:49.553+00:00The "wrong type" of nature<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNsEwgD7b8VW-h9O05g4aeO6ewtnu6YDjzio-l0OBv1ea6Ql1sBT_xv8OO2jkgJ5PnZEI0pKMZBJftGObX8s7bU8xvhQVWwuJMn_sOj0u5a0Iucgkbh1Vg_T9XW1wmEviYOQvXTg/s1600-h/1234619568317.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 150px; height: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNsEwgD7b8VW-h9O05g4aeO6ewtnu6YDjzio-l0OBv1ea6Ql1sBT_xv8OO2jkgJ5PnZEI0pKMZBJftGObX8s7bU8xvhQVWwuJMn_sOj0u5a0Iucgkbh1Vg_T9XW1wmEviYOQvXTg/s200/1234619568317.jpg" alt="" id="BLOGGER_PHOTO_ID_5314924059652942914" border="0" /></a>Here in the South of England spring seems to have arrived, and that means getting back out to the apiary to see how things have faired over winter.<br /><br />I was pleased to see the colonies in both my hives are still alive and well (sadly not the case for many beekeepers' colonies this year).<br /><br />You can see from the photo on the left that I left my hives with some winter protection. If you look closely you can see a metal "mouse guard" to keep the hibernating critters out, a super of honey for the bees' winter food, a solid roof which you can't see but has insulation inside, and the whole lot is surrounded with chicken wire -- which I had lying around in the garage.<br /><br />The chicken wire is there to stop woodpeckers. In winter, when food is scarce, the woodpeckers figure out that there are bees in those big "lunch boxes", and they cling on the side to peck a hole and help themselves. Apparently, they will even tap around a bit and figure out that the handles are the thinnest part of the hive, and will attack there.<br /><br />Well that was a good move, because the birds had helped themselves to some friends' bees that were placed close by:<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4NdozSxocL0kcyBhvDWLn8Bqy_-JNgEF08ueVjep3B8iJeQIoTAdEVlm3IUsUsi9Y9UMSOyGzu1RUCa7sL0VEeac-DJ9nvGnpKyD5lvWq98HNpSWbdvnqpGG51Y24c1UKCvkZDQ/s1600-h/1236694984992.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 150px; height: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4NdozSxocL0kcyBhvDWLn8Bqy_-JNgEF08ueVjep3B8iJeQIoTAdEVlm3IUsUsi9Y9UMSOyGzu1RUCa7sL0VEeac-DJ9nvGnpKyD5lvWq98HNpSWbdvnqpGG51Y24c1UKCvkZDQ/s200/1236694984992.jpg" alt="" id="BLOGGER_PHOTO_ID_5314926226609605778" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgStqxhtScRMFOFlPRTnvrRMjpN48Eux4r2xPhKJrPWI3eOQLCUXnYyNbdWQbBhGuFJ7CDBgYUyZkmsDTo8IiRslrn2NIe8L5H_oAZFl2g8GiJY4_O9jeL6HViseMPEutAH7QedJA/s1600-h/1236694775445.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 150px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgStqxhtScRMFOFlPRTnvrRMjpN48Eux4r2xPhKJrPWI3eOQLCUXnYyNbdWQbBhGuFJ7CDBgYUyZkmsDTo8IiRslrn2NIe8L5H_oAZFl2g8GiJY4_O9jeL6HViseMPEutAH7QedJA/s200/1236694775445.jpg" alt="" id="BLOGGER_PHOTO_ID_5314926469812002162" border="0" /></a><br />Apart from the annoyance of having the woodwork damaged, and having bees eaten and wax damaged - having an extra entrance means the hive is harder to defend for the remaining bees and the reduced colony may well be "robbed" of any remaining food by stronger colonies. Once the woodpeckers learn there are free bees, they also tell their friends and you get them all round for a feast.<br /><br />Luckily the damage was spotted quite quickly, and repairs made. Besides using chicken wire you can also tack plastic sheeting on the sides to stop the birds getting a hold.<br /><br />With both my colonies growing again it will be time to restart the regular inspections and get back into the intriguing world of the honeybee.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-70134529232280370332009-02-17T13:21:00.002+00:002009-02-17T13:38:14.156+00:00The Magic Android powered phoneThe <a href="http://news.bbc.co.uk/1/hi/technology/7894516.stm">BBC are reporting</a> a new Android-based phone announcement at Mobile World Congress. The HTC "Magic" will go on sale in various European countries through Vodafone.<br /><br />Judging by <a href="http://www.itjobswatch.co.uk/jobs/uk/android.do">the job advertisements</a>, you can also get a reasonable salary with Android programming skills <a href="http://www.itjobswatch.co.uk/jobs/uk/j2me.do">compared to Java ME</a> experience. It's still a tiny percentage of the demand but maybe a sign of some traction in larger companies. Watch out for the onset of non-phone devices powered by Android.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-41203047254932428592008-12-13T12:18:00.000+00:002008-12-13T12:18:01.009+00:00Bops, tree hugging, and safe wagers<a href="http://tellison.blogspot.com/2008/07/gift-from-me-to-you.html">Back in July I wrote</a> about how <a href="http://harmony.apache.org/">Apache Harmony</a>'s TreeMap implementation had been used (with modifications) to deliver improvements in Sun's SPECjbb2005 score by "a solid 3-5% depending on the platform" <a href="http://blogs.sun.com/dagastine/entry/apache_harmony_thanks_for_the">according to Dave</a> who also promised that they were "making the necessary steps to give back [the] code changes to Apache Harmony"; even though they are not obliged to do so according to the Apache License.<br /><br />Did you expect us to sit and wait?!<br /><br /><a href="http://www.spec.org/osg/jbb2005/results/jbb2005.html">IBM has just published its latest SPECjbb2005</a> scores with, amongst other things, an enhanced version of TreeMap from Harmony that gives them a 10% boost, and thereby move ahead in many reporting categories. <a href="http://j9tr.blogspot.com/2008/12/specjbb2005-bragging-rights-for-j9.html">Derek has all the details</a>, and I encourage you to read them.<br /><br />It would be interesting to look back and compare the changes Sun and IBM made to Harmony's TreeMap, and merge them for the common good.<br /><br />While I'm sure Dave's intentions are pure, I doubt the suits will let him contribute his changes back to Apache and all the talk of "<a href="http://www.sun.com/software/opensource/java/faq.jsp#g19">requiring innovation sharing in the commons</a>" only applies in one direction. In fact, I'm so sure, that if Sun <span style="font-style: italic;">do</span> successfully contribute their TreeMap changes back to Apache Harmony I promise to give £500 of my own hard-earned money to <a href="http://www.woodland-trust.org.uk/">The Woodland Trust</a> to benefit some real trees.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com3tag:blogger.com,1999:blog-7766304.post-1689076575083549052008-12-12T11:46:00.005+00:002008-12-12T12:11:24.446+00:00Debugging mixed-language code in Apache Harmony + EclipseI've been hacking in managed runtimes for <a href="http://tellison.blogspot.com/2007/01/you-are-only-as-old-as-keyboard-you.html">more years</a> than I'd care to mention, and plenty of that time has been spent in debuggers of one sort or another!<br /><br />...and that's the point. Implementing a runtime requires that you have a suite of debuggers that cover the different target platform native code and the dynamic late-bound language <span style="font-style: italic;">du jour</span>. You have to switch from Eclipse to WinDbg/gdb and back again frequently.<br /><br />Intel's Software group have (for some unknown reason) been quite low key about their innovation in this space, with the development of an <a href="http://software.intel.com/en-us/articles/integrated-debugger-for-javajni-environments">integrated debugger for Java and JNI environments</a>. This advance has been enabled by the combination of support in the Eclipse Java Debug Tools and <a href="http://harmony.apache.org">Apache Harmony</a> runtime.<br /><br />Now, as you step into a native method from Java, the Eclipse debugger shows a logical representation of the mixed Java thread / C thread stack frames and allows you to inspect variables etc. in either language. They also support the JNI methods that call back into Java so you get full roundtripping. Cool.<br /><br />For most people who need to debug a system comprising Java and native code this is exactly what you want to do, and its a real time saver to be able to manage the breakpoints, variable watches and flow of control from a single IDE.<br /><br />Kudos to Chris, Vasily, Gregory, Ilya, <span style="font-style: italic;">et al</span> who made this work. Clearly people who live in the real world!<br /><br />Go watch the screencast demo, download it and try it out!timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-54017287197797704742008-11-14T15:36:00.005+00:002008-11-14T15:44:33.361+00:00EVP of software leaves Sun - that makes 6,001Rich Green, the long time Executive Vice President of Software has quit Sun according to <a href="http://www.marketwatch.com/news/story/sun-micro-lay-off-many/story.aspx?guid=%7B26E52A47-4A68-4263-86DD-F7696D2C0299%7D&dist=msr_1">press reports</a> about the new round of job cuts affecting 6,000 workers.<br /><br />Seems that the Sun website was quick to notice, <a href="http://www.sun.com/aboutsun/media/ceo/bio.jsp?name=Rich%20Green">his webpage</a> went offline almost immediately (but can still be found in <a href="http://64.233.183.104/search?q=cache:2kJgByV5tyoJ:www.sun.com/aboutsun/media/ceo/bio.jsp%3Fname%3DRich%2520Green+site:sun.com&hl=en&ct=clnk&cd=3&gl=uk&client=firefox-a">the Google cache</a>). I guess there is no love lost with the software guys and girls running the website ;-)<br /><br />Not a good time to be made redundant (if ever there was). Good luck to all those smart people who will be out there in the market place now looking for new opportunities.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-12102798321620852802008-10-28T20:49:00.007+00:002008-10-28T22:07:33.188+00:00Sun get a visit from Uncle Sam<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.mancrush.com/images/guys/ezi/683.jpg?1161547080"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 100px; height: 100px;" src="http://www.mancrush.com/images/guys/ezi/683.jpg?1161547080" alt="" border="0" /></a><br />Things really are not looking too good at Sun right now.<br /><br />The <a href="http://google.brand.edgar-online.com/displayfilinginfo.aspx?FilingID=6203934-1974-49240&type=sect&TabIndex=2&companyid=8840&ppu=%252fdefault.aspx%253fsym%253dJAVA">recent SEC filing</a> shows that Southeastern Asset Management (a.k.a. Uncle "SAM") have spent $2,115,932,199 to bring their acquired stock of Sun up to 21% of the company's total outstanding shares.<br /><blockquote><span style="color: rgb(0, 153, 0);">The aggregate number and percentage of Securities to which this Schedule 13D relates is 160,566,828 shares of the common stock of the Issuer, constituting approximately 21.2% of the 757,953,410 shares outstanding.</span></blockquote>But Uncle Sam is no sugar daddy. He wants to move in for a while and "help" Sun to manage the company...<br /><blockquote style="color: rgb(0, 153, 0);">As the result of investment analysis or the occurrence of events, Southeastern may desire to participate in discussions with the particular portfolio company's management or with third parties about significant matters in which Southeastern may suggest possible courses of action to assist in building corporate intrinsic value per share or to cause the Company's true economic value to be recognized. In such situations, Southeastern may elect to convert a filing on Schedule 13G to a filing on Schedule 13D in order to be more active in corporate governance and management matters, and to have the ability to enter into discussions with third parties concerning proposed corporate transactions of a significant nature.</blockquote>Hmm - what do you read into the expressions "<span style="font-style: italic;">suggest possible courses of action</span>", "<span style="font-style: italic;">be more active in corporate governance and management</span>" and "<span style="font-style: italic;">enter into discussions with third parties concerning proposed transactions of a significant nature</span>" ?? That in conjunction with news that co-founder <a href="http://www.hemscott.com/news/static/tfn/item.do?newsId=68240589790923">Bechtolsheim has found new interests</a> outside Sun points to some loss of control by the current management team.<br /><br />This comes hot on the heels of <a href="http://www.sun.com/aboutsun/pr/2008-10/sunflash.20081020.2.xml">Sun's preliminary results for 1Q09</a> in which, beyond the earnings warnings, there was the notice of imminent "goodwill impairment" which essentially means that the premium they paid on their acquisitions probably won't be earned back. Which acquisition(s) they overpaid for is a matter of <a href="http://weblog.infoworld.com/openresource/archives/2008/10/does_mysql_play.html?source=rss">debate</a>. I expect <a href="http://www.sun.com/aboutsun/investor/earnings_releases/audiocast.html">the results call</a> will be tough on Thursday.<br /><br />We can only speculate about what Uncle Sam will think of Sun's software business, and the Java group in particular. Now it is open sourced it is hard to see how Sam will realize it's "intrinsic value" for Sun's shareholders. Let's hope Sam sees the value of freedom over no-cost -- and let's hope that Sun can turn things around in this period of <a href="http://news.google.co.uk/news?hl=en&q=global+economic+downturn&um=1&ie=UTF-8&sa=X&oi=news_group&resnum=4&ct=title">global economic downturn</a>.timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-39708663344039762862008-09-23T20:58:00.003+01:002008-09-23T21:33:28.908+01:00T-Mobile G1 (tm) with Google (tm) with HarmonyThe <a href="http://www.t-mobileg1.com/g1-announcement.aspx">Press Release</a> is out, and T-Mobile G1 is officially launched. I'm delighted that T-Mobile are making the platform available in the US and Europe simultaneously.<br /><br />Of course, the real difference is that unlike some other 3G /WiFi feature phones you can buy today, Android is a truly open platform built with software available under the Apache License. This makes it a real contender for businesses to invest their effort and value and compete.<br /><br />The core class libraries come from <a href="http://harmony.apache.org/">Apache Harmony</a> -- the same source that IBM are using for its server class certified Java offerings [<a href="http://www-03.ibm.com/servers/eserver/zseries/software/java/">></a>], and Sun Microsystems are using in their performance release [<a href="http://blogs.sun.com/dagastine/entry/apache_harmony_thanks_for_the">></a>]. It's a testament to the innovation and flexibility embodied in the Harmony project that the code can span from mainframe zSeries machines to mobile phones.<br /><br />Interesting that the selling points for the phone are the applications it runs and how well they are integrated and adapted to the mobile device. I believe it will give the young incumbent a run for its money -- and that is good news for the consumer.<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEQWilTassOD2PNvtwlJ2V0qnHpE9mhjfmnv-QNK6DRb_XTlzNETG1YDs6doo-iYz8GysSqIMNHJ-3evO0koFO9YGnjdow_SmAK43aSIgB7ZTdFTEcEJ5i5GL0s-diAZ5PbAKpiw/s1600-h/google_g1_logo.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEQWilTassOD2PNvtwlJ2V0qnHpE9mhjfmnv-QNK6DRb_XTlzNETG1YDs6doo-iYz8GysSqIMNHJ-3evO0koFO9YGnjdow_SmAK43aSIgB7ZTdFTEcEJ5i5GL0s-diAZ5PbAKpiw/s200/google_g1_logo.jpg" alt="" id="BLOGGER_PHOTO_ID_5249317060401453890" border="0" /></a>timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-75014879966583823592008-09-22T17:43:00.002+01:002008-09-22T18:01:47.148+01:00Ubuntu - now with added fizz<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEFp-GRhqQjrQuvlXRVuWYM_rkCh5udlRaYWvFVw7_5C0Vu4Jvccd16d3Y8Batay8rgZw0EU5Z2NMSJvGyv6qCpG-wczBnPkYja187XjRM2BrK4ydcpuCDgJNWpkSV5aIWvMZhJQ/s1600-h/IMG00044.jpg"><img style="margin: 0px 10px 10px 0px; clear: both; float: left;" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEFp-GRhqQjrQuvlXRVuWYM_rkCh5udlRaYWvFVw7_5C0Vu4Jvccd16d3Y8Batay8rgZw0EU5Z2NMSJvGyv6qCpG-wczBnPkYja187XjRM2BrK4ydcpuCDgJNWpkSV5aIWvMZhJQ/s320/IMG00044.jpg" width="202" border="0" height="252" /></a> It took me about two seconds to put Ubuntu on my laptop this morning :-)<br /><br />This bottle caught my eye yesterday, so I had to buy it. I guess if you are looking for ways to shift large quantities of Fair Trade sugar, then selling cola has to be as good a way as any.<br /><br />Now if Pepsi & Coke switched to Fair Trade sugar I bet that would make a difference to the growing economies far beyond the cola-nization of offering free umbrellas to advertise their wares.<br /><br />Ubuntu : "I am because we are".<div style="clear: both; text-align: left;"><a href="http://picasa.google.com/blogger/" target="ext"><img src="http://photos1.blogger.com/pbp.gif" alt="Posted by Picasa" style="border: 0px none ; padding: 0px; background: transparent none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="middle" border="0" /></a></div>timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com0tag:blogger.com,1999:blog-7766304.post-75321716224153615332008-08-19T16:55:00.003+01:002008-08-19T17:07:19.536+01:00The first honey crop!Last weekend, after getting back from holiday, I took eight frames from the bee hive at home, and extracted the beautiful golden honey.<br /><br />The bees have been doing a great job, and they are fascinating to watch and learn about. It's a little civilization in your backyard. There are little victories as you see bees laden with nectar and pollen return safely to the hive, and concerns as you see hornets and wasps trying to get in to seal the pupae and honey.<br /><br />The honey we got is very light coloured. The bees are collecting from a variety of sources in our neighbourhood, and although I don't like honey I'm told it has a wonderful delicate flavour.<br /><br />Here's a slideshow of the hive and honey. From eight frames we got about 23 lbs (~10kg) of honey and there are another thirty frames to go! Obviously way more honey than we'll ever be able to use.<br /><br /><div style="text-align: center;"><embed type="application/x-shockwave-flash" src="http://picasaweb.google.co.uk/s/c/bin/slideshow.swf" flashvars="host=picasaweb.google.co.uk&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.co.uk%2Fdata%2Ffeed%2Fapi%2Fuser%2Ft.p.ellison%2Falbumid%2F5236255562670701665%3Fkind%3Dphoto%26alt%3Drss" pluginspage="http://www.macromedia.com/go/getflashplayer" width="288" height="192"></embed><br /></div>timhttp://www.blogger.com/profile/11980633186746724857noreply@blogger.com2