Women in Computer Science – An Endangered Species of a New Kind?

January 31st, 2008 by comment gennipher

This year I have decided to finally go back and take a course at my local college. I already have a Computer Science Degree. I graduated in the spring of 2004. The course that I’m enrolled in, Operating Systems, I have already taken, but now that I’m an Oracle DBA and I am responsible for some Linux System Admin, I figured that retaking the course would be good for me and help refresh my memory on some concepts related to system processes, process scheduling, etc, general stuff really that can be applied to Oracle tuning. So here I am sitting in this 400 level senior course on the first day of class, looking around at my fellow classmates, and feeling grossly out of place. Feeling so, because I am the only woman in the class. Out of 31 students, I am the only woman, and to make it worse, I have already taken this course so I am not really a part of this graduating class! The first time I took the class, I distinctly remember at least 5 chicas out of 30(ish) students. Where are all the women? Did they just take the class a year early? The class is only offered once a year, so that’s even more disconcerting. Hopefully this graduating batch of women were just smart enough to take it a year earlier than what is recommended in the student handbooks. But now I’m starting to think about how my beloved Computer Science department was combined with the Industrial Technology department in 2005. Not that there is anything wrong at all with Industrial Technology, but the two fields are completely different! I am wondering if this departmental change may have scared off wonderfully potential female candidates.

Back in high school, my senior year, our math class was working on proofs. The teacher was assigning specific problems to students and they would work the problem out on the board. This one proof she let 2 students solve it on our dry-erase boards (which we had 2 of). Student 1, male, solves the problem taking up the entire dry-erase board. Student 2, also male, also solves the problem using the entire dry-erase board. I start to panic, because it only took me 3 lines to solve this proof! Did I do it wrong? So I go back and read over it a couple of times, and I just can’t see anything wrong with it. My hand shot up, and the teacher comes over. I showed her my answer, and pointed to the boards asking her, did I miss something? Am I looking at this wrong?? She takes a minute or two to look at it, and reassured me that I had not done anything wrong and that my answer was right. She was very impressed because even she didn’t see the route I took to solving the proof, until she saw my answer. It was elegant and clean. She asked me if I would put it on the board and show the class how I did it, which I was delighted to do (who doesn’t love a little ego rub). So after I wrote my 3 lines on the board, and took a few minutes to explain how I got to the solution, I looked back at my classmates to see if they had any questions, and found myself looking at wrinkled noses, tilted heads and perplexed faces (one guy actually slapped his forehead to acknowledge his realization). Slowly but surely they began to see this simple route to the answer. It is funny, because I remember the feeling of how impossible it seemed to me that out of my entire class, including my teacher, I was the only one that saw the answer this way. But it just was.

Having this memory, perhaps this is why I find it such a bitter pill that I am the only female in my class this semester. Not that I am trying to be an ultra feminist, but how are we supposed to reach simple and graceful solutions when our classes are only being represented by a majority of white males. And I certainly am not saying that white men don’t have simple and graceful solutions, just that diversity plays a very important role in everything. So I am thinking about pulling some resources (my boyfriend has plenty of statistics at his disposal since he is a Business Consultant) and doing some research on my college and the female representation in Computer Science and how that relates to my city and the women in the workforce here. I’d also like to know how these women compare with the male classmates, i.e. top of the class, middle or failing. Although, admittedly, this might be greatly skewed for inappropriate reasons. Which may or may not be discussed, depending on the relativity to this topic as I get further along with my research.

I’d love to hear from the readers as well, what are your thoughts/comments/suggestions? Is there an idea you have on what you would like to see discussed in my research?

ˆ Back to top

HAML Tip

January 28th, 2008 by comment desi

So we were having an issue with haml and using a text-area output. It had indentation when it should not have and double indented after doing a save. A quick google search brought me to Ray Morgan’s Blog for the answer. Basically instead of using the = sign use a ~ and it will preserve whitespace. Thanks Ray. I am posting it here so I will remember where to find it if/when I forget what the answer was in the future.

ˆ Back to top

AVON Tomorrow Fund

January 25th, 2008 by comment desi

DevChix has applied for the AVON Tomorrow Fund to help us with operating costs, scholarship fund, and conference sponsorships. Keep your fingers crossed for us.

From the AVON Tomorrow Fund site:

“At Avon, we believe that empowering women can be the most effective way to improve society and change our world. For over 120 years we have provided economic opportunity for women worldwide, often in places and at times when employment options were limited. Given the resources, women can impact their lives, their families and their communities in meaningful ways. Women can change our world.

