Dev: March 2008 Archives

Back from Utah

|

I got back from Salt Lake City this afternoon brought a lot of ideas with me. The talks were really informative and thought-provoking and I made some great connections.

I'm also officially a beta tester for PicLens, a great plugin for Firefox. They're up for a Webware award this year, so if you use the plugin (and if you don't, you should get it) you should vote for them.

I've somehow managed to sneak out of Rookie Orientation thus far, but my luck has run out and I've got to go this week. Naturally, work doesn't stop when this happens so I'll be pulling double duty until Friday.

My boss invited me to go to Rails Conf this summer in Portland so I've also got to review the talk schedule and see if it will be interesting. I'm pretty sold on Merb, and look forward to Rubinius, but it may be good to go nonetheless.

One of the things I've been experimenting with this weekend is binding the GNU debugger (gdb) to a running Ruby app. It produces much more informative stack traces, and allows you to see the C stack trace as well. Of course there's more information there than I can process at this point, but there's always room for learning. More on this later.

Well, I've got to hit the hay and learn about being 'fanatical' tomorrow.

Mountain West Ruby Conf

|

Today was the last day of Mountain West Ruby Conf in Salt Lake City, and it was a very productive trip. Among other things, I got to chat with Ezra Zygmuntowicz, the creator of the Merb framework and strong Nginx proponent.

We also got to grab dinner with Jan Lehnardt, a developer of CouchDB.

Possibly the most surreal thing that happened was getting to hang out with the crew from Engine Yard crew in the Hilton executive suite last night.ey_hilton.jpg

At the end of it, I got a job offer. We'll see how that goes.

Tomorrow I'm heading off to Salt Lake City for West Mountain Ruby Conf. I always like traveling, especially on someone else's tab. We get back Sunday afternoon, and that evening I'm meeting a friend of mine in a situation which _I_ certainly consider a date. Which means I'll find a way to make a complete fool of myself.

I ran into a bizarre error today and thought I'd see if anyone else had run into it. I moved an app to a testing environment and after I got the stack configured, the app was failing with every call.

I verified that the mongrel conf file was correct, that the web server was running properly, etc, etc, and nothing was showing up in either error log. I finally looked in the application error log and after sifting through the stack trace found that the problem was occuring in /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.4/lib/action_controller/cgi_ext/pstore_performance_fix.rb.

It turned out that it was looking for the session files in app_root/tmp/sessions//ruby_sess.asdfasdfasdf. Since there was a '//' in the path it was dying, but I can't figure out where that came from. By opening up the pstore_performance_fix.rb file mentioned above and taking a "...+ '/' + ..." out of line 15 the problem went away.

When I saw that, I thought that I must have added an extra slash in the mongrel_cluster conf, but I verified that there isn't one.

Weird, especially considering the app worked perfectly in the dev environment. Anyway, by changing that line I have the stack up and running. I also made a debian package for updating the code which will make updating easier.

I may spend part of tomorrow looking at evented mongrel and swiftiply. The site with the article is the blog of Ezra Zygmuntowicz, who is the founder of Engine Yard and a Rails deployment bad-ass. I've read a lot of his stuff dealing with Nginx, and it's always a good read.

XSD, breakroom phosphate

|

I woke up this morning just before 5. I thought 'Great! Now I can get started on some work!' Five hours later, I woke up (again) with nary an atom of work (I'm too tired, but insert your own chemistry joke here - to get you started, imagine what the properties of 'work tri-oxide' or 'employee-lounge monosulfate' might be) got done.

However, I was considering looking at Lisp today, so it's a good thing this entry got my parenthesis-typing fingers warmed up.

Yesterday I learned my way around generating XSD documents which, I must say, is a complete waste of time. If you're doing anything more than returning a simple document that hardly ever changes it's okay, but like hell I'm re-writing the damn thing every time there's a new product offering. Regardless, it's something new to learn, and that is after all why I'm on this earth. That and periodically making smart remarks.

XSD is an interesting concept - it's certainly easier to deal with than DTD, and if I have to write one of these for every service I generate, here's hoping that DTDs die a quick death. For the uninitiated, 'XSD' stands for 'eXtensible Schema Definition', and is essentially a way to indicate to the outside world what some XML document will look like. A simple example might help muddy the waters:

An XML doc that looks like this:

<cow>
   <stomach>
     grass
   </stomach>
</cow>

could be defined in an XSD like this:

<schema>
  <xs:element name="cow">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="stomach" type="xs:string"/>
       </xs:sequence>
     </xs:complexType>
  </xs:element>
</schema>

Note to perfectionists - yes, the XML declaration line, namespace, etc is missing.

As you can see, the XSD is concerned with what tags go where and what is valid data for those tags to contain. Since the <stomach> tag says that it contains a string, a document with a number instead of a string will cause validation to fail. This is a very simple example - XSD allows you to do spectacularly stupidly complex things. Since I've only had one Amp so far today, I'm not going into it any further. The point is, there seem to be plenty of things that can generate a sample XML file given an XSD, but all the things that will generate an XSD given an XML doc seem to cost money. I'm not in favor of this, and my try my hand at writing one one of these days.

SNMP, Erlang, Screen

| | Comments (2)

Thanks to dluke for fixing the MoveableType template and correcting an error in the commenting. As a token of my appreciation, he may add any person or organization to the List Of People And/Or Organizations Who Can Suck My Balls.

Today I continued work on a simple SNMP polling project, written in Ruby. I decided to abstract out the device types into separate classes and, with Brent's help, created a factory class to return instantiation of the proper object type.

Tomorrow I've got a little work to do on the Interface class, an extension of the Switch class. Once that's done, I've got to re-graft it onto a Rails framework to give it that nice RESTful flavor of which I'm so fond.

I'm happy with the Ruby SNMP library, but it seems that once you instantiate the manager, there's only one command (get_value(OID)) that you ever really need.

I'm going to spend a little bit of tomorrow looking into how I could transfer this project over to Erlang. I spent some time chatting with one of the founders today who's got some experience in Erlang and he seemed to think it was a good idea.

Additionally, 'screen' is badass. I've been tossing so many term windows around lately I finally broke down and used screen - if the 'attention' sequence could be changed to something other than ctrl-A it would be a lot nicer.

There's apparently a way to split the screen vertically, which would certainly have it's uses. I'm giving some thought to seeing about having a screen session sitting inside an ncurses interface for a bit of added visual flair.

Ruby error

|

This is just to remind myself so I don't waste time looking into it next time I run into the same problem:

If you're installing a gem and you see...

"extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)"

...it means you didn't install the ruby1.8-dev package.

About this Archive

This page is a archive of entries in the Dev category from March 2008.

Dev: February 2008 is the previous archive.

Dev: April 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.