Monday, October 5, 2009

New Blog: the "How Can Renee Make This Code Better" blog

Over the weekend, I worked on the CS class I'm taking online, and solved a problem that had been frustrating me. I got so giddy when it worked and so wanted to show it to someone that I took a screenshot and posted it on my Facebook wall.

A couple of friends commented on the picture, and my friend Ben even went so far as to IM me and start giving feedback. I find it much more satisfying to do work when other people who understand what you're doing can see it and tell you what they think. At Stanford, students who are actually enrolled in the class get "interactive grading sessions," where the TA will sit down with them for 30 min to review the code and discuss what's good and bad about it. This is particularly important, since you can write a program that completes the task required, but still have produced a poor program; there are usually more than one ways to get the task done, and some strategies are more efficient or flexible to change than others.

I don't have a Stanford TA, and I can't walk to the next workstation and ask a Google engineer what he or she thinks about my program, but I do have inquisitive, generous friends who have studied programming, so I'm creating this other blog in the hopes of getting that interaction which is so important to learning CS.


Sunday, June 28, 2009

Oh, so THAT's what Larry Summers meant

A couple of days ago, I was talking with one of my new roommates about his job. Shawn works at an organization called ADVANCE, and our chat went something like this:


Renee: "ADVANCE? What do they do?"
Shawn: "They deal with inequality in higher education. As you get higher and higher in education, the proportion of women and underrepresented minorities gets smaller and smaller, until you're looking at tenured faculty and the proportion is 3%. So we try to figure out where the gaps are."
Renee: "Oh! Cool! What gaps?"
Shawn: "So if we're talking about tenure, for example. Many woman professors take time off to have kids, and if you take time off from your research, your tenure clock restarts. So women are thinking, 'Is it worth pursuing this career if I'm going to have to start over again when I have a kid?' The fact that there are so few women and minorities in tenured positions-- part of it is because of blatant sexism, sure. But a lot of it is because of systematic flaws like this that just make it harder for them to achieve."

At this point, I got to thinking about a lecture delivered by one of my favorite econ profs, Ann Velenchik. She was exploring the question, Why do girls in developing world get less education than boys do?

She parsed out all the potential reasons, including:

A. Education-as-consumption reasons:
1. Girls get less inherent satisfaction out of school than boys do (as if!)
2. Parents get less inherent satisfaction out of educated daughters than educated sons

B. Education-as-investment reasons:
1. The opportunity cost of schooling is greater for daughters than sons; if children aren't in school, they can work. Or, they can replace their parents at home so that the parents can work, and in agricultural homes, girls are a closer replacement for their mothers than boys are for their fathers.
2. The investment returns stay in the family for less time, as sons earn money that goes back to the family, but girls marry and contribute to the husband's family.

She didn't come down on any one reason; the point of the lecture wasn't to come up with an answer. The point was to get people thinking of schooling as a rational, economics-driven decision, instead of a sexist, values-driven one. (In a sign of what was to come, she kicked off the lecture by stating, "I'm an economist, so we're going to be thinking about this issue as economists do.") If we think of girls schooling as a rational, economics-driven decision, we can solve it with economics. For example, the Progresa program in Mexico, which gives aid to poor families, has subsidies for families if they send daughters to school. (There is a smaller amount attached to sending the sons to school). The program attempts to neutralize the economic decision for families.

If we think of girls schooling as a values-driven decision, we solve it by passing laws that make it mandatory for girls to attend school, sending Angelina Jolie on a speaking tour, etc.

In an infamous speech, then-president of Harvard Larry Summers was trying to take the same analytical approach to tackle the question, Why are there so few female tenured faculty in the math and sciences?

He also parsed out several hypotheses, including:

1. Becoming tenured faculty requires insane hours-- a sacrifice difficult for women who want to have kids
2. There are fewer women with off-the-charts brainpower
3. Discrimination on the part of universities

As you probably know, the academic community exploded in the aftermath of this speech. Many professionals in math and engineering were offended that someone in his position would imply that women and men have different levels of ability, and women faculty at Harvard were frustrated at what appeared to be a lack of support from their president. Summers resigned the following year.

In fact, what Larry was trying to do was apply a technical framework to tackling what he agreed was a serious problem. In a sign of his intentions, Larry kicked off the speech by saying, "I think it's important to try to think systematically and clinically about the reasons for underrepresentation."

I think Prof. Velenchik did a better job of encouraging her listeners to think like economists because she didn't come down on any one answer. Summers, on the other hand, stated outright that he believes in reasons #1 and #2, and was completely dismissive of #3. This took attention away from his "Let's be analytical" perspective and focused attention on his "These are my opinions" perspective.