In this spirit, Avon has created the Hello Tomorrow Fund. Every week since April 15, 2007, $5,000 has been awarded to an individual to help realize a program, project or idea to empower women.”

ˆ Back to top

Call Me! A quick how-to for getting dialable phone numbers in your Rails app.

January 22nd, 2008 by comment desi

This might be something everyone knows but just in case I figured I would post a quick how-to on getting a clickable phone number in your Rails app. This example is only for the iPhone user_agent but you can make it work for other types as well as long as you know the user_agent.

Place the following code snippet in your application.rb file

 session :mobile => true, :if => proc { |request| Utility.mobile?(request.user_agent) }

  class Utility

    def self.mobile?(user_agent)
      user_agent =~/(iPhone)/i
    end
  end

Then in your view or your presenter code put a check for the session variable and if it is set then display the clickable phone number with the tel protocol in the href like so


"tel:#{contact.phone}"

and if its not set then just do things normally. Make sure you have the check there because if you don’t then when someone clicks the link in the browser it will complain about not understanding the tel protocol.

ˆ Back to top

Two Mint Condition Original Unitech "Unix Magic" Posters for Auction

January 20th, 2008 by comment gloriajw

I have two of these posters for auction. They are both original Unix Magic posters, in mint condition, rolled up for 20 years and never touched or hung.

I will leave this announcement up for one month, and the posters go to the highest bidders. Deadline is Feb 21st, 2008. There is a minimum bid for me to even consider parting with these (Hint: You have to give me a lot of money for me to part with these babies. I stood in long lines, did many puzzles and gave away lots of business cards at Unix Expo to get these posters many years ago.)

Private bids are welcome, drop us a message stating your bid by using the Contact Us Form. The highest bid for the moment will be posted, but the bidder will remain private in those instances.

Proceeds will go to the DevChix Scholarship Fund, now that DevChix is nonprofit! Woot!

I have a third that I’m keeping for myself, along with a Unix Feuds poster that will go with me to the grave. If anyone knows where to get the elusive Unix Views poster, please drop me a message. I contacted the original artist but to no avail.

Gloria
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Highest bids to date:

Poster 1: $300
Poster 2: $290

ˆ Back to top

Mac OS X Hack: Autoupdate your desktop background

January 16th, 2008 by comment SarahMei

My new favorite site on teh intarwebs is the Mt. St. Helens Volcano-cam. So serene! So pretty! So different from the view out my office window, which always seems to include at least one screaming firetruck, particularly during conference calls!

Ahem. Anyway, the volcano-cam picture on the main site is updated every 5 minutes (ish). I wanted it to be my desktop background and update more or less in sync with the online version.

To my surprise, I could find no way to set this up in the OS X control panels. Read the rest of this entry »

ˆ Back to top

A Hello World for Ruby on Ragel 6.0

January 13th, 2008 by comment Ana Nelson

This is an updated version of this tutorial. This updated version is compatible with Ruby 1.8 and Ruby 1.9, and Ragel 6.0. A version of this tutorial in Portuguese is available here.

By the end of this post, you’ll be able to turn a simple string “h” into the much longer and more interesting string “hello world!” using the magic of Ragel, all from the comfort of Ruby. Ragel is a very powerful state machine compiler and parser generator, which is at the heart of software like Mongrel and Hpricot. It’s able to generate C, C++, Objective-C, D, Java or Ruby code.

Ragel has excellent documentation provided by the author. My goal here is just to give you some context so that the documentation “sticks” when you read it, and to give you a working example which you can modify as you explore Ragel’s functionality. If you want to skip ahead, the full example is here.

The first step, of course, is installing Ragel. The Ragel home page has a Download section which lists ports for various platforms. If you already have Ragel installed, check that the version is 6.0 or higher. You can also compile and install Ragel from the source. Even if you don’t want to install from source it’s handy to have a copy of it to get some examples to play with. The subversion repository for Ragel is located here:

http://svn.complang.org/ragel/trunk/

As usual the test/ directory is your friend, also check out the examples/ directory. As per this thread, try searching for “LANG: ruby”.

When writing Ragel code, you create a file with a .rl extension. The .rl file is written in the “host” language, in this case Ruby, and the Ragel machine specification is embedded within the Ruby code using special delimiters. There’s actually no obligation to specify a state machine, so a perfectly valid .rl file is:

