Archive for the 'programming' Category

Editors and IDE’s

A while ago, I switched from Vim to Emacs. I did this for a couple of reasons. Mostly I was hoping to learn elisp which would enable me to make the editor do what I want, and avoid frustration with limitations. You can do similar things in vim, but vim script is uglier than home made sin. I wanted to avoid that if I could.

I didn’t exactly throw myself into elisp, and as a result had trouble making it do even minor things.

Yesterday I got to spend some time with David. He’s the only person I have ever met who is more chronically dissatisfied with software than I am.

We discussed some of our frustrations with emacs, and by the time the conversation was over, I had decided to play around with some other editors and see what is out there.

To be more specific, I don’t want just an editor; I actually do want an IDE. I have eschewed them in the past, but after using Eclipse and RadRails and most recently ecb with emacs, I really want a decent file browser. I’d also like integration with version control and perhaps some other things. Most of all, I want to script it in a language that I know, or could know pretty easily. I’d also prefer that language not be Python (that’s right, I’m a hater :).

This led me to looking at free IDE’s.

Recently it appears ActiveState made their Komodo Edit editor open source. I installed that last night and played with it until about 2:30 in the morning. It’s actually quite cool.

At this point I have only done a small sub set of tasks in it, so I am unprepared to give it a ringing endorsement, but it’s quite usable.

One of the things I find frustrating with IDE’s is the editor portion is usually quite poor. OpenKomodo has a vi mode which gives you access to a lot of the vi(m) commands you already know. That is clutch.

I still have a lot of things I want to explore, but so far I give it a Nathan Powell “Not horrible” award. I will try to put together something a little more coherent later. I just wanted to scratch out my first impressions here.

P.S.
I think I have found a bug though. In using Visual Block Mode (in command mode: C-v) the cursor highlights properly, but when you operate on the region it behaves like Visual Line. That’s too bad, as I like that feature in vi(m) a lot. Maybe I am mistaken and if you know what I am doing wrong, please leave a comment.

Fun with irb

irb can be a lot of fun. I will usually fire it up to test something out as I am looking over some ruby.

ruby sub-reddit

Just to help the cause, I will post that reddit now has a dedicated sub-reddit for Ruby.

Random array element in Ruby

Was looking for the Ruby way to return a random array element.

  
  array = [foo, bar, baz]
  puts array[rand(a.size)]

My collection

I really like computer books. Well, I really like books. One type of books I buy is computer/programming related bookery.

I recently picked up two new books. K&R’s The C Programming Language Second Edition and Design Patterns by the GoF

I have been reading K&R and it’s very accessible so far, even for a dynamic language junkie like me. I hope to get a little more deft with C…if only for fun.

Anyway, I am happy to have added these two to the collection of books.

EC2 and S3

Over the last couple of days I have spent some of my vacation playing with EC2 and S3. I have to say, I haven’t been this excited about technology in a long time. The possibilities for using the two separately and together are pretty staggering.

Essentially, EC2 (Elastic Compute Cloud) is a service that allows you to create Xen images (which they refer to as AMI’s (Amazon Machine Images)), upload them to S3 (Simple Storage Service) and then via API calls (or as I have been doing via a Firefox extension) start/stop/reboot a virtual Linux server. The server can then be used as would any Linux server.

S3 is simply storage space. And also via API calls, you can access Objects (data) that is stored in S3. However, of interest to me, is Eastic Drive which allows you to mount S3 space. I haven’t tried this yet, but plan to in the near future and will post about it here.

As many of you may already know, there are a few drawbacks and workarounds to drawbacks that need to be considered when deciding on using EC2/S3 for your web project. The first is that it costs money to test it. Yesterday I messed around for about 4 hours and ran up a bill of 44 cents :)

The second is that all virtual machines in the cloud are assigned dynamic IP’s (I will leave this for another time, because I am not convinced this matters as much as some do).

Third is that the AMI’s don’t maintain state, so anything created by a running instance becomes volatile data. Think, logging, MySql records, hand made changes to config files, etc.

There are others, but I will get into the ones above and the others as time goes on. I plan to spend the next few months designing some things to work with EC2 and so I hope that I can share that journey here.

Happy Hacking!

Web Services calls for the programmatically impaired

Someone at work mentioned this morning that a company they knew of has an interesting API strategy for collecting data from 3rd parties. You have heard of REST, and SOAP and xml-rpc…this is DSI. DSI is interesting in that it doesn’t require that you learn their particular web service, you only need to know SQL. That’s correct, DSI means DIRECT SQL INSERTS.

(I made up the DSI acronym, not the actual story)

rmagick and Ubuntu

If you want to install the Ruby Gem rmagick you have to have the libmagick development files installed for the gem to compile. If not, you’ll get this error:

configure: error: Can't install RMagick. Can't find Magick-config or GraphicsMagick-config program.
RMagick configuration failed with status 1.

To fix:

sudo apt-get install libmagick9-dev

Happy hacking.

vi has arrived

Jeff A. sent me a link for Vi written in Javascript. How flipping great is that.

I am already envisioning gmail with this as the editor…just need to jam that in greasemonkey and attach it to the textarea. Ho ho, hee hee!

Seriously though, I had that idea a while ago, but I of course did nothing with it. Thankfully others are more talented and less lazy than I.

Rails and menu state

Has anyone else done anything to save UI state in a Rails app? If so, I’d like to know what you did. I ended up making a helper method that jams stuff in the session using the Ajax.Request stuff from Prototype. It’s ok, the code needs some tweaking, but it works without issue. Just curious what others have done.

« Previous PageNext Page »