<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Life on Rails - Home</title>
  <id>tag:lifeonrails.org,2008:mephisto/</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://lifeonrails.org/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://lifeonrails.org/" rel="alternate" type="text/html"/>
  <updated>2008-03-19T13:19:27Z</updated>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2008-03-19:939</id>
    <published>2008-03-19T13:09:00Z</published>
    <updated>2008-03-19T13:19:27Z</updated>
    <category term="rants and ideas"/>
    <category term="tips"/>
    <category term="1and1"/>
    <category term="cancel contract"/>
    <category term="dedicated server"/>
    <category term="hosting"/>
    <link href="http://lifeonrails.org/2008/3/19/1and1-does-it-again-great-hosts" rel="alternate" type="text/html"/>
    <title>1and1 does it again, great hosts</title>
<content type="html">
            &lt;p&gt;Just a short note to say that I truly love the web hosts 1and1. That's who my server is hosted with, and who is responsible for hosting all of the sites I have.&lt;/p&gt;

&lt;p&gt;They have great dedicated server packages that are super fast, with loads of bandwidth. I actually run visualchat.co.uk on on of their dedicated servers, which has ample bandwidth for all the audio and video of the webcam chat sessions.&lt;/p&gt;

&lt;p&gt;In short,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the servers are fast,&lt;/li&gt;
&lt;li&gt;they got great control panels,&lt;/li&gt;
&lt;li&gt;the support is actually really good, both written, and on the phone,&lt;/li&gt;
&lt;li&gt;the bandwidth is phenomenal,&lt;/li&gt;
&lt;li&gt;you get free ftp backup with each dedicated server,&lt;/li&gt;
&lt;li&gt;they never go down.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They really are great - I strongly recommend them... However, I'm not writing because of that - I'm writing to let you know that they have exceeded my expectations again:&lt;/p&gt;

&lt;p&gt;In September 2007 I took up a new server package, a beefed up dedicated server, that came with 3 months free contract, then 18 months minimum term. Now, I was intending to migrate my existing dedicated server (contract expired) to the new server.&lt;/p&gt;

&lt;p&gt;However, I started working for Adobe, and was so busy that I never got a chance to move the server, and therefore ended up paying for both dedicated servers. Now 1and1 get a few bad reviews for locking people into contracts, but I have to say - they were great with me - I called them, explained what had happened, and they simply asked me to fax them the details.&lt;/p&gt;

&lt;p&gt;The server is now cancelled: Including the 18 month contract! Yep! they just let me back out of it, by being reasonable and human about it all - so next time someone tells you that they are monsters, and hold people in to contracts, I suggest you ask them how they spoke to their staff, and how they treated them - I know other people who have been rude, and they get what they give..&lt;/p&gt;

&lt;p&gt;I don't know any other host that would do this - I can definitely tell you 3 other hosts that wont budge at all on these matters (though I don't want to name them)... &lt;/p&gt;

&lt;p&gt;BTW, I'm not an affiliate - I haven't joined their program, so I'm genuinely objective - check them out if you want dedicated servers- for any small-medium scale project (read as, don't need a server farm and fail over), they're great!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2008-02-26:837</id>
    <published>2008-02-26T22:02:00Z</published>
    <updated>2008-02-26T23:26:32Z</updated>
    <category term="flex"/>
    <category term="me, a person"/>
    <category term="adobe certified expert exam"/>
    <category term="flex"/>
    <link href="http://lifeonrails.org/2008/2/26/i-passed-my-adobe-flex-exam" rel="alternate" type="text/html"/>
    <title>I passed my Adobe Flex Exam</title>
<summary type="html">&lt;p&gt;I passed my ACE exam,&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.lifeonrails.org/images/ace.gif&quot; alt=&quot;Adobe Certified Professional&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I'm now an Adobe Certified Professional in Flex. Whoohoo!&lt;/p&gt;

&lt;p&gt;I'm really chuffed, I scored 86%, and got 100% on the UIComponent section, which is no surprise really, as I do lots of ux work on our current project. Getting to the exam was hilarious. It was on a Sunday and we don't have a train service on a Sunday, so I planned it precisely: cabs, bus, tube, the lot. 2 hours of travel to get to the examination only to find... I'd gone to the wrong place!!!&lt;/p&gt;

&lt;p&gt;I couldn't believe it, I had just 45 minutes to get to the other side of London. Fortunately, I found a mini cab office next door with a cab driver who was like something from a Jason Staham movie (think &quot;the transporter&quot;). This guy was super cool, and drove like a maniac. I had to use his 10 year old map of London to find the way to the proper examination centre, which made me sooo travel sick, it was unbelievable..&lt;/p&gt;

&lt;p&gt;But we got there, and despite me being late and so sick that I had to sit down for 10 minutes, I passed! I have to say it, the exam is quite hard - you need to know a lot of stuff to pass. Here's a pic of all the notes that I made over the last 3 weeks. If you're gonna do this, even if you've been doing flex for a year or more, I really suggest reading up, for a few reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the areas covered by the exam are very diverse,&lt;/li&gt;
&lt;li&gt;you need precise knowledge of some controls in order to choose between bogus properties, and real properties,&lt;/li&gt;
&lt;li&gt;It tests you on some of the finer points of framework, such as low level event architecture and the collection and renderer interfaces,&lt;/li&gt;
&lt;li&gt;best of all - you learn loads by reading up.&lt;/li&gt;
&lt;/ul&gt;</summary><content type="html">
            &lt;p&gt;I passed my ACE exam,&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.lifeonrails.org/images/ace.gif&quot; alt=&quot;Adobe Certified Professional&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I'm now an Adobe Certified Professional in Flex. Whoohoo!&lt;/p&gt;

&lt;p&gt;I'm really chuffed, I scored 86%, and got 100% on the UIComponent section, which is no surprise really, as I do lots of ux work on our current project. Getting to the exam was hilarious. It was on a Sunday and we don't have a train service on a Sunday, so I planned it precisely: cabs, bus, tube, the lot. 2 hours of travel to get to the examination only to find... I'd gone to the wrong place!!!&lt;/p&gt;

&lt;p&gt;I couldn't believe it, I had just 45 minutes to get to the other side of London. Fortunately, I found a mini cab office next door with a cab driver who was like something from a Jason Staham movie (think &quot;the transporter&quot;). This guy was super cool, and drove like a maniac. I had to use his 10 year old map of London to find the way to the proper examination centre, which made me sooo travel sick, it was unbelievable..&lt;/p&gt;

&lt;p&gt;But we got there, and despite me being late and so sick that I had to sit down for 10 minutes, I passed! I have to say it, the exam is quite hard - you need to know a lot of stuff to pass. Here's a pic of all the notes that I made over the last 3 weeks. If you're gonna do this, even if you've been doing flex for a year or more, I really suggest reading up, for a few reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the areas covered by the exam are very diverse,&lt;/li&gt;
&lt;li&gt;you need precise knowledge of some controls in order to choose between bogus properties, and real properties,&lt;/li&gt;
&lt;li&gt;It tests you on some of the finer points of framework, such as low level event architecture and the collection and renderer interfaces,&lt;/li&gt;
&lt;li&gt;best of all - you learn loads by reading up.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I passed my ACE exam,&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.lifeonrails.org/images/ace.gif&quot; alt=&quot;Adobe Certified Professional&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I'm now an Adobe Certified Professional in Flex. Whoohoo!&lt;/p&gt;

&lt;p&gt;I'm really chuffed, I scored 86%, and got 100% on the UIComponent section, which is no surprise really, as I do lots of ux work on our current project. Getting to the exam was hilarious. It was on a Sunday and we don't have a train service on a Sunday, so I planned it precisely: cabs, bus, tube, the lot. 2 hours of travel to get to the examination only to find... I'd gone to the wrong place!!!&lt;/p&gt;

&lt;p&gt;I couldn't believe it, I had just 45 minutes to get to the other side of London. Fortunately, I found a mini cab office next door with a cab driver who was like something from a Jason Staham movie (think &quot;the transporter&quot;). This guy was super cool, and drove like a maniac. I had to use his 10 year old map of London to find the way to the proper examination centre, which made me sooo travel sick, it was unbelievable..&lt;/p&gt;

&lt;p&gt;But we got there, and despite me being late and so sick that I had to sit down for 10 minutes, I passed! I have to say it, the exam is quite hard - you need to know a lot of stuff to pass. Here's a pic of all the notes that I made over the last 3 weeks. If you're gonna do this, even if you've been doing flex for a year or more, I really suggest reading up, for a few reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the areas covered by the exam are very diverse,&lt;/li&gt;
&lt;li&gt;you need precise knowledge of some controls in order to choose between bogus properties, and real properties,&lt;/li&gt;
&lt;li&gt;It tests you on some of the finer points of framework, such as low level event architecture and the collection and renderer interfaces,&lt;/li&gt;
&lt;li&gt;best of all - you learn loads by reading up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was talking about this last point with a good friend from work, and we both realised that often times, when you're reading the documentation for the first time, it's in a more goal-based manner: you want to know how to do that drop in renderer, or how to access the outerdocument, or what's wrong with your e4x statement. As such, you see things like catching events in the capture phase, or event priorities, and think &quot;that wont solve my problem, I don't need it&quot;.&lt;/p&gt;

&lt;p&gt;Going through the docs in such a methodical, pragmattic way was a total boon. I found loads of interesting things, and I have to say it, some better ways of doing things than I had done.&lt;/p&gt;

&lt;p&gt;And that's pretty much what I was expecting: It was one of my main reasons for doing the Flex Certification: I have a great job, which I love and am very proud of, and I wanted to know that I deserve the role I got, so I figured it was worth doing to make sure I make the grade.&lt;/p&gt;

&lt;p&gt;In case you're going to do the exam, I'll list what I did to revise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;read UML-demystified - there are questions on UML, so brush up if you're rusty,&lt;/li&gt;
&lt;li&gt;read Advanced Actionscript 3, with design patterns, particularly the &quot;advanced topics&quot; section,&lt;/li&gt;
&lt;li&gt;followed all 3 of the excellent lynda 2 videos (ok, I kept my finger on the fast forward button for a lot of it, but there was a lot of good stuff, especially in the FDS series),&lt;/li&gt;
&lt;li&gt;read AND MADE NOTES ON the flex 2 developers guide from Adobe&lt;/li&gt;
&lt;li&gt;read programming in Actionscript 3,&lt;/li&gt;
&lt;li&gt;coded lots of small apps based on things I wasn't too hot on, which for me in particular was the data management and RPC stuff,&lt;/li&gt;
&lt;li&gt;installed and played extensively with FDS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Oh, and when I say made, notes, I mean, old school, uni style notes. I studied the guide, the same way I studied networking, or predicate logic, or bpr at uni. I read about 80% of the manual, and made notes on the lot.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.lifeonrails.org/images/allnotes.jpg&quot; alt=&quot;picture of notes&quot; /&gt;&lt;/p&gt;

&lt;p&gt;On that note (no pun intended), I strongly recommend, seeing as the exam is multiple choice, that you use a shorthand form to make your notes, and don't try to remember everything - it's not possible, there is too much. I saw the note making as more of a loose index, if you catch my drift.. it meant that if I saw any keywords in a question, I could search through my brain for pages of notes that matched that keyword.&lt;/p&gt;

&lt;p&gt;As such, I wouldn't recommend writing full text notes, as you wont learn anything. It's better to read the stuff, code it and know it, so that you don't need explanaitons, and just write down the methods, properties, and stlyes, and any saliant points for the area you're covering. In fact, I knew the majority of stuff already, I just needed the index for the finer properties.&lt;/p&gt;

