posts by tag

work (28)
Consuming SOAP services in Ruby

I know, I know, REST is cool and SOAP sucks. Rails is awesome and .NET blows. But the reality is I have to do a little bit of both.

Things at work are moving more and more toward Rails, but there’s still a large investment in a few .NET systems that must be maintained (until the decision is made to rewrite them in Rails). With that means there are a few SOAP services that I still need to work with. It turns out, this isn’t so bad.

Originally I thought I’d bring back AWS and deal with it that way. But from my experience, AWS has more support for generating services rather than consuming services. While AWS isn’t a terrible approach, there’s an easier way this can be handled: SOAP::WSDLDriverFactory. This is a straight-up Ruby solution that comes shipped with the standard library. It’s straight-forward to use and requires no XML parsing (which sort of surprised me).

As an example, one of the Rails applications I’m currently working on needed to have the ability perform certain actions under that users’ .NET account. Mainly, since the applications are completely separate (read: separate DB, separate users table), I needed to get the user id from the .NET system via their credentials in the Rails system. While this isn’t the actual implementation, you can see how easy this is to do.

require 'soap/wsdlDriver'

class SomeDotNetWrapper
  attr_accesssor :endpoint, :service

  def initialize(endpoint=nil, service=nil)
    @endpoint = endpoint
    @service  = service
  end

  def get_user_id_from_credentials(username, password)
    soap = wsdl.create_rpc_driver
    response = soap.GetUserID(:username => username, :password => password)
    soap.reset_stream
    response.getUserIDResult
  end

  private
    def wsdl
      SOAP::WSDLDriverFactory.new("http://#{@endpoint}/services/#{@service}.asmx?WSDL"
    end
end

By creating a “factory” with the services’ WSDL, you can easily set things up for remote procedure calls (i.e. GetUserID(username, password)). What’s even nicer is that you can parse the response by chaining methods together. In this case, it put me right inside the response, where I only needed to call one level of nested XML (response.getUserIDResult). But if this were nested deeper, I’d just keep calling the methods that map to the XML nodes until I got to what I wanted. And of course, I could then write any Ruby code to do what I needed to do, but the point is it’s automatically method-like access, which is nice (think of Builder).

So, once you write your “wrapper” class, you’re ready to go.

class SomeDotNetWrapperController < ApplicationController

  def store_other_id
    raise InvalidCredentials if params[:username].blank? || params[:password].blank?
    service = SomeDotNetWrapper.new('http://example.com', 'authentication')
    other_id = service.get_user_id_from_credentials(params[:username], params[:password])
    current_user.update_attribute(:other_id, other_id) unless other_id.to_i == 0
  rescue InvalidCredentials
    # ...
  end
end

I’m sure there are a lot of different approaches, but this seemed the easiest to me. I had somewhat of a difficult time finding a solid solution online for easily consuming .NET SOAP services, so I decided to resort back to the standard library, as generally every language has support for this sort of thing. Anyway, maybe someone else with the same needs will find this useful.

Childish behavior

Today was a bad day. It was another one of those days where nothing seemed to go right. At work I’ve just been switched to a C# project, which pretty much sucks. But it wasn’t necessarily the code that bothered me. Sure, the syntax is ugly, but that simply wasn’t it. I don’t agree with a lot of the .NET methodologies, but again, it wasn’t .NET that ruined my day—it was my childish behavior.

All day I spent my time on simplistic things, yet managed not to complete a single task. I got so frustrated because I couldn’t do the things I knew were easy. It was one right after another. By lunch I was definitely ready to go home.

Unfortunately, there was a guy working with me who is relatively new to .NET and OO programming, and was trying to learn a thing or two. I say unfortunately because I was too frustrated with myself to teach/explain anything. Having someone watch the simpler things go badly aggravated me even more, since I’d normally have everything I tried today finished in 30 minutes.

Now I could complain write all day about how much I don’t like this and that, but I’d just be ignoring the real issue: my poor attitude. The truth is there are tons of people who write successful .NET applications and really do enjoy it, I’m just not one of them.

I honestly am annoyed with the thought of being back at the beginning again; especially with a language I have no desire to learn. As a result of my annoyances, though, I ruined mine and the “paired programmer’s” day today. From now on, I hope to quit being so childish when I get stuck on things, and do my best to keep a positive attitude no matter what the situation.

Of course, talk is cheap, so we’ll see how it goes.

Silence is distracting

How many times have you heard something like, “Shhhh, I’m trying to think,” as if noise inhibits thinking? To me, one of the most distracting environments is one that is quiet. Most people I come across tend to think otherwise, where a quiet atmosphere ascends focus more than a busy, noisy, and “distracting” one. I suppose there are different levels of “distracting”, but I’m referring to that of a typical office environment. You know, people talking, faxes coming in, doors opening/closing, etc. Not a jack-hammer outside of the window.

In January, the team I work with moved to a separate office space, consisting of around five people—it was dead silent. I quickly realized how much I had missed the “distractions” from the other office. Instead, I was being irritably distracted by the silence. It’s still the same, today. Personally, I think being able to hear every keystroke, mouse click, chair movement, etc from a co-worker is not only distracting, but annoying. Every morning, I play music because it just gets too quiet around here. I think better with noise. I don’t wear headphones (I’ve yet to find a pair that doesn’t hurt my ears after 2 hours), so it just blares out for everyone to hear—thanks to Amie’s Dad for the online XM access. Bottom line: I don’t want to be able to hear myself think; despite popular belief, silence is itself, distracting.

Blah

Things have been strangely busy lately, at work and at home. I’ve been doing .NET at work for at least the last month or so, and javascript aside from that. I’ve stated before that it can be nice to take a break from what I love doing, if for no other reason than to appreciate it more, but I think break time is over. I now feel like I’m being poisoned by everything that is not Ruby/Rails. I’m aching to get back into Ruby code, but unfortunately, at work I don’t necessarily foresee that in the near future. Of course, that’s the beauty of personal projects, but then time is always an issue (which is what Golf Trac is currently suffering from).

Design and develop web applications using Ruby on Rails at $125/hour, 40 hours per week (based on convenience), with optional overtime, full-benefits, and 6 weeks vacation. All server administration and maintenance will be handled by a specialized server admin.

If anyone stumbles across a job description similar to that, please let me know (I suppose I’d settle for a little less).

What an incredibly unproductive day

Yesterday just may have been the most unproductive day I’ve had at IRC. We’re nearing the end of a relatively tough-to-meet deadline (which results in a rather large deployment), and I got nothing accomplished. In fact, I’ve managed to go backwards.

The day before, an incredibly productive day, made me anxious to finish up; however, I ran into my first issue almost immediately. No problem, I can fix anything, right? Two hours later, I was still struggling with the same problem. Going against my better judgment, I moved on to a few of the bugs that I knew I could fix quickly. You know, supporting the “if you step away from it for a while…” mentality. It didn’t help matters, because I spent the rest of the morning on a new, but equally irritating and apparently not as easy to fix as I had thought, bug. The same one I had planned on gaining the quick-win off of.

Lunch rolled around, and I couldn’t ignore the aggravation. All I thought about were those two seemingly simple bugs, and what on earth would lead me to their demise. My attempts to fix the second bug led to not only the second bug not being fixed, but resulted in two more bugs from code that was previously working fine.

To make a very long and drab story short(er), I left the day with three new bugs, in addition to my existing list of fixes. Legacy code is an evil beast, and can be very difficult to maintain. Especially when dealing with .NET stuff like this (access a <span> from the server-side):

Dim detailsSpan As System.Web.UI.HtmlControls.HtmlGenericControl = e.Item.FindControl("courseDetails")

Yuck. Have you ever felt like you’re worthless for an entire day, and you’ve caused more work for yourself just by being there? Hopefully today goes a lot smoother.

All out of ideas

Since the end of January, I’ve designed between 7-10 sites from scratch, and I’m currently working on another one. It’s beginning to wear me out. I don’t mind working that much, but it’s the depressing realization that I’m all out of ideas that’s breaking me down. It’s hard to be creative and do something fresh and new over and over and over again. I think I’ve hit a wall, and I have a deadline coming up around mid-August for another new design.

Sometimes I wonder if I’m moving too fast; sometimes I wonder if I like this stuff as much as I say I do; and sometimes I wonder if I just need a break from it all. It can be frustrating… very, very frustrating. But in the end, bad days come and go. I’ll move on, and probably be happy with the design. For now, though, I feel like complaining.

Daily meetings or campfire?

I read a post from Ryan Carson where he mentioned a tip from 37signals on how to use campfire to manage people and what they’re up to. When someone arrives at work, he/she types “[IN] this is what i plan to get done today” and right before he/she leaves, “[OUT] this is what i got done today”. It forces you to think about your daily activity before getting started and look back to what you actually accomplished when you’re done. Weekly review meetings might then become easier, since you could use the campfire archives to see planned vs. completed tasks for each day of the week.

It seems like a good solution to the problem of managing what’s getting done, but of course, it wouldn’t work for everyone. Some people prefer to not have to report or check-in at all, but the reality is there needs to be some sort of accountability for progress. I think it’s interesting (and clever) to use a chat room to manage employees and tasking. It’s unobtrusive, too.

Personally, I couldn’t come up with an ideal fix for task management. There are too many variables, and someone will always be somewhat disappointed in the solution. I’ve tried several different methods, and they all have their ups and downs. The one thing I do know is I don’t really like meetings.

sql query: development versus production

Have you ever heard of a SQL query running fine in development, but returning an empty set in production? Usually that links to being an inconsistent data problem, but it’s the same data in this case—I’m confident that’s not it. I’m sure my local version of MySQL is newer than what’s in production, but that can’t be it, can it? Is that even something worth thinking about?

What an annoying turn of events. I don’t even know where to begin on this one.

UPDATE: fixed. From now on, any problem I have, no matter how small, I’m going to post it. Seems to be the fastest way to realize a solution.

Unexpected trouble with a sql query

I’ve done this before. I know I have. The concept isn’t difficult at all, but this query is giving me a headache. Before I change the way I’m doing this, I thought I’d post about it since that often helps me to think things through, overcoming the obvious.

So a user can take assessments on individual topics/sections of a course, which can then be used to make up a course grade (if desired). Anyway, it was decided recently, instead of updating a users score when a topic assessment is retaken, save all scores so they can see their progress. There are plenty of ways to do this, I realize, but I thought it may be easiest to insert a new record for that user/topic combination and just pull out the most recent (as this isn’t something you “rollback” to—at most, you’d just want to see previous scores, etc).

That brings me to this query. I need to get all of the topics for a course, group them (since there are now multiples), and only return the most recent of the group. Pretty simple, eh? I tend to agree. However, whether it be that I haven’t written explicit SQL in a while or I’m completely overlooking the obvious, I’m not getting what I need. I can get the record individually from the group, without the other topics; or I can get all the topics except the most recent of the group. So I thought about UNION, but that seems over-the-top for this. It’s hard to accept a monster query when I don’t think it should be monstrous. Here’s a dumbed down version of the setup:

## TABLE: courses (has_many topics)
 #   id, title, description, etc
## TABLE: topics (belongs_to course)
 #   id, course_id, title, description, etc
## TABLE: user_topics
 #   id, user_id, topic_id, score, completed_on, etc
 # ----------------------------------------------------
 # (note: topics can be infinitely nested with itself as 
 #  well, but that relationship shouldn't matter, here)

## SQL (1)
 # => returns everything except the most recent topic -
 #    in fact, it doesn't return any records within that 
 #    "group" of topics

 select topic_id, score, completed_on
 from user_topics ut
 inner join topics t on t.id = ut.topic_id
 where t.course_id = {course_id}
 group by ut.topic_id
 having ut.completed_on = max(ut.completed_on);

## SQL (2)
 # => same results as above

 select ut.topic_id, ut.score, ut.completed_on
 from (select topic_id, score, max(completed_on) as max_completed_on
       from user_topics
       group by topic_id) ut
 inner join user_topics u_t on u_t.topic_id = u_t.topic_id
 inner join topics t on t.id = ut.topic_id
 where t.course_id = {course_id} and ut.completed_on = max_completed_on;

Anyway, there are several other attempts, but no reason to list them. I don’t expect anyone to think about it, I was just hoping to clear my mind and give it another shot before handling this a different way. I suppose I could treat it as a “version” of a user_topic, but my stubborn side won’t let me move past this; the data is there, I just need to get it out. I remember when I used to LOVE writing SQL—I’m afraid those days are long gone.

Meta-programming and the singleton class

Confusing, confusing, confusing. I finally have the opportunity to play with the has_many_polymorphs plugin. I’m using it to handle tagging. As suggested, I’ve written several tag extensions (tag_with, tag_list, tagged_with?, etc). I’m not having trouble writing methods that work on an instance of a class, it’s when I want to add methods that work directly on a class itself (even though a class is an instance of the class, Class—right?). I’ve read a couple of articles, but man, this stuff is tricky.

What I wanted to do was give each model a class method such as find_tagged_with. I thought it would be cleaner as a class method of the “taggable” class in question (but without me having to explicitly define it in each class, as that would defeat the purpose), rather than always referring back to the Tag class. This is how it works currently:

class Dog < ActiveRecord::Base; end;
class Cat < ActiveRecord::Base; end;

Tag.find_by_name("animals").dogs
# => {all dogs tagged with "animals"}

Tag.find_by_name("animals").cats
# => {all cats tagged with "animals"}

I could leave it as is, but it’s not as intuitive as I’d like it to be. Since I’m getting objects of the Dog and Cat classes independently, I would like to have the find_tagged_with method become part of those classes. So I could do something like:

Dog.find_tagged_with "animals"
Cat.find_tagged_with "animals"

From what I’ve read, class methods are just singleton methods defined on the instance of the class in question. So they wouldn’t apply to all instances of a class, but I wouldn’t need them to. I figured I would need to open up the singleton class, since that would only apply to one object. The “taggable” class would be the object, since they are really just instances of the class, Class (and all objects have singleton methods). But obviously what I was thinking wasn’t right, since all I can come up with is “undefined method ‘find_tagged_with’ for ”. I don’t know, maybe I should just move to the mountains and study the Ruby language night and day, since I keep finding more and more I don’t understand.

Extending my view, literally

In late September, I finally got a new computer at work (I was using my personal laptop before that). Despite what some people would say, it’s a pretty nice Dell with a 19” ultra sharp flat panel. I’ve always been a sucker for space on the screen (I keep my laptop resolution at ~ 1900×1200). Well, it was decided that I could get another 19” flat panel, you know, to spread things out a bit. So here’s what I see now:

I didn’t know having dual monitors would be so nice. There’s something about never having to minimize my code that makes me more productive.

A snowy and dangerous day

I didn’t go to work today. I woke up with full intention to go, but the traffic out front was backed up and I assumed it was because of the weather. I walked outside and took a few pictures to capture the mess; it’s much easier to just show those than try to explain how bad it really was. I made a set on Flickr:

I’m not too fond of snow (because I have to commute in it), but solid ice on a really steep hill is much, much worse.

Today versus Yesterday

Have you ever had one of those days where everything you tried to do didn’t work? Or went wrong? Yesterday was that day for me. I had what was probably one of the worst days I’ve had yet this year. I woke up with a headache. I get to work and started the morning off with a 3 hour troubleshooting task that should have taken about 15-20 minutes, moving on to realize I didn’t do my homework that was due by 5:00 that evening, I then found out I left my allergy pill bottle at home so I couldn’t call in a new prescription, and ended the day with a broken, torn apart application that I couldn’t commit. I would have stayed until I fixed it, but the person I carpool with had to leave by 4:30, so I had no choice but to leave that mess for the next morning (I hate leaving something open-ended like that). What a day.

But today I woke up with a clear head, which aided me in getting about 2 days worth of work done by noon (including 5 solid commits), and my teacher let me turn in my assignment a day late. Everything seems to be going smooth again, which is how I like it.

Passing an array to a partial

I’m using a partial that is responsible for setting up a link_to_remote helper to navigate through files in a directory. I’m keeping track of the current index, and I need to pass the partial an array of filenames, so I can parse it and display the title with each prev/next navigation, based on the current index. However, I can’t seem to pass an array to the partial. I though using :object would work, but apparently not. Here’s what I have:

# the call to render the partial (passing in the @screens array)
<%= render :partial => 'navigation_link',
           :object => @screens,
           :locals => {:link_text     => 'Previous',
                       :action        => 'navigate_screen',
                       :total_screens => @screens.size,
                       :screen_index  => @index,
                       :screen_title  => @screens[@index]} %>

And here’s what I have in the partial…

# _navigation_link.rhtml
<%= link_to_remote link_text,
                   :url => {:controller   => 'courses',
                            :action       => 'navigate_screen',
                            :screen_count => total_screens,
                            :index        => screen_index,
                            :title        => @screens[screen_index], # this fails
                            :direction    => link_text.downcase},
                   :loading  => "Element.show('loading');",
                   :complete => "Element.hide('loading');" %>

Why would <%= @screens[screen_index] %> display the correct filename (yes, from within the partial) if it was nil? I’ve tried :collection as well, but I don’t think that’s what I want, here. Any thoughts on why I’m getting a nil.[] error even though it, apparently, isn’t nil? I’m open to other suggestions as well, but I’d rather not use the session.

Working with transactions in Rails

I’ve been playing around with transactions a little bit, and it seems like it will work nicely for something I need to do at work. But I’m somewhat confused with the model prefix.

For example, I have to read in folders from a directory, parse out the folder name as a generic title for the database, then go into that folder and save all of the sub-folders as a has_many relationship to the parent folder, in the same manner. But I don’t want to save the parent folder or any of its sub-folders if an exception is thrown. The content has to be tracked, so I need the information in the database.

So what I’m doing is allowing an admin to view the available content (folders in a directory that aren’t yet in the database) versus the active content (what’s already in the database). I’m allowing the content to be toggled (activated/deactivated) based on these two methods:

# call to 'activate' a course
def load_course
  @course = Course.new
  @course.title = params[:title] if params[:title]
  Course.transaction do
    @course.save!
    read_directory(@course.folder_title).each do |f|
      lo = LearningObject.new
      lo.course_id, lo.title = @course.id, f.gsub('_',' ')
      lo.save!
    end
  end
end

# call to 'deactivate' a course
def unload_course
  unless params[:id].nil?
    @domid, @title = "available_#{params[:id]}", Course.find(params[:id]).title
    Course.transaction do
      LearningObject.destroy_all "course_id = #{params[:id]}"
      Course.destroy(params[:id])
    end
  end
end

Based on this, it would make sense to me if only the Courses table would ROLLBACK on an exception; however, I’ve tested this and it seems as though, if an exception is thrown in either case, neither the course nor the learning objects are saved. Granted, that is what I want to happen, I’m not completely convinced this will ROLLBACK the learning_objects table everytime. Do I need some sort of nested transaction, or is qualifying the block with Course good enough?

Needing to extend Rails view path

By default, I believe ActionView only looks in the ‘views’ folder for any templates and/or partials, which makes sense. But what if I have a bunch of static partials (not related to a specific controller) that I didn’t want cluttering my ‘views’ directory? How could I extend the view path to realize an additional directory? Lets say, ‘lib/content’ or ‘public/content’? Or what about another computer entirely?

Here’s my situation: I have to work with some “published” content (which is no more than a strict folder structure with embedded HTML files), and allow a user to navigate through that content. I can’t change what needs to be done, but I do have a little control over the filenames that get published. I thought I could publish them in the _partial.rhtml format, and in my application, deal with the directory hunting to find what I need, rendering each partial accordingly. For very valid reasons, I’m unable to modify the system that publishes the content any further than the filenames, so I have to work within the given constraints.

The published content has potential to get rather large, so I’d like it separate from my ‘views’ directory. Plus, it has nothing to do with my application; it’s just static content I need to read in. Ideally, I’d like to be able to reference a directory on another server (which seems like a lot to ask); but I could tolerate having a ‘public/content’ folder. Any thoughts on how to add another directory to the view path in order to make something like render :partial => "public/content/partial" become an option?

Paper prototyping a design

I always sketch out design ideas on paper before I do any markup, as it helps to have a reasonably structured layout in mind. I’m often reluctant to use Photoshop to mock up a design, since that in itself takes a bit of time (although it does help with color). Plus, for work, putting some thoughts on paper is a quick-and-dirty way to show my boss a few designs I have for whatever we’re working on. I guess you could call this paper prototyping. A List Apart recently had an article on paper prototyping, which is a little overkill for what I would ever do (as I’d never use scissors), but there are several good scenarios for how something as simple as paper can help your design process. And personally, I think it’s fun.

(Trying to) run lighttpd in development

This morning I’ve been spending some time on the Mac trying to get everything setup for RoR development. I found a nice rake task that should handle the permission problems (since we develop in Windows and OS X now). And I believe I have MySQL setup correctly (although there are still some annoying user permissions there, as well). So that leaves me with the development server. We chose to use lighttpd because webrick is rather slow, and I’ve heard nothing but good things about lighttpd (but that still doesn’t mean it’s good). It’s installed and working correctly, but my issues are with the config/lighttpd.conf file. I specified the server.port = 3000, but what I don’t get is when I run the application on 3000, then stop lighttpd (Ctrl+C), I can no longer run it again on that port. The only way I can get it to startup again is by going to the config/lighttpd.conf file and incrementing the port (say 3001), which I’m well aware of as being ridiculous. So, how do you get lighttpd to use the same port all the time? Or maybe I’m not properly shutting it down, where it really is still running on 3000 (meaning Ctrl+C is not enough)?

Also, if I try to run webrick on a port I haven’t used (i.e., $> script/server webrick -d 3010), I get binding errors. Is there something I should change for that, too?

I believe the problems are narrowed down to the development server (and maybe MySQL). I really should look into sqlite3, but I don’t want to get too much on my plate at once since I’m new to this environment.

Possible office colors

I’ve mentioned a time or two about January and how things will be changing at work. Well, one of those things just so happens to be a new office space for our team. It’s more convenient for us to be away from the other (distracting) projects that normally surround us, and put more focus into what we’ll be offering. That’s for another post, though.

We’ve already moved into our new office space, and we’re attempting to establish a pro-creative environment where collaboration and innovation become the norm. I’ve found that a bad environment can definitely take a toll on your productivity; likewise, a good environment can support and promote productivity. So a new office space with slightly off-white walls isn’t going to cut it for us. We’re planning on painting the walls, and here are some of the shades we’ve considered:

#790003 | RGB (121,0,3)

#889A65 | RGB (136,154,101)

#BABAA9 | RGB (186,186,169)

#807753 | RGB (128,119,83)

#262F4F | RGB (38,47,79)

Oh yeah, here is the one color within the office that we do have to match:

#62789D | RGB (8,20,157)

These tones cover the generality of that color, so for the green tone we might choose another shade, but it has to be a variation that will coincide with the static color that we can’t change (#62789D). We’re thinking the walls should be dark, so things like pictures, white boards, etc. will stand out and add character, rather than a white board hanging on a plain white wall. If you had to choose one of the shades above, what would you pick? Any other suggestions?

Hiring a new (web) designer

There are important things to consider when designing and developing a website. Most of these things a person can learn through reading and personal experience. But I’m convinced that a large part of design stems from creativity and artistic talents. Unfortunately, these are things that cannot be taught. There’s more to designing than meets the eye, and often it takes another good designer to realize that. Just because Bob Ross makes painting look easy, doesn’t mean it is.

I’m in no position to hire anyone, but if I were, I’d go about it from a different angle. There’s a saying that pops up every now and then, “a picture is worth a thousand words.” I think that’s true. As an employer (which I’m not), what would I want in a new designer? Hmmm… here’s how I’d find out…

I would go through a normal interviewing process, scanning previous works (assuming he/she brought some sort of portfolio), discuss important web-related topics, maybe a few more random, seemingly meaningless questions, and off you go. But not before I gave out the assignment: “You have one week to build a site that will reflect you as a designer. On this site, I want you to write why I should hire you, and what you think about [my] company. The site can be one page or ten pages; it’s up to you.” There would be no answers to any questions asked, but the questions would be noted.

What an employer cares about is what the designer can do now… today. And within time constraints. From this, you could see how creative the designer is; his/her style; how much the designer cares about what he/she does; his/her passion; how fast he/she can work; how dedicated the designer is to the task; the designer’s ability to self-direct him/herself (by the limited number of emails/questions); how well the designer understands markup; how well he/she follows web standards; and finally, how well he/she can write. Good, clean writing can say a lot for a person. I’d then narrow down the choices to three, and call them for a second interview. I would now know first hand what these designers can do given a minimal amount of time.

Personally, I would love to have an interview like this. And I think those who have a passion for design would agree. Of course, this would take place in a world where it didn’t matter who you knew. A world where the best man wins, and not because you know the best man.

Change of plans

I’m no longer going to Lockheed, and it boiled down to a decision on my part. I’ve been awaiting this security clearance (which has yet to come through) for almost a year now. During this past year, I’ve been a “temporary” office employee until I was shipped off to Lockheed. Of course, back in January (when I accepted a full-time position), I thought I might make it until February. Then maybe March. Long story short, I’m still here in the office. I’ve been using my laptop for work since every day was in question.

IRC was (is) on the brink of some company restructuring that is to take place in January. After realizing this, I wasn’t sure I wanted to go to Lockheed anymore. I know clearances are expensive, and I didn’t know IRC was able to tell Lockheed, “Sorry, you took too long.” Well, we all had a meeting to discuss the options. It ended in a proposition that would set up a nice situation for January. Ultimately, I could accept the offer and stay in the office, or decline and still go to Lockheed. I chose to stay.

Honestly, I don’t know what I’m missing by not going, but here’s what I assumed it to be:

  1. no internet
  2. small cubicle setting
  3. no leniency on time (8-5 sharp)
  4. longer drive (and no carpool)
  5. program in Java (not for the web)
  6. fixed requirements (where I have no say in the end product)
  7. less job satisfaction (a lot due to the previous)
  8. large teams
  9. strict security (since it is within the FBI complex)

Really, that doesn’t sound all that appealing. Especially versus my other option:

  1. internet (with permission to browse all day if I choose)
  2. office setting
  3. extremely flexible hours
  4. shorter drive (plus I can carpool)
  5. web development (Ruby and Rails)
  6. creative control in an agile atmosphere
  7. job satisfaction (in developing applications I’m interested in)
  8. great team (and small)
  9. carefree environment with common goals and interests

I’ve chosen the path that led to happier job placement, and I’ve given up potential experience with a larger company. In my life thus far, I’ve realized how important it is to like your job and who you work with. In the end, I think I’ve made the right choice, and I’m excited for January. Until things get settled, I’ll be developing in C# for ManTech (through IRC), which isn’t so bad.

Minimal progress so far today

Today is a terrible day to get things done. It wasn’t really the office, but a lot of distractions popped up today. Fortunately, I was still able to make decent progress, but I know I could have done more had I been in the mood. It all started when I woke up tired. Often I wake up tired (usually every morning), but after the shower I’m always good to go. I knew it wasn’t going to be a good day when I got out of the shower and still wanted to go back to bed. I haven’t had much sleep the last couple of days, but more importantly, I forgot to take my allergy pill last night. That always results in a rough morning. Plus, it’s now an hour or so after lunch and I’m going through the early afternoon lag. I don’t know about you, but after lunch I’m drained. I snap out of it quickly, but there’s always around a 30 minute period of unfocused blank stares aimed at the computer screen. Unless I go out to lunch, then getting some fresh air wakes me up a little. To top off my day, it’s Monday, and I have class from 6:00-8:30 pm on Monday evenings. That definitely doesn’t help. But I guess I could blame it on the allergy pill.

Following the Ajax trail

At work, I’m helping to build a new application that utilizes ajax to the fullest. This is bar none the most ajax intensive application I’ve worked on. It’s awesome, though. I’m learning so much about Ruby and Rails. I knew I would if I were to do this stuff at work instead of trying to find the time between work, school, and hanging out with Amie. Anyway, this afternoon was the most severe case of ajax I’ve come across.

Sometimes it can be tricky to follow the variables and keep track of IDs and requests when you have multiple ajax calls without a page refresh. For instance, just today, I had to add the ability to post entries related to [a top secret something] and allow comments for those entries. Also, this is a multi-user application, so if the entry belongs to you, allow editing of the title and body, as well as your comments (if any) for that entry. Thankfully, Rails has tremendous support for ajax. This is all fairly straight forward, but the part I was having slight trouble with was if a user posted an entry, wanted to add a comment, edit the entry, add another comment, etc., all without refreshing the page (or upon return). Each time I came back from an ajax call, I had to keep track of the unique <div> IDs so the other ajax requests that were rendered in the previous response would still work and update the same locations as if it were a fresh visit. For instance, let’s say this happened without a page refresh: click to post a new entry (request 1), submit the entry (request 2), edit the entry body (request 3), view the comments (request 4), add a comment (request 5), edit the entry title (request 6), edit the comment (request 7), delete the comment (request 8), and finally, delete the entry (request 9). Essentially, that could happen. Even though it’s unlikely, it has to work just in case. It’s always those wacky situations that bite. So after tracing through the issues for a bit, it started coming together. I got it all worked out this afternoon (I still need some slight fixes on the comments) and it seems to be flawless so far. It always feels good to reach a good stopping point on a Friday, and it feels even better now that I have it commited in the repository :) Out of curiousity, what’s the craziest ajax trail you’ve had to follow?

Update: I fixed the comments tonight, and tested everything. It’s all working as planned. Sweet!

The form has no properties

Programming is a challenge. I understand that. Problems will arise no matter what environment you’re in or language you’re using. But I like it more when the challenge comes from something I don’t know how to do rather than something I’ve done hundreds of times, and today decides to not work. I know the application or program only knows what you tell it to do, but sometimes things get hard to troubleshoot.

What I’m trying to do is render a partial via ajax and submit the form via ajax. No big deal at all. I’ve done this so many times, but now I’m getting “the form has no properties.” I can’t seem to get the data out of the form, so it thinks there’s nothing to submit. I tried the ajax request within the form tag as well as an external link to submit the form and serialize the data based on the form ID. Neither one worked and I’ve done both methods in the past. This past week, actually. The odd thing is, the form will submit without the ajax. That doesn’t make sense to me. It’s the same code. The same code is executed whether it’s via ajax or not, but it only captures the parameters when the call is not asynchronous. It seems to me the point of failure should be when the form is rendered using ajax and was injected into the page, because in a sense, it’s not really there so it should fail on both attempts (post-back submit and ajax submit). I know it’s getting to the method because I rendered text to make sure. I’ll fix it eventually, and the problem will probably turn out to be ridiculous, but I think I need to leave it alone for now.

Too busy to post

Most of my posting is done while at work. Sometimes, if it’s a longer post, I’ll throw it in a Writeboard and finish it up later. Even so, I end up posting it at work. Lately, I’ve been so swamped with tasks, I feel as if I don’t have the time to post. It’s not a bad thing, though. This may strike you as strange, but I usually don’t even eat my lunch at noon anymore. Sometimes it’s not until 1:30 or 2:00 pm. I feel like there is just too much going on and I’m never at a solid stopping point. I don’t know if it’s me or what, but I cannot stop in the middle of something. If it takes me an extra two hours, so be it. Anyway, maybe if I had the no admin interface like some people we know I would be more inclined to post—it would be much less effort. I’ve spent more time on the admin side of this site than ever before, but it’s still a login protected area usually requiring a visit to at least two (or three) pages after the login. Oh well, we can’t all have those clever ideas ;) We just have to be inspired and move on.

