Friday, February 27, 2009

One Strike And You're Out

The Jews have been wandering around the desert for a really long time and get to a place where there is no water and they're worried about dying from thirst. So God says to Moses and Aaron - get your rod, gather the people, and talk to this rock and it will give you water. Moses and Aaron get the rod, gather the people, and then Moses hits the rock with the rod twice. (Obviously I'm summarizing, but the real story isn't much longer.) Then because they didn't follow the Lord's instructions, which God interprets as them losing faith, Aaron dies soon after and Moses isn't allowed into Israel.

Growing up reform I heard a lot of: there are lots of mitzvahs, you can't do all of them all the time, but you do what you can.

What the Torah seems to actually say: even if you are one of the "best Jews" of all time, mess up once (even under some pretty serious pressure) and God might just kill you or your brother.

And what's with specifically telling Moses to bring his rod and then getting mad that he used it? And what did Aaron do wrong?

Wednesday, February 25, 2009

What's With The Unified Government?

Star Trek - one semi-utopian human government. Firefly/Serenity - one over reaching government that has varying levels of influence on different planets. Battlestar Galactica - one human government both before and after the attack. Dune - one government, although a much looser structure than the other cases - will come back to that. The Foundation Series - one government. Hitchhiker's Guide To The Galaxy - only one human. Star Wars - one government (not counting the rebels as a government), in 1-3 arguably still one government, although a bit more UN like. Futurama is the perfect example - in 2000, pre-serious space exploration, there is the current set of countries, in 3000 when there is lots of space travel there is one Earth/human government. There are a bunch where government doesn't really play a role and the basic assumption is there is only one exploring space: Rendezvous with Rama, Alien, Dark Star, Red Dwarf, 2001 A Space Odessey, Ender's Game, Total Recall, iRobot (the book).

There's plenty of science fiction not involving space that involves multiple governments and some that involve their interaction (ex: most Neal Stephenson books). There's plenty of science fiction where aliens come to Earth and there are multiple governments (War of the Worlds, Independence Day, Close Encounters of the Third Kind, ET, Transformers), although I'm having trouble thinking of any where it really matters that there are multiple governments. There's some science fiction with multiple governments while there has been some movement into space, but the story is almost entirely about Earth (ex: Blade Runner/Do Androids Dream of Electric Sheep). So why can't I think of any stories where humans have multiple governments exploring space? Do they exist and I just can't think of them? Is there some assumption that if people are going into space either everyone has unified or there is a single space bound country? Is it just avoiding the complexity that would be added to stories? Am I just not going back far enough - did people get it out of their system during the space race?

I think that we will get to serious space travel/colonization before the world will unify under one government. There is the UN, but I think it is far weaker than any of the governments listed above (if we found aliens would it really be the UN that would negotiate with them?). Plus it seems like it would open a lot of possible stories if instead of the humans trying to deal with say the Romulans, the US was trying to create a treaty while the EU was at war with them and at the same time China and the US were at war (BSG is sort of touching on this right now, but they split the cylons instead of splitting the humans). Or even if there are no aliens, just something a bit more complex than one big oppressive government and one small rebel group. Of all the examples I listed, Dune has the least centralized government and some of the story comes from the maneuvering of the groups that make up the government and how the main character plays them off each other. That further makes me think there is potential there.

Also science fiction can be helpful when it predicts something and works through some of the issues ahead of time (such as iRobot and some of the old images of space ships). Since there's an increasing number of countries capable of space exploration it seems like a topic worth exploring.

Ok, I should really stop writing now since it is quite likely someone will have a list of a bunch of stories I'm just not thinking of.

Sunday, February 22, 2009

Sore Forearms

Just got back from 5 hours of indoor rock climbing, this time at the Sunnyvale location of Planet Granite. I think that I improved some since last time, but I think if I really want to make progress I'd have to go more often than once a month.

Being a beginner I tend to climb near little kids. Especially towards the end of the day as I get tired I tend to curse every time I reach for a higher hand hold. Hopefully I didn't teach too many kids new words. Well, I'm actually not that creative when I curse so at least they would have only learned one or two.

I've rediscovered that if you are tired and hungry and you eat food you get less tired and hungry. Who would have thought?

Saturday, February 21, 2009