&lt;p&gt;Here's an example:
&lt;img src=&quot;http://www.lifeonrails.org/images/noteExample.jpg&quot; alt=&quot;picture of notes&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I am in fact, going to make  couple of cheat sheets out of my notes over the next few weeks, on the following areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flex events,&lt;/li&gt;
&lt;li&gt;Flex Data Management Service&lt;/li&gt;
&lt;li&gt;Flex RPC service,&lt;/li&gt;
&lt;li&gt;Flex Events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to help with that project just buzz me at georgejcook (put an AT symbol here) google mail dot com&lt;/p&gt;

&lt;p&gt;If you got here, searching for info on the exam yourself, good luck!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2008-02-19:784</id>
    <published>2008-02-19T00:37:00Z</published>
    <updated>2008-02-27T00:52:11Z</updated>
    <category term="flex"/>
    <category term="flex testing eval actionscript open source"/>
    <link href="http://lifeonrails.org/2008/2/19/flextramp-achieve-something-with-every-build" rel="alternate" type="text/html"/>
    <title>flexTRAMP - "Achieve something with every build"</title>
<summary type="html">&lt;p&gt;This is my new open source project...&lt;/p&gt;

&lt;h2&gt;Flex TRAMP is a testing Runtime Actionscript Mini Parser,..&lt;/h2&gt;

&lt;p&gt;which means it allows you to interact with your running flex app, and:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create variables, &lt;/li&gt;
&lt;li&gt;assign objects,&lt;/li&gt;
&lt;li&gt;update attributes,&lt;/li&gt;
&lt;li&gt;call methods&lt;/li&gt;
&lt;li&gt;and basically interact with your flex app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Why?&lt;/h1&gt;

&lt;p&gt;Me and some colleagues are currently working on a flex app that takes a while to build. It's very frustrating to do a build, then see that some variable, or object is initialised with the wrong value, and have to rebuild again..&lt;/p&gt;

&lt;p&gt;I'm used to working with FIrebug - if something goes wrong with my js, I can modify it on the fly, and try again.&lt;/p&gt;

&lt;p&gt;Take this example:
We've got a part of our app that prints some info out. To get to it, you have to enter lots of registration info, and perform lots of tasks.&lt;/p&gt;

&lt;p&gt;With FlexTRAMP, I can fire up the app, and in the command line window that appears when I click the FlexTRAMP button, I can create and initialise all of the objects I need, and call the print method, again, and again and again.. no need to go through the whole registration process. Lots of time saved, I'm more productive, and therefore happier :)&lt;/p&gt;

&lt;p&gt;Another example - only just today - I did a few changes and made a build. I found that the currentState of one of my component's was wrong.. This meant I had to go back and rebuild again... however, using FlexTRAMP, I could still set the state, update a few vars, and one method call later, debug a transition I had, which I found needed a slight tweak.&lt;/p&gt;

&lt;p&gt;So you see, I didn't end up doing a build and achieving nothing.&lt;/p&gt;

&lt;p&gt;For anyone used to Firebug, or Microsoft's command line processors, you will know the use of this approach. It's not a replacement for unit tests, but a very useful tool for when you have to get hacky with some defects, or trail blazing some code.&lt;/p&gt;

&lt;p&gt;But I thought Actionscript doesnt have eval?&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;This is my new open source project...&lt;/p&gt;

&lt;h2&gt;Flex TRAMP is a testing Runtime Actionscript Mini Parser,..&lt;/h2&gt;

&lt;p&gt;which means it allows you to interact with your running flex app, and:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create variables, &lt;/li&gt;
&lt;li&gt;assign objects,&lt;/li&gt;
&lt;li&gt;update attributes,&lt;/li&gt;
&lt;li&gt;call methods&lt;/li&gt;
&lt;li&gt;and basically interact with your flex app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Why?&lt;/h1&gt;

&lt;p&gt;Me and some colleagues are currently working on a flex app that takes a while to build. It's very frustrating to do a build, then see that some variable, or object is initialised with the wrong value, and have to rebuild again..&lt;/p&gt;

&lt;p&gt;I'm used to working with FIrebug - if something goes wrong with my js, I can modify it on the fly, and try again.&lt;/p&gt;

&lt;p&gt;Take this example:
We've got a part of our app that prints some info out. To get to it, you have to enter lots of registration info, and perform lots of tasks.&lt;/p&gt;

&lt;p&gt;With FlexTRAMP, I can fire up the app, and in the command line window that appears when I click the FlexTRAMP button, I can create and initialise all of the objects I need, and call the print method, again, and again and again.. no need to go through the whole registration process. Lots of time saved, I'm more productive, and therefore happier :)&lt;/p&gt;

&lt;p&gt;Another example - only just today - I did a few changes and made a build. I found that the currentState of one of my component's was wrong.. This meant I had to go back and rebuild again... however, using FlexTRAMP, I could still set the state, update a few vars, and one method call later, debug a transition I had, which I found needed a slight tweak.&lt;/p&gt;

&lt;p&gt;So you see, I didn't end up doing a build and achieving nothing.&lt;/p&gt;

&lt;p&gt;For anyone used to Firebug, or Microsoft's command line processors, you will know the use of this approach. It's not a replacement for unit tests, but a very useful tool for when you have to get hacky with some defects, or trail blazing some code.&lt;/p&gt;

&lt;p&gt;But I thought Actionscript doesnt have eval?&lt;/p&gt;
&lt;p&gt;This is my new open source project...&lt;/p&gt;

&lt;h2&gt;Flex TRAMP is a testing Runtime Actionscript Mini Parser,..&lt;/h2&gt;

&lt;p&gt;which means it allows you to interact with your running flex, and&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create variables,&lt;/li&gt;
&lt;li&gt;assign objects,&lt;/li&gt;
&lt;li&gt;update attributes,&lt;/li&gt;
&lt;li&gt;call methods&lt;/li&gt;
&lt;li&gt;and basically interact with your flex app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Why?&lt;/h1&gt;

&lt;p&gt;Me and some colleagues are currently working on a flex app that takes a while to build. It's very frustrating to do a build, then see that some variable, or object is initialised with the wrong value, and have to rebuild again..&lt;/p&gt;

&lt;p&gt;I'm used to working with FIrebug - if something goes wrong with my js, I can modify it on the fly, and try again.&lt;/p&gt;

&lt;p&gt;Take this example:
We've got a part of our app that prints some info out. To get to it, you have to enter lots of registration info, and perform lots of tasks.&lt;/p&gt;

&lt;p&gt;With FlexTRAMP, I can fire up the app, and in the command line window that appears when I click the FlexTRAMP button, I can create and initialise all of the objects I need, and call the print method, again, and again and again.. no need to go through the whole registration process. Lots of time saved, I'm more productive, and therefore happier :)&lt;/p&gt;

&lt;p&gt;Another example - only just today - I did a few changes and made a build. I found that the currentState of one of my component's was wrong.. This meant I had to go back and rebuild again... however, using FlexTRAMP, I could still set the state, update a few vars, and one method call later, debug a transition I had, which I found needed a slight tweak.&lt;/p&gt;

&lt;p&gt;So you see, I didn't end up doing a build and achieving nothing.&lt;/p&gt;

&lt;p&gt;For anyone used to Firebug, or Microsoft's command line processors, you will know the use of this approach. It's not a replacement for unit tests, but a very useful tool for when you have to get hacky with some defects, or trail blazing some code.&lt;/p&gt;

&lt;h2&gt;But I thought Actionscript doesnt have eval?&lt;/h2&gt;

&lt;p&gt;It doesn't, and while some people are going to great lengths (and using great skill) to get a genuine eval in actionscript (such as compiling the bytcode and loading it back in through a swf), we're not doing that. &lt;/p&gt;

&lt;p&gt;We're doing something much more simple, but just as effective for the purposes we have. &lt;/p&gt;

&lt;h1&gt;Who's making it, what license?&lt;/h1&gt;

&lt;p&gt;I'm making FlexTramp, with some colleauges from Adobe Consulting - we are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;George Cook (me),&lt;/li&gt;
&lt;li&gt;Ignacio Martin,&lt;/li&gt;
&lt;li&gt;Mike Herron, &lt;/li&gt;
&lt;li&gt;Satinder Ubhis.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project is open source and will be hosted on google shortly. It will be released under the &lt;a href=&quot;http://sam.zoy.org/wtfpl/&quot;&gt;wftpl license&lt;/a&gt;. &lt;/p&gt;

&lt;h1&gt;What state is it in?&lt;/h1&gt;

