Posted by synedra on Mar 24, 2009 in
Uncategorized
Today is Ada Lovelace Day, and along with thousands of other bloggers, I’m going to write a little bit today about a woman I have found inspiring in the technical world. This isn’t an easy task, picking one woman. Like Liz, I am blessed to personally know a huge number of inspiring geeky women, but in the spirit of the day I’m going to pick just one, who I’ve never met personally, but who has made a significant contribution to my personal success as a programmer.
Kathy Sierra was the author of the original
Head First book, and that series of books has done more for my technical progress than any other single factor. I’m known by many people as a highly skilled programmer, but I didn’t learn that stuff in school – I have a BA in Philosophy. I’m not good at learning from dry crusty tomes – regular programming books tend to hold my attention through about the first 3 chapters and then I’m off to try the stuff on my own. The Head First books, of which I have 9, engage me throughout and get the needed information in my brain, so that I can dive into a programming project with the sense that I have the tools I need.
That’s not all she’s done, though. I saw her speak at OSCON a few years ago and was inspired to go find her blog and read it. For the next couple of years, I read
Creating Passionate Users religiously, hoping to glean some sense of how best to engage my users and make them feel like superheroes while using my tools.
A couple of years ago, some internet trolls crossed the line in a serious way, threatening Kathy in a way that made her feel uncomfortable about continuing to participate in the blog community. She is still out there sharing her ideas in other ways, but I am still saddened and infuriated that anyone could do such a thing to someone who has given so much to our community and to our level of discourse.
Kathy Sierra is my unsung hero. Her ideas have helped me become a better programmer and a better interface designer. Happy Ada Lovelace Day, everyone!
Tags: AdaLovelaceDay09
Posted by synedra on Feb 27, 2009 in
Uncategorized
I need to get OpenCV working on my system for a couple of image processing tasks I have for work, and as with many complex software systems, it was somewhat difficult to get it working on my system, a macbook pro running Leopard (OS/X 10.5).
Their
installation instructions were fairly good. I first tried to use regular old make, but I had a few issues with libraries that regular old make couldn’t find. So I installed cmake to use for this purpose. I highly recommend it.
With cmake, I was successful with the suggested instructions:
% mkdir build
% cd build
% cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PYTHON_SUPPORT=ON ../
After that, ‘make’ and ‘make install’.
I ran into a few issues during this process.
- No swig on my system. The installation page lists it as an optional install, but it’s needed for python, and python is what I want (they say this, but I thought it would do something other than just ignore my desire for python). So install swig, and use the CMake GUI tool to make sure that your SWIG_DIR is set correctly.
- Couldn’t find my Python.h file. Since I had installed my python using darwinports, my Python.h isn’t really where it was looking. I fixed this by editing the CMakeCache.txt to change PYTHON_INCLUDE_PATH:PATH=/sw/include/python2.5. If your swig stuff is complaining about no Python.h (but you have one), find your Python.h and change this line in CMakeCache.txt. There’s probably a more elegant solution, but this worked.
- For some reason CMake was pointing to the wrong SDK on my system (. It wanted to use the 1.4u version, but I’ve got 1.5, so I changed /Developer/SDKs/MacOSX10.4u.sdk to /Developer/SDKs/MacOSX10.5.sdk using the CMake GUI.
- Couldn’t find my resulting opencv library. I copied it to the /Library/Python path.
- I wanted to make sure it installed all of the examples, so I selected them using hte CMake GUI utility.
Note that I did try the darwinports version, and lost a couple of hours trying to figure out how to get the python piece of that to work on my system. I don’t suggest that path.
I am pleased to report that now the python examples (at least) work on my system. Including the houghlines.py which I needed to do the actual task ahead of me. So, hurray.
I decided that to implement a houghcircles example I should really get the C code examples working, and thanks to the helpful instructions
here I was able to do it easily. Follow those instructions and then you’ll be able to compile and run all of the C example files (and make your own, and run them too!)
So I wrote a houghcircles example using some of the example code from the opencv book, and it works, kinda. Pretty well I think, for just futzing around for an evening:
Someone wrote to me about this blog post and said they were having some trouble with using the iSight for video input. I discovered I was having the same problem. The answer, gleaned from various places on the internets, was to unset DYLD_LIBRARY_PATH in my environment. Confuses the heck out of openCV. Which is kind of a problem because ROS requires it, at least to build. So if you get weird library missing/wrong errors, unset that bad boy and see if it helps.
Tags: opencv, python
Posted by synedra on Feb 18, 2009 in
Uncategorized
I was having some fun poking around at the Netflix API, and realized that there wasn’t a Netflix module for python, so I put one together. First version is up at http://code.google.com/p/pyflix. Has installable code, an example file, and a py.test compatible test file.
Posted by synedra on Feb 10, 2009 in
Uncategorized
When last we left my intrepid tummy, we were headed to the gastro doc to talk about why it was so sad. She decided I should have a colonoscopy to make sure my intestines weren’t problematic, and a CAT scan to make sure my pancreas wasn’t puffy. So, after finishing my 3 weeks of the elimination diet, I spent a day drinking barium for the cat scan, and then later that week I spent a day eating clear liquids for the colonoscopy.
Verdict: My pancreas is fine. My intestines did have a flat polyp which she removed (hurray!) No crohn’s, no other problems.
So, we’re left with the likely problem of Small Intestine Bacterial Overgrowth. I’ve done some research on this and I’ve found a program that seems to really be working. So, anyone in a similar situation can take heed and see if something like this will help you too:
- Enteric-coated peppermint oil. This stuff is awesome. It kills bacteria in your small intestine and reduces gas and bloating. 3x/day. I’m gonna take this for a month and then switch to building up my flora, because I’m guessing the peppermint oil isn’t smart enough to distinguish between “good flora in the large intestine” and “misguided flora in the small intestine”
- Much less crap. I’m trying to keep myself to foods which are as close to whole as possible. I know, duh, but really, this is making a huge difference. I’m making bread in my breadmaker almost every morning, making dinners from actual ingredients, avoiding foods that tend to cause acidity in your system. I noticed that eating more alkaline-causing foods made my body happier so I’m working on that. Note that artificial sweeteners are the acidest foods of all.
- UltraClear Ph. This is medical food that helps keep your Ph in the right place. And it seems to help my system be happy.
So much success I’m having on this plan that two days ago I WORE PANTS for the first time in 3 years. And didn’t have to take them off from uncomfortable bloating.
Posted by synedra on Jan 15, 2009 in
Uncategorized
My friend has been a boy scout leader for years. She doesn’t have any children, but she and her husband are active scout leaders nonetheless, giving their support and guidance to kids because they enjoy it, and because they are good people.
My friend has lost a lot of weight and goes to boot camp and bikram yoga regularly. She did the Danskin triathlon with me last year. She could almost certainly pass whatever fitness test the BSA threw at her to prove she’s able to survive in the severe conditions present at a Boy Scout Camping event.
The BSA has just updated their guidelines for their leaders. According to the chart they have, unless she loses weight to meet an arbitrary standard, she will no longer be able to participate in remote or strenuous boy scout events, and the organization strongly suggests that she not be able to participate in *ANY* boy scout event. If their goal is to provide the boys with a good role model, a larger person who is active and healthy is a much better role model than a normal weight person who smokes, or drinks, or just plain doesn’t exercise. I would take her as a leader for my den in a heartbeat – she is a smart, moral, and fit person who embodies the values I’d like my son to strive for.
I hope that someone sues the Boy Scouts over this. It is pure discrimination with no reasonable defense. I will have to consider strongly whether my son should continue in an organization which believes that they can judge his moral worth based on his belt size – or the belt size of his leaders. I realize that the Boy Scouts are a private organization, but this kind of ignorant elitism is unacceptable. If you want to make sure that people are fit to camp, test them. The results might surprise you. The only reason for this particular decision has to be that someone in BSA headquarters doesn’t want their organization associated with overweight people. Pure, unadulterated, bigotry.
If you’d like to see the new health form yourself you can see
it on their website. The precise wording is “Individuals desiring to participate in any high-adventure activity or events in which emergency evacuation would take longer
than 30 minutes by ground transportation will not be permitted to do so if they exceed the weight limit as documented at the
bottom of this page. Enforcing the height/weight limit is strongly encouraged for all other events, but it is not mandatory.”
Posted by synedra on Jan 2, 2009 in
Uncategorized
My GI tract has been doing some super weird things over the last couple of years. When I eat pretty much anything, my stomach puffs up by 5 inches, and it gets totally hard. My answer to this conundrum up until now has been to only wear skirts, and only skirts with elastic waistbands, but it occurred to me that perhaps I should mention this to my doctor. So I did, which started me on a super fun game called “What the heck is wrong with this system, anyhow?”
The first thing I did was a CDSA test, which indicated that I have a lot of inflammation markers in my gut. This can be caused by a wide range of things, including Celiac, other food sensitivities, an infection, or cancer. Also, my happy bacteria were completely missing, which wouldn’t be totally weird, except that I’ve been taking probiotics filled with them for a few months, so somehow they’re getting gobbled up and not colonizing. And I had some little benign amoebas taking up residence.
So then we did a celiac test. Negative. That’s good, I guess, although at this point I’d rather have that than some of the other options. I took Flagyl for a few days to kill the amoebas (in case maybe they weren’t benign, and were causing the problems). It almost killed me, so I begged off of that for now.
Next stop, Elimination Diet. So this week I started my 3-week diet with no corn, wheat, soy, milk, eggs, red meat, caffeine, sugar, peanuts… pretty much nothing. I’m glad I’m on vacation this week while I get started with this, and I’m happy to say that I’m almost through day 5 and am still alive. I just finished a pretty decent lunch – homemade turkey chili over roasted potatoes, with slices of avocado on top. My life became a lot better when I figured out how to make a pretty decent representation of a rice crispy treat with brown rice syrup, almond butter, vanilla, and brown rice crispy cereal. I got to take those to the movies, and they were a perfect snacky treat.
In a couple of weeks I’ll be visiting the gastroenterologist, to see what she thinks about this whole thing. My tummy isn’t getting all that much better, but I’m going to go through this for 3 weeks so we know if it helps or not. As long as I have my rice crispy treats, I think it’ll be ok.
Posted by synedra on Nov 30, 2008 in
Uncategorized
After I got my new sidebar widget working, I thought I’d go and see if any more of my friends were listed on Twitter, and discovered to my chagrin that they have elected to remove the “search for people” function on Twitter. It’s been replaced by an “Allow Twitter to Rifle Your Rolodex” function where it looks to see if anyone you know is on twitter – and then does the super annoying Facebook-like list of everyone who isn’t enTwittered yet – “These losers haven’t signed up yet. Spam them for us!” Yeah, no.
Two third party folks have made cool applications to replace this functionality. Neither is perfect (and they’re both pretty overwhelmed), but they’re better than nothing. You can find people with the name of <whatever> at
twitterdir, and you can find friends-of-friends at
twubble. I had a lot of fun futzing with the latter this morning.
Your other alternative is to google “site:twitter.com Kirsten Jones”
Note that if you play with twubble for too long, Twitter will throttle you, and you’ll end up with no functionality for your cool sidebar widget thing for an hour while you contemplate the error of your ways.
Posted by synedra on Nov 24, 2008 in
Geek Stuff
In my job as an elf for Santa, I frequently have to travel back to the North Pole to visit with my fellow elves, so it’s not always easy to tell where I might be. Given that fact, and my desire to procrastinate a bit, I decided to make a handy badge for my blog that tells people where I am. Most twitter clients allow you to throw some location information in your posts, so it’s relatively easy to make it relatively easy for someone to stalk you.
So, I started with this excellent
post describing how to make a basic twitter (Javascript/HTML) badge. That page has some handy information on how to set up a badge with no location, and if you don’t want location, you should probably follow his guide. But if you want to add in some location information as well, then here’s the info you need.
First, you’ll need to create a local Javascript file to do your evil bidding. I plopped mine in my mt-static directory (because I use Movable Type) but you can put it in any static spot on your server. You can grab mine
here.
Now that you’ve got that put on your server, you just need to put some code in your blog template (wherever your other badge stuff is) to get your fabulous information to show up. The code for the HTML looks yucky in my post, but you can view source and grab the stuff marked as “TWITTER”.
The last piece is styling your box. I have mine styled so that it matches the rest of my site, but you can make yours work however you like.
#twitter_div {
border-bottom-style: solid;
border-bottom-width: 1px;
margin-bottom: 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
padding-right: 5px;
padding-left: 5px;
text-decoration: none;
}
#twitter_location {
margin-left: 25px;
text-decoration: none;
margin-bottom: 10px;
}
#twitter_div ul li {
text-decoration: none;
border-bottom-style: solid;
border-bottom-width: 1px;
padding-bottom: 5px;
margin-bottom: 5px;
}
#twitter_div p {
text-align: right;
padding-right: 6px;
margin-bottom: 10px;
}
Tags: location, twitter
Posted by synedra on Oct 30, 2008 in
Uncategorized
For an upcoming project at work, I needed to get a better idea of how the AWS services work together, and wanted to also see how the EC2 instances could be used for parallel processing. Sadly, I do not love Java, and although I would use it if pressed, I wanted to see if I could find a pythony way to process some data using a hadoop setup.
So, based on
this page, I created a mapper and reducer in python. The mapper looks through a file and spits out lines for each match it finds. The reducer takes the stdout from that process (using hadoop streaming) and does the thinking, then spits out the result. The examples on that page are a fine place to start for this piece. And you can time the process on your system here to get an idea of the speedup using the hadoop setup.
Next, I needed to get the files over to S3 so I can access them from my EC2 instance. S3 instances are persistent, and transfers between S3 and EC2 are free, so I can run my processes an infinite number of times without incurring new costs for grabbing the files. First, I created a bucket using the Python S3 tools, and then copied the files over using:
hadoop fs -put <file> s3://ID:SECRET@BUCKET/name_of_dir
There are, of course, other ways to move things to S3 buckets. Pick one you like.
Now that all of my files are there for accessing, it’s time to set up the hadoop instance.
This part isn’t included in toto anywhere, so I’ll cover it here in detail. This assumes you’ve done all of:
- Set up yourself with an AWS account with EC2 and S3 access (including setting up a properly permissioned id_rsa-gsg-keypair as described here)
- Created a bucket in S3 and populated it with files
- Created a mapper.py and reducer.py and tested them with your files
- Installed the hadoop tools on your local system and configured them as described here
Next, even though every piece of documentation says to do this:
That’s a lie. Try this instead:
bin/hadoop-ec2 launch-cluster <group_name> <number_of_slaves>
This will create a master hadoop node, and your slaves. For number_of_slaves you want to pick something <= 19 so that your total doesn’t exceed 20 (unless you have special privileges).
Now we have to move our snazzy mapper and reducer to the master:
bin/hadoop-ec2-env.sh
scp $SSH_OPTS /path/to/mapper.py root@$MASTER_HOST:/home
scp $SSH_OPTS /path/to/reducer.py root@$MASTER_HOST:/home
‘run’ apparently used to then log you into your master, but since we’re using launch-cluster, you’ll need to do it yourself:
ssh $SSH_OPTS root@<your_new_master>
And there you are! On your new master. Awesome. Now let’s move the data to our cluster (ID and SECRET are your AWS credentials, BUCKET is the bucket you created):
cd /usr/local/hadoop-<version>
bin/hadoop fs -mkdir files
bin/hadoop distcp s3://<ID>:<SECRET>@<BUCKET>/path/to/files files
Ok, great. Almost there. Now we need to run the thing:
hadoop@ubuntu:/usr/local/hadoop$ bin/hadoop jar contrib/streaming/hadoop-0.18.0-streaming.jar -mapper mapper.py -file /home/mapper.py -reducer reducer.py -file /home/reducer.py -input files/* -output map-reduce.output
While it’s running, you can check out the neat web report hadoop creates at http://<server_name>:50030. Go ahead, check it out. It’s totally cool.
Posted by synedra on Oct 23, 2008 in
Uncategorized
Today, fighting a cold, I’m hacking in a totally unattractive way. I’d love to redeem my hacking status by heading up to the Freebase Hack Day in a couple of weeks, but unfortunately that’s the week I’ll be visiting my corporate masters in Southern California. Don’t worry, I already sent in my absentee vote. Democracy is still safe in our great nation.
For anyone else who has any ability to go spend a day, or even a few hours, at the Metaweb offices in San Francisco, I highly recommend going.
Freebase has always been a cool platform, but it’s suffered somewhat from being overwhelming and difficult to approach. The team is about to roll out
Acre, a new application development platform, which makes it easy to create new applications and new ways to play with the content. I hope to have time to play with Acre soon myself, because my brief introduction to it was really intriguing. One of the things I love best about it is that it allows you to discover new things about the content you already know. Connections between things, similarities (and lack thereof!). Check out the video to get a better idea of how it works…
The data in Freebase is growing continually, and is already far too big to really understand as a whole. Creating windows into this data, or different ways to understand it, is one of those cases where it’s almost more fun to create the solution than it is to come up with the problem. So take this great opportunity to get yourself some interesting company, a t-shirt, free food, and time to play with some excellent toys.