puts "hello world"

Don’t worry, I’m going to do a better Hello World than that, but this is a good place to start. To convert this .rl file into an executable .rb file, use the “ragel” command with a -R flag to indicate that you want Ruby code.

ragel -R hello_world.rl

This will create a file entitled hello_world.rb with the following contents:

# line 1 "hello_world.rl"
puts "hello world"

I’ll, er, leave executing that file as an exercise for the diligent student.

Ragel actually does this conversion in 2 stages. First it creates an XML file, then converts the XML to Ruby. If you want to view this intermediate XML then you can pass the -x flag in addition to the -R flag.

ragel -R -x simple_state_machine.rl > simple_state_machine.xml

Now, let’s write some actual Ragel. Start a new .rl file or download the example and read along. We’re going to create a machine which prints “hello world!” when it’s passed the string “h”, and does nothing otherwise. To indicate to the ragel compiler that we are writing instructions for it, and not Ruby code, we need to place our Ragel code within double-percent-sign-curly-brackets %%{ and }%% , or you can enter a single line instruction by just typing %%. (See page 6 of the User Guide.) Here’s our state machine specification:

%%{
  machine hello;
  expr = "h";
  main := expr @ { puts "hello world!" } ;
}%%

A quick overview of what’s happening here. The name of this machine is “hello” (Ragel makes us name it). It recognizes a single token, the string “h”. When it encounters that token, it performs (in Ruby) the action:

puts "hello world"

Now, if you were to run the ragel command on this file it would compile, but you would basically end up with a blank Ruby file. We have only specified the machine, we also have to tell Ragel to actually translate this machine into Ruby code using Ragel’s write statements. The first write statement we need to add is

  %% write data;

If you add this line after the state machine definition block, it will compile, as long as you remember to add a blank line afterwards. (After you’ve worked with parsers for a while you come to appreciate newlines in a whole new way.) After adding this line and compiling, you should have a rather significant Ruby file with lots of class << self statements all generated by Ragel. You don't need to study this code, at least not right now. It's pretty dull and ugly. And, if you run the ruby file at this point, you won't see any output.

There are 2 more write statements to add, and for convenience we're going to place them within a ruby method. The argument to this method is going to be the string we want to parse. Ragel expects to find a variable named "data" containing an array of ASCII codes, so we will need to convert our string to an array. This is done very easily in Ruby using the unpack method.

def run_machine(data)
  data = data.unpack("c*") if data.is_a?(String)
  %% write init;
  %% write exec;
end

write init tells Ragel that we want to generate initialization code for the state machine. The code Ragel generates here is:

begin
  p ||= 0
  pe ||= data.length
  cs = hello_start
end

The variable p keeps track of which character in the data string we are currently parsing, starting at 0. pe is an upper limit for p. cs stores the current state of the state machine, and here it is initialized to the starting state of the state machine. These variables are discussed in the User Guide.

write exec tells Ragel to write the meat of the parser (finally!). The code generated here will actually take an input (the data argument) and determine what the state of the system should be based on that input, executing any actions which might be triggered along the way. Let's add some puts statements so we can follow the code execution.

def run_machine(data)
  data = data.unpack("c*") if data.is_a?(String)
  puts "Running the state machine with input #{data}..."

  %% write init;
  %% write exec;

  puts "Finished. The state of the machine is: #{cs}"
  puts "p: #{p} pe: #{pe}"
end

Just add 2 more lines at the end to call run_machine with various arguments and then we can actually compile and run our state machine.

run_machine "h"
run_machine "x"

And here we go...

Running the state machine with input 104...
hello world!
Finished. The state of the machine is: 2
p: 1 pe: 1
Running the state machine with input 120...
Finished. The state of the machine is: 0
p: 0 pe: 1

It worked! Now, to help us interpret the values of p, pe and cs let's take a look at the state chart of this state machine. Ragel has built-in Graphviz support to create state charts. We need to use the -V flag instead of -R.

ragel -V simple_state_machine.rl > simple_state_machine.dot

If you render the resulting simple_state_machine.dot file in Graphviz, you should get something like this:

State Chart for Simple State Machine

We can see that the state machine has only one possible transition, from state 1 to state 2. When we passed "h" as the parameter to run_machine we did indeed end up with the variable cs (current state) equal to 2 at the end of our run. When "x" was passed, we ended up with cs = 0. 0 is the error state, indicating that an error occurred in the state machine. (You can tell that 0 is the error state by reading some of the variable assignments generated by write data, the code I said was dull and ugly.)