If you're interested, you can find the Summers speech here, and listen to Prof. Velenchik's lecture by looking up "Wellesley College" in the ITunes store.

Addendum: ...And, if Obama were to realize that many Americans are continuing to drive gas guzzlers out of economic-based reasons, not just values-based reasons, he would offer an incentive for them to switch. Oh! wait, he just did:

"The CARS program is intended to encourage consumers who own an older, gas guzzler to purchase or lease a new, more fuel-efficient vehicle. In doing so, it is expected to give the auto industry a sales boost, while at the same time transitioning participating car owners to thriftier vehicles and thereby reducing national fuel consumption...Purchased vehicles may be from domestic or foreign brands, through participating dealers."

Sunday, February 22, 2009

Something Intriguing: The Netbook Revolution


WIRED magazine's March 2009 issue has a really interesting article on netbooks-- those small, light, and cheap laptop computers that are rising in popularity (15 million sold late 2007-2008, or 7% of all laptops sold worldwide). Here's some info from the article:


$300, not $1,000 like a standard laptop. How?
-Flash memory, not a hard drive
-Open-source Linux operating system, not Microsoft XP
-4GB of storage, not ~80GB as is standard in a laptop.

In short, you have a small notebook computer that can't store hardly anything. But it does do the internet, with wireless capabilities that are the same as a laptop.

2 interesting trends that netbooks push forward:

1) Base-of-the-Pyramid Design Cycle, where innovation trickles up.
The cost-saving technology in netbooks was conceived for One Laptop Per Child (OLPC). MIT's Media Lab, which is driving OLPC to deliver computers to children in resource-strapped countries like Rwanda, contracted the Taiwanese firm Quanta to manufacture the devices. Quanta's competitor Asustek (also based in Taiwan) caught on and started making adult-style low-cost laptops, and middle-class consumers are buying them up. Now, US companies like Dell are forced to develop netbook lines to penetrate markets like China and India, and it's a wonderful way for consumers in those regions to enter the computer market.

2) Showtime for Cloud Computing.
Because storage space and processing power are so small, just about the only think you can use netbooks for is the internet. Yet since most of what I use my computer for is internet-based (emailing, blogging, Facebook-ing, even word processing now on Google Docs), then the quality of my experience depends on the performance of machines external to my personal device. As long as I have a good internet connection, I can get away with buying a cheap computer.

Personally, I'm excited by what netbooks are doing to open up PC access for much of the world; if I didn't already have a work computer and a home computer that function fine, I'd consider getting one. 2 things that might stop me: First, I download PDFs and pictures to my hard drive all the time. There are cloud-based services like Dropbox which can step in, so netbooks should integrate smoothly with web-based file storage in order for users to find them convenient. Second, there are still several programs I need that would prevent me from switching over completely. Yet article predicts that more and more powerful functions will be available on the cloud, letting people switch to internet-based programs to do things like video-editing online the way Writely (now Google Docs) lets you do word-processing online. Looking forward to what will come next.

Monday, January 19, 2009

Engineering Everywhere, including my living room

This month, I started taking a computer science class online, along with my friend from high school, Corey. Neither of us have any technical experience, but we're taking the computer science class at Stanford for freshmen with no prior background. It's a blast. I won't be able to understand what the Google engineers are talking about anytime soon (hmmm, or ever), but it's fun to tackle the puzzles that come up when you're trying to solve a CS problem.

