Archive for May, 2012

h1

Words are power

May 31, 2012

In school, I studied systems engineering. I went to an odd college where we learned how to put a system together mathematically, modeling just about everything as a resistor-inductor-capacitor circuit or a spring-mass-dashpot. Because it all boiled down to math that looked the same. This holistic view gave me fresh eyes and I love the hammer-like feel to it.

So when I got out of college, I started to look for nails. Oddly, I actual found some. That led to embedded systems where that same math becomes surprisingly important. I was really good at this! My niche education was going to be useful!

I was still a fairly junior engineer so I explained my plan and process for solution to a senior engineer. i described the math parts, showing a little of my work but glossing over areas that needed to be done. At the end of my show and tell, the senior engineer took all the fun parts away from me and told my manager I didn’t know what I was doing.

See, he called a part of the system the “plant” and I never used those words. And when he used them, I didn’t recognize what he meant. I was a couple years away from my systems courses so part of the problem was my forgetfulness but, at my school, the professors I had called that part the “transfer function”, “system”, or the “process”. The literature tends to use these somewhat interchangeably (not precisely interchangeable, a book usually chooses a term and sticks with it).

It took a long time and a lot of math (and working code) to show I did know what I was doing. Even after that, I didn’t like this senior engineer, he felt so petty. Now I kind of understand what happened- I waved my hands and he probably though the project was too large and important to leave in such untried hands.

This is why I get stressed out when people are nervous about not knowing words. I mean, there is jargon and certainly that plays a role in making people feel like outsiders (and idiots). But sometimes, the words don’t seem like jargon, they are just words and everyone else knows what they mean, I’m just too dumb to understand.

Ahem. No. Words have meaning. Learn the words; understand the meaning. Then you have their power.

Words have incredible power but the most amazing thing about the world today is how easy it is to learn what the words mean. So let’s look at the word algorithm. I’m not going to look it up on Wikipedia for you, feel free. I’m not even going to Google it so I could be wrong in some tiny piece of semantics that are to follow. Watch me not care, I understand the meaning of this word: an algorithm is the word a man uses to mean a recipe.

Oh, I should not read the feminist blogs before writing my own, especially since the connotation is not true. On the other hand, an algorithm tends to be technical, usually related to computers or math based things; a recipe is something one follows when cooking dinner But at the heart, they share a lot: a list of requirements, a list of steps in phrased for the skilled reader, an ideal outcome.

Say I wanted to make cookies. My lackadaisical cookie making method requires a ratio of somewhere between 1:2:3 (butter: sugar: flour) and 2:3:4. Add other things like eggs, salt, baking soda or powder (depending mostly on type of sugar but also other flavoring agents), flavoring agents (vanilla, chocolate chips, peanut butter, orange rind, etc.) to taste. Mix then bake for 5-15 minutes depending on cookie size at 300 to 365F (convection) depending on cookie size and desired texture.

That is neither a good algorithm nor a good recipe. It is a useful direction but not at all a destination. (If you ever want a cookie recipe from me, get it as soon as you can because I won’t remember a recipe the next day.) I’d call that description of how to make cookies a pattern. It is a very loose way to go about it, leading to generally good results. As design pattern: cookie it works pretty darn well (for me).

Of course, if you have no idea what you are doing, it will be a disaster, it assumes a lot of knowledge from the user, knowledge that usually comes from experience. (Ahem, even that mix step hides a ton of potential information though if you take it on the surface, just mixing the dough however you feel so moved, the results won’t be bad).

So as a recipe, a cookie recipe might be:

Simple vanilla cookies recipe

1/4c butter (softened)
1/4c white sugar
1/4c brown sugar
1 egg
3 tsp vanilla
3/4c flour
1/2 tsp salt
2 tsp baking powder

Cream butter and sugar. Beat in egg. Add vanilla. Add flour, baking powder and salt. Put on cookie sheet with silpat (or greased cookie sheet), each cookie should be about 1 tablespoon worth of dough, rolled and then flattened. Bake at 325F for 8-10 minutes.

Makes approximately 2 dozen. Suggest serving with small bowl of chocolate buttercream frosting for DIY inverse oreos.

I think there is a enough details there that just about anyone can follow that. I suppose I used the standard “cream butter and sugar” jargon and that might be meaningless to some. And I didn’t say to preheat the oven. I kind figured you’d know how to do that. That you maybe had made cookies at some point in your life. What an odd assumption on my part.

I could create an algorithm to create simple vanilla cookies. Let’s see. Since I write software, this is a lot like writing a program to tell a robot how to make cookies.

Simple vanilla cookies algorithm

 