&lt;p&gt;Currently there's a spike I knocked up, which has some functionality:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;variable assignment,&lt;/li&gt;
&lt;li&gt;Object creation,&lt;/li&gt;
&lt;li&gt;method invocation,&lt;/li&gt;
&lt;li&gt;basic method info,&lt;/li&gt;
&lt;li&gt;real basic operators, concatination  and boolean expressions,&lt;/li&gt;
&lt;li&gt;can add existing variables from your application!&lt;/li&gt;
&lt;li&gt;access of static methods,&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;There are some limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;only one type of operator (+ - * / ) per expression&lt;/li&gt;
&lt;li&gt;not much nested anything (e.g (), []).. Parser is very ropey with brackets (only one set of brackets allowed per expression&lt;/li&gt;
&lt;li&gt;no iteration (do, while,etc)&lt;/li&gt;
&lt;li&gt;no functions.&lt;/li&gt;
&lt;li&gt;only public variables/methods are accessible.. this will probably always be the case..&lt;/li&gt;
&lt;li&gt;doing things like a[0].length, or object.method().property, or object.method().method() is not supported yet..&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Ugly, ugly parsing code!!&lt;/h2&gt;

&lt;p&gt;The parser I wrote is so utterly horrible (it's just a quick proof of concept that mushroomed one afternoon) that I wont let anyone see the code at the mo!!  it's also the same reason tha there are so many limitations. Ignacio is working on a much nicer parser this week, and once we have implemented that, along with some of Sat and Mike's stuff - we'll be releasing the code to all and sundry.&lt;/p&gt;

&lt;p&gt;We have lots of ideas for the future of this project, and our aim is to make something that will let you hack around, and get dirty with your code - basically some dirty little scutter of a parser, that allows you to get nasty, while still having some chic. &lt;/p&gt;

&lt;p&gt;Think : &quot; the lady is a tramp&quot;, and you'll be catching our drift.&lt;/p&gt;

&lt;p&gt;More real soon, I promise.&lt;/p&gt;

&lt;p&gt;and I couldn't help myself a kind of basic version is here:&lt;/p&gt;

&lt;h2&gt;Let's try some code:&lt;/h2&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;a = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; hello world!&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;myApp = mx.core.Application.application&lt;/li&gt;&lt;li&gt;myButton = new mx.controls.&lt;span class=&quot;pt&quot;&gt;Button&lt;/span&gt;()&lt;/li&gt;&lt;li&gt;myApp.addChild( myButton )&lt;/li&gt;&lt;li&gt;myButton.label = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; Hello from TRAMP &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;myButton.width = 200&lt;/li&gt;&lt;li&gt;myButton.height = 100&lt;/li&gt;&lt;li&gt;mx.controls.Alert.show(myButton.label,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;now you can play with your flex app in runtime :-)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;/li&gt;&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;if you want to use that code, copy it into a text editor first, and remove the hash symbols that this blog puts at the start of each line (soz)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;extra comands are &quot;cls&quot; to clear the output and
delete VARNAME, to remove a variable..
e.g. delete myButton.&lt;/p&gt;

&lt;p&gt;Note you can also enter multiline commands, so you can copy your fave snippets to a browser for later use.. double clicking on an element in the tree, will put a reference to it in your code window.  BEWARE the tree (and the parser, for that matter) are quite ropey at the mo!&lt;/p&gt;

&lt;h1&gt;Example&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;http://www.lifeonrails.org/flexTramp/demo/main.html&quot;&gt;Example of FlexTramp - it's really early, so dont' expect too much!&lt;/a&gt;+&lt;/p&gt;

&lt;p&gt;I've been using this the last couple of days to debug a LCDS app with cairngorm. It's great fun creating the cairngorm events and tweaking them and dispatching them over and over again, without having to rebuild.&lt;/p&gt;

&lt;p&gt;More soon!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2008-02-17:767</id>
    <published>2008-02-17T20:22:00Z</published>
    <updated>2008-02-17T21:30:40Z</updated>
    <category term="flex"/>
    <category term="tips"/>
    <category term="flex flexUnit asynchronous events testing actionscript"/>
    <link href="http://lifeonrails.org/2008/2/17/flex-unit-and-asynchronous-tests" rel="alternate" type="text/html"/>
    <title>Flex unit, and asynchronous tests</title>
<summary type="html">&lt;p&gt;Thought I'd share this with you..&lt;/p&gt;

&lt;p&gt;If you're using flexUnit and want to test some class or method that dispatches an asyncrhonous event, then this snippet is for you.&lt;/p&gt;

&lt;p&gt;I've seen this done a few ways, but I recently discovered this neat little feature of flexUnit. If you know this already, then good for you, but if not, let me introduce you to the addAsync method.&lt;/p&gt;

&lt;p&gt;Basically, this TestCase method acts as a proxy between you're addEventListener call and FlexUnit, giving you a teeny bit of extra functionality on the way. The basic use is:&lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;myObject.addEventListener( eventName addAsync( handlerMethod, timeOutInMillisecs ) );&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;It's quite straight forward, you provide it with a handler in your TestCase, and if a matching method is not dispatched in the prescribed amount of time, the test fails. Neato.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;Thought I'd share this with you..&lt;/p&gt;

&lt;p&gt;If you're using flexUnit and want to test some class or method that dispatches an asyncrhonous event, then this snippet is for you.&lt;/p&gt;

&lt;p&gt;I've seen this done a few ways, but I recently discovered this neat little feature of flexUnit. If you know this already, then good for you, but if not, let me introduce you to the addAsync method.&lt;/p&gt;

&lt;p&gt;Basically, this TestCase method acts as a proxy between you're addEventListener call and FlexUnit, giving you a teeny bit of extra functionality on the way. The basic use is:&lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;myObject.addEventListener( eventName addAsync( handlerMethod, timeOutInMillisecs ) );&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;It's quite straight forward, you provide it with a handler in your TestCase, and if a matching method is not dispatched in the prescribed amount of time, the test fails. Neato.&lt;/p&gt;
&lt;p&gt;Thought I'd share this with you..&lt;/p&gt;

&lt;p&gt;If you're using flexUnit and want to test some class or method that dispatches an asyncrhonous event, then this snippet is for you.&lt;/p&gt;

&lt;p&gt;I've seen this done a few ways, but I recently discovered this neat little feature of flexUnit. If you know this already, then good for you, but if not, let me introduce you to the addAsync method.&lt;/p&gt;

&lt;p&gt;Basically, this TestCase method acts as a proxy between you're addEventListener call and FlexUnit, giving you a teeny bit of extra functionality on the way. The basic use is:&lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;myObject.addEventListener( eventName addAsync( handlerMethod, timeOutInMillisecs ) );&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;It's quite straight forward, you provide it with a handler in your TestCase, and if a matching method is not dispatched in the prescribed amount of time, the test fails. Neato.&lt;/p&gt;

&lt;p&gt;Here's an example from one of my current open source projects.. I've got a historyManager class, which dispatches a historyMoved event, to any interesting parties, if the moveHistory method is called. It returns at TextEvent with the current history text, for anyone who might like to know.&lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;r&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;test&lt;/span&gt;.Controller&lt;/li&gt;&lt;li&gt;{&lt;/li&gt;&lt;li&gt;   &lt;span class=&quot;r&quot;&gt;import&lt;/span&gt; flexunit.framework.TestCase;&lt;/li&gt;&lt;li&gt;   &lt;span class=&quot;r&quot;&gt;import&lt;/span&gt; flexunit.framework.TestSuite;&lt;/li&gt;&lt;li&gt;   &lt;span class=&quot;r&quot;&gt;import&lt;/span&gt; com.FlexTramp.HistoryManager;&lt;/li&gt;&lt;li&gt;   &lt;span class=&quot;r&quot;&gt;import&lt;/span&gt; flash.events.TextEvent;&lt;/li&gt;&lt;li&gt;   &lt;/li&gt;&lt;li&gt;   &lt;span class=&quot;r&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; HistoryManagerTest &lt;span class=&quot;r&quot;&gt;extends&lt;/span&gt; TestCase {&lt;/li&gt;&lt;li&gt;        &lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;r&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;var&lt;/span&gt; historyManager : HistoryManager;&lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;r&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;var&lt;/span&gt; expecectedHistoryString : &lt;span class=&quot;pt&quot;&gt;String&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;r&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;var&lt;/span&gt; expecectedHistoryIndex : &lt;span class=&quot;r&quot;&gt;int&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;        &lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;        override &lt;span class=&quot;r&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; setUp() : &lt;span class=&quot;r&quot;&gt;void&lt;/span&gt;&lt;/li&gt;&lt;li&gt;        {&lt;/li&gt;&lt;li&gt;          &lt;span class=&quot;c&quot;&gt;//create history manager with test SO name, to save losing our commands :)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;          historyManager = new HistoryManager( &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; );&lt;/li&gt;&lt;li&gt;          historyManager.&lt;span class=&quot;fu&quot;&gt;clear&lt;/span&gt;();&lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;        &lt;/li&gt;&lt;li&gt;        override &lt;span class=&quot;r&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; tearDown() : &lt;span class=&quot;r&quot;&gt;void&lt;/span&gt;&lt;/li&gt;&lt;li&gt;        {&lt;/li&gt;&lt;li&gt;          historyManager = &lt;span class=&quot;pc&quot;&gt;null&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;        &lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;r&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; testInitialize() : &lt;span class=&quot;r&quot;&gt;void&lt;/span&gt;&lt;/li&gt;&lt;li&gt;        {&lt;/li&gt;&lt;li&gt;          assertEquals(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;pointer should've been 0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, 0, historyManager.getCurrentIndex() );&lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;        &lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;r&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; testAddToHistory() : &lt;span class=&quot;r&quot;&gt;void&lt;/span&gt;&lt;/li&gt;&lt;li&gt;        {&lt;/li&gt;&lt;li&gt;          historyManager.addToHistory( &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; );&lt;/li&gt;&lt;li&gt;          assertEquals(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;pointer should've been 0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, 0, historyManager.getCurrentIndex() );&lt;/li&gt;&lt;li&gt;          historyManager.addToHistory( &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; );&lt;/li&gt;&lt;li&gt;          assertEquals(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;pointer should've been 0 - last element was duplicate&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;/li&gt;&lt;li&gt;              0, historyManager.getCurrentIndex() );&lt;/li&gt;&lt;li&gt;          historyManager.addToHistory( &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; );&lt;/li&gt;&lt;li&gt;          assertEquals(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;pointer should've been 1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, 1, historyManager.getCurrentIndex() );&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;r&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; testMoveBack() : &lt;span class=&quot;r&quot;&gt;void&lt;/span&gt;&lt;/li&gt;&lt;li&gt;        {&lt;/li&gt;&lt;li&gt;          historyManager.addToHistory( &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; );&lt;/li&gt;&lt;li&gt;          historyManager.addToHistory( &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; );&lt;/li&gt;&lt;li&gt;      &lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;c&quot;&gt;//the move methods results in a HistoryMoved event being dispatched&lt;/span&gt;&lt;/li&gt;&lt;li&gt;      historyManager.addEventListener( HistoryManager.HISTORY_MOVED,&lt;/li&gt;&lt;li&gt;          addAsync( historyMoved, 2000 ) );&lt;/li&gt;&lt;li&gt;      expecectedHistoryString = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;      expecectedHistoryIndex = 0;&lt;/li&gt;&lt;li&gt;      historyManager.moveHistory(-1);&lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;        &lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;r&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; historyMoved( &lt;span class=&quot;pt&quot;&gt;event&lt;/span&gt; : TextEvent ) : &lt;span class=&quot;r&quot;&gt;void&lt;/span&gt;&lt;/li&gt;&lt;li&gt;        {&lt;/li&gt;&lt;li&gt;          assertNotNull(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;event should've been returned&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pt&quot;&gt;event&lt;/span&gt;.text);&lt;/li&gt;&lt;li&gt;          assertEquals(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;should've returned previous history text&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;/li&gt;&lt;li&gt;            expecectedHistoryString, &lt;span class=&quot;pt&quot;&gt;event&lt;/span&gt;.text);&lt;/li&gt;&lt;li&gt;          assertEquals(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;should've been history index &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + expecectedHistoryIndex, &lt;/li&gt;&lt;li&gt;            expecectedHistoryIndex, historyManager.getCurrentIndex() );&lt;/li&gt;&lt;li&gt;              &lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;    &lt;/li&gt;&lt;li&gt;           &lt;/li&gt;&lt;li&gt;    }&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;From the snippet, you can see that I can check my event in the historyMoved handler (and any other pertinent properties), but best of all, if the method wasn't dispatched within 2 seconds, Flexunit will fail. Just to be sure, I checked it by adding a timer to my event dispatcher, and it plays ball..&lt;/p&gt;

&lt;p&gt;I'm chuffed - lovely bit of DRY code that I've certainly written myself, too many times.. but not any more :-)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2008-02-11:733</id>
    <published>2008-02-11T19:50:00Z</published>
    <updated>2008-02-11T20:19:57Z</updated>
    <category term="flex"/>
    <category term="me, a person"/>
    <category term="adobe flex exam"/>
    <link href="http://lifeonrails.org/2008/2/11/flex-exam" rel="alternate" type="text/html"/>
    <title>FLEX EXAM</title>
<content type="html">
            I'm going for my [Adobe Certified Exam in flex](http://www.adobe.com/devnet/flex/articles/flex_certification.html) later this month. Most people wait till they pass to make it public knowledge. You're sat next to someone for months, then one day they suddenly come out with  : &quot;yeah, I got my ace now&quot;, or you read a blog post &quot;I passed my ACE&quot;.... well, balls to that! I haven't passed mine yet... I might fail and look like an utter cock in the process!
However, at least this way...

* More pressure on me to pass,
* I'm being straight with my friends and colleagues, and not just suddenly being like &quot;oh, yeah I was just walking to work the other day and wow! there was this exam hall right there and they just happened to be doing the ACE exam, which I've never mentioned to you ever before, and I just happened to be on the register, and just happened to go in and pass, so yeah, yesterday I wasn't an ACE, but now I am..&quot;
* At least I can blog about the learning process with some gusto... I wont elaborate, but what man ever takes his missus out to dinner again, once he's had desert... 

I've so far found that [Lynda.com](http://www.lynda.com) is great to do a refresher course of what you know - and it's also really good for learning some new stuff too (despite using fms and flashcom, I've not had much exposure to FDS or LCDS). I'd heartily recommend going through their excellent Flex videos.
I also recommend reading [&quot;flex 2 training from the source&quot;](http://www.amazon.co.uk/Adobe-Flex-2-Training-Source/dp/032142316X) and cribbing on [&quot;UML demystified&quot;](http://www.amazon.co.uk/UML-Demystified-Paul-Kimmel/dp/007226182X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1202760006&amp;sr=1-1) or another similar title.

There are a couple more things you can do as well. This one chap has made [ATTest](http://www.pxldesigns.com/attest/) which is an excellent tool for  doing mock exams in Flex - it comes with 3 mini tests and 3 exams, and comes for the bargain price of : £20 ($39)... I heartily recommend it.

I've been particularly working with E4X and LCDS, which are certainly my weakest areas. My test is on the 24th - so we'll just have to see how it goes. I'm hoping that I pass though, not least of all because everyone knows I'm sitting the test!

I'll keep this blog up to date with my progress and let you know any cool stuff I find.

WISH ME LUCK :D !!

Failing that, give me some good advice!! Anyone else done it? Got any suggestions.. wow - look  : there's a comments form below, just for you!
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2008-02-11:732</id>
    <published>2008-02-11T19:33:00Z</published>
    <updated>2008-02-11T20:06:30Z</updated>
    <category term="me, a person"/>
    <category term="flex consulting ruby on rails work"/>
    <link href="http://lifeonrails.org/2008/2/11/flex-consulting-a-cure-for-cabin-fever" rel="alternate" type="text/html"/>
    <title>Flex consulting - a cure for cabin fever.</title>
<content type="html">
            &lt;p&gt;It's been a while since I've written anything on this blog. There I was, getting my ruby on rails funk on, getting all RIA, with my javascript and flex, and planning a startup or 2 with my good friend Jon Baker, when life suddenly decided it had different ideas.&lt;/p&gt;

&lt;p&gt;Since then I've been working for Adobe consulting, the last 5 months, as a senior consultant with Flex 2. It kinda happened by accident, but boy am I glad it did :).&lt;/p&gt;

&lt;p&gt;I've been using Flex 2 for more than a year now, and flash for a long time before, but I hadn't quite fallen for it, if I'm honest. I was still loving all of my Ruby on Rails goodness, and getting quite agile (no pun intended) with js and programming the DOM.&lt;/p&gt;

&lt;p&gt;I was using Flex in a very specific way: Writing portal's and services in Ruby on Rails and mysql, and having the actual &quot;rich&quot; bit (the app), in Flex. &lt;/p&gt;

&lt;p&gt;I thought I'd take the Adobe gig for a bit, then get back to the world of freelance Ruby on Rails, and making sites by my lonesome... but that hasn't happened. I've actually totally fallen for using Flex now: No more messing around with cross browser issues, no javascript worries, no DOM Hassle, and the framework is fantastic : Powerful, and very flexible.&lt;/p&gt;

&lt;p&gt;It really is what I like to do - I love ECMA Script based languages, and the frustration of js in the browser for me has always been the DOM, and not the js. With flex I get to do the programming I love most. I still get to do some js, and xhtml, and backend stuff like Java and Tomcat and all that (I'm lucky enough to be using Live Cycle Data Services on a project), so I'm still keeping my finger in lots of pies here, and as such keeping myself interested, and always raising my game..&lt;/p&gt;

&lt;p&gt;As for contracting - I gotta say it : I prefer working as an on-site consultant, to freelancing at home. Sure, I gotta wear the trousers and shirt, I gotta be on site pretty much in core hours, I'm not my own boss, but man.. it's great! I like having to wear smart clothes (I can rip them off when I get home and forget about work), I like being there in core hours (means I can't procrastonate, or waste time), I like being told what to do - I mean, I still end up getting responsibility for stuff (don't we all?), but at least it's not ALL on my shoulders.&lt;/p&gt;

&lt;p&gt;Biggest of all though, is that I'm not alone at home, with just IRC. No, let me rephrase that, I've got good company at work.. In fact, I've got really good company - great colleagues who are not only really really technically savvy and know their shit, but who are a great crack - real great blokes - everyday I feel so lucky to go to work, not only with such great technology, but also with such ( professionally and personally ) wonderful people.&lt;/p&gt;

&lt;p&gt;So it's been a real time of change - changing technology (going toward flex, LCDS and Java from Ruby on Rails and AJAX), changing philosophies and changing fortunes. Its meant I've been too busy to update life on rails, but I think now I'm ready to write up some more articles, which I hope others will find useful.&lt;/p&gt;

&lt;p&gt;Have I gone all &lt;a href=&quot;http://www.zedshaw.com/rants/rails_is_a_ghetto.html&quot;&gt;Zed Shaw&lt;/a&gt;, and turned my back on rails? Shit, no! I still think Rails rocks, but it's just not where I want to be at the mo. For the time being, I've kinda had it with all the pressure of making sites by myself (and supporting them.. yuk!).. and Rails is particularly good for that. I'm enjoying more being part of the whole, and contributing with others, to create something much better than I could make by myself.&lt;/p&gt;

&lt;p&gt;I'm keeping the name of this blog, too:  &quot;Life on rails&quot;, clearly a a pun on ruby on rails - but after my wild 20's, travelling around and doing crazy shit, it's a reminder to me, if anyone, that I'm on the rails, and for the time being, I'm on them with Flex :)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-09-03:19</id>
    <published>2007-09-03T21:11:00Z</published>
    <updated>2007-09-04T13:08:58Z</updated>
    <category term="os x"/>
    <category term="mac"/>
    <category term="menu bar"/>
    <category term="os x"/>
    <category term="x11"/>
    <link href="http://lifeonrails.org/2007/9/3/hide-os-x-menu-bar" rel="alternate" type="text/html"/>
    <title>Hide os x menu bar</title>
<content type="html">
            &lt;p&gt;I use remote desktop for windows in x11, as it's the best version out there - believe it or not, it's still better and faster than the latest version micro$ft released just a few weeks back. Anyhows, one annoyance for me is that the apple menu strip, often times will overlap your windows applications, making resizing them or closing them a bit of a nuisance.&lt;/p&gt;

&lt;p&gt;Well it turns out that you can hide the menus strip in os x on an app by app basis. &lt;/p&gt;

&lt;p&gt;You do the following. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;View the package contents of the application you wish to hide the menu bar for,&lt;/li&gt;
&lt;li&gt;Open the file Info.plist in a good text editor,&lt;/li&gt;
&lt;li&gt;Add the following to the list of keys:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;key&gt;LSUIPresentationMode&amp;lt;/key&gt;
&amp;lt;integer&gt;4&amp;lt;/integer&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Bingo!&lt;/p&gt;

&lt;p&gt;Your menu bar will now hide whenever you select the app.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-08-30:48</id>
    <published>2007-08-30T23:24:00Z</published>
    <updated>2007-08-31T10:21:06Z</updated>
    <category term="netbeans"/>
    <category term="ruby on rails"/>
    <category term="netbeans"/>
    <category term="ruby on rails"/>
    <category term="textmate"/>
    <link href="http://lifeonrails.org/2007/8/30/netbeans-not-just-a-nice-personality" rel="alternate" type="text/html"/>
    <title>Netbeans not just a nice personality</title>
<summary type="html">&lt;p&gt;I was googling about and came across &lt;a href=&quot;http://www.danielfischer.com/2007/08/29/netbeans-is-cool-for-rails-development-but-ugly-compared-to-textmate/&quot;&gt;this&lt;/a&gt; article by Daniel Fischer. I kind of understood what he was getting at and it made me happy because:&lt;/p&gt;

&lt;p&gt;a) I take the aesthetics of my working environment very seriously (which was one of the precursors of me leaving windows), and was glad that someone else understands that an IDE should be beautiful,&lt;/p&gt;

&lt;p&gt;b) I'd clearly been so in love with netbeans that I had accepted her as &quot;having a nice personality&quot;&lt;/p&gt;

&lt;p&gt;It's true, when I first got netbeans I thought she was rather, how shall we say it...?.. plump, in the gui department. I remember the first couple of days trying to make a few changes here and there.. however, I fell so head over heals for her that I forgot all about this.&lt;/p&gt;

&lt;p&gt;Until now.&lt;/p&gt;

&lt;p&gt;Daniel called my gorgeous netbeans ugly, and while she's not the cocoa supermodel that textmate is, I thought that was a little unfair. So, having been familiar with the gui for some time, I decided to trim some of the gui clunk out. Here's what I came up with:
&lt;a href=&quot;http://www.lifeonrails.org/images/articles/netbeansbare.png&quot;&gt;
&lt;img title=&quot;bare gui&quot; src=&quot;/images/articles/netbeansbare_small.png&quot; alt=&quot;bare gui&quot; /&gt;
&lt;/a&gt;
&lt;a href=&quot;http://www.lifeonrails.org/images/articles/netbeansbare.png&quot;&gt;Click here for a bigger pic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's what I did...&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;I was googling about and came across &lt;a href=&quot;http://www.danielfischer.com/2007/08/29/netbeans-is-cool-for-rails-development-but-ugly-compared-to-textmate/&quot;&gt;this&lt;/a&gt; article by Daniel Fischer. I kind of understood what he was getting at and it made me happy because:&lt;/p&gt;

&lt;p&gt;a) I take the aesthetics of my working environment very seriously (which was one of the precursors of me leaving windows), and was glad that someone else understands that an IDE should be beautiful,&lt;/p&gt;

&lt;p&gt;b) I'd clearly been so in love with netbeans that I had accepted her as &quot;having a nice personality&quot;&lt;/p&gt;

&lt;p&gt;It's true, when I first got netbeans I thought she was rather, how shall we say it...?.. plump, in the gui department. I remember the first couple of days trying to make a few changes here and there.. however, I fell so head over heals for her that I forgot all about this.&lt;/p&gt;

&lt;p&gt;Until now.&lt;/p&gt;

&lt;p&gt;Daniel called my gorgeous netbeans ugly, and while she's not the cocoa supermodel that textmate is, I thought that was a little unfair. So, having been familiar with the gui for some time, I decided to trim some of the gui clunk out. Here's what I came up with:
&lt;a href=&quot;http://www.lifeonrails.org/images/articles/netbeansbare.png&quot;&gt;
&lt;img title=&quot;bare gui&quot; src=&quot;/images/articles/netbeansbare_small.png&quot; alt=&quot;bare gui&quot; /&gt;
&lt;/a&gt;
&lt;a href=&quot;http://www.lifeonrails.org/images/articles/netbeansbare.png&quot;&gt;Click here for a bigger pic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's what I did...&lt;/p&gt;
&lt;p&gt;I was googling about and came across &lt;a href=&quot;http://www.danielfischer.com/2007/08/29/netbeans-is-cool-for-rails-development-but-ugly-compared-to-textmate/&quot;&gt;this&lt;/a&gt; article by Daniel Fischer. I kind of understood what he was getting at and it made me happy because:&lt;/p&gt;

&lt;p&gt;a) I take the aesthetics of my working environment very seriously (which was one of the precursors of me leaving windows), and was glad that someone else understands that an IDE should be beautiful,&lt;/p&gt;

&lt;p&gt;b) I'd clearly been so in love with netbeans that I had accepted her as &quot;having a nice personality&quot;&lt;/p&gt;

&lt;p&gt;It's true, when I first got netbeans I thought she was rather, how shall we say it...?.. plump, in the gui department. I remember the first couple of days trying to make a few changes here and there.. however, I fell so head over heals for her that I forgot all about this.&lt;/p&gt;

&lt;p&gt;Until now.&lt;/p&gt;

&lt;p&gt;Daniel called my gorgeous netbeans ugly, and while she's not the cocoa supermodel that textmate is, I thought that was a little unfair. So, having been familiar with the gui for some time, I decided to trim some of the gui clunk out. Here's what I came up with:
&lt;a href=&quot;http://www.lifeonrails.org/images/articles/netbeansbare.png&quot;&gt;
&lt;img title=&quot;bare gui&quot; src=&quot;/images/articles/netbeansbare_small.png&quot; alt=&quot;bare gui&quot; /&gt;
&lt;/a&gt;
&lt;a href=&quot;http://www.lifeonrails.org/images/articles/netbeansbare.png&quot;&gt;Click here for a bigger pic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think this isn't a bad comparison to textmate, imho, and certainly a fairer comparison than Daniel has on his site. That's not a swipe by the way, if I remember right, I didn't quite grok the netbeans way when I was first using it and couldn't work out how to hide some of the toolbars (maybe it was a bug in earlier versions?) - in fact I commend Daniel, because in the image in his comparison, you can see he has turned some of the extra gui features off - if he was being a dick about it, he honestly could've made netbeans look worse than a couple of broads I've found myself with thanks to &quot;beer goggles&quot;.&lt;/p&gt;

&lt;p&gt;It got me thinking though, that perhaps some others might like to know that netbeans can have a very textmate like gui. Simply do this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the view menu and deselect pretty much everything (I keep line numbers and diff sidebar),&lt;/li&gt;
&lt;li&gt;Go to preferences click on fonts and colors and select &quot;city lights&quot; - note that this isn't quite the textmate colour scheme yet, and you also have to edit it  - for example I've noticed that my classes are Black on black - if you look in the large image you'lll see they're missing,&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note - you can also right mouse click on menu strips and get rid of them from the context menu.&lt;/p&gt;

&lt;p&gt;I also found that you can dock the project window, something you can't do in textmate, like this, which is arguably even nicer than textmate's drawer feature.&lt;/p&gt;

&lt;p&gt;Projects window is hidden,&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;bare gui&quot; src=&quot;/images/articles/netbeans_bare_hide.png&quot; alt=&quot;bare gui&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Click on it and it pops up&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;bare gui&quot; src=&quot;/images/articles/netbeans_bare_show.png&quot; alt=&quot;bare gui&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It dissapears again if you open a document or click elsewhere.&lt;/p&gt;

&lt;p&gt;I guess netbeans will never be as &quot;snappy&quot; as textmate - it zips around very quickly, but I also guess that textmate will always be a (superb) text editor and netbeans will be a fully fledged, extremely slick and well integrated ide. For those of us who love that textmate look, I guess all we're waiting for is for someone to port over the  colour scheme and for the netbeans dev team to let us know how we can share colour schemes with each other, to save any repeated work...&lt;/p&gt;

&lt;p&gt;So for now I've lost any trace of textmate eny I had: If we follow the chick analogy one last time we can say that Netbeans' personality is far superior to textmate's she's smart, on the ball and cultured - and now, thanks to Daniel's article, she's just as, if not better looking too!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-08-30:15</id>
    <published>2007-08-30T10:52:00Z</published>
    <updated>2007-08-30T11:24:22Z</updated>
    <category term="netbeans"/>
    <category term="ruby on rails"/>
    <category term="aptana"/>
    <category term="eclipse"/>
    <category term="flex builder"/>
    <category term="netbeans"/>
    <category term="radrails"/>
    <category term="ruby on rails"/>
    <link href="http://lifeonrails.org/2007/8/30/netbeans-the-best-ruby-on-rails-ide" rel="alternate" type="text/html"/>
    <title>Netbeans THE best ruby on rails IDE</title>
<summary type="html">&lt;p&gt;I use netbeans 6, milestone 10 (get it &lt;a href=&quot;http://www.netbeans.org/community/releases/60/&quot; title=&quot;get netbeans milestone 10&quot;&gt;here&lt;/a&gt; as my ruby on rails ide now. I'm a mac user, having moved from windows last year.&lt;/p&gt;

&lt;p&gt;I was gonna write a blow for blow comparison of netbeans against radrails, but I really see no point. I figured it's best just to tell you why netbeans' rails support is so creamingly good, but so you know I have evaluated both and textmate, firstly - here's some points about the other 2...&lt;/p&gt;

&lt;p&gt;Here's some groovy ruby code completion to wet your appetite. Click more to read the rest of the article:&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/6.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;I use netbeans 6, milestone 10 (get it &lt;a href=&quot;http://www.netbeans.org/community/releases/60/&quot; title=&quot;get netbeans milestone 10&quot;&gt;here&lt;/a&gt; as my ruby on rails ide now. I'm a mac user, having moved from windows last year.&lt;/p&gt;

&lt;p&gt;I was gonna write a blow for blow comparison of netbeans against radrails, but I really see no point. I figured it's best just to tell you why netbeans' rails support is so creamingly good, but so you know I have evaluated both and textmate, firstly - here's some points about the other 2...&lt;/p&gt;

&lt;p&gt;Here's some groovy ruby code completion to wet your appetite. Click more to read the rest of the article:&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/6.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I use netbeans 6, milestone 10 (get it &lt;a href=&quot;http://www.netbeans.org/community/releases/60/&quot; title=&quot;get netbeans milestone 10&quot;&gt;here&lt;/a&gt;) as my ruby on rails ide now. I'm a mac user, having moved from windows last year.&lt;/p&gt;

&lt;p&gt;I was gonna write a blow for blow comparison of netbeans against radrails, but I really see no point. I figured it's best just to tell you why netbeans' rails support is so creamingly good, but so you know I have evaluated both and 
textmate, firstly - here's some points about the other 2.&lt;/p&gt;

&lt;h1&gt;Text Mate&lt;/h1&gt;

&lt;p&gt;First up, as a general text editor I love textmate, it's truly fab - and it's NOT an IDE.. which is my number 1 reason for not using it for RoR: I was new to rails so needed an IDE that had some code completion, or just some documentation support, which textmate doesn't support. Also I found that to get it working in a way I liked took ages - on top of that the following annoyances really pissed me off:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The indent key not being tab (it's square bracket), &lt;/li&gt;
&lt;li&gt;The project window (drawer) disappearing from time to time, &lt;/li&gt;
&lt;li&gt;Dragging more folders into a project is like playing an 8-bit platform game: you have to be pixel perfect,&lt;/li&gt;
&lt;li&gt;The find really means find (as in you can't see where the search results are, you literally have to scan the page to find what textmate has found - and it never seems to wrap searches for me).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But as I said, textmate still rocks, but it wasn't floating my ruby boat.&lt;/p&gt;

&lt;h1&gt;Eclipse&lt;/h1&gt;

&lt;blockquote&gt;
    &lt;p&gt;&quot;It ain't no use in calling out my name, Gal&lt;/p&gt;
    
    &lt;p&gt;Like you never done before&lt;/p&gt;
    
    &lt;p&gt;And it ain't no use in calling out my name, Girl&lt;/p&gt;
    
    &lt;p&gt;I can't hear you any more&lt;/p&gt;
    
    &lt;p&gt;I'm a thinking and a wond'ring all the way down the road&lt;/p&gt;
    
    &lt;p&gt;I once loved a woman, a child, I'm told&lt;/p&gt;
    
    &lt;p&gt;I gave her my heart, but she wanted my soul&lt;/p&gt;
    
    &lt;p&gt;But don't think twice, it's all right&quot;&lt;/p&gt;
    
    &lt;p&gt;Bob Dylan - &quot;Don't think twice, it's all right&quot;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Okay perhaps a bit too dramatic, but really - when I first found eclipse, I was in love. I was using power flasher from FDT, which was THE best actionscript editor of all time imho. Eclipse was an utter revelation for me. I would sing it's praises (I mean metaphorically, not like Bob Dylan) to my friends and colleagues, even my clients.&lt;/p&gt;

&lt;p&gt;When Flex builder came out I was similarly marvelled by its' ease of use for editing as3 and mxml (especially the layout gui) - but like the matrix, my eyes had never really learned to see. You see, I'd only recently moved from windows to mac - and was starting to shed the weight of windows with its' dialogue boxes, bugs, qwerks, awkward behaviours, work-arounds and was starting to find out what computing was really meant to be like.&lt;/p&gt;

&lt;p&gt;I'd been singing my &quot;eclipse rocks&quot; song on #flex and arguing it's pro's and  cons with some visual studio lovers there. I found I didn't have the will to defend it anymore: I was starting to fall out with eclipse very rapidly. Here are some reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subversion support is cacka.. Honestly, it sucks balls,&lt;/li&gt;
&lt;li&gt;Find and replace dialogue is like punishment - it's just dumb and clunky,&lt;/li&gt;
&lt;li&gt;Context sensitive menu items are never what I want,&lt;/li&gt;
&lt;li&gt;Setting up a project is like being told off by your nan. Honestly, it's always &quot;You can't put a project here&quot;, &quot;There is an existing project somewhere near this folder, I can smell it&quot;, &quot;I am going to waste 20 minutes of your time MWAHAHAH&quot;. Okay, I might be exaggerating the error messages - but anyone who knows the pain will understand what I mean.&lt;/li&gt;
&lt;li&gt;In fact, that last point is the reason I put the Bob Dylan song reference - Eclipse feels like the girlfriend (or boyfriend) who just wants too much.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On top of that rails support in eclipse is only available via RadRails.
RadRails seems to be the back burner project for Aptana these days - very little has been achieved with radrails this year (I'm saying this in comparison to netbeans). No offence to radrails: what they achieved at the time was truly incredible especially with just 2 coders doing it for love.&lt;/p&gt;

&lt;p&gt;However, for me at least, radrails has the following problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code completion is abysmal, and really, if I'm not going to get that feature, why use eclipse (100+mb of ram) instead of textmate?&lt;/li&gt;
&lt;li&gt;In line documentation isn't too good,&lt;/li&gt;
&lt;li&gt;Not a very nice workflow for me - feels, dare I say it, too much like eclipse,&lt;/li&gt;
&lt;li&gt;It's in eclipse - which means all the pain in the arse problems of eclipse, with the limitations of radrails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm sure radrails can be truly great with some time, but it seems like all that time is spent on implementing php support for aptana (which incidentally is very very good, and if it wasn't in eclipse, and had better rails support, I would use).&lt;/p&gt;

&lt;h1&gt;Enough whining, I thought this article was about netbeans!&lt;/h1&gt;

&lt;p&gt;Okay, so that's my little whinge done - I was sick of radrails, and I needed more than textmate could give me - I needed an ide that helped me to learn ruby on rails, not that helped me to learn the ide. I wasn't a rails guru, all the textmate shortcuts in the world weren't going to help me. I looked about and by chance came across an article that said that ruby on rails support was being added to netbeans 6.
I hunted around like a crack addict and found the nightly builds to try out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I was extremely impressed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Netbeans is fucking fab, it proper rocks. I've been on netbeans 6 since milestone 8, which is about 1,000 builds now (they're constantly working on it, and updating it). I've been with it through broken indentation, broken code completion, broken everything, null pointers, new features, more efficiency, the memory leak sorted out. I've watched it evolve before my eyes: I was installing new builds twice a day - Now it's so stable and so good that I haven't updated my build in a month (I might later on ;-).&lt;/p&gt;

&lt;h1&gt;I thought netbeans was only for Java, and the name sucks balls!&lt;/h1&gt;

&lt;p&gt;I agree on both of these points. I too thought it was only for Java, and I HATE the name. Truly - I once upon a time, had to work with beans in weblogic, and the name reminds me of that. I always thought it was a sucky name for Java objects, and I think it's worse for an IDE.&lt;/p&gt;

&lt;p&gt;However rest assured, I know, I know - you think it's just for Java, even now months on I find myself wanting to banish it to hell, because it must be from the devil itself, because netbeans is just for Java... but after some time, I'm sure I'll come to accept that the program I edit my rails in every day, really, truly, is netbeans.&lt;/p&gt;

&lt;h1&gt;Doesn't it use like, 1 gajillion uberbytes of ram?&lt;/h1&gt;

&lt;p&gt;No, though it isn't a text editor, and has a lot of functionality, so it does use a fair amount of ram. The whole IDE is easily comparable to eclipse for ram use, BUT: You an get a standalone version of the ide, which only has the ruby support. I believe you can get it &lt;a href=&quot;http://deadlock.netbeans.org/hudson/job/ruby/&quot; title=&quot;netbeans downloads&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've got an imac with 3gb of ram, so I've got netbeans with the full monty, all my c++, java, and ruby plugins, so despite the fact it uses as much ram as a small os (about 250mb) I don't even notice.&lt;/p&gt;

&lt;p&gt;When I only had 2gb, I was perfectly comfortable with the standalone version, which would use between 80mb and 120mb).&lt;/p&gt;

&lt;h1&gt;So why is netbeans so good?&lt;/h1&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Code completion that works - really really works:&lt;/h2&gt;

&lt;h4&gt;Code completion is activated with CTRL + SPACE - once activated you can type, or select from the list:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/1.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;The code completion knows a lot of the rails framework already:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/2.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Like this...&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/3.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And this...&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/4.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Upon selecting the item you're looking for it also puts place holders in for completion, so you can tab through to enter arguments:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/5.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;It works on your own classes too, check this out - NO OTHER RAILS IDE can do this, to my knowledge:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/6.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;I like the way it groups all the attributes up by the object too - also, it doesn't just work for my models, it works also for my other classes, look at this IPAdress from my Infrid module, netbeans knows about that too:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/8.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;The best subversion integration I have ever seen in an IDE:&lt;/h2&gt;

&lt;h4&gt;You can easily track the status of your files - from here I can clearly see that database.yml is updated while edit.rhtml is new:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of svn integration&quot; src=&quot;/images/netbeans/13.png&quot; alt=&quot;Image of svn integration&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;The subversion context menu gives you everything you need.&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of svn integration&quot; src=&quot;/images/netbeans/14.png&quot; alt=&quot;Image of svn integration&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Here's what happened when I clicked &quot;show changes&quot; on my vcRails project&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of svn integration&quot; src=&quot;/images/netbeans/54.png&quot; alt=&quot;Image of svn integration&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And from here you can select to commit, update, do diffs, etc&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of svn integration&quot; src=&quot;/images/netbeans/55.png&quot; alt=&quot;Image of svn integration&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;You can search the history for any files (might be hard to see, but you can search by message, user, date)&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of svn integration&quot; src=&quot;/images/netbeans/15.png&quot; alt=&quot;Image of svn integration&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And here are what the diffs look like in the files themselves:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of svn integration&quot; src=&quot;/images/netbeans/51.png&quot; alt=&quot;Image of svn integration&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;In line documentation when you need it, where you need it:&lt;/h2&gt;

&lt;h4&gt;Just press CTRL+SPACE on a keyword and you get the docs.&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of inline documents&quot; src=&quot;/images/netbeans/16.png&quot; alt=&quot;Image of inline documents&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Even picks out the documentation from your own methods&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code completion&quot; src=&quot;/images/netbeans/7.png&quot; alt=&quot;Image of code completion&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Purdy colours:&lt;/h2&gt;

&lt;h4&gt;I like the default colours of netbeans very much -here's what one of my models looks like:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/20.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And here's an rhtml file:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/18.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And here's an rjs file:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/17.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And here's a yaml file:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/19.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Code navigator&lt;/h2&gt;

&lt;h4&gt;This useful little window tells you the anatomy of the file your viewing, double click to go straight to a method:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code navigator&quot; src=&quot;/images/netbeans/22.png&quot; alt=&quot;Image of code navigator&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Useful highlighting:&lt;/h2&gt;

&lt;h4&gt;I swear these guys have read design documents or suchlike, it's so useable, look at this - I click on if:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/23.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Click on end, or move the caret over it with the cursor keys:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/24.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Click on rescue, or move the caret over it with the cursor keys:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/25.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Same for a bracket:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/26.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Also note the grey squiggly line under the variable - this is netbeans telling me that I never use that variable - oops! Glad I wrote this post!. :)&lt;/p&gt;

&lt;h4&gt;A variable, or keyword:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax highlighting&quot; src=&quot;/images/netbeans/21.png&quot; alt=&quot;Image of syntax highlighting&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;code folding:&lt;/h2&gt;

&lt;h4&gt;You use the + and - buttons to fold code&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code folding&quot; src=&quot;/images/netbeans/53.png&quot; alt=&quot;Image of code folding&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And unfold it&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of code folding&quot; src=&quot;/images/netbeans/52.png&quot; alt=&quot;Image of code folding&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;useful aids:&lt;/h2&gt;

&lt;p&gt;I wont show screen shots for these, just take my word for it&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Typing a bracket, or a quote, or square bracket will give you a matching bracket.&lt;/li&gt;
&lt;li&gt;Highlighting text, then pressing ( or &quot; or [ will wrap it in the appropriate symbol.&lt;/li&gt;
&lt;li&gt;Unlike other text editors (both eclipse and textmate) deleting an auto inserted character isn't a pain the bum. E.g. if I type '(' and it automatically inserts ')', upon changing my mind and deleting the '(' it will also delete the ')'&lt;/li&gt;
&lt;li&gt;Really smart tab indenting - trust me, it really smartly indents the tabs. IT does some great stuff with tab indentation - also you can indent blocks using tab or shift and tab.. you just select a bit of your code..&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img title=&quot;Image of indenting&quot; src=&quot;/images/netbeans/27.png&quot; alt=&quot;Image of indenting&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Press tab (note that the first line wasn't totally selected, so you can indent a line by only select a few chars - mint!&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of indenting&quot; src=&quot;/images/netbeans/28.png&quot; alt=&quot;Image of indenting&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And you can tab back with shift and tab. Also note that the entire thing gets flattened.. With each subsequent press of shift tab, it will flatten another level - this is one of my fave features as I can easily re-factor blocks of code and then get them indented super quick in a doddle. (I hate it when editors will stop me from flattening my code using the indent feature)&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Image of indenting&quot; src=&quot;/images/netbeans/29.png&quot; alt=&quot;Image of indenting&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;A syntax error in my rhtml:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax error&quot; src=&quot;/images/netbeans/30.png&quot; alt=&quot;Image of syntax error&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Log output, complete with hyperlinks for errors&lt;/h2&gt;

&lt;p&gt;I love the log output window - it shows you the results of rakes, svn submits, and best of all log output from your running mongrel (which you can run from in netbeans by clicking the play icon).&lt;/p&gt;

&lt;h4&gt;Here you can see the output of my running mongrel. It automatically turns stack traces into hyperlinks.. Click on them and you go straight to the line.&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of syntax error&quot; src=&quot;/images/netbeans/31.png&quot; alt=&quot;Image of syntax error&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Jump straight to definitions&lt;/h2&gt;

&lt;p&gt;Holding down the apple key (CTRL on windows?) and mousing over a keyword, method, attribute or object will highlight any that netbeans can identify (which is most). If you then click on that definition, it will go straight to the code for it.
I would show you a pick of this, but I've done so many!! I'm sure you get the idea.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Top class database integration, built straight in&lt;/h2&gt;

&lt;h4&gt;It's easy to get set up with a sql database and perform selects, updates, create tables, etc, all in netbeans&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of sql editor&quot; src=&quot;/images/netbeans/32.png&quot; alt=&quot;Image of sql editor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;First class debugging&lt;/h2&gt;

&lt;h4&gt;Of course you can debug nicely with drb, but netbeans really goes much much further. It's actually close to what I was used to in visual studio. It really is fully integrated.&lt;/h4&gt;

&lt;h4&gt;You can set breakpoints in your code from the ide:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/44.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And then run your rails app by selecting debug from the menu, or clicking the relevant icon.&lt;/h4&gt;

&lt;p&gt;As you'd expect: code execution stops when you hit the breakpoint, but back in netbeans the party is just starting:&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/45.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;View all environment variables - you can see their types, and contents, and expand hashes and arrays too !&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/46.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Set watches:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/48.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;View the entire calls stack - double clicking will take you to appropriate file at the right place.&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/47.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Step through the code:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/49.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And here we can see I've advanced a couple of lines: (I pressed F8) - note the watch I had set up, I can see the user that got returned by the code, and his attributes:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/50.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;You can even mouse over objects and variables when in breakpoint mode and the ide will pop up the values (my mouse is over request.remote_ip):&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/58.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And look at the user.email variable (my mouse is over that too)&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/57.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;I didn't realise, but I can actually change the variable in realtime, and it shows me the current value (I changed email to id).&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of debugging&quot; src=&quot;/images/netbeans/56.png&quot; alt=&quot;Image of debugging&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;I don't think it gets much better than that!&lt;/h4&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Full support of rake and script tasks&lt;/h2&gt;

&lt;h4&gt;You can run rake and script tasks such as server, console and generate straight from the project tree:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of rake tasks&quot; src=&quot;/images/netbeans/33.png&quot; alt=&quot;Image of tasks&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Rake tasks:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of rake tasks&quot; src=&quot;/images/netbeans/34.png&quot; alt=&quot;Image of tasks&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Generations:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of rake tasks&quot; src=&quot;/images/netbeans/36.png&quot; alt=&quot;Image of tasks&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Manage your gems, right from the ide&lt;/h2&gt;

&lt;p&gt;Note, I'm not suggesting that all this GUI loveliness is easier, or better than using the command line - I'm a hopeless keyboard junky, and my mouse is just an interruption to the conversation I have with my keyboard- however, sometimes I've got loads going on, and I just can't be arsed to open another terminal window for one command (sacrilege?) - in these cases, like generating a new migration, or checking what gems I have installed, it's convenient&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Image of rake tasks&quot; src=&quot;/images/netbeans/36.png&quot; alt=&quot;Image of tasks&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Execute database migrations from the ide&lt;/h2&gt;

&lt;p&gt;This is really handy:&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Image of rake tasks&quot; src=&quot;/images/netbeans/35.png&quot; alt=&quot;Image of tasks&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Execute all of your tests inside netbeans!&lt;/h2&gt;

&lt;p&gt;I'm not even going to get started on this.. perhaps a future blog post!&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;(imho) Best search, find, replace of any ide, I've ever used&lt;/h2&gt;

&lt;p&gt;I cannot begin to tell you how much I love search and replace in netbeans:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Supports regular expressions,&lt;/li&gt;
&lt;li&gt;Searches whole file, and forward and back, and with wrap,&lt;/li&gt;
&lt;li&gt;Can search a whole project, or across multiple projects,&lt;/li&gt;
&lt;li&gt;Results are clear and easy to read,&lt;/li&gt;
&lt;li&gt;It highlights ALL matches so you can find them easily,&lt;/li&gt;
&lt;li&gt;Highlights as you type:&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Here I am looking for the letters &quot;us&quot;. I've not pressed return yet, it highlights as I type :-)&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of search&quot; src=&quot;/images/netbeans/38.png&quot; alt=&quot;Image of search&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Now &quot;user_&quot;&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of search&quot; src=&quot;/images/netbeans/39.png&quot; alt=&quot;Image of search&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Now &quot;user_id&quot;&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of search&quot; src=&quot;/images/netbeans/40.png&quot; alt=&quot;Image of search&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And as I said, you can search across a project, when you do you get this results window, which unlike eclipse, puts the FORWARD and BACK arrows, next to the results, not on some totally random part of the page, meaning a lot of useless mouse travel. It's like netbeans got someone to do a report on all the cack features of eclipse, and started from there...&lt;/p&gt;

&lt;h4&gt;The search dialogue:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of search&quot; src=&quot;/images/netbeans/40.png&quot; alt=&quot;Image of search&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And the results:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of search&quot; src=&quot;/images/netbeans/42.png&quot; alt=&quot;Image of search&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I've put so many pics in here, just take my word for it that it highlights the search matches in the document.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Macros&lt;/h2&gt;

&lt;p&gt;These are a great feature - you can record all sorts of behaviours, including search and replace with regexs, and bundle them up in a macro which can be repeated over and over again.&lt;/p&gt;

&lt;p&gt;I found this really useful when dealing with a load of csv text that needed putting into sql and would've been quite a pain to do in ruby, but with the macros was really easy. I'm sure this would have lots of other uses too.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Code templates&lt;/h2&gt;

&lt;p&gt;These are great! It's like in textmate where you type a couple of characters and press tab.. E.g. If I'm in an rhtml file and type r and press TAB I get:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&amp;lt;% %&gt; 
    with my cursor flashing away in the middle of it, so I can start typing straight away:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;re and TAB:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&amp;lt;%= %&gt;
    Again with my cursor in the right place
    table and TAB&lt;/p&gt;
    
    &lt;table&gt;
       &lt;tr&gt;
          &lt;td&gt;   
           &lt;/td&gt;    
       &lt;/tr&gt;    
    &lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;They're great, and you can configure your own so easily, and if you follow conventions, the default values are very useful - you can of course change them, just by tabbing to each one. A very powerful, and useful feature that saves a lot of time.&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Image of templates&quot; src=&quot;/images/netbeans/43.png&quot; alt=&quot;Image of templates&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Easy to configure&lt;/h2&gt;

&lt;p&gt;I wont go showing you pics here, because it will take me aeons but you can configure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;keyboard shortcuts,&lt;/li&gt;
&lt;li&gt;tips,&lt;/li&gt;
&lt;li&gt;which ruby installation to use,&lt;/li&gt;
&lt;li&gt;colours,&lt;/li&gt;
&lt;li&gt;indentation,&lt;/li&gt;
&lt;li&gt;code templates,&lt;/li&gt;
&lt;li&gt;which tool  tips to use,&lt;/li&gt;
&lt;li&gt;just about anything you want - really easily and logically.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Jump straight to any file:&lt;/h2&gt;

&lt;h4&gt;I forgot this, it's my favourite feature probably: On a mac, I press CTRL + SHIFT  + O and I get this box:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image goto file&quot; src=&quot;/images/netbeans/9.png&quot; alt=&quot;Image of goto file&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;I start typing the name of a file:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of goto file&quot; src=&quot;/images/netbeans/10.png&quot; alt=&quot;Image of goto file&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Here's another example:&lt;/h4&gt;

&lt;p&gt;&lt;img title=&quot;Image of goto file&quot; src=&quot;/images/netbeans/11.png&quot; alt=&quot;Image of goto file&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once you find your match, just press return and it opens the file.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Friendly tab switching:&lt;/h2&gt;

&lt;p&gt;On a mac, I press CTRL + TAB, and I get this dialogue, I can tab back and forth between 2 tabs (as in open documents), or I can keep my finger on CTRL and keep pressing CTRL, or SHIFT and tab to cycle to the document I need.&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Image of tab switching&quot; src=&quot;/images/netbeans/12.png&quot; alt=&quot;Image of tab switching&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;Friendly shortcut keys to get to access different parts of the ide&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pressing APPLE 0 focuses on the code window,&lt;/li&gt;
&lt;li&gt;Pressing APPLE 1 shows/hides the project window, &lt;/li&gt;
&lt;li&gt;Pressing APPLE 2 shows/hides the files window, &lt;/li&gt;
&lt;li&gt;Pressing APPLE 4 shows/hides the output window, &lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;This is really useful and makes a lot of workflow's possible.&lt;/h4&gt;

&lt;p&gt;I like to have my public folder, config and my db migrations open in the files view, and the ruby-centric files, like rjs, rhtml and rb stuff in my project folder, I can then apple 1 and 2 between them.&lt;/p&gt;

&lt;p&gt;I also use apple 4 like it's going out of style.. I can clear the window easily with APPLE and L then click around on my app in a web browser, come back to netbeans, press APPLE 4, and view the log - clicking on any errors takes me straight to the code.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h2&gt;It's stable:&lt;/h2&gt;

&lt;p&gt;I've been through many versions of netbeans now -it's still in beta, and some of them have had me banging my head. However, it's solid now. You get the odd null pointer exception, but it wont fall over, and you wont lose work. I probably get some kind of anomaly like that once every few days - it's not crashed on me in over a month of every day use.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/p&gt;

&lt;h1&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;I know I sounded like a whiney bitch earlier, but the truth is I don't know of any other ide that has the feature set of netbeans when it comes to ruby on rails support. And even when one of its' competitors has similar features, you can just guarantee that netbeans absolutely wipes the floor with it, in terms of implementation and ease of use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is no better rails ide, imho&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I can't say about text editors though, but really, if you're just after an editor, well why the hell did you read this article? ;-) Get yourself textmate or a windows/linux equivalent (in fact, ditch windows and get textmate on mac, or a linux equivalent).&lt;/p&gt;

&lt;p&gt;I could write this much about netbeans' great features over again, btw - this isn't an exhaustive appraisal - it's just it's bank holiday, and I got some other geeky fun I need to go have. &lt;/p&gt;

&lt;p&gt;This is probably far too long an article, maybe I'll split it up - I don't expect anyone to use it as a reference, I just wanted to shout out about netbeans and all the hard work they've been putting in over there, especially Tor Norbye who's been doing such an excellent job - he's actually made an engine which may see netbeans supporting even more duck-typed languages in the future. &lt;/p&gt;

&lt;p&gt;If you read this far, then thanks for reading. However, please, if you wanna be rude or a fanboy, go do it on digg - if on the other hand, you've got any constructive criticism, or any views on the whole netbeans and radrails debate, leave a comment.&lt;/p&gt;

&lt;p&gt;However, I think you should just download it for yourself - if you want a ruby ide, I don't think you can do better - and the I'm just gutted that I can't edit actionscript in netbeans, because if I could I would.&lt;/p&gt;

&lt;p&gt;Though - BE WARNED! After using netbeans 6, you will most likely not want to go back to eclipse and especially radrails.&lt;/p&gt;

&lt;p&gt;You can get Netneans &lt;a href=&quot;http://www.netbeans.org/community/releases/60/&quot; title=&quot;get netbeans milestone 10&quot;&gt;here:&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The wiki, and lots of useful information is &lt;a href=&quot;http://wiki.netbeans.info/wiki/view/Ruby&quot; title=&quot;netbeans wiki&quot;&gt;here:&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-08-28:24</id>
    <published>2007-08-28T18:08:00Z</published>
    <updated>2007-08-31T12:26:56Z</updated>
    <category term="os x"/>
    <category term="tips"/>
    <category term="finder"/>
    <category term="os x"/>
    <link href="http://lifeonrails.org/2007/8/28/create-new-file-from-context-menu-in-finder" rel="alternate" type="text/html"/>
    <title>Create new file from context menu in finder</title>
<content type="html">
            &lt;p&gt;I often take this for granted, but then friends happen to see me do this and always ask me how it works...&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Adding a file from the finder context menu&quot; src=&quot;/images/articles/context_menu_new_file.png&quot; alt=&quot;Adding a file from the finder context menu&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It's something I missed on os x after years of windows - the ability to create a new document just by clicking the right mouse button.  Thankfall Nufile is a context menu plugin which exists for this purpose, it's donate-ware and can be downloaded &lt;a href=&quot;http://growlichat.com/NuFile.php&quot; title=&quot;Nufile&quot;&gt;here:&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I've used it for almost a year without problems. You can customize it to add whatever file types you like, and even provide templates. The help on the website is really thorough, so I suggest you check that out.&lt;/p&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-08-28:23</id>
    <published>2007-08-28T17:56:00Z</published>
    <updated>2007-08-31T12:27:13Z</updated>
    <category term="os x"/>
    <category term="tips"/>
    <category term="finder"/>
    <category term="os x"/>
    <link href="http://lifeonrails.org/2007/8/28/finder-cut-and-paste" rel="alternate" type="text/html"/>
    <title>Finder cut and paste</title>
<content type="html">
            Having come from windows, I was looking everywhere for this!

Fortunately, some dude called Illari Scheinin wrote a couple of apple scripts that do the job. A link to his website and these scripts is [here](http://ilari.scheinin.fidisk.fi/findercutandpaste/ 'get the scripts')

He points out some apps you can use to run these scripts, they may be good or not, I don't know because I use the excellent [Quicksilver](http://quicksilver.blacktree.com/ 'quicksilver'). If you don't know about quicksilver, well go download it!

I'll blog about it more in the future, but needless to say you can store both of these scripts in a suitable folder somewhere, which quicksilver is scanning. I have a folder specifically for apple scripts which I've set quicksilver to scan. It's simply a case of dump these 2 script files in that folder, make sure quicksilver is scanning it, then set up a trigger for cut files.scpt (I did it with CTRL + APPL + X) and one for paste files.scpt (I chose CTRL + APPL + V). You can now select one or more files/folders in finder, and use cut and paste!

HOORAY! and thanks Illari!
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-08-26:14</id>
    <published>2007-08-26T21:49:00Z</published>
    <updated>2007-08-27T23:04:34Z</updated>
    <category term="javascript"/>
    <category term="ruby on rails"/>
    <category term="helper methods"/>
    <category term="javascript"/>
    <category term="rjs"/>
    <link href="http://lifeonrails.org/2007/8/26/not-writing-the-same-js-over-and-over-again" rel="alternate" type="text/html"/>
    <title>Not writing the same js over and over again</title>
<content type="html">
            &lt;p&gt;I was doing a bunch of rjs stuff in rails, and lots of ajax goodness, and found myself constantly showing, and hiding the spinner and the update element (like a submit button, or other button)..&lt;/p&gt;

&lt;p&gt;I'm a bit of a minimalist where possible and like to get rid of as much code as I can, and being as DRY as I can, and so I decided to make the following function:&lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; updating_field(field_name, finished) {&lt;/li&gt;&lt;li&gt;  &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; (finished) {&lt;/li&gt;&lt;li&gt;    $(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;spinner&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;).hide();&lt;/li&gt;&lt;li&gt;    $(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;update_&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; + field_name).show();&lt;/li&gt;&lt;li&gt;  } &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt; {&lt;/li&gt;&lt;li&gt;    $(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;spinner&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;).show();&lt;/li&gt;&lt;li&gt;    $(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;update_&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; + field_name).hide();&lt;/li&gt;&lt;li&gt;  }&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;I simply call this method from the onclick method, or sumbit method of elements on the page and it tidies up my code considerably. &lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;type&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;value&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Save these changes&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;update_avatars2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;onclick&lt;/span&gt; = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;updating_avatars(false);&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;I can then call this code over and over again... In fact, I do, and I have many other helpers similar to this - which I'll explore in other blog posts.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-08-26:13</id>
    <published>2007-08-26T21:43:00Z</published>
    <updated>2007-08-27T22:47:59Z</updated>
    <category term="java"/>
    <category term="ruby"/>
    <category term="java"/>
    <category term="ruby"/>
    <link href="http://lifeonrails.org/2007/8/26/ruby-is-java-is" rel="alternate" type="text/html"/>
    <title>Ruby is... Java is...</title>
<content type="html">
            &lt;p&gt;I don't want to be a hater, but I've been doing Java recently, quite intensively, after doing a bunch of rails. Well, the other day I was on irc, talking to someone about my experiences, and this kinda fell out, and I like it, so here it is:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;ruby is like, how shall I put it..? It reminds me of being in Cornwnall or a Spanish city&lt;/p&gt;
    
    &lt;p&gt;Java reminds me of being in London&lt;/p&gt;
    
    &lt;p&gt;...in the square mile&lt;/p&gt;
    
    &lt;p&gt;....at rush hour&lt;/p&gt;
&lt;/blockquote&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-08-26:12</id>
    <published>2007-08-26T21:32:00Z</published>
    <updated>2007-08-27T23:00:57Z</updated>
    <category term="ruby on rails"/>
    <category term="ruby on rails"/>
    <category term="script/console"/>
    <link href="http://lifeonrails.org/2007/8/26/script-console" rel="alternate" type="text/html"/>
    <title>Script console.</title>
<content type="html">
            &lt;p&gt;When I was first learning rails I found one thing which helped immensely: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;script/console&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's the bees knees.. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when you're starting out it's like a safe ruby boxing ring where you can spar without getting your butt whooped,&lt;/li&gt;
&lt;li&gt;as you get a bit better you can practise new moves, and get some essential dojo in,&lt;/li&gt;
&lt;li&gt;once you know your stuff you  can try out some severely funky moves without having to refresh the browser every few seconds,&lt;/li&gt;
&lt;li&gt;you can always nip into console and get your db sorted, check on db state, sessions, tidy some things up, interrogate your models and find faults, and perfect new bits of code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I do all my practising, and probably a fair bit of debugging in script/console - if I'm ever doing anything new, or have a new idea it's the first place I go.&lt;/p&gt;

&lt;p&gt;If something's gone screwy with my app, it's the first place I go, and when I was starting out - it was ALWAYS open on my desktop.&lt;/p&gt;

&lt;p&gt;I've written this up because I was just on irc, and for the umpteemth time spreading the word about script/console. Really, go discipline yourself.. Amy Hoy said it far better than this over on slash 7, go check it out:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://slash7.com/articles/2006/12/21/secrets-of-the-rails-console-ninjas&quot; title=&quot;http://slash7.com/articles/2006/12/21/secrets-of-the-rails-console-ninjas&quot;&gt;http://slash7.com/articles/2006/12/21/secrets-of-the-rails-console-ninjas&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://lifeonrails.org/">
    <author>
      <name>georgejcook</name>
    </author>
    <id>tag:lifeonrails.org,2007-08-26:11</id>
    <published>2007-08-26T20:51:00Z</published>
    <updated>2007-08-28T02:04:15Z</updated>
    <category term="ruby"/>
    <category term="ruby on rails"/>
    <category term="mixin,comparable,ip address"/>
    <category term="non-drb-drb"/>
    <link href="http://lifeonrails.org/2007/8/26/blocking-ip-addresses-in-rails" rel="alternate" type="text/html"/>
    <title>Blocking IP addresses in rails</title>
<summary type="html">&lt;p&gt;I've been moving &lt;a href=&quot;http://www.visualchat.co.uk&quot; title=&quot;visual chat&quot;&gt;visualchat.co.uk&lt;/a&gt; to ruby on rails recently and one of the things they have to do is block certain ip addresses, in fact, entire ranges of ip addresses, as they get a lot of naughty mischievous chilldren (read as fucktards) creating havoc.&lt;/p&gt;

&lt;p&gt;I tinkered about a bit and then asked on #ruby-lang where one &lt;a href=&quot;http://www.rubypal.com&quot; title=&quot;David black&quot;&gt;David Black&lt;/a&gt; answered the call. The code he gave me is my favourite bit of ruby code ever. I think his solution is so very nice it's unbelievable.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;I've been moving &lt;a href=&quot;http://www.visualchat.co.uk&quot; title=&quot;visual chat&quot;&gt;visualchat.co.uk&lt;/a&gt; to ruby on rails recently and one of the things they have to do is block certain ip addresses, in fact, entire ranges of ip addresses, as they get a lot of naughty mischievous chilldren (read as fucktards) creating havoc.&lt;/p&gt;

&lt;p&gt;I tinkered about a bit and then asked on #ruby-lang where one &lt;a href=&quot;http://www.rubypal.com&quot; title=&quot;David black&quot;&gt;David Black&lt;/a&gt; answered the call. The code he gave me is my favourite bit of ruby code ever. I think his solution is so very nice it's unbelievable.&lt;/p&gt;
&lt;p&gt;I've been moving &lt;a href=&quot;http://www.visualchat.co.uk&quot; title=&quot;visual chat&quot;&gt;visualchat.co.uk&lt;/a&gt; to ruby on rails recently and one of the things they have to do is block certain ip addresses, in fact, entire ranges of ip addresses, as they get a lot of naughty mischievous chilldren (read as fucktards) creating havoc.&lt;/p&gt;

&lt;p&gt;I tinkered about a bit and then asked on #ruby-lang where one &lt;a href=&quot;http://www.rubypal.com&quot; title=&quot;David black&quot;&gt;David Black&lt;/a&gt; answered the call. The code he gave me is my favourite bit of ruby code ever. I think his method of comparing ip addresses is so very nice it's unbelievable.&lt;/p&gt;

&lt;p&gt;He told me to create an ip address class, which includes the comparable mixin (see &lt;a href=&quot;http://www.ruby-doc.org/core/classes/Comparable.html&quot; title=&quot;click here for info on comparbale&quot;&gt;here&lt;/a&gt; for more info).&lt;/p&gt;

&lt;p&gt;Like this:&lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Infrid&lt;/span&gt;&lt;/li&gt;&lt;li&gt;  &lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;IPAddress&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    include &lt;span class=&quot;co&quot;&gt;Comparable&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;initialize&lt;/span&gt;(address)&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;iv&quot;&gt;@address&lt;/span&gt; = address&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;split&lt;/span&gt;&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;iv&quot;&gt;@address&lt;/span&gt;.split(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;).map {|s| s.to_i }&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;&amp;lt;=&amp;gt;&lt;/span&gt;(other)&lt;/li&gt;&lt;li&gt;      split &amp;lt;=&amp;gt; other.split&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    &lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;to_s&lt;/span&gt;&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;iv&quot;&gt;@address&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;Note that I put this code in my own Infrid module which I store in lib/Infrid of my rails app.&lt;/p&gt;

&lt;p&gt;Now you can create ip address objects, and do code like this.&lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;ip_address_a = &lt;span class=&quot;co&quot;&gt;IPAddress&lt;/span&gt;.new(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;127.0.0.1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;ip_address_b = &lt;span class=&quot;co&quot;&gt;IPAddress&lt;/span&gt;.new(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;126.0.0.1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;ip_address_c = &lt;span class=&quot;co&quot;&gt;IPAddress&lt;/span&gt;.new(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;127.4.34.3&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;ip_address_a &amp;lt; ip_address_b&lt;/li&gt;&lt;li&gt;&amp;gt;&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;&lt;/li&gt;&lt;li&gt;ip_address_a &amp;gt; ip_address_c&lt;/li&gt;&lt;li&gt;&amp;gt;&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;&lt;/li&gt;&lt;li&gt;ip_address_a.between ip_address_b, ip_address_c&lt;/li&gt;&lt;li&gt;&amp;gt;&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;How cool is that?&lt;/p&gt;

&lt;p&gt;I then use this in my rails app to check if an ip address is banned. I have a banned_ip model which keeps ranges of ip's using first_ip and last_ip.&lt;/p&gt;

&lt;p&gt;It looks like this:&lt;/p&gt;

&lt;ol class=&quot;CodeRay&quot;&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;BannedIp&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;iv&quot;&gt;@banned_ips&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# hash of ips and masks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;    validates_presence_of &lt;span class=&quot;sy&quot;&gt;:first_ip&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:message&lt;/span&gt; =&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;first address is needed&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    validates_presence_of &lt;span class=&quot;sy&quot;&gt;:last_ip&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:message&lt;/span&gt; =&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;last address is needed&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    validates_format_of &lt;span class=&quot;sy&quot;&gt;:first_ip&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:with&lt;/span&gt; =&amp;gt; &lt;span class=&quot;co&quot;&gt;REG_IP&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;is invalid (must be x.x.x.x where x is 0-255)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:if&lt;/span&gt; =&amp;gt; &lt;span class=&quot;co&quot;&gt;Proc&lt;/span&gt;.new {|ar| !ar.first_ip.blank? }&lt;/li&gt;&lt;li&gt;    validates_format_of &lt;span class=&quot;sy&quot;&gt;:last_ip&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:with&lt;/span&gt; =&amp;gt; &lt;span class=&quot;co&quot;&gt;REG_IP&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:message&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;is invalid (must be x.x.x.x where x is 0-255)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:if&lt;/span&gt; =&amp;gt; &lt;span class=&quot;co&quot;&gt;Proc&lt;/span&gt;.new {|ar| !ar.last_ip.blank? }&lt;/li&gt;&lt;li&gt;  &lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.banned?(ip)&lt;/li&gt;&lt;li&gt;      reload_banned_ips &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;iv&quot;&gt;@banned_ips&lt;/span&gt;.nil?&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;r&quot;&gt;begin&lt;/span&gt;&lt;/li&gt;&lt;li&gt;          ip = &lt;span class=&quot;co&quot;&gt;Infrid&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;IPAddress&lt;/span&gt;.new(ip)&lt;/li&gt;&lt;li&gt;          &lt;span class=&quot;iv&quot;&gt;@banned_ips&lt;/span&gt;.each { |b|&lt;/li&gt;&lt;li&gt;            &lt;span class=&quot;r&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; ip.between?(b[&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;], b[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;])&lt;/li&gt;&lt;li&gt;          }&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;r&quot;&gt;rescue&lt;/span&gt;&lt;/li&gt;&lt;li&gt;          logger.info &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;IP FORMAT ERROR&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;          &lt;span class=&quot;r&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.banned_ips&lt;/li&gt;&lt;li&gt;        reload_banned_ips &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;iv&quot;&gt;@banned_ips&lt;/span&gt;.nil?&lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;iv&quot;&gt;@banned_ips&lt;/span&gt;.collect {|b| b[&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;].to_s + &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + b[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;].to_s }.join&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;c&quot;&gt;#keeps a cache of all banned ip ranges&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.reload_banned_ips&lt;/li&gt;&lt;li&gt;      r = connection.select_all(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;select first_ip, last_ip from banned_ips&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; !r&lt;/li&gt;&lt;li&gt;        &lt;span class=&quot;iv&quot;&gt;@banned_ips&lt;/span&gt;=[] &lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;      &lt;span class=&quot;iv&quot;&gt;@banned_ips&lt;/span&gt; = r.map {|item| [&lt;span class=&quot;co&quot;&gt;Infrid&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;IPAddress&lt;/span&gt;.new(item[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;first_ip&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]),&lt;span class=&quot;co&quot;&gt;Infrid&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;IPAddress&lt;/span&gt;.new(item[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;last_ip&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;])] }&lt;/li&gt;&lt;li&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;You can then call the banned? method with the ip address from the request, e.g. &lt;strong&gt;request.remote_ip&lt;/strong&gt;, or any other ip you want.&lt;/p&gt;

&lt;p&gt;It's worth noting that I have this reload_banned_ips method which stores my ip address objects in a static variable @banned_ips. My reasoning for this is that I don't want to go back to the db and create ip_address objects every single time I check if an ip address is banned.&lt;/p&gt;

&lt;p&gt;I'll talk about this and my &quot;non-drb-drb&quot; rails technique for saving on db activity in a future blog post.&lt;/p&gt;

&lt;p&gt;Also, a note for the pedants, I wouldn't have done any of this if I wasn't checking an ip address falls within a range, in which case it would've been a straight forward string comparison.&lt;/p&gt;

&lt;p&gt;Again, thanks to David Black, who turned me on to the comparable module and in doing so showed me some kick arse , yet very elegant rails moves. His website is &lt;a href=&quot;http://www.rubypal.com&quot; title=&quot;David black&quot;&gt;www.rubypal.com&lt;/a&gt; &lt;/p&gt;
          </content>  </entry>
</feed>
