Category: Dev

  • Devoxx day one

    Devoxx day one

    Today was the first day of Devoxx, the European Java conference held in Antwerp.

    The first two days are actually the ‘University’ sessions. These are longer, more in depth talks and the first one I went to was the ‘Productive Programmer’ by Neal Ford from Thoughtworks.

    This was an interesting talk split into two sections, the first dealing with the mechanics of productivity and the second consisting of a number of tips putting these principals into practice.

    The overarching theme was that “any time you are doing simple repetitive stuff on behalf of your computer it is laughing at you”. This means don’t type the same commands over and over but it also means learning keyboard shortcuts for your IDE and OS.

    Neal demonstrated the Key Promoter plugin for IntelliJ which will pop up keyboard shortcuts whenever you use a menu item instead. I already use the GOTO class shortcut in IntelliJ all the time but didn’t know you can just type the capital letters of a class and it will find it. For example type ‘mac’ to find MyAwesomeClass.

    Neal is so productive he doesn’t even bother to type the left hand side of statements in IntelliJ; he lets the IDE fill that in for him (using introduce variable). 🙂

    Neal also talked about a concept called ‘locus of attention’ and the need to make your environment quiet to preserve your locus of attention. The higher the level of concentration, the denser the ideas, so turn off notifications, don’t keep email open all the time. Windows is the worst at stealing focus; “it is like a bored 3 year old”. Another reason why 80% of people here seem to have Macs… I quite like the idea of using something like Doodim to gradually dim everything on your desktop apart from the application you are working in.

    The problem with using graphical tools to navigate a file system or class structure is that the hierarchies are too deep. Any time you know where you want to get to already it will be faster to search than to navigate. So make use of shortcuts like GOTO class or OSX menu item search.

    Another neat idea was to use Selenium to record interactions for debugging web apps. Rather than having to repeatedly click through a sequence to get to where you need to be in the app, simply record the sequence using Selenium and play it back instantly. Even better: get your QA team to record a Selenium script to reproduce a bug and have them attach that to the JIRA ticket instead of a screenshot.

    Neal suggests to always use a ‘real’ programming language for scripting (groovy, ruby, php) instead of sed or awk. This allows your little tools to grow into assets and lets you add unit tests and refactor.

    The second major session was an introduction to MongoDB by Alvin Richards. This was a pretty in depth session and as he said it was a bit like drinking from the firehose but I came away liking what I saw.

    MongoDB belongs to the so-called NoSQL family of data stores and is ‘document oriented’. Documents are stored as binary JSON and the schema is not fixed. This makes it really easy for your schema to evolve with your application.

    With MongoDB you get all this built in:

    • Horizontal scaling
    • Simplified schema evolution
    • Simplified deployment and operation

    Reads can be scaled using replica sets. These are a cluster of servers where any node can be the primary and failover/recovery is handled automatically. All writes go to the primary node.

    Writes can be scaled using automatic sharding. MongoDB’s sharding is transparent to the application code and migrations and rebalancing are handled automatically with no down-time(!)

    You can write Map Reduce functions in JavaScript for MongoDB.

    You can either use the low-level java library to talk to MongoDB or use Morphia which provides a kind of O/R wrapper to map your POJOs. Morphia gives you Annotations like @Entity, @Transient, @Indexed, @PrePersist, @PreSave, @PostPersist, etc.

    To backup MongoDB you can either use mongodump/mongorestore which gives you a binary dump that is not neccesarily consistent from start to finish or use fsync + lock from a slave and then snapshot the files.

    It was a long day but a good start to the conference. Tomorrow I’m starting with another NoSQL data store: Cassandra.

  • You do not have permission

    You do not have permission

    Miguel found this screenshot in an old email from when we were working on permissions and preferences in OpenX:

     

    The subject of the email was “Permissions & Settings: Learn From The Masters”

  • SmugImport: Import your SmugMug albums into Facebook

    SmugImport: Import your SmugMug albums into Facebook

    SmugMug is great.

    As the marketing material says, SmugMug gives you

    • Gorgeous online albums
    • Unlimited storage
    • Privacy when you need it
    • Complete customisation
    • No ads or spam
    • Stunning HD video

    I’ve been using SmugMug for a couple of years now and a quick glance at the stats in my control panel tells me I have uploaded 7,197 photos, totalling 21.58GB. That’s a lot of photos.

    But while my photos look about a bajillion times better on SmugMug than they do on Facebook, there are some advantages to having them on Facebook, as well. In the past this meant uploading each photo twice; once into SmugMug and then again into Facebook. That’s a pain, even with a pretty fast connection.

    While you can post links to your SmugMug galleries on Facebook I wanted to be able to import them into their own Facebook albums so I wrote a Facebook application to do it.

    SmugImport allows you to import your galleries from SmugMug directly into Facebook.

    At the moment it only works with public SmugMug galleries but I plan to add support for private galleries in the near future.

  • WordPress 2.7

    WordPress 2.7

    I just upgraded to WordPress 2.7. I’ve done a few WordPress upgrades now so it usually goes pretty smoothly but I know from experience how difficult some people find upgrading web apps which is why I thought this comment on the WordPress blog was interesting:

    … this may be the last time you ever have to manually upgrade WordPress again. We heard how tired you were of doing upgrades for yourself and your friends, so now WordPress includes a built-in upgrade that will automatically notify you of new releases, and when you’re ready it will download them, install them, and upgrade your blog with a single click.

    This is something we’ve talked about doing with OpenX so I’ll be interested to see if it works when the next WordPress version is released.

  • NetBeans 6.5 rocks!

    NetBeans 6.5 rocks!

    It seems I’m not the only one who thinks the new PHP support in NetBeans is pretty cool.

    Roumen’s blog points to a post on the zend forums:

    My company bought 3 3-year licenses for Zend Studio earlier this and up until a few weeks ago, there was nothing else on the market that even came close to meeting our requirements. Then Netbeans released 6.5 with PHP support. Right out of the gate, their PHP and JavaScript support is on the whole, so much better and faster than Zend’s product, with so many fewer bugs, that despite the fact that we spent $1000 this year investing in Zend’s product, and I personally have spent time with Zend’s tech support and developers (good guys, very helpful), I am assisting my team in migrating over to use Netbeans for most of our development.

    and a comment from Demian there really hits the nail on the head:

    As a Zend license payer for many years I believe I’m entitled to share my opinion on the emergence of netbeans as an Eclipse and Zend Studio killer, at least as far as PHP support is concerned.

    This is not a superficial “ide war” as suggested above, but probably more a reflection of the fact that PHP developers have had to endure low quality IDEs for years, so the relief felt now that a decent product, netbeans 6.5, has appeared on the market, is tremendous. Netbeans is far more than just decent though, it is clearly head and shoulders above Zend Studio for Eclipse, you only need to watch the videos or use it for 5 minutes to realize.

    The Zend Studio product on the other hand maintained the same bugs in its product for literally years, releasing updates less than once a year, and showing an apparent total lack of interest in responding to the requests of its customers.

    Then with the move to Eclipse customers were burdened with an even slower, more bloated and memory hungry app with possibly thousands of unnecessary configuration options and with an odyssey of undertaking required to get debugging working. I’m not surprised, given the context, that there is a lot of emotion being expressed now that a decent product is finally available.

    For years we had to put up with Zend Studio’s bugs simply because there wasn’t anything better. Now there is.

  • NetBeans 6.5 RC

    NetBeans 6.5 RC

    I first blogged about the PHP support in NetBeans at JavaOne this year. At that stage it was only available as an Early Access release and was a little too buggy for serious use so I always found myself having to switch back to Zend Studio. Since then the development builds have been getting better and better and now there is a NetBeans 6.5 Release Candidate available.

    The improvement in the last few months has been massive and the PHP support has reached a level of maturity such that I have no problems using it as my main IDE. Last week I made heavy use of it on a project at work based on Zend Framework and not once was I forced to switch back to Zend Studio. Code completion and source navigation works great, debugging is integrated nicely with Xdebug (which is much easier to get working than the Zend debugger), plus you get all the other NetBeans goodness like great subversion support and local file history, source highlighting for loads of languages, a nice CSS editor and refactoring support. If I did much JavaScript programming I’m sure I’d be impressed with the JavaScript support, too. It also means I only need one IDE for all my PHP, Java and Grails projects and can take advantage of all the NetBeans plugins available.

    According the to the roadmap, NetBeans 6.5 is due for release on November 18 but if you’re still using Zend Studio or even emacs or vi I strongly recommend downloading it and giving it a go.