Loving what you do

I haven’t read the feeds in my reader since last Wednesday; that’s unusual for me. It’s almost as if my work is now distracting me from my distractions, if that makes any sense. Don’t get me wrong, I think that’s a good thing. Infact, I think it’s a great thing. It’s nice to enjoy work again. The time goes by much faster, but that’s probably because I’m no longer staring at the clock.

It’s so important to love what you do. In life, that is probably most important, really. From the moment college is over you’re out in the work force where you’ll be for the next 40 years. That is a tremendous amount of time, so hopefully your time is spent wisely. The whole point of college is to learn about something you’re interested in so you can get a good job and have more opportunities to do what you love. My high school didn’t offer much programming, so I was never introduced to it until college. Needless to say, I liked it. Mixing that with the art of design, and I now know what I love to do. But (this is a huge but), I think creative control and small teams are a must if I’m going to continue to like web development. Right now, I’m young and I know I could afford to gain a little experience. That’s why I don’t really mind going to Lockheed Martin—who I’m sure is totally against creative control and small teams. They might not necessarily be against it, but they are far more formal in their process. And for that type of work, I’m sure they have to be. But, overall I’m a young programmer; I might benefit from learning the Java language. Plus, from a web development standpoint, I believe Jakarta Struts is an MVC framework? It might be good for me to work with another framework to experience something else.