In the label 104/4:18 over the arrow transitioning from state 1 to state 2, the 104 corresponds to the ASCII code for the letter "h". (Type "?h" in irb.) The / indicates that an action is being performed, and 4:18 tells us that the action starts at line 4, column 18 of the .rl file. Had we given our action a name, that would have appeared here instead of the file position.

By the way, here's the (textmate-specific) shell script I use to run all these steps quickly:

ragel -R simple_state_machine.rl
ragel -V simple_state_machine.rl > simple_state_machine.dot
dot -Tpng simple_state_machine.dot > simple_state_machine.png
open simple_state_machine.png
ruby simple_state_machine.rb
mate simple_state_machine.out

Now, try running this code:

  run_machine "hh"

You should get:

Running the state machine with input 104104...
hello world!
Finished. The state of the machine is: 0
p: 1 pe: 2

You don't get "hello world!" twice. Sorry. Our state machine is only looking at a the first character we pass. It knows we gave it two characters, the variable pe = 2, but after it evaluates the first character it's in a final state. There's no arrow coming out of the state 2 circle. So, passing additional input results in the system entering the error state. If we want the entire data string to be evaluated, we need to make a small change to our machine specification.

main := expr+ @ { puts "hello world!" } ;

Endless Simple State Machine

(Try expr* instead of expr+ and see how the state chart is different.)

Now, try running this new state machine with inputs "hhh" and "hxh":

Running the state machine with input 104104104...
hello world!
hello world!
hello world!
Finished. The state of the machine is: 2
p: 3 pe: 3
Running the state machine with input 104120104...
hello world!
Finished. The state of the machine is: 0
p: 1 pe: 3

When we pass "hhh", we get a "hello world!" for each "h". When we pass "hxh", we get the first "hello world!", but when we hit the "x" we enter the error state, so the last "h" doesn't get evaluated.

Here's one more example, this time without defining a run_machine method:

  %%{
    machine hello_and_welcome;
    main := ( 'h' @ { puts "hello world!" }
            | 'w' @ { puts "welcome" }
            )*;
  }%%
    data = 'whwwwwhw'
    %% write data;
    %% write init;
    %% write exec;

Hello and Welcome State Machine

welcome
hello world!
welcome
welcome
welcome
welcome
hello world!
welcome

So, there you go. Hours of entertainment await you. We've only scratched the surface of Ragel's features here, but you should now be able to navigate through the User Guide without too much trouble. If you need a better reason than "fun" to play with Ragel, then bear in mind that parsers are a great tool for constructing Domain Specific Languages (DSLs), and state machines are magic code shrinking machines for situations where you need to keep track of the, er, state of something and control the transitions between states (i.e. business logic). I would highly recommend everyone to read this article about Ragel which inspired me to check it out. If you're into Rails, then take a look at the acts_as_state_machine plugin which might be more intuitive than Ragel at first. If the DSL angle is more your cup of tea then you might want to look at ANTLR instead, which has a different focus and feature set than Ragel.

ˆ Back to top

DevChix is Incorporated

January 11th, 2008 by comment desi

DevChix is officially incorporated. We filed the Articles of Incorporation in the state of Florida, since this is the state in which I live. Our next steps are to file all the paper work around becoming 501c3. Once we are an official 501c3 we can then begin to seek financial donations to start funding some of the programs we want to put in place this year.

I am very excited about our progress and I am even more excited about what we have in store for the year. I am going to write up some information on the programs we want to get going soon and post those so everyone will know what we are working on.

Cheers
Desi

ˆ Back to top

A Little History Lesson: The ENIAC Programmers

January 7th, 2008 by comment desi

Two of the goals we have here at DevChix are to promote women in development and educate others about women in development. I started thinking about how we might accomplish those goals and decided that one way would be to have history lessons on past women in development. Several women on the list have signed up to do these articles and my article is slated as the first one. So here is a little history lesson about the ENIAC programmers.

I first read about the ENIAC Programmers a couple of years ago when I accidentally stumbled on the WITI Hall of Fame. I was amazed I hadn’t heard about these women before, a little embarrassed that I hadn’t done more to find such women, and a little awestruck that they were never taught to me or mentioned in any computer science courses I had ever taken.

During WWII there were some 80 women who worked at the University of Pennsylvania calculating ballistics trajectories for the US Army. These women were referred to as the “computers” because they had to calculate complex differential equations by hand.