Take this first assignment for example. We have a robot (named Karel-- he's Czech :) ) who lives in a quadrangle of 3 arches and 4 columns. If you look at the first frame of the video, you can see that the columns have some stones missing. What's the best way to make Karel replace the stones? 



There are four basic commands you can work with:

-move forward
-turn left
-put down a stone
-pick up a stone (we don't use the last command in this particular problem)

[[From the basic commands, you can extend out to "turn around" 180 degrees by commanding two left turns. Also, assume Karel has an infinate number of stones he carries with him.]]

There are three challenges to tackling computer programming. First is simply nailing the syntax; those characters and brackets that the software demands in order to read properly. The second challenge is a more sophisticated logic problem; after you get the syntax right, there are a dozen ways you can get the robot to fix the quad like you see in the video. The trick is how you can define your commands to make your program as universal as possible.

It's easy enough to move Karel to where the gaps are and make him put down stones. We actually want to make Karel think for himself, so that we can relocate him (with the same programming) to a different quad.  So for example, the stones are missing from arbitrary spots; can we make a program that works if the gaps are in different spots? There are four columns of five stones each, but can we program Karel to fix this quad OR a quad of different size and shape?

The third challenge, which is emphasized very eloquently by the prof, is writing programs that humans can understand. You should write so that computers can understand your commands, but it's more important that people can interpret your program too. Here's why.

Programs break. If a new engineer needs to go in to your program and fix it, or if he needs to alter your program to do something slightly different, your program needs to be clear enough for a stranger to make adjustments. Otherwise, he's better off scrapping your work completely.

This last requirement of practicing proper form reminds me of the summer I worked on a boat. There are such particular ways of coiling a rope or tying down the pulleys that raise a sail. I had thought that these rules were extraordinarily nit-picky, but you want standard rules so that in an emergency, any sailor can pick up a line you tied down and adjust it without having to figure out your particular knot. Same goes for a code you've written-- you want it to be as clear as possible.

Taking the class has been fun, as evidenced by the delighted and geeky messages between Corey and me. I encourage other people to have a look:

Lecture 2 | Programming Methodology (Stanford)


Monday, January 5, 2009

Cyberlaw, and Journalism At The Crossroads

Last night, I listened to a great interview of Lawrence Lessig with Terry Gross. Most of what he said were extremely clear and persuasive versions of ideas already on my mind from past articles and programs-- not surprising because Lessig and the center he founded (Stanford's Center for Internet and Society) originated many of our culture's ideas on 21st-century IP law. Overall, he wants the law be flexible and encourage the creativity that content-sharing on the Net allows, from researching academic journals to remixing music samples.

In one great section, Terry asked about the revenue declines that newspapers have been suffering as we increasingly get our news online. Lessig agreed this is a problem, and his greatest concern is that investigative journalism is endangered. Yes we have blogs and Twitter, but newspapers used to assign reporters to a story for months at a time to uncover corruption or expose readers to a faraway war-- an important service for our democracy. Now even major papers can't afford to pay for a long-term assignment.

Lessig said that papers have suffered a lot from Craigslist, which, though a useful tool, has wiped out classifieds. This led me to two questions:

1) Where do newspapers typically make their money? (% subscriptions, % advertising, % classifieds....I would have guessed classifieds are minor.)
2) Do we have a Seymour Hersh (who exposed the My Lai massacre in Vietnam for the St. Louis Post-Dispatch) or Woodward and Bernstein (who broke the story of the Watergate scandal in the Washington Post)? Who are the great investigative journalists of our generation? The two that come to mind are from TV: Christiane Amanpour and Mike Wallace (the latter of which was, incidentally, the great investigative journalist of the last generation).

You can listen to the full interview on the NPR site.

Sunday, January 4, 2009

Improve your life today! Join a book club.

US News and World Report said that joining a book club is one of the top ways to improve your life. Does this surprise you? When my friend Moses shared this report with me and the rest of our book club, it came as no surprise at all. As the book "Bowling Alone" observes, Americans are much less likely to join gardening clubs or rec sports leagues than they were a generation ago. Instead, we're much more likely to watch TV and be disengaged from our communities, and as a result, our social fabric has become much more thin. Book club brings people together for a gathering that is not completely social, not completely work- or task-driven, but a little bit of both.

Here are the details of my group. It was created by my Google co-worker and his friend who, in her day job, does research with an institute at the U of M business school. Our mission is to focus on books that discuss business and social responsibility. You may think that, with such a narrow focus, our book options are limited, but in fact after one year we still have more books we're eager to read than we have time for! Our picks have ranged from the relatively academic (Travels of a T-Shirt in the Global Economy, which traces the life-cycle of a China-manufactured shirt), to The Omnivore's Dilemma, which has become very popular in the media and in "eco-gastronomic" circles.

Our club meets every month at a different house every time. Members are relaxed enough that the decision of where to host and what to read next gets determined at the end of each meeting, and what doesn't get settled is discussed online via our Google Groups forum. (You may have heard of book clubs feuding over book choices like in the article "Fought Over Any Good Books Lately?", but our club is completely drama-free.) We also use our core discussi
on group as a launching pad for other activities. For example after reading The Omnivore's Dilemma, we toured a local farm and did a bit of weeding, and after reading a book on new urbanism, we invited a business-school professor to discuss local real estate and urban development trends with us.

Ever since graduating from college, I've looked for ways to keep exploring with my mind and get connected with people outside my usual circles. I've done this by listening to lots of NPR (and watching the great TED Talks videos online), volunteering, and pursuing exciting projects at work, but the greatest of all these is my book club.