Anyway, I never realized how important it is to love your work until I didn’t. My days quickly turned into “required tasks” rather than a place I go for 8-10 hours and do some cool stuff. I dreaded waking up more and more because I knew it was going to be many hours before I could come home. For the next 40 years I hope to get paid doing what I love. After seeing the other side, I don’t know that I could handle anything else.

Hopefully it takes a little longer

My security clearance is in the final stage. I don’t know how many stages there are, and considering it’s been nearly a year, the “final stage” doesn’t mean much to me. However, supposedly it’s going to be done in two weeks or so (it’s not the first time I’ve heard that). Before, I was ready to go just to rid myself of that project I WAS working on. But I’ve been switched over to another project until the clearance comes through, and it just so happens to be developing an application using Ruby on Rails. How nice is that? But my time is limited, unfortunately.

There are a lot of things I don’t do that I should when I develop (like use subversion), but I’m hoping I can pick up a few good habits before I head over to Lockheed. I’ve been staying somewhat involved in the project, simply because I love web applications and this one in particular seems pretty cool. I never really worked on it much, but I had several conversations concerning its goals and potential. I’m excited. I’ve been given total control over the interface design, which I should be able to knock out rather quickly. And as always, it will be tweaked throughout the process. That’s the nice thing about working for a small business… creative control. I’m now hoping Lockheed drags their feet on the clearance, but knowing my luck it will come through tomorrow.

