Friday, November 09, 2007

Albarracin trip day three - Sol

Well, a bit more about where we're staying. We're at Camping Albarracin. It's a somewhat strange place in terms of requiring an international bank transfer to pay the deposit, but they accept Visa when I came to pay the balance on arrival. We're in a bungalow advertised as being suitable for four, and it would do that, but it feels very bijou with just the two of us. Not sure how Andy, Emma et al will find it next week!

Went to Sol today, and again had slight problems finding our way there. We followed our Spanish topo, but went a bit far before breaking up the hill parallel to the road. Sol was good, lots of stuff to warm-up on. My skin is feeling it already though. Trying a big roof today; I couldn't quite use Scott's sequence due to not having sixty foot arms, but need to work on press moves a bit more. I couldn't quite press out over the lip enough.

Albarracin trip day two - Arrastradero

Had the most awful food at Hotel Albarracin last night. It was steak, but well-done at one end and completely raw (proper raw, not just the raw that I've had in certain French establishments. So, late start before getting up to go climbing. Lovely day again, got a bit lost going to where we intended. We went up to the main car park, and then along the road a bit before striking left into the forest, past a collection of cave paintings. This was thanks to our reading of the topo, and we had inadvertently gone to the wrong side of the hill. We noticed some enticing looking walls on the left (minimum 7a?, so a bit hard to warm up on) and eventually got to where we wanted to be. What we should have done is walked up past the swing park, until you see the climbing area on your right. But our Spanish was non-existent. Another good day, good rock and lovely area. I'm not getting any power onto the rock really, been pulling on blobs too much and got no topping out skills for these slopey topouts, so I'm struggling on everything except the crimpy overhanding walls. Scott is climbing really well, but then he climbs on rock lots! Jealous, moi!?

Albarracin trip day one

Flew into Madrid, managed to get all of the bouldering kit including my unfeasibly large extending stick on the plane and then drove the Albarracin. No map in the hire care (thanks Europcar!) but a combination of the AA and Google Maps directions got us there without any mishaps. We got there at about six in the evening and Scott was mad keen. I was more up for a beer, but we went for a drive, found some rocks and had a quick play. The rock and national park is really cool, and we were climbing as the moon came up. Beautiful. Sadly Al's got the camera this week, so I hope that my phone will suffice. Think we're going to have a good week.

Saturday, October 20, 2007

How to remove a key when a 2 year old has snapped the key off in the lock

Google to the rescue again. In case this helps anyone else avoid locksmith callout charges on a Saturday, I started off here and here, and was sufficiently enlightened as to solve it myself. Try checking that the key is in the correct orientation to be removed, twisting using a screwdriver where necessary. Then you should hopefully be able to use another key to push it out from the other side, and use tweezers to coax it out the rest of the way. The suggested superglue method wasn't necessary, but is a nice trick.

Monday, October 08, 2007

Java Mock Objects tip

Discovered while using JMock, but I would imagine it's also good for EasyMock, RMock, ...


checking(new Expectations() {
{
one(httpServletRequest).getParameter("c");
will(returnValue("-2"));

one(httpServletRequest).getParameterNames();

// StringTokenizer implements Enumeration. A bit cheeky!
will(returnValue(new StringTokenizer("c")));
}
});

Thursday, October 04, 2007

Surgery

How I love the smell of burning vas in the evening! Recovery tips:

  • treat it as a soft tissue injury and ICE it!
  • Arnica; there's going to be a lot of bruising, so any old snake oil is worth a try.

Tuesday, October 02, 2007

Novarra makes a play for End Game

So there's been a bit of a kerfuffle over here. What's happened is that Vodafone UK have started using Novarra's content adaptation technology to transcode the internet for mobile phones. Why has this caused such irate responses in some quarters? Well, a history lesson seems to be in order...

Evolution of Mobile Internet Standards

The mobile internet started out with devices unable to render nearly all of the internet due to hardware constraints. WML was introduced as a very limited markup which phones were able to use to display content. Early WML sites were, needless to say, fairly limited in functionality, and tended to be exposed as distinct resources; e.g. Apache user-agent detection would be used to send you to http://wap.example.com/ if you accessed http://www.example.com/ with your phone. Moore's law still holds in this arena; devices got a bit more capable and iMode (CHTML) was introduced in Japan. This was initially something like HTML 2.0 / 3.2 without <table/>s, but with the better networks over there, this was somewhat more successful in the marketplace. The W3C stuck in their thumb and pulled out XHTML Basic, and then there was the related XHTML Mobile Profile.

So who is so offended by what Vodafone UK and Novarra have done? Well, mainly the mobile internet community. The solutions that the community provide have evolved over time from hand-coded WML sites, iMode sites, XHTML Basic sites, sites where the view renders the model to the appropriate markup and DIAL processors / Drutt / Volantis's offerings in this market. There is an entire industry sector dedicated to providing solutions in this area and nearly all of those solutions rely on the HTTP header User-Agent being present and being a reliable indicator of the requesting client. Novarra / Vodafone UK have introduced a fairly disruptive change which could be viewed as an attempt to change the rules of the game. They're making some pretty provacative statements along the way.

2.3.1.7 A content transformation server can do a better job of following
mobile best practices
The "Mobile Web Best Practices 1.0" W3C Proposed Recommendation [1]
contains many recommendations for authoring content that is intended for
viewing on a mobile device. A well-designed content transformation
server can do a better job of following the mobile best practices than a
human author, especially when taking into account the capabilities of
the many different mobile devices. The result will be a more
consistent, uniform experience.

I call BS. The incumbent mobile content industry is feeling the pain, but this could just be a game-changing move like Google upp-ing the storage limits on webmail. Time will tell whether the market (mobile phone customers) feels that the Vodafone UK solution is good enough, or whether a more open market will be preferred. I'm all for the Ubiquitous Web when it's good for the customer. So here's a little gedank-experiment. What happens to the mobile content industry if all carriers start using a content-adaptation proxy? How else is your company adding value? Evolving markets are hardly a new phenomenon, although maybe the rate of change is a little faster in these modern times...

Sunday, September 30, 2007

Connor responding to discipline

We were out in a restaurant for Al's birthday meal and Connor was playing with the door where we were sitting. We warned him not to do that or the waitress would come over and tell him off. Five minutes later, the waitress came over and the boy's first reaction?

"I'm not touching it!"

Key log

Not blogged for a while. Usual issues:

  1. Been busy at work.

  2. Been on holiday and had a lot of catching up (reading blogs!)

  3. Been ill
Well, I can fix the second one at least - the first thing isn't really something to complain about, and there's not a lot I can do about the third. Unsubscribed from Planet Intertwingly (sob). That should free up some more time to finish off Jython UnicodeData, read stuff and do more hacking.

Saturday, September 29, 2007

Happy Birthday Babe

8 years ago I met my wife. She still amazes me every day and I can't believe how lucky I am.

Friday, September 07, 2007

Rugby World Cup - France vs Argentina

I don't think much of the English chances, but bring it on!

Update 1 9 - 17. The French seem to be choking. Lots of basic errors and not converting their chances. The Pumas are really going for it. We could be on for a massive upset and blow to the hosts (and favourites in some eyes) chances... (Loving Will Greenwood as a pundit as well).

All consuming

That's a major one of my frustrations with my current feed reader of choice dealt with then. Now, about those duplicate entries...

Saturday, August 18, 2007

Amazon losing capability in core function?

I was watching Steve Yegge's talk from OSCON about branding, and one of the things he touched on was Amazon's brand is books, and they want to get out of that since Jeff Bezos thinks that certain consumables will become totally digitized. My current thinking is that they are focusing on other things anyway (hosting, anyone?) and maybe this is taking away from their original core competency. Recent orders of mine have taken a lot longer than they used to. Previously, I'd order stuff on a Monday and it would arrive on Wednesday or Thursday the same week, with Super Saver Delivery. Now it takes a lot longer. So I'm still waiting for the Erlang, ANTLR, Haskell and REST books to arrive that I'd hoped to read on holiday.

Thursday, August 02, 2007

Hello Cameron

There we go, another smasher has arrived. I think there were various events and conversations that I wanted to record today, but it's late and I'm knackered. Blog more with photos tomorrow or the weekend.

Jython UnicodeData hacking in the CDS

Got numeric and decimal working today in between contractions in the Central Delivery Suite at Frimley Park Hospital today. Nearly got categories working as well, except I'm not clear how CPython has implemented unicodedata.category for undefined codepoints.

e.g. Python 2.5 uses Unicode 4.2 for the Unicode database. The integer codepoint 13313(decimal) / 3401 (hex) is not defined within Unicode 4.1.

3400;;Lo;0;L;;;;;N;;;;;
4DB5;;Lo;0;L;;;;;N;;;;;

It isn't defined in Unicode 5.0, which is what I've been using to do the Jython implementation.

3400;;Lo;0;L;;;;;N;;;;;
4DB5;;Lo;0;L;;;;;N;;;;;

So how does CPython define unicodedata.category(unichr(13313)) to be 'Lo'? And it doesn't seem to be just 'Lo' in all cases of undefined items. I'm speculating that it might be falling back to the preceding valid codepoint category. Think I need to post to a CPython list to confirm.

Tuesday, July 31, 2007

Google Reader Bug report - use Atom <id/> elements

I am directly subscribed to Sam Ruby's feed. I recently added Planet Intertwingly as well, which contains Sam's blog. Both feeds are served as application/atom+xml. In Google Reader, duplicate items show up (for Sam, Steve Loughran, and others that overlap from my other subscriptions. I don't want to remove individual subscriptions in case Sam removes them from Planet Intertwingly.

From my readings of the spec a while ago, that was an explicit rationale for having id's associated with each entry. As you would expect, the id's are the same. From Planet Intertwingly:


<entry>
<id>tag:intertwingly.net,2004:2619</id>
<link href="http://intertwingly.net/blog/2007/07/31/Agile-Financial-Publishing" rel="alternate" type="text/html"/>
<link href="http://intertwingly.net/blog/2619.atom" rel="replies" type="text/html"/>
<title>Agile Financial Publishing</title>
...
</entry>

From Intertwingly:


<entry>
<id>tag:intertwingly.net,2004:2619</id>
<link href="2007/07/31/Agile-Financial-Publishing"/>
<link rel="replies" href="2619.atom" thr:count="1" thr:updated="2007-07-31T12:15:28-04:00"/>
<title>Agile Financial Publishing</title>
...
</entry>

Those atom:id element IRIs appear to be the same to me...

Wednesday, July 25, 2007

Objective review of why Vista pisses me off (or Why isn't Vista more like Ubuntu?

So I'm being completely upfront in the title as to where I am on this one, but I think that it's worth giving some airtime to a few of these. Readers might care to note that they should route around the "grumpy Yorkshireman that doesn't like change" for some of these. You never know, I might get some comments explaining why I'm a bozo when it comes to Windows.


Avalon and the new Windows Aero UI.
I gave it two weeks and then I'd had enough. Does it really make me more productive having all that shit, or is it just effects for the sake of it? I have the same opinion on Compiz - I haven't yet seen a compelling reason for it to exist, beyond being secretly sponsored by Nvidia / ATI to make people get shiny new graphics cards. Let the conspiracy theorists chew on that one. And despite paying Dell more for a fancy graphics card in this laptop,

WindowsExperienceIndex-20070605

apparently it's not that good.

Blue screen of Death
No really, I had one in my first week, and I've had one since then. Lovely. Occasionally (once a quarter?) when running Ubuntu Dapper, I've had X lock up on me and be completely unresponsive, to the extent that I couldn't even switch to a virtual terminal or ssh into the box and do something to it. The first time this happened, I went climbing at lunchtime, came back and it was still borked, so just a hard reboot to fix that. A reboot once a quarter on a development machine doesn't strike me as too bad. Vista is managing once a week at the moment, and in neither case am I writing C or any system level code. It's all Java / Python / Ruby and that sort of level.

Black screen of death
That was a Vista new feature for me; I've never had that on previous versions of Windows. This is progress people!

Still no decent shell
I'm using Cygwin, but it doesn't seem to let me tail files and press Return to get some space in between lines. Minor, but annoying.

Continual swapping
Previously I was on a 2GB RAM Dell workstation, and now I have a 2GB RAM Dell laptop. The laptop is always swapping. What's changed? Well, I'm now on Vista rather than Ubuntu and I'm not running Oracle XE anymore, but otherwise the services running are much the same. IDEA / Eclipse, Tomcat, MySQL, Firefox, intermittent email client and a text editor. Don't know why Vista is always swapping (TaskMngr thinks it has 700MB free) but it's bloody annoying.

Broken file permissions
Doing a release today, the VPN crashed (don't know if that was Vista, BT, the Windows 2003 Server or something else. That appears to have left me with the following undeletable file.

no-permissions-on-file

So Vista has let me create a file that I don't have the rights to delete. That's smashing!

undeletable-file

Random security policies
Or that's what I'm guessing is causing this anyway. If so, then a learning mode like AppArmor has would be nice. See

Java-Virtual-Machine-Launcher-Error
and

java-heap-allocation-failure

No, when I ask for a large amount of heap to be allocated for my Java process, I don't really know what I'm doing, so please stop me. Thank you Vista, you're my hero.

Update: LazyWeb to the rescue, at least about the disk thrashing issue.

Tuesday, July 24, 2007

The Hustler

There was a bag of sweets up on the kitchen top. Connor spotted these and was after them, but I told him "Not for breakfast". After I'd gone to work, he asked Al the same and got the same response. His reaction?


Connor:
OK Mummy, me just hold it, OK?

Al:
OK Connor.

(Al continues ironing. Some time passes)


Connor: (Coming back into the kitchen)
Look Mummy, me just hold it, OK?

Al:
Well done Connor.

(More time passes)


Connor: (Comes back into the kitchen again)
Look Mummy, me still hold it

Al:
Good boy, Connor!

After an hour, the ironing is done and Al's about to phone me to say how well-disciplined the boy's been, just holding the sweets. So she takes the ironing upstairs and comes back down to see Connor doing his Muttley laugh and just shy of shovelling all of the sweets into his mouth! Gamed by a 2 year old.

Friday, July 20, 2007

Good ETag support requires thinking about it up-front

I posted a comment on this but I thought it worthwhile going a little deeper.

Blogger doesn't support Trackback so I'll just post and link.

My point was not to argue about how little code is required to implement sending an ETag and checking an ETag based on the MD5 hash of your content (that's pretty much a library issue which should level out to be equal over time) but to go a little deeper into ETags.

I've been reading Sam Ruby long enough to have had the benefit of ETags drummed into me. The posts that Bill links to are focused on the network savings aspect of conditional GET. But you can also save server processing power, if you put a little more thought into your application model.

So we come back to the requirements for Java frameworks to support ETags such that it is possible to avoid doing the bulk of the server side processing. Caveat this could well be premature optimization, and is merely me thinking out loud. Struts is the one I'm most familiar with and I think with the struts-chain RequestProcessor, this approach could be used, but anything that works as a chain would do for this (so pure Filters would also work).



public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) throws IOException, ServletException {

HttpServletRequest httpRequest = (HttpServletRequest) request;

/*
* Do something that works out what is required to render a response
* for this request and generate an ETag based on that. So here we
* have moved away from the approach of generating ETags from MD5
* hashes of the response body.
*/
ETag currentResourceETag = calculateETag(httpRequest);
ETag incomingETag = extractETag(httpRequest);

if (currentResourceETag.equals(incomingETag)) {
response.sendStatus(HttpServletResponse.SC_NOT_MODIFIED);
} else {
filterChain.doFilter(request, response);
response.addHeader("Etag", currentResourceETag.stringValue());
}

}

You would need to be able to obtain the items responsible for determining the ETag value reasonably early in the request processing, before any really expensive operations. Not sure what implications that has for the layers in your application, or if you were using strict MVC how disruptive / worthwhile it would be to try this approach...

Wednesday, July 18, 2007

Jython - UnicodeData mirrored is complete!


from test_support import verify, verbose
import sha

encoding = 'utf-8'

def test_mirrored():

h = sha.sha()

for i in range(65536):
c = unichr(i)
h.update(str(unicodedata.mirrored(c)))
print "%i : %i%c" % (i, unicodedata.mirrored(c), unichr(10)),

# Value returned by Python 2.5, which uses Unicode 4.2
#verify('91cd30c6c81911835dbcbed083f99fc9fc073e4a' == h.hexdigest(),
# h.hexdigest())

# Value returned by current Jython implementation, which uses Unicode 5.0
verify('595795a212ca0ac629d6b2dfb09c703a472adb03' == h.hexdigest(),
h.hexdigest())

# Add next test!

if __name__ == '__main__':
import unicodedata
test_mirrored()


OK, it's only for the BMP, but it's a good start. Supporting supplementary characters (in Java terminology) or the other sixteeen planes would need a more fundamental change to PyUnicode, methinks. Now I need to start adding the other unicodedata methods which should be fairly straightforward. Then I'll have a working implementation to post to the dev list. Maybe end of this month, unless Baby comes and I lose my late night hacking time?