The ENIAC (Electrical Numerical Integrator And Calculator) computer was basically a very large calculator made up of 17,468 vacuum tubes, along with 70,000 resistors, 10,000 capacitors, 1,500 relays, 6,000 manual switches and 5 million soldered joints. It covered 1800 square feet of floor space, weighed 30 tons, and consumed 160 kilowatts of electrical power. This computer was created to calculate these ballistics trajectories that all these women had been calculating by hand. It was built by John Mauchly and J Presper Eckert in 1946.

Six women were selected from the 80 “computers” to be the first programmers of the massive all-electronic digital computer. The programmers had to physically route data and program pulses through the machine with switches, digit trays and dozens of cables. Those first six programmers, all women, were Kathleen McNulty Mauchly Antonelli, Jean Jennings Bartik, Frances Snyder Holberton, Marlyn Wescoff Meltzer, Frances Bilas Spence and Ruth Lichterman Teitelbaum. This photo is of Jean Jennings Bartik (left) and Frances Bilas Spence (right) preparing for the public unveiling of ENIAC, February 1946. Jean Jennings Bartik (left) and Frances Bilas Spence (right) preparing for the public unveiling of ENIAC, February 1946.

On February 15, 1946, the ENIAC Computer was unveiled to the public and press. It ran the ballistics trajectory programmed by the six programmers and captured the world’s imagination. The machine became a legendary machine and all the engineers of the machine, all men, became quite famous. However, unlike the engineers, the programmers, all women, were never mentioned. Its not really that surprising but it is sad. These women did something extraordinary and it hasn’t been until the last 2 decades or so that their story has even begun to be told.

Currently there is an effort to produce a documentary about the ENIAC programmers before they all disappear. The site eniacprogrammers.org is currently taking donations to help fund the documentary so please do check them out and maybe throw a little bit of money their way to help with this. I would love to see the documentary get made and for these women become household names just like Ada, Grace, and Anita.

Also check out the WITI Hall of Fame For the ENAIC Programmers or just spend some time reading about some of the other women in the Hall of Fame. Wired Magazine also did an article on the women back in 97 which is a good read if your interested.

Resources used: Wikipedia, WITI, About.com, ENIACProgrammers.org and Wired Magazine

ˆ Back to top

Programming from the (under)ground up

January 5th, 2008 by comment lisa

Hello. Welcome to my first article.

And my brand spankin new, made-from-scratch stab at programming. It’s going to be a bumpy ride: bumpy like fun-old-rollercoaster-bumpy not trainwreck-bumpy (universe willing).

Please allow me to rattle off some quick background facts so you know what planet I’m coming from. I’m a 26 year old retired bartender. I did that for more years than I care to say (ok fine, 8). I fancy myself an amateur artist; basically, I paint for therapy and fun. I’ve always liked things of a nerdy nature (i.e. writing very basic html in a webshell on angelfire when I was 13, Magic the Gathering, guys who majored in Astrophysics, etc). I consider myself very confident and intelligent, and it’s a shame that went to waste for so many years. That being said, years of bartending with no substantial plans for the future wore me out and made me feel quite desperate for awhile.

Then something changed. I got beat down so much by the universe’s way of telling me to stop f’ing around, that I got fed up with being fed up. Well, Desi McAdam happens to be one of my favorite people on the planet and a very close friend, and she had always offered to teach me programming…intensively. She and my other longtime friend/ROR evangelist Obie Fernandez had always told me they thought I’d be a great programmer. I didn’t know what they were talking about. So I called up my dear Desi and said “I’ll do whatever it takes. Let’s do this thing.”

I thought I was going to be learning in my off time while still bartending and getting tutored whenever Desi was in town. I knew this would take a very, very, very long time, but I felt ready for the challenge.

As it turned out, she and Obie were down here in Florida on the beach working with this fabulous guy Mark Smith. I had met him some weeks before, and we all had a great time together. They wanted to bring an apprentice on to the small team, so voila! Here I am. I am now in full on training starting with nothing but my instinctual and intellectual abilities and no experience. I am extremely grateful for the opportunity I have, and I intend to give back to Desi and Obie by trying hard to be a bad ass programmer.

Desi is putting alot of effort into being my personal, full-time tutor, and I think she rocks socks for it.

So I’m offering up myself, my victories, and my many future foibles here for your musing and amusement.

Cheers and enjoy

ˆ Back to top