Bestiality

A somewhat common line from people who oppose gay rights is "What's next, bestiality?". In addition to being absurd, it struck me as kind of out of nowhere. Well, turns out that when laying down the law on what sex acts get the death penalty, just after man lying with a man is man or woman lying with a beast. So I must scale back my incredulity to just finding the argument absurd, since the source is clearer than I'd expected.

Wow, the end of the section that describes all the sex acts that deserve death is "A man or a woman who is a medium or a wizard shall be put to death; they shall be stoned with stones, their blood shall be upon them". I learned about this writing technique in the satire class I took in high school. You present a list that gets increasingly absurd to point out the absurdity of the stuff at the beginning of the list.

It's interesting that Jews and Christians both closely follow certain parts of the Torah and completely ignore others, they just picked different parts. And I'm surprised by how much of what is considered fundamentalist Christian ideas come from the Torah.

If a man or woman lies with a beast not only is the person supposed to die, but so is the beast. Why does the beast have to die? That doesn't seem fair. Of course, killing a person for lighting a fire on Shabbat doesn't seem all that fair either, but at least there the person knowingly broke the rules.

So what happens to you if you don't follow God's commandments (other than the ones where he specifies that you'll be put to death)? Well, a list of bad stuff too long for me to bother to type (see Leviticus 26). And if after that you don't turn back to God he'll do a bunch more bad stuff to you including, "You shall eat the flesh of your sons, and you shall eat the flesh of your daughters". Whoa. That's twisted even by Law and Order SVU standards.

Oh and a bit of follow up from last time. The rules of kosher in the Torah are a bit more specific than I expected (although they have clearly been adjusted over time), heck which bugs are ok and not ok is even covered (if you keep kosher and you want to try grasshoppers you're good to go). And everyone knows that when Moses came down from the mountain the first time he broke the stone tablets in anger. What seems to get skipped over is that Moses also had three thousand people killed and then God unleashed a plague. But, whoa - tablet breaking - that's the part that shows how mad he was. Actually the commonly told story is Moses carved some stone tablets, got mad, broke them, had to carve new ones. Kind of a boring story. Seems like killing thousands of people helps add some zest to the story.

Thursday, February 19, 2009

EE terms

There are two kinds of connections to integrated circuits - pins and balls. Pins seem kind of obvious (little metal wires), balls are metal balls that sit between the die and the package making the electrical connection.

There are several kinds of capacitors in integrated circuits. One increasingly popular kind is the metal-oxide-metal capacitor or mom cap or for very short mom.

I've made it through several years of talking about balls and moms with a straight face. But tonight I was eating dinner with several coworkers, including one of my boss's peers who is also the lead on my main project. Near the end of dinner one of my coworkers brought up that we want to move some of the ball connections. That was fine, but then when the project lead expressed concern, my coworker explained that it should be ok since we won't touch anyone else's balls, we'll just move our own balls. That's when I finally lost it. Luckily I didn't actually laugh out loud, but I think people noticed the crazy contortions that my face made. I'm just glad no one mentioned that we'd have to move some of the moms out of the way of our balls.

Wednesday, February 18, 2009

Wine Pump and Project #2

After letting the wine bottle sit for 120 hours we took a look. While we didn't have any way to measure the exact volume of the balloon, it looked like the size before we pumped out the air. When I pressed on the air release it make some noise, but it was fairly brief. So the pump does does a decent job of removing air, but not of keeping new air from seeping in.

Even after switching the cap the battery charger still wasn't fully charging the batteries. So I put an ammeter in series with the batteries and found they were only getting 0.4 mA - about 1/1000 of what it should be. So I looked back over things for a bit and found that I had put the pnp in backwards. Doh! Well now it is in the right direction and the charge current is 430 mA. Much better - hopefully that will do the trick.

Tuesday, February 17, 2009

Project update

I compared the battery voltage after using the charger I built to the store bought one and realized the one I built isn't fully charging the batteries. Looking back at the table that says what timing capacitor to use, it assumes that if you are charging at 400 mA that the battery capacity is 800 mA*hr. But these batteries are 2000 mA*hr. I need to change the cap value so the charger won't turn off early. Ooops.

Monday, February 16, 2009

1 2 3 4 5 6 7 8 9 10, hello

一 二 三 四 五 六 七 八 九 十
(yi er san si wu liu qi ba jiu shi)

你好
(ni hao)

Project #2 Part 2

As part of the grand scheme for project #2 (cell phone/ipod back up battery) I built a charger for rechargeable AA batteries (NiMH).

NiMH batteries are 1.2V as opposed to the 1.5V for normal AA. So one thought was just put 4 in series, then there's no over voltage fear. But if I'm using rechargeable batteries I want to be able to charge them and preferably over USB (I don't feel like getting into building something that plugs into the wall). But the USB voltage can be as low as 4.75V - tough to charge up to 4.8V off 4.75V (not impossible, but would require a lot more parts). Also 4 AA doesn't fit in the size I want.

Now the thought is use two rechargeable AA and use a boost converter to charge the phone (sort of like mintyboost except I want to provide more current and have rechargeable batteries). Charging two AA off USB isn't too tough since Linear makes a part (LTC4060) which is designed to cover this situation. So I ordered two free samples from Linear. They got here on Friday. Unfortunately the part has some really small pins (the tiny black part on the big brown board).



Fry's sells a protoboard that fits the part's package so I bought one of those and soldered on the part and the bit of surrounding electronics. Technically there should be a ground connection to the bottom of the chip, but the protoboard isn't set up for that. It is not a big deal because it is mostly for heat conduction and I'm setting the charger to use much less current than normal (because of the limitations of USB) so there shouldn't be any thermal issues. Of course the first time through soldering as I was almost done I messed up one of the holes so I got to de-solder everything and do it again on the other side of the board. The big part hanging off the side is a pnp which is what the current actually flows through to get to the batteries. This is one I just had around - it is massively oversized. What I ended up doing for the tiny pins was to put a big blob of solder over all the pins on a side, then use solder wick to remove all the excess.

The main thing I was learning about when building this was how to solder such small pins (key lessons being: light helps, magnifying glass helps, pay attention, move slowly, check connections with multimeter often, solder wick is my friend). However there were two other bonus lessons. One is those 9V battery connectors aren't great for connecting two sets of wires because if on one red is positive then on the other black is positive. This occurred me as I noticed the LTC4060 getting really hot after connecting the batteries. Luckily it didn't break the part (good job Linear on the reverse protection). The other lesson was what it feels like when a 700 deg F solder blob jumps off the soldering iron and lands on your finger, especially when it takes a moment to flick it off because you have stuff in your hands. It makes a cool little blister in the shape of the blob.



Here's the charger working (see the red LED is on, so it must be working). I don't think it is perfect - it took a long time to charge and I had to unplug it and plug it back in to get it to charge all the way (at least I think so, it is so hard to know what is going on with batteries).



Here's the state of my beautiful card table work bench:



I'm going to go ahead and call part 2 a success. Eventually I will need to find something over than that big protoboard to put everything on, but first I'm going to get the boost converter built (I'm waiting on some samples from Maxim) and make sure the electronics work before working too hard on the physical design. I am starting to think designing a PCB is the way to go, batchpcb looks cheap enough to be reasonable.

You might have noticed the battery holder is different than the normal plastic kind - I ordered some fancy ones because I thought they would fit in a smaller space, but they don't and they make getting batteries out a huge pain. So I'm using them for prototyping, but I'll be switching back to the cheap plastic kind.

It might seem like lithium ion batteries would be better for this project than NiMH. They do have some advantages. But using NiMH means they can be replaced by normal AA if needed. And lithium ion batteries are a bit more prone to exploding if charged wrong.

Some of you might notice this a really simple project. That is true. But I've noticed that what has kept me from making projects in the past is my design skills are way beyond my building skills. So I decided to work on stuff more on the level of my building skills.

Sunday, February 15, 2009

Dollhouse

Overall I agree with what Julie had to say about Dollhouse (especially the point her friend made). Although I'm less unhappy with Eliza Duku as the lead, cause, well you can figure it out. I think my biggest issue with the show is it doesn't seem to have a goofy/funny element to it.

I will add that the bit of dialogue where Echo claims she will put the kidnappers at ease and the father disagrees seemed very familiar to me (20.5 minutes in). I started to think that Whedon had copied a sequence in another show. Then I finally realized it was The Shepherd's explanation for why the alliance was so willing to give him medical help in the Firefly episode "Safe" (38 minutes in). I guess Whedon will forgive Whedon.

Skin Jobs

For all the BSG fans - the term skin job is from Blade Runner.

God supports the flat tax

Seriously it is in the torah:
The LORD said to Moses, "When you take the census of the people of Israel, then each shall give a ransom for himself to the LORD when you number them, that there be no plague among them when you number them. Each who is numbered in the census shall give this: half a shekel according to the shekel of the sanctuary, half a shekel as an offering to the LORD. Every one who is numbered in the census, from twenty years old and upward shall give the LORD's offering. The rich shall not give more, and the poor shall not give less, than the half shekel, when you give the LORD's offering to make atonement for yourselves. And you shall take the atonement money from the people of Israel, and shall appoint it for the service of the tent of meeting; that it may bring the people of Israel to remembrance before the LORD, so as to make atonement for yourselves."

I bet the IRS wishes it could threaten to give the plague to people who don't pay their taxes.

I would have expected God to be more on the side of a progressive tax, although maybe that's just his hippie son.

So people often make fun of sports players who attribute their success to God (or Jesus) by saying there's no way God is worrying about who wins a sports game. But let's face it God can go on for pages about how to make the curtains for an altar. That seems like the obsessive, detailed oriented characteristics of someone with extensive knowledge of baseball stats. And since he hasn't done much writing recently he probably has some time on his hands. I bet God isn't just swaying who wins the super bowl, but is adjusting ERAs of minor league players.

From what I understand the rules of keeping kosher were very roughly given in the Torah and then heavily expanded upon in other texts. The rules of animal sacrifice were clearly detailed in the Torah. Some people follow the largely man made Kosher rules to the letter of the law. No one performs animal sacrifices anymore. Discuss.

Actually, talk about reasons why God would be making final four brackets - he wants a bunch of animals killed for him on fancy alters, now he has a bunch of people who get together for an hour a week and say the exact same thing every time. He must be bored out of his mind.

Ok - now for a more serious question. Did God give Moses the torah? If not, when is it that God gave people the Torah (assuming it wasn't written by people...)? If so, what do you think Moses did when he was writing everything God said and they got to the part about Moses not getting into Israel as a punishment? And wouldn't he have been prepared for that whole rock thing? And when they got to the part about him needing to write the whole thing a second time do you think he kept writing or just faked the rest since he knew he'd have to do it again? Ok, I tried to be serious. But really - I want to know, because it didn't seem very clear - did God give the Torah to Moses, or was it given later, or is the orthodox view that sections came from God, but the overall compilation and some of the stories were put together by people later?

And what's with the whole section on how to handle owning Hebrew slaves just after the story of leaving Egypt? I thought the whole point of that story was don't have slaves. If you want to be a pain at a passover seder, at some point slip in Exodus 21. My favorite part:
When a man strikes his slave, male or female, with a rod and the slave dies under his hand, he shall be punished. But if the slave survives a day or two, he is not to be punished for the slave is his money.

Friday, February 13, 2009

Balloon in Wine Bottle

There was a disagreement at work about how well hand vacuum pumps for wine bottles work. So I brought my wine bottle pump and a bag of balloons and someone else brought in an empty sparkling cider bottle. We put a balloon in the bottle and held the end of the balloon. A coworker used a coffee stirrer to push on the neck of the balloon to keep it from filling the neck of the wine bottle while he blew into the balloon. It took him a few tries, but he got enough air into the balloon so that it was stretching a little and then tied the end. Then he pushed the balloon so it fell to the bottom of the bottle. Then I used the wine bottle pump just as I would when trying to preserve wine. The balloon grew as I pumped out the air in the bottle. The growth was very noticeable, but very far from filling the entire bottle. We made a very rough guess that the volume of the balloon increased by 4x. I think that means I pumped out 75% of the air in the bottle. That's more than I expected and I think enough to justify using the pump.

The next part of the challenge is to see if the stopper's seal holds over several days. So the bottle with the balloon in it is sitting under the desk in an empty cube (no one wanted a bottle sitting in their cube). On Tuesday we'll check how big the balloon looks (very tough to tell much from this since no way to compare the size - I tried to take a picture, but the bottle was dark enough it didn't really work, see below). The other test will be pushing on the valve and listening for the air going into the bottle.

Well it is about as far from scientific as you can get, but I'd say the bottle pump is worthwhile.

Look for the pink blur at the bottom of the bottle:

Thursday, February 12, 2009

Annoying Stickler

This article is far from The Onion's funniest, but it makes me so happy!

"If it weren't for that guy, we'd already be in space by now." - It's like they were spying on my last job.

Sunday, February 08, 2009

Sore Calves

Over the weekend I headed up to Tahoe with Julie, Saeed, and a bunch of people Julie goes to school with. On Saturday we went skiing at Heavenly. Since the last time I went was basically my first time and it was two years ago I wasn't sure how much of what I learned I retained. So in the morning I stuck to the "First Timer" slope.

Then in the afternoon I took a private lesson with someone in the group who was skiing for the first time. It was kind of funny because the instructor made some comments at the beginning based on thinking we were dating or married (at one point he referred to her as my better half). As the lesson went on he figured out we met for the first time that morning. A lot of what I learned before came back quickly. But it was good to take the lesson to reinforce the good habits and correct a few things I remembered wrong. We also learned one or two things I didn't know or remember from last time. I actually went the whole day without falling over, which I take as a sign I wasn't pushing myself enough. Based on how the day went, next time I go I'll definitely step things up a bit. (For my memory - next time I'm supposed to say I want level 3 lessons).

That night we did the outdoor hot tub in the snow thing - very cool. And hung out with the group. Sunday we got up reasonably early and headed back. Which worked out well since it gave me a chance to do laundry which means I get to wear clean clothes to work.

Monday, February 02, 2009

Weekend Projects

Disclaimer: I am not an professional electrical engineer, oh wait, yes I am. Regardless, I do not take responsibility for anything, ever. And I especially don't take responsibility for anything stated in this post.

Project #1:
At work it is sometimes so quite that even at the lowest setting my ipod is louder than I want, especially when I listen for 5 hours in a row. So I decided to make a set of headphones with some attenuation. My first try was to add 120 ohms in series with each side. This worked reasonably well, but as a coworker pointed out, it really wasn't the right thing to do since headphone impedance is frequency dependent. Then I realized the correct attenuator for a headphone that is typically 32 ohms. So I made another set by putting 33 ohms in series and 3.3 ohms to ground on each side. This is a 10x attenuation, has a 3 ohm drive impedance and looks like approximately 36 ohms to the amplifier. Yes, ideally there are slightly better resistor values, but welcome to the world of standard 5% values.

I did this by buying an empty headphone jack at frys ($0.99). Then I put the resistors in the headphone jack and pulled out some wires. I soldered those wires to the headphone jack on an old set of ipod headphones. Then covered the three wires with some electrical tape. Not amazing looking, but does the trick. A better choice would probably have been to buy a female headphone connector so I could just have an attenuator to add inline without permanently attaching to the headphones. But oh well. I could have cut the headphone wires and inserted the resistors there. But I bought a cheap set of headphones to experiment and the wires were super thin so I figured it was better to not have to deal with them.



Project #2:
I'm working on building a backup battery for my iphone. The first attempt involved a 9V battery and a linear regulator. But that only gave me about 10 minutes on my old ipod mini. Then I noticed that someone online just put 4 AA batteries in series and used that. It is a bit scary since that's 6V, but USB is only supposed to put out 4.75 to 5.25V. But it worked, well for the ipod. After a couple hours of playing off the battery pack I got bored. At first it didn't work for the iphone, but then I found a tip online to short the two data wires together which worked. There were other people who had a more complex (and power burning) way to get it to work, but luckily just shorting the two wires works. I'm still not very comfortable with the over voltage issue - seems to work for iphones/ipods (wasn't too worred about them since they also work off firewire which can be up to 10V), but I want it to work for any phone that charges off USB. So I'm going to keep thinking about that. And ideally it would fit in an Altoids tin, but I haven't gotten that worked out yet. The battery holder is just a bit too wide and I don't have the skillz to cut it up and remake it as some sites recommend.

9V and linear regulator version:


4 AA in series version: