Desi McAdam

September 30, 2007

RubyEast Recap, Slides, and Other Thoughts

Filed under: Uncategorized — desi.mcadam @ 10:31 pm

I spoke at RubyEast this past Friday and I think the presentation went pretty well. It was my first presentation in a speaker/audience type setting so I was very nervous. I have presented at Agile 2006 but it was a game (interactive) and was co-presented by several other people. This presentation was the first time I stood in front of a room full of people and spoke and everything went very well. Like I said I was really nervous but as soon as I got started the nervousness went away. I think I am very lucky because I was able to present to a room full of very nice/cool people and that made the experience a great one. I want to actually thank the people who came to hear me present and who gave me great feedback and encouragement afterwards it really made my day. If you are interested here are the slides for the presentation. A Tour Of Rails Testing using RSpec

I didn’t get to see many of the sessions because I was busy preparing for my talk but I was able to catch Obie’s presentation - Advanced ActiveRecord which was really good (and I am not just saying that because he is my boyfriend). I also caught the ending Keynote where Nap (I actually don’t know his real name) announced the Rails Rumble winners. There were several screencasts and it made me wish that Obie, Clay, Nick and I would have had time to get the video that was shot of us over the weekend edited and ready for prime time. We had a blast doing the competition and while we didn’t win (we got honorable mention) we learned a lot and I think we all grew closer in those 48 hours. The teams that did win did a tremendous job on their apps and well deserved the loot. Take a look at the winners there really are some great apps. Rails Rumble Winners

Friday evening a bunch of people got together after the conference and played several games of Werewolf which is a really fun game to play. I got to know a lot of people during that game and it was a great way to wind down.

Couple of other thoughts before I end the post. ShesGeeky (un)Conference sounds like it is going to kick major ass so any of you ladies out there who can attend make sure you get registered. Additionally, ladies if you want to talk during the conference please contact the organizers.

GrrrlCamp seems to be getting a good footing. I was lucky enough to meet THE Gloria this past Friday and I look forward to being a part of GrrlCamp.

I have taken on an apprentice and she will soon be posting to the blog about her experiences. I am in the process of trying to see if creating an apprenticeship type program run by DevChix is possible because after speaking with Sonia (one of the women on DevChix) she helped me figure out that I would really like to have a program that fits the apprenticeship model rather than a mentoring program. Look for more to come on this in the future.

July 24, 2007

will_paginate array?

Filed under: Uncategorized — desi.mcadam @ 5:11 am

Today I started putting pagination in the app that I have been working on. Based on recommendations from Obie I decided to use “will_paginate”, a rails plugin for pagination put out by the err the blog guys. It worked amazingly and the view helper was great! I really like the fact that I can apply the same look and feel to all page pagination throughout the app… well umm.. until I wanted to add pagination to a collection not generated from a finder or association. Since I really wanted everything to look the same and behave the same I did the following little trick so that you can call paginate on a plain old array.

class Array
  def paginate(page=1, per_page=15)
    pagination_array = WillPaginate::Collection.new(page, per_page, self.size)
    start_index = pagination_array.offset
    end_index = start_index + (per_page - 1)
    array_to_concat = self[start_index..end_index]
    array_to_concat.nil? ? [] : pagination_array.concat(array_to_concat)
  end
end

Before folks say anything about the above code.. yes I know it could be more concise if I didn’t use all the local variables but I wanted it to be really clear what I was doing here so.. leave it alone.

Now basically you can say

myarray.paginate(params[:page], per_page)

If you want to see it work yourself feel free to run this spec.


require File.dirname(__FILE__) + ‘/../spec_helper’

describe ‘Given we call paginate on an array’ do
  it ’should return an array containing the first 3 elements of the org array when page = 1 and per_page_count = 3′ do
    array = [”a”,”b”,”c”,”d”,”e”]
    current_page = 1
    show_per_page = 3
    expected_array = [”a”, “b”, “c”]
    (array.paginate(current_page, show_per_page)).should == expected_array
  end

  it ’should return an array containing the last 2 elements of the org array when page = 2 and per_page_count = 3′ do
    array = [”a”,”b”,”c”,”d”,”e”]
    current_page = 2
    show_per_page = 3
    expected_array = [”d”, “e”]
    (array.paginate(current_page, show_per_page)).should == expected_array
  end

  it ’should return an array containing all the elements of the org array when page = 1 and per_page_count = 5′ do
    array = [”a”,”b”,”c”,”d”,”e”]
    current_page = 1
    show_per_page = 5
    expected_array = [”a”,”b”,”c”,”d”,”e”]
    (array.paginate(current_page, show_per_page)).should == expected_array
  end

  it ’should return an array containing all the elements of the org array when page = 1 and per_page_count greater than org number of elements i.e = 6′ do
    array = [”a”,”b”,”c”,”d”,”e”]
    current_page = 1
    show_per_page = 6
    expected_array = [”a”,”b”,”c”,”d”,”e”]
    (array.paginate(current_page, show_per_page)).should == expected_array
  end

  it ’should return an empty array if you ask for a page that does not exist’ do
    array = [”a”,”b”,”c”,”d”,”e”]
    current_page = 3
    show_per_page = 5
    expected_array = []
    (array.paginate(current_page, show_per_page)).should == expected_array
  end

  it ’should return an empty array if you ask for a negative page number’ do
    array = [”a”,”b”,”c”,”d”,”e”]
    current_page = -1
    show_per_page = 5
    expected_array = []
    (array.paginate(current_page, show_per_page)).should == expected_array
  end

  it ’should return an empty array if you ask for a negative per_page number’ do
    array = [”a”,”b”,”c”,”d”,”e”]
    current_page = 1
    show_per_page = -5
    expected_array = []
    (array.paginate(current_page, show_per_page)).should == expected_array
  end
end

March 28, 2007

About Kathy

Filed under: Uncategorized — desi.mcadam @ 2:54 am

Last night I read Kathy Sierra’s blog about the threats and comments that she has been receiving and I have to tell you that it infuriated me. My immediate thought was, “And people wonder why we have so few women in the industry and even less who are willing to be a part of the blogsphere”. It is incidents like these that make it so difficult to choose IT and Development as a career. These guys may live behind anonymous names while on the internet but I can almost bet that they have at least some behavior that comes out in their day to day work life that causes women around them grief. Now I have made some assumptions here.. I am assuming these are men but I could be wrong.. I doubt it but I could be. Regardless, this sort of thing should not be tolerated. I would like to know how many men receive threats like these? I am speaking of threats against your life or comments as humiliating as the ones left on her blog?

I hate to make it a “women” issue but until some men come forward and say that these sort of things happen to them as well then I have no other choice than to believe these things were said because she is a woman. I was having a discussion with someone I respect a great deal about this last night and his response was that when you put yourself in such a celebrity position you have to expect this sort of thing. He also stated that you should simply ignore it because by not ignoring it we are giving them the attention they are looking for. I completely disagree. By ignoring the situation we indicate to the people who do this sort of thing that it is okay to behave this way. That is not the message that I want to send nor is it the message that I think our community should send. As for the celebrity comment, even celebrities take death threats seriously. My friends response to that was that celebrities only concern themselves with substantiated threats. So what then makes a substantiated threat on the internet? Does someone have to finally show up at your door with a gun to make it legit?

Our industry is one of the few industries that I know of where your career can be made or broken by your blogging behaviors. Blogging is one of the ways in which we share our ideas and thoughts… its part of what we do. I have always had a problem with it being okay to treat someone with disrespect regardless of the forum. Rudeness should not be tolerated but I have heard time and time again from people in this community comments such as “Oh it is just part of it” or “It is just our way”. It should not be tolerated no matter what the physical makeup of the individual being treated rudely is.

I know very few men who would look a women in the eye and call her a “cunt”. They know the level of insult that word carries and most don’t want to be the deliverer of it. Why should it be any less insulting when some coward does it over the internet? I also know very few men who would stand around and let that be said to women in their presence. I doubt my friend would hear that and say “Just ignore him .. he’s an asshole and if you let it bother you then you are just giving in to his need for attention”. If he did then he isn’t a very good friend.

I am hoping that one day women won’t have to worry about these sorts of things because I actually do love my job and I want more women to see that our industry IS a place where they can exist in peace and actually be successful through hard work.

One last thing that my friend said to me that really got me: “The only reason this is a big deal is because she is a woman… if it were a man no one would give a fuck.” If that is really how men (my friend is male) feel in our community then we have a lot further to go than I thought. I want to believe that people value each other a little more than that. I value PEOPLE more than that. I do and will “give a fuck” no matter who the person is.

I hope that this does not stop Kathy or others from continuing to post. It is like any other threat, if we let it push us down then it will never go away. Her situation may make it such that she feels she must stop posting or speaking and that is her decision but I hope that we are able to fight this sort of thing and stand up to this type of behavior. MLK once said “When you are right you cannot be too radical; when you are wrong, you cannot be too conservative.” I am starting to really get that statement.

This is also posted to Devchix

Powered by WordPress