Fixing my autotest after switching to Rails 3.1.0
posted by joanwolk May 24, 2011 @ 7:49 PM • 0 comments
[cross-posted from git init and get in it]
In my last post, I complained about autotest being broken. Well, it’s not actually broken. I’ve just fixed my problem, and it turned out to be one of the perils of the way I went about the conversion of my project to the new version of Rails, and not at all related to the Rails upgrade or the autotest gems.
The missing piece was that in my new project folder, I didn’t have a .rspec file. That file contains one crucial line of code, --drb. That’s all. (Ok, I actually have a second line in mine, --color to show red/yellow/green for fail/pending/pass, but that’s not the important part.)
That one invisible file with the one short line of code is, approximately, the connection that allows spork to load the project for testing and allows autotest to recognize the location of the tests. The rspec wiki page regarding autotest explains that having a .rspec file in the project root “tells RSpec to tell Autotest to load RSpec’s autotest extension.” Thank goodness I found the advice of the third responder on a year-old StackOverflow question!
This problem was only tangentially related to my Rails version upgrade. Because I created a fresh project and copied over only the relevant bits of the code, it was easy for me to miss the invisible .rspec file. (For my fellow noobs, any file or folder beginning with a period will be invisible in the default file navigation view of your system. A lot of system files are named this way to prevent people accidentally altering them.) By copying over most of the code I needed, I may have actually blocked myself a bit. I think that if I had set up RSpec properly, it would have created the file for itself based on my system-wide preferences for it. The dangers of cutting corners, eh?
Rails 3.1.0.beta1
posted by joanwolk May 12, 2011 @ 4:24 PM • 0 comments
[cross-posted from git init and get in it] The hubby (a longtime PHP developer and fellow Rails n00b) is super-excited about the recent release of the Rails 3.1 beta because it has support built in for things like Sass (a.k.a. SCSS) and CoffeeScript. These things are nifty, although besides Sass, I’m only vaguely aware of most of the things he lists off. I agree, the new version of Rails will be fun. Where we differ is how much fun trying to use it in beta is.
I’m used to how things work in Rails 3.0. I didn’t have any real issues with how it worked, because I don’t do enough scripting (read: almost none) to care about CoffeeScript, and I was content getting the hang of regular CSS before branching out into Sass. My projects weren’t of a scope where I needed those features. So switching to 3.1 for a project the hubby wants to work on with me was more a favor for him, and I thought it would be an opportunity to get used to some of the features a little earlier.
Hoo boy.
I forgot, or perhaps didn’t really know, how difficult bugs can be to track down in a beta, especially when I make plenty of new and exciting mistakes on my own at this point that I have to diagnose. And there are some fun ones to make when moving a project from one version to another!
For example, after I renamed my old version of the project, I had to copy over “just the essential files” to the new version of the project. First try, I copied over way too many things and broke it. Rather than try to roll back the changes I’d made, I just started over. Second try, I copied over only the page code and the routes file. When I tried running my site locally (just on my own browser, not on the web), I found I needed to copy over my javascripts, stylesheets, and images. So I added all those things into the ‘public’ folder where they lived in 3.0, but it turns out they live in a new place in 3.1, the ‘app/assets’ folder. And then I had to change the lines of Ruby in my application layout that called the stylesheets and the javascripts that I use because the syntax changed! And finally, I needed to copy over my ‘db/migrate’ folder and run “rake db:migrate” to make my user model work again.
Then the hubby found out that in 3.1, password encryption is a built-in feature (which is an AWESOME change), so I rolled back two migrations in which I had implemented my own password encryption. Then I spent a while looking at the one blog post everyone linked to on the topic and trying to figure out what the heck they meant by “Your model will need a field called password_digest”. Where was I supposed to add that, and how? Well, it turns out that means you need to add a column to your database table with a migration:
class AddPasswordDigest < ActiveRecord::Migration
def up
add_column :users, :password_digest, :string
end
end And then run “rake db:migrate”.
So I did that, and then I wanted to annotate my models to see if the changes had gone as I expected, at which point I ran into a whole new problem: I couldn’t run the command “annotate”. So I tried to add it to my Gemfile. It was already there, it seemed, but I tried moving it into a different group. I tried different annotation gems. I tried destroying my Gemfile.lock and re-running “bundle install”. Nothing worked. I thought the beta had broken something badly. I finally gave up on Google to answer the question and was writing up a question on stackoverflow.com when the hubby looked over at my screen and asked what was going on. With his greater experience in debugging, he found out that the problem was that I hadn’t quit my text editor between when I deleted my first attempt at the project and when I created a new attempt of the same name. Basically, the version of the Gemfile I’d been editing was the version in the trash. D’oh! But come on, how un-intuitive is that?
And now, annotate is STILL broken! It shows up as being installed now, but it still gives errors when I try to run it. It hasn’t been updated since November 2009, so it may just be broken with the new version of Rails. Ick.
Also busted in the beta: autotest. This makes me very, very sad. Having constant reporting on whether my tests pass is really nice, and would have been extra-nice now, when a bunch of stuff is broken and I’m going to have to rewrite at least half of my tests. At least running “rspec spec” still runs my tests, but doing it manually after each of my adjustments is going to be a pain in the butt.
Boston folks: Python Project Night, May 20th
posted by jesstess May 10, 2011 @ 4:18 PM • 0 comments
The second Boston Python Workshop filled up in less than 24 hours, awesome!
We are back with a new event, the Python Project Night: http://meetup.bostonpython.com/events/17802791/, 5:30pm – 9:30pm on Friday, May 20th at Microsoft NERD.
Come work on Python projects, get programming help, help others, and hang out. Bring your own project or work on one of the suggested projects.
The event is open to everyone of all programming experience levels, but there’s an emphasis on resources and support for beginning Python programmers. Staff from the Boston Python Workshop — a programming event for women and their friends organized by women in the Boston open source community — will be there to help work through intro material and practice projects.
A lot of great women from the Boston programming, open source, and tech communities will be there, and it’s a supportive, no-assholes-allowed environment for new programmers (and for everyone).
I hope to see some of you there!
Hello world!
[cross-posted from gitinit.wordpress.com]
Ha! For once, the default title of a WordPress blog is relevant! Because as all programmers know, and anyone dipping their toes in the field will quickly discover, the first program of just about any language you learn to write is one that produces or displays the text “Hello world!”
So, yes, hello world. I’m Joan, and I’m teaching myself Ruby on Rails with the help of the fantastic Ruby on Rails Tutorial. There are always more “rabbit holes” though, and I’m also learning about version control with Git and hosting copies of my open source code on GitHub, and scalable hosting on Heroku (free for small projects). I run up against various problems with my code, then have to track down the source of my errors and figure out how to fix it, and often get side-tracked with other things I’m learning as I dig into the problem. Bugs in my code are annoying (I didn’t get it right!) but I definitely learn a lot from solving them, and hopefully I can share that knowledge with other people here. I expect the technical level of the writing to start fairly low and go up over time as I run into more challenging problems than “Where did I end up with a typo?” or “Why does Heroku make it so hard to find their relevant support documents?”
New to free and open source software development? Want some help getting started?
posted by jesstess Oct 10, 2010 @ 5:28 PM • 1 comment
in foss irc mentoring openhatch programming software engineering volunteering
The punchline: new to free and open source software development? Want help getting started? Come to the OpenHatch open house tonight, Sunday October 10th, at 8:30pm Pacific: https://openhatch.org/blog/2010/learn-more-sunday-monday-office-hours/
In full:
Free and open source software (FOSS) projects need all kinds of help — everything from coding and documentation to artwork and translation to helping users, encouraging new volunteers, and getting funding.
Contributing to FOSS projects is awesome for many reasons. It’s a great way to develop your software engineering skills and proficiency in a programming language. It’s a great way to gain experience with real-world development environments (revision control systems, patches, test frameworks, automated testing and build farms, communication media like IRC, release cycles, writing and maintaining documentation…the list goes on and on). It’s also a great way to meet new, smart, interesting people.
For many people, the biggest hurdles are 1) finding a first project to work with, and 2) getting comfortable enough within a project community to make the leap to speak up for the first time (be it submitting a bug report or patch, helping someone, or asking for help). If this resonates with you, have a look at OpenHatch: https://openhatch.org/
OpenHatch helps you find projects, bugs, and people in the open-source community. Browse projects matching your criteria. Tell projects you want to help and have them work out assignments that make sense for your skill set. Browse bite-sized bugs to get your feet wet, and search for bugs by type or programming language. Find people near you who are also contributing. Become a mentor or mentee.
If you want to learn more about OpenHatch, come to their virtual open house, tonight, Sunday October 10th, at 8:30pm Pacific: https://openhatch.org/blog/2010/learn-more-sunday-monday-office-hours/
The open house is on IRC. If you want help getting started with IRC, or want to practice chatting using IRC before the open house, send me a stemming.org private message and I’d be happy to help.
Hi! And some links for girls & tech
posted by abby Apr 17, 2010 @ 6:03 PM • 0 comments
Hi! I just found this site from DevChix (thanks, Jeanne!).
So just wanted to say hello and what an awesome site this is! I’m a software developer – I have The Hacker Chick Blog and I just landed a totally snazzy new job as a Developer Evangelist for Startups at Microsoft.
One of the amazing things is all of the great programs that Microsoft sponsors for students. I actually got to spend my first day volunteering at a DigiGirlz Day where we brought very cool next generation technology (Surface/multi-touch, electronic art, fabric-based computers – totally neat!) to around 300 high school girls. That was _totally _my coolest 1st day on a job ever. :-)
DigiGirlz Website: http://www.microsoft.com/about/diversity/programs/digigirlz/default.aspx
We also do Imagine Cup, which is a worldwide student competition, where students compete to build technology that addresses some of our greatest challenges like hunger and environmental issues. The US Finals are being held April 26th in Washington DC and they’re open to everyone (am a little jealous I won’t be able to get down to DC for this!): https://www.microsoftusevents.com/IC10communityshowcase/Content/Home.aspx
Anyway, just thought some of you might be interested, I’ll try to post more things like this as I find them and am looking forward to meeting more of you on the site! :)
Motivating Programming for a 12-Year-Old
posted by jesstess Apr 2, 2010 @ 1:44 PM • 10 comments
I have a sister who is 12. She loves her math and science classes, but her school doesn’t seem to be interested in teaching computer skills (not even typing – I bought her some typing programs to get her started when I found that out).
I love computers and I love programming because of the limitless applications and ways to help people. My enthusiasm has yet to convince her that programming is something she’d be interested in, though. I’ve tested the programming waters with her on a few occasions using Python, but she is quickly bored by the need to understand basic data structures and flow control before being able to do anything interesting.
I’m not sure how to better motivation programming for her. Super-high-level kid-oriented languages exist, for example Scratch and many other projects from the Lifelong Kindergarten group at the MIT Media Lab, but as the group name suggests, these programming platforms are geared towards kids half her age.
One idea I’ve been toying with is setting up a Moo for her and her friends and seeing if exploring the world inspires her to want to learn how to add things to it (although Lambda is maybe a sadistic choice for first programming language).
Has anyone has success with introducing programming to someone this age? What worked for you?
Ada Lovelace Day -- the women of Stemming!
posted by clara Mar 24, 2010 @ 3:54 PM • 1 comment
in ada lovelace day ald10 amanda dartmouth data analysis emma emma staatz grad school jen myers jenmyers lola lola thompson mame maloney mamealoney math michelle steigerwalt mootools morgannalefey programming public health siobhan perricone skepchick
Happy Ada Lovelace Day — an international day of blogging about women in science and technology! Some of my technical & scientific heroines are the women of Stemming — below, a few women who agreed to be profiled today.
Emma (Emma Staatz) is studying to be a doctor specializing in public health — after getting degrees in English and theater in college, she took the initiative to take science courses and EMT training on her own in preparation for a medical career (even though, as she says, “there is a sad lack of costumes in science”). She loves learning how things work — “from toasters, to physics, to people’s bodies” — and prepared for a scientific career from an early age by having a lab in her basement as a child. Currently, Emma works in an office, and she enjoys movies, obsessing about Lost, and hanging out with friends.
Jenmyers (Jen Myers) always enjoyed working with computers, and once she discovered the internet, she worked on creating her own websites, which inspired her to change her major to computer science (moving away from her background as an artsy literature geek). She found the transition challenging, but says "I’m a firm believer in erasing all the lines that exist as barriers to tech/science, whether it’s for people who are told they’re only good at “creative” endeavors or whether it’s because they’re of a certain gender or ethnicity." Now Jen works as a web designer and front-end developer. She finds the fast pace of new technology that she has to keep up with both exciting and frustrating, and while she finds some aspects of the typical tech culture frustrating, she’s hopeful that that is changing. Jen is a single mom to a four-year-old daughter, writes for Skepchick.org, and runs a local skeptic group in central Ohio. She also blogs at deliberatepixel.com and tweets as @antiheroine.
Lola (Lola Thompson) is a mathematics PhD student specializing in number theory. She’s loved math and logic since an early age; as a kid, she loved going to math camp, and learning about ideas like fractals and the Fibonacci sequence. Her mathematical career hit a bump when she was turned off by the formulaic qualities of calculus in high school and early college, but once she discovered the possibility of a career in theoretical math, as she says, “once I got a taste of this so-called ‘pure math’, I knew that I had to be a mathematician”. She loves the creativity and flexibility of her job, but wishes there were more women in her field, especially other women who love skirts and heels! When she’s not doing math, Lola dances, cooks, and tries to travel each year to the most interesting place that she can for under $500 (last year: Iceland, this year: Peru). You can also find her online at math.dartmouth.edu/~thompson.
Mamealoney (Mame Maloney) is using her math degree as a programmer and data analyst at an economic consulting firm. She has always excelled at math and science, and enjoyed the satisfaction of pursuing subjects she was good at. She enjoys the day-to-day rhythm of her quantitative job, and likes her colleagues, but regrets that her challenging technical job takes up a great deal of time and pressures her to focus on technical development at the expense of her more sensory and artistic interests, like drawing, painting, and piano. But when she does have free time, Mame reads, rides her bike, drinks beer, shops, and is active in the animal welfare movement. You can find her online at hydrobromic.com.
MorgannaLeFey (Siobhan Perricone) has been interested in computers ever since her father first brought home a VIC-20, and now she works as a web applications and database developer. She loves using her technical skills to help make people’s lives easier, and says “there’s a real rush of pleasure when I finally manage to debug my software” — but she finds it frustrating when people dismiss science and technology as “too hard” for them. She enjoys a variety of games — computer games, online collaborative games, tabletop roleplaying games, board games, and card games — and spends a lot of time reading and watching movies. She also loves to travel; she attends at least one gaming convention a year and looks forward to a trip to the UK to officiate a wedding this summer.
Nora (Nora Friedman) is pursuing a PhD in public health — she studies infectious disease epidemiology. Her job involves a variety of scientific techniques — researching and compiling data, biology, immunology, bio-statistics, coding in SAS, and teaching both scientific theory and epidemiology methods — and she enjoys all these aspects of her work. Nora comes from an academic and scientific family that encouraged her pursuits in these fields; when she’s not working, she bikes around New Orleans, takes care of her house, and volunteers as a parasitologist at an animal shelter. She occasionally blogs at bigshouldersbigeasy.blogspot.com.
And Stemming user
Amanda wants to give an Ada Lovelace Day shoutout to her twin sister Michelle — the only woman on the MooTools dev team!
Did you make an Ada Lovelace Day post today? Link it in the comments!
Resources for Beginning Programmers
posted by clara Feb 23, 2010 @ 5:34 PM • 6 comments
in computer science for teens getting started hackety hack interactive fiction lisp programming project euler ruby scheme text adventure games why's poignant guide to ruby
In almost all areas of STEM, there’s a good chance that you’ll need to learn a little coding at some point to crunch your fruit fly data or make your robot go. Even if it’s not totally necessary for your projects, it’s often good to know some programming anyway — it’ll give you an advantage in your lab or office, it’s a great skill that can get you plenty of jobs on its own, and more importantly, it’s fun to learn and do.
Think you might want to learn programming, but don’t know where to start? Here are some great, (mostly) free, and fun resources that will have you coding like a pro in no time:
First, you’ll need to pick a language to learn. There are a LOT of options, and everyone will have a different opinion about what’s best for a beginner. The good news: for the most part, you can totally ignore that! It doesn’t really matter what language you pick first. Just stick with it for a few months until you’re able to write a couple of simple programs that do something interesting; then, when you start to learn a second language, it will be much easier. (Try “translating” some of the programs you wrote in the first language into the second.) Once you’ve learned to do the same things in two different languages, you’ll probably find that it becomes simple to pick up a new language whenever you need it for a job or project.
Here I’ll suggest Ruby and LISP, two of my favorite languages. Ruby was designed to be fun to program, and is a good language for creating little scripts to do things on your computer, or, later, writing complex web applications. LISP (which stands for “List Processing”) is an old-school language with simple syntax that’s a good basis for really digging into the ideas behind programming. It comes in a few different dialects, but don’t worry, the differences are minor!
(For those who aren’t new to programming: what resources helped you when you got started, and what resources did you wish you had? Share in the comments!)
Falling in love with computers
posted by MorgannaLeFey Feb 17, 2010 @ 9:38 PM • 1 comment
in .net access alaska amiga bbs cold fusion commodore computers databases fidonet love lusternia online communities programming q-link quantum link second life sql t1 technology time bank vermont vic-20 web applications
I think it all started with the electric typewriter. I loved that thing. My father was a free-lance writer who produced a fair amount, and was actually published in a few magazines. He used the electric typewriter, of course, and it was in the “study” which always had a desk (no matter which house we were in, there managed to be some place for Daddy (yes, I call him Daddy, deal with it) to write), but was also a mishmash of boxes filled with photos, old yearbooks, and other memorabilia. I have many fond memories of various rooms over the years where I would sit and thumb through books or look at old family photos, or read strange things I later discovered that my father had written.
I adored the sound the typewriter made. The hum as it was powered on, the sshtick as the typewheel spun around and shifted to the left margin, the whir of the platen as I feed in a sheet of paper, and of course the clacking as I typed. When I was fairly young, I’d just sit at it and make noise with it until I was told to turn it off and stop wasting paper and ribbon. I learned to touch type by the time I was twelve years old, and I used it for various reports at school. Then Daddy brought home a sort of word processor. It was like an electric typewriter, but it had a little screen where you typed in your words and could get them right before you committed them to the paper. I remember thinking how utterly cool that was.
Then he brought home a computer. I was around fourteen or fifteen years old and he brought home a Commodore VIC-20. It didn’t have a cartridge slot, it used a cassette that stored the software you ran on it. It came with Lunar Lander and I was hooked. I loved that game. I thought it was so amazing that you stored the game on a cassette!
After the VIC-20, we got a Commodore 64. This had a floppy drive, so we were able to load programs from 5 1/4 inch floppies. I played a jillion games on that thing (Infocom Text Adventures anyone?). I learned about basic programming, and about loops, and pokes, and peeks, and creating little things that floated around the screen, and I was charmed. It never occurred to me that I could do anything with that, though.
I hadn’t been much interested in math or science in school. Frankly, I was never encouraged along those lines by the school system. In fact, I was kept in lower level classes because they wanted to make room for more males in the upper level maths classes. This put my nose out of joint and pushed me more into the humanities. I still dated guys from the chess, science, and forensics clubs, though.
I went into theater arts in college, and I was working backstage. I enjoyed the organization required to be a stage manager, and had envisioned myself in a professional career in Minneapolis (I went to college in southwest Minnesota). I wasn’t ready for college, though. And it kicked my ass. Not academically, but emotionally. I dropped out and got bits and pieces of theater work that didn’t pay the bills, and office jobs that did.
I never stopped loving computers, though. I was delighted when I found out that the college I was going to had a computerized card catalog in the library. My roommate was a math major, and she introduced me to the wide area network chat that connected the entire state college system. I started spending nights and weekends when I wasn’t in rehearsals chatting from various terminals around the campus (some that used acoustic modems and print-out displays instead of monitors). I got to know a variety of math and computer majors from various schools, and we’d often head out on road trips to visit them. After dropping out of school, I kept in touch with these folks, mostly through computer bulletin board services (BBSes). I knew people who maintained their own, and often hung out at their houses to play games or such online.
I spent from 1984 to 1987 this way. Going from office job to office job. Eventually getting into data entry jobs, and chatting/emailing with folks on BBSes when I could get near a computer/terminal at someone’s house. Eventually, I moved in to share an apartment with one of the guys I’d met during the party days in college. He owned an Amiga 1000 and a Commodore 128 that he used in 64 mode to connect to a national network called Quantum Link, which was specifically for Commodore owners.
A new world opened up. I found chat rooms that were way cooler than the chat program I’d used in college. I found a place where roleplaying gamers hung out called the Red Dragon Inn (Q-Link eventually became AOL, it was way cooler when it was Q-Link). I met people from all over the country there, and spent a lot of time (and money) chatting with folks. Eventually, I met a couple from Alaska who had an extra room in the house they were renting and who were willing for me to move in and pay rent and help me get settled. I wasn’t really doing much in St. Paul, MN at the time, so I decided Alaska sounded cool.
I moved there and we hit it off pretty well after a bit of a rocky start. I was 22 and I managed to get a job in a furniture store, and still kept chatting on Q-Link whenever I could. I tried to get the furniture store to consider getting computers to manage things, but the owner wasn’t interested.
I also met my husband online. This was 1988. I was in Alaska, he lived on Long Island. We met in Q-Link, in the Red Dragon Inn, and in an online game of Trollball using the Runequest gaming system. :) We became romantically involved and chatted online, called each other, and wrote each other cards and letters. Eventually, my roommates were moving out of state and I needed a roommate to afford rent. My husband was ready to move away from his mother’s house, and I knew he’d been looking at places like Colorado, some place where there was wilderness. So I asked if he’d be interested in moving out to share the apartment and see if our romance would survive the reality of who we were. He thought about it and decided to give it a go. He arrived in Juneau on December 5, 1988 and we’ve been together ever since, we married around two years later. We used Commodore and Amiga computers, and ran our own BBS for a while, that was connected to FidoNet.
In time, I finally got a job working for the state, doing data entry for a Medicaid program, and that started me off on being a power user and computerizing the offices where I worked.
I set up all sorts of things. I learned about desktop publishing. I worked on a manual for the program I worked for. I acted as a liaison with some programmers we contracted with to provide time study software. I learned about ad hoc reporting and building queries, something for which I seemed to have a natural ability. Still I’d not seriously entertained becoming a programmer.
I spent the next several years working in office administration jobs (in 1993 we moved to Vermont after we’d decided Alaska wasn’t going to give us everything we wanted), and in each job I did everything I could to computerize as much of the work as I could. I developed a lot of systems for things, working my way through Windows 3.1, Windows 95, etc. My husband had been telling me for years that I could be a good programmer, and that I had the right turn of mind for it, but I wasn’t convinced for the longest time. I think that somewhere inside was this stubborn girl that got the idea that math wasn’t for girls and programming was math.
Eventually, however, he convinced me. He taught me some basic things, and I made a shift in my career. I’d always been the person that people came to first with their computer problems, so getting a help desk job seemed like a logical next step. I got a job working for a local ISP in 1997. I did phone tech support for two years before getting a job with a bank fixing general problems on the computer systems and setting up print servers and back up print servers on OS/2 (shudder). Then I got a job helping support databases for the state treasurer’s office, and I started learning Cold Fusion and writing small web applications.
This is where I am now, though not in the treasurer’s office any more. I write and support databases in Microsoft Access and SQL, web applications in Cold Fusion and .Net, and front ends in Access and .Net. I offer computer support to the community through a timebank exchange (which is AWEsome, by the way). I play games online, and have a blast surfing in Second Life (literally surfing, with a surf board, on the ocean), which seems like a natural progression in online communities that I’ve been happily participating in since 1983. I like loads of other computer games, too. I play Sims 3 when the mood takes me, and I’m shocked how much I enjoy RockBand. :) And finally, FINALLY, after five years of not having anything but satellite internet at the house we built in 2004, we have an actual T1 line to our home (DSL and cable internet are STILL not available in our area).
There are no less than seven computers connected to our wifi network, and we both have two computers each (he has a laptop and a netbook, I have a desktop tower and a netbook). We have a media/file server. A PS3. Our guest computer for house guests that can be configured however necessary for friends who might be staying with us. The Linux server my husband uses to hold the development code for an online game he codes for… there must be more… I suppose the DVR we have connected to our Dish might count…
I love technology. I love computers. I love the internet. I don’t see how anyone can NOT love these things. I accept that there are people who don’t, but I just can’t… understand them, I guess.