It's only a matter of time, now

I recently received word that my long awaited security clearance is in its final stage and will be done in a week or two. Yeah, it’s the same clearance I submitted in November of 2005 (Thanksgiving break). I’ve been full-time in the Fairmont office of IRC while I wait on the clearance. I’m anxious to get this process overwith, but I wonder what it will be like at Lockheed Martin. I know I’ll be working in a UNIX based environment with Java as the core language; but, I don’t know any of the people I’ll be working with, what my office space will look like (cubicle?), if I’ll have outside internet access and so on. I’m sort of nervous. It’s almost as if I’m starting all over again. I guess I am starting all over again. I’ll have a new project, new co-workers, new language and no more web-development. Although, I have to say, the last month or two at work has been rough. I’ve been switched over to a project that I’m not particularly fond of. It’s to the point where I’m almost ready to leave for Lockheed because of this project. It’s just not for me. It’s entirely not IRC’s fault, though – they were kind enough to let me go full-time back in January while I wait on the FBI, which basically means I work on several different projects. I’ve been able to save a lot of money and pay off a couple of those annoying bills that never seem to go away.

I guess there are high points and low points about leaving, but I can sum it up briefly. The reason(s) I want to go is to get a break from the current project I’m on, plus it will be a really good experience. The reason(s) I don’t want to leave is because of the people I work with. They are the absolute best, and the atmosphere around the office could never be replaced. It’s a great place to work. System.out.println("So, I guess it's time to get out the Java book again. Redundant, lengthy code, here I come!");

2008 by Ryan Heath | Get In Touch

flickr

DesolateInfinityLooking upDazedBlurred