1. Measure 1/4c butter, heat to soften.
2. Mix in 1/4c brown sugar and 1/4c white sugar until mixture is creamy and has no granular pieces of sugar of remaining.
3. Beat in one egg until fully mixed.
4. Add 3 tsp vanilla, beat until fully mixed.
5. Add 3/4c flour to top of bowl (do not mix in).
6. Add 1/2tsp salt and 2 tsp baking powder to flour.
7. Gently stir dry ingredients together then mix with wet ingredients.
8. Scoop a cookie, about 1 tablespoon at a time.
9. Roll dough into a ball, place on greased cookie sheet leaving about >1 dough ball worth of distance on all sides.
10. Flatten dough ball into a disk about 1/4in high.
11. Repeat 8-10 until all dough is used.
12. Place cookie sheet in preheated convection oven at 235F.
13. Wait 9 minutes, remove.
14. Serve with chocolate buttercream.

Ok, that is a little detailed in spots but you can see how it contains all the same information as in the recipe but in a different format. It isn’t a better format or a worse one, just different. I could have shown it as a flowchart and it would still have been an algorithm. In fact, anything you can represent as a flowchart is probably an algorithm.

Usually, though, algorithms lead to things other than cookies. In pure math, an algorithm might lead to an single answer. Say you want to give someone change… they buy 10 cents of lemonade and hand you a $5 bill. For one algorithm, you (or the cash register) calculates the difference between their purchase and then you given them the difference. It seems so simple, of course that is how anyone would do it. Well, no, the other school of thought for creating change (another algorithm that can be used) is to count up from their 10 cents, handing them pennies until they get to a number divisible by 5 (none), nickels until they to a number divisible by 10 or 25 (none), dimes until they get to a number divisible by 25 (four), quarters until they get to dollars (two), then the number of dollars (four). The whole time counting it out: lemonade was ten cents, twenty, thirty, forty, fifty, seventy five cents, one dollar, two, three, four, five.

Both of these change-creating algorithms are valid. They can both be proven to work. Ok, that is one area where algorithms are different from recipes: proofs. I mean, I can experimentally determine that my cookie algorithm works but doing it. But can I prove it will always make cookies? I don’t know how to start to show that given the conditions described, it will always work.

But in the math and computer world, an algorithm is usually developed so that it works under certain  conditions and can be considered optimal in some way. How it is optimal, that is an interesting question (fastest? least possibility for error? least memory used?). When people say they study algorithms, they not only learn all the different ways to sort through a list of data, they also learn how to determine how one way is better than another and under which circumstances.

Well, as usual, I’ve totally forgotten the point of this post. And I find myself strangely hungry for cookies. I hope there was a point. If not, well, I hope you have cookies too.

 

h1

My mom only gave me 4 stars on Amazon

May 29, 2012

In November of 2005, I wrote a novel.

It was fairly terrible but really, really fun to write (and for me to read). Someone with a resume suspiciously like mine ends up free floating in space and has to save the world from terrorists with the help of her drummer-physicist-engineer husband. (Yeah, that would be C.)

The novel came about via NaNoWriMo (National Novel Writing Month) and my officemate (and friend). Phil came in one day and said, “I really want to write a novel for NaNoWriMo.” I replied (and I swear I was just trying to get some work done, I may even have had headphones on) “I will if you will.” Phil will not live down the hassling until he finishes his novel. Which I’m sure will be this November.

After two months planning and one month writing, I spent a year editing and refining and then got it self-published through Lulu.com, mostly as a Christmas present to my mom but also to continue the hassling of Phil. A year or two later, Lulu worked out a deal with Amazon. One morning I got to work and there was my book on Amazon. It was very, very cool.

Well, once you get a book (anything) on Amazon, the next thing to do is to get some reviews. Phil, exceedingly graciously given the aforementioned hassling, wrote a 5-star review for me. My mom also agreed to do a review. She gave the novel 4 stars.

Let me say it more clearly: my mom only gave my book 4 stars on Amazon.

Oh, so amusing and cringe-worthy. Both at the same time. There is nothing like your parents keeping you humble.

To be fair, my mom had no idea that a 4-star review was akin to saying “just ok”. Amazon indicates it means “I like it” vs. the 5-star “I love it”.  In her review, my mom says that the work is pretty good for a first time author and she looks forward to more. It is a positive review with a few light criticisms from someone who reads a lot (a lot!) of science fiction and fantasy. She had high standards and my novel didn’t quite merit the same rating she’d give to Bradley, McCaffrey, Henderson, Norton, or Zelazny.

My mom was very supportive in everything I did. I never had any doubt she loved me. But anytime I talk growing up, I definitely pulled out the 4-star review as an indication of how difficult my childhood was. It almost always gets me an incredulous laugh.

Around the time my mom passed away, the reviews from both her and Phil disappeared (Lulu and Amazon weren’t linked anymore and the reviews didn’t apply to the Kindle version for some reason). I wish I’d copied them down. But I’ll never forget them.

h1

Why computers?

May 27, 2012

A new book has come out describing why some women do get into computers and how information is useful to getting more women in the field. That made me think about how I got here.

Two factors started me on the path to a career in computing: education and opportunity.

Given an affinity for math and science, I went to a small college with the plan to get an general engineering degree and then build underwater cities. I’d taken calculus in high school (a giant school where very few graduates went to college). In my freshman year in college, I was taking the college level calculus and acing derivatives. But then we got to this flattened S symbol that I had never seen.

