Nifty tidbits
Nifty tidbits and random thoughts on technology and anything else that catches my fancy
Tag Archives: code
Moved to bitbucket
I’ve been using Git Enterprise for hosting private repositories since github’s free plan doesn’t include any private repos. Git enterprise’s worked – but the UI leads a lot to be desired the few times that you actually have to use the web interface.
So the other day while doing something else, I landed on bitbucket . Bitbucket is Atlassian’s code hosting service – and for some reason I was under the impression that it only supported mercurial repositories. Was pleasantly surprised to see that not only can you have git repos, you also get unlimiited private and public repos with upto 5 collaborators all for the unbeatable price of free!
Can’t ask for more – so it’s Bye-bye Git Enterprise! and Hello! Bitbucket… Bitbucket also has a nice helpful repo import – plug in the url to your git repo and it gets cloned. Once that was done, it was a simple matter to update the origin url of my repo with
git remote set-url origin https://raghur@bitbucket.org/raghur/home.git
Unit testing Apache CXF RESTful services – code available
So, the original post on the topic written about two and a half years ago had code snippets, but there’s been comments and PMs for the complete code. So last week, as I resurrected this blog, decided to get that code out on github. Unfortunately, that was easier said than done; it has been quite some time and frankly, I’d lost the code. I must’ve switched machines about 3 times in the interim and gone from SVN to github for personal projects. Some hunting around ensued and thankfully, I was able to find the actual code we wrote based on the sample I’d posted. So cleaned that up – and just extracted the unit testing example out of it and pushed it to github – get it here. I haven’t updated any of the dependencies – so this is still running against spring 2.5 and cxf 2.2.3 (I think) and things might’ve changed quite a bit since then (I haven’t used the JAXRS bits of CXF much after that)
Running tests:
mvn test
Running the server:
mvn jetty:run
Fun with python’s decorators
Was in need of a utility function that can retry an arbitrary function a few times before giving up. Essentially something like Gmail or Google Readers behavior when there’s no network connection.
Thought it would be a few minutes job to cook up a decorator utility in Python. Boy! was I wrong! I mean, the basic use case is definitely trivially easy with Python – however, once you want something that’s more useful than that and resembles something that you’d actually use in production, the complexity goes over the top!
Anyway, I’m figuring out all sorts of fun things about decorators – and all of it the hard way! OTOH, its a lot of fun to write small test code to test & validate assumptions!
Make no mistake – I’m still a python fanboy
– just that going through some pains with decorators right now. Will follow this up with a longer/detailed post that may have some useful insights I’ve gained till then. Thanks for stopping by!