Physics, chemistry, even biology and psychology, were all much harder until I learned integration (and I never gained the same level of confidence). But intro to computer science? That was blissfully easy compared every other class I was taking: I could understand it just by thinking like an idiot (and I felt like an idiot a lot given the math situation).

I know computers aren’t easy for everyone. I don’t know if they would have been easy for me if I hadn’t been doing so poorly in everything else. But I was so computers were comparatively simple and a welcome refuge.

Anyway, around the end of the semester, since I’d done well in intro CS, I was able to take a work study job as a student consultant to the CS department, helping the system admins by answering common questions and leaving the serious problems to the CS staff members (juniors and seniors doing work study). I stayed with it, eventually becoming part of the admin staff and learning to take care of a variety of unix systems (and manage the front-line question-answering consultants).

I kept going back to systems engineering (how can I hate integration but love Fourier?). However, CS jobs were more prevalent, particularly given my shiny new resume with experience of sys admin and some odd programming jobs for math and chem professors. The systems engineering math has been awesome for embedded software (motor control and signal processing!) so I got what I needed, more than I expected, much more than I knew to ask for.

I’d still love to work on underwater cities. But I bet they’d have microprocessors so I’m good.

 

h1

Where to from here?

May 22, 2012

Hmm… well, we made it through the trip. I have trouble saying it was vacation. And I have trouble saying it was wonderful. I tend to say “time off”, “trip”, and “cross country road trip”. For adjectives, it is “cool”, “educational”, “interesting”, and “epic”. Overall, I had a good time. But I don’t know that I’d do it again this decade.

But this blog, what is going to happen with it? Well, I want to have someplace bigger than twitter to write things. What things? Sheesh, stop pushing… I’m not sure. I’d like to write some technical things, maybe how to do some embedded systems things but I don’t really want to put too much code in. I’d kinda like to keep it accessible to friends and family (most of whom skipped over that gadgets and time post a few weeks back).

Let’s see… I’d like to explain to Emma what an algorithm is and why it isn’t something she should ever have worried about asking about (short answer: a recipe; long answer: forthcoming post). I’d like to bemoan the fact that my amazingly talented flute-playing sister-in-law didn’t know what Excel (or Numbers) was and then generally explain how a spreadsheet will make her new career much, much easier. (How can your run a small business without a spreadsheet? Playing music is definitely a small business.) I’d like to write more about my book (I got new reviews! Reviews are scary… And I just put an ad on a web site, also oddly nerve-wracking). I want to help Luckshman with his new-to-firmware where-do-I-even-start questions. I’m planning a post about spam-comments. I still have some trip related things to write about based on the questions I get (which cities were the best?). There are some gadgets to review… and maybe some books.

That is all pretty unfocused. That is ok. Remember, it is about the journey here. Wandering around in circles is ok as long as each circumnavigation is interesting.

The posts may be slower but I’m not done here.

 

h1

More about George

May 17, 2012

George was a good pet. He ate a lot but took us all over. Here is George, munching.

C and I spent a lot of time in him. Let’s just say it was about 100 hours (7102 miles, we didn’t go 90mph always… there was the occasional construction and some traffic and that hideous 40 minute drive to go 4 miles in Boston).

This is what C looked like for most of that time. (Though this is Donner Pass, toward the end of the trip.)

I did drive some but taking pictures while I drive is dangerous. I planned to get some bloggin done in the car, maybe even some work (I still haven’t started the article due this month or the blog-article due last month, sigh). Thus, this is what I planned to look like:
Actually, though, I mostly stared out the window. That was one of the reasons I tried so hard in the never ending battle against bugs on the window. Even the side windows got gunky eventually; they were still clear in Memphis.

George had a decent sound system so we listened to music and books. He also heated seats (really only useful in Boston) and separate driver/passenger temperature controls (normally set to the same temperature but the first twenty minutes of being in the car were always different so separate controls is a new high-want feature for future cars). We normally put the back seats down but left the front seats up, filled with backpacks, jackets, shoes, small ice chest, snack bag, trash bag, and box of kleenex.

When we had our brother- and sister-in-law in Boston and their travel cases (larger than ours though they were only in Boston for a weekend, I will be teasing someone about that), it was a tight squeeze. But we did all fit ok, probably could have fit one more (small) person (but not their luggage).

We could have slept in George but we never needed to. It was nice to have the backup option. I don’t think we could have slept *comfortably* but that is ok, it was like backup plan S.

With 17 mpg city and 24 mpg highway, George could have been slightly hungrier. Or we could have driven slower to get the highway number more consistently. It is a far cry from our normal Prius milage. Actually, going back to the Prius has been a bit jarring. It is more than ten years old and while a decent non-luxurious car, it doesn’t have much pickup (comparatively, no acceleration) and the cloth seats feel cheap. Of course, it is dusty and needs a tune up (two lights on the dash are on!). And it doesn’t even have a name. Sad.