Sunday, April 27, 2008

What's Up with Battery Prices?

So I go to RiteAid to buy the two LR44/GPA76 batteries for my newly found TI-30Xa calculator, and would you believe RiteAid wanted $4 a piece for those two batteries. That's insane.

Not only is the identifiers for watch batteries ridiculously unstandardized, the prices are outrageous. Searching more on Amazon, I found watch batteries selling for almost $10. I'm not going to pay $8 for batteries for a $15 (free) calculator.

After spending maybe half an hour on Amazon, I finally found a 10 pack of LR44 for $2.50, but here's the key, the shipping was only $4. There was lots of batteries for sale for less than $1, but had shipping ~$8. I'm not going to pay $8 so they can send me something the size of a dime.

So I don't understand why, but I just got the best deal overall for my 2 batteries by buying a pack of 10. So if anyone needs a LR44/GPA76/etc battery, just let me know!

Saturday, April 26, 2008

Found a TI-30Xa

That's right, a TI-30Xa scientific calculator. The little workhorse of a calculator. I actually found one of these at Fremont High a few years ago and it's been my backup calculator for when I can't find my TI-84+ Silver.

I found this one in the E-waste bin in Segundo when I was recycling a bunch of batteries that I've drained with my Joule Thief. It was sitting there, begging me to save it. It was DOA, but the exterior looked alright; no cracks, no water damage. I grabbed my mini screw driver set and opened both calculators. The 30Xa is a wonderful design. 6 little screws, and the back came right off. No glue, no scary plastic clips that you think are there.

Swapped the batteries in the two calculators, and the new one fired right up. Now I just got to go buy another pair of GPA76 button batteries and I'll have another scientific calculator sitting around. I love E-waste bin diving.

The inside of the calculators really surprised me. The PCB layouts of the two calculators was completely different. They even had different trace thicknesses and it looked like one of them had more layers. The CPU on the new one also lacked the foil shielding the other one had and only had the black epoxy that is the bane of every hacker.

Thursday, April 24, 2008

My Capacitors Came

So over spring break dad gave me an oscilloscope to play with and I identified an unexpected behavior in my 40 meter radio. The oscillator in it that is meant to be running at 7MHz to match the signals being received (7MHz * 40 meters = 3*108 m/s aka speed of light) was instead running at 3.8MHz.

Luckily I figured this out by Monday night of the week, so I emailed Ramsey technical support right away asking for any input on the matter. They asked if one of my inductors was a K6883, which it was, and they said they'd send me replacement capacitors to alleviate the issue.

I wait, and wait, and wait. Didn't come all week, so back to school. Little did I know that just as I got back to school, the package came with the caps. So I've been waiting for the package to come and have been harassing Ramsey support about not getting anything, when in reality my mom has had it sitting in my room at home the whole time.

Lesson learned: Ask *everyone* in the house before you start harassing tech support, not just my dad... -_-

Now I have another project waiting for me when I get home!

Tuesday, April 22, 2008

Text Editing in C

New page on the C Tips wiki:

This writeup was inspired by revision control systems that fire up nano for the commit messages. Anyone got any input?

Tegan and Sara Concert

I went to the Tegan and Sara concert last night. First concert I've even been to.

It really was about what I expected. The crowd smelled of alcohol and pot. There was a lot of emo college students, and wannabe emo 13 year olds. We got there 2 hours early and we still ended up in the 6th row.

Don't get me wrong, I enjoyed it. The music wasn't as good as the CDs in some ways, in other ways it was of higher quality (feeling anyone?). It was pretty obvious that Tegan was either sick or suffering from Davis allergies. Their stories were pretty entertaining.

Overall: $25 for a concert isn't bad. In retrospect I've done it again, but I don't see myself going to another concert soon. I just don't roll the stoners and emos and crowds. Give me a laptop and internet, I'm good.

Monday, April 21, 2008

100 Posts

Yay! This is the third year this blog has been in operation, and the volume of posts has been rather exponential (1 post first year, second year 2-4 per month, this year approaching 1 per day).

Here's to 100 posts and oh so many more posts in the future.

On another note: yesterday was 4/20, and would you believe I totally missed it. A college campus and I didn't see one sign of it all day. Here's to *NOT* going to Santa Cruz for college!

Edit: So apparently there was 4/20 goings on, I just kind of live under a rock in my room, so I didn't notice any of it. Only seven weeks left until I can get the hell out of here.

Sunday, April 20, 2008

Joule Thief What?

I'm retracting that last post. It was completely and totally wrong. In every way. Forget it. I fail.

Doing some more electronics research today, and I happened upon this comment on Hack A Day. His response to mindtrap mentions that the Joule Thief prefers a power source with low impedance.

Impedance is kind of like the alternating version of resistance. A circuit with a high impedance will strongly resist changing current, where something with a lower impedance will readily respond to a sine wave input. In the Joule Thief, the lower the impedance on the entire circuit, the faster it switches on and off, the more effective it is at draining those dead batteries.

So how to lower the impedance of the power supply. Originally this circuit is fed by a dead battery, which has limits on how much current you can pull from it. The chemical reactions taking place can only go so fast, so the solution is to connect the battery to something that can store and release energy faster.

This would be the perfect place to use a capacitor. A capacitor works by having two plates of metal very close to each other without touching, so when you apply a voltage to the plates, they generate a magnetic field. Once the voltage source is taken away, the magnetic field is held, and can drain very quickly. One application is in the flash on a camera. When you take a picture (more with a disposable camera), you can hear it charge for a few seconds, but it can discharge VERY quickly.

So I added an electrolytic capacitor (3300uF, probably a little big, just what I happened to have laying around) and the light got much brighter right away. Circuit below:

Thursday, April 17, 2008

It Takes a Thief

I'm watching "It Takes a Thief," which is a show where these two guys break into a house, then show how to secure it.

Right after they broke in, the first thing the family did was completely WRONG! When you walk into your house and see stuff thrown everywhere, stop, turn around, and the get hell out of the house. There's no saying that the intruder isn't still there.

Get out of the house and call the cops. Don't explore, leave.

Fun Power Source

So I've been doing some research lately on radio waves, which will eventually turn into another project once I have enough *SPACE* for it. One of the circuits that always blows my mind is the simple crystal radio. The concept is that the antenna picks up enough energy to drive an earpiece and you can hear music with a ridiculously simple circuit.
Enough energy is collected by the antenna, then the diode only lets it flow to ground, causing a net current and the speaker makes sound.

What I was thinking: Why not use this feature of collecting energy to charge something? Obviously natural radio waves aren't enough to charge anything substantial, so a more powerful source is needed.

Why not equip a wristwatch with an antenna tuned to 2.4GHz, connect the ground plane to the metal base of the watch, and when you need to recharge it, just stick it in the microwave!

Disclaimer: This is most likely a really bad idea, it's just a musing.

Tuesday, April 15, 2008

Electro-Diesel Locomotives

We're quickly approaching Memorial Day, which is one of my favorite holidays, only because it heralds in the beginning of another summer season of working on locomotives. Real life, 130 ton, steel monsters on rails.

It really is an experience of a lifetime. I volunteer at the Western Pacific Railroad Museum (Portola, CA) and have been going there as long as I can remember. My dad originally found the place when I was about 2 years old, and we've been going there ever since.

It was always my father's dream to be able to operate a diesel locomotive, and WPRM gave him the chance. Unfortunately for me, the operating department had a 16 year old minimum, so I was stuck with nothing to do. Understand that it's not at all uncalled for to have an age minimum. This is real railroad equipment, and the risks involved are VERY real. You start screwing around and getting smart, this shit can kill you like THAT. Volunteers at the museum have lost fingers or airlifted out with 2nd degree burns. The worst I've done is some minor cuts and a muscle injury (tried kicking something heavier than me, I don't want to talk about it, it was stupid).

So I'm like 10 years old, wandering around an operating rail yard a few weekends a year with nothing to do. A kids got to keep himself entertained. It started out with simple things like sweeping the shop. Then some of the guys in the Mechanical Department would bring me out with them and I'd be their "Gopher," who is someone who goes-for things they needs. They're tell me to go get a crescent wrench or a socket and I'd go make the trudge back to the shop and bring back the tool. It then progresses to the mechanics showing me how to do something long and tedious and setting me to it all weekend.

Why do the hard work when you can give a 12 year old a grinder and he's happy as punch all weekend getting filthy?

One mechanic who really taught me above and beyond of the rest was Alan Hirasawa. I worked almost exclusively with him for 3 years. The most valuable lesson he taught me was how to weld. I've been using those skills ever since (before 7th grade?) and couldn't be more thankful for everything he taught me.
He also set me off on my first large project. He picked out a locomotive he wanted to get running again, handed me a maintenance manual and we got to work. I'm planning on this being a series of posts this summer, so I'll talk more in depth about this project later.

I've spent the last 7-8 years at the museum learning as much as I could and earning the respect of the guys in charge to get larger and more exciting assignments, which I also plan on posting about.

And lastly, I'd like to describe the principle behind an Electro-Diesel locomotive. Unlike a car, a locomotive doesn't have a mechanical transmission. The forces involved are so great, no material on Earth could withstand the shear when a fulling loaded train is starting to move.

The main body of a locomotive is taken up by a (usually) 16 cylinder diesel engine, which rotates the drive shaft down the length of the engine room, which operates two other pieces of equipment: the air compressor for air brakes, and an electric generator (along the lines of 600 volts). The electric generator has 1 inch thick cables running from it down to the wheels, which have giant electric motors in them the size of a mini fridge. The locomotive industry beat the auto industry to the concept of a hybrid by 80 years! Granted locomotives didn't have batteries set up to store energy like a hybrid car until only quite recently...

I look forward to an outstanding summer getting waist deep in grease and grime fixing something huge. Let's hope for another safe season.

I'm Finished with the Dorms

I'm getting really tired of living in the university dorms. This room is just too small to support the projects I want to work on.

The worst part is the bathrooms. It wasn't anywhere near as bad in Miller, but every day when I go to the bathroom, it's a new unpleasant surprise. I went in yesterday and there literally was crumpled paper towel covered in peanut butter in the sink. I've gone in there and seen barf filling the sink, piss all over the floor, facial hair shavings everywhere and anywhere.

And this is with our maids working 7 days a week. College students are so bad, we wouldn't be able to make it 2 days without someone else to clean up after these slobs. Next year I'll have my master bedroom with it's own bathroom. Never going to live on campus again. Ever. Even in graduate school, if I get the option, I'm not going to apply to school housing, unless it's sweet. cheap, and guaranteed.

I Love Paying Taxes

That's right. Paying taxes is a great deal. The more taxes I have to pay, the better. One of my life goals right now is to reach the next tax bracket so I can pay even MORE taxes.

God bless taxes.

Monday, April 14, 2008

Interest Rates

I had the weirdest experience this month. Like all normal fun-loving minors, the least of my worries were the dry boring things in life like how the economy was doing or what the federal bank had to say about anything. All of the talk of mortgages blowing up was just tremendous background noise as far as I was concerned.

Today I logged in, and sadly saw that my ING saving account has fallen from 4.1% to 2.9% in the last few months, which is depressing when I see myself adding more money to it and earning less money per month in interest.

On the bright side, the ads on my websites continue to tick away, earning money at about 4 times the rate of my savings account, with the one downside being that I can't get to it... I'll earn $100 eventually...

Sunday, April 13, 2008

Easy Math Homework This Week

Thank the lord! This week all we did was infinite series, which is really hard to explain, but once you get the general feeling for if something gets bigger or smaller as numbers get huge, it's trivial.

I seriously just did a weeks worth of math homework in 6 minutes. 20 converge/diverge questions, and I only got one of them wrong because I wasn't reading the question carefully enough.

Now I'm looking forward to a week vacant of MyMathLab (aka using stupid activeX plugins (aka using Internet Explorer (aka booting into Vista))), so Linux, here I come!

Saturday, April 12, 2008

Slice Viewer

Slice Viewer is the piece of software that my neuroscience professor has asked me to work on. This tool is used to view the MRI scan data from the lab and make some basic edits to it.

There are a few problems with this piece of software. Five years ago this was started by another student in Integrated Studies. Over the years it has had more and more features hacks and kludged into it to make it work. Some of them don't even work.

The data is stored in a giant 3D array. As you view it, you can flip it along the X or Y axis, you can rotate it around the current view or from one plane to another (ie XY to YZ to XZ planes). You then need to handle all of these different axes of rotation in all the different parts of the program that change or display the data in any way.

  • 410kBs of source code
  • More than 320 lines of warnings, including unsafe casts from floating point to integers, unused variables, overriding commands, and other warnings I've never seen before.
  • We identified 9 bugs in the initial conversation.
    • Some of the functions forget to handle the rotations and so edit random parts of the data
    • Some paths scale the data to fit the range where others don't
    • Some of the bugs aren't consistently reproducible.
  • Essentially no comments in any of the heavy lifting code.
  • Revision control consisted of filename.cpp.bk, filename.cpp.bk2 folderbk/ etc etc.
    • I hope none of that was important, because I deleted all of it.
    • One of the files wasn't even clearly a backup: 2sliceviewer.cpp. That person needs to be taken out and shot.
So I definitely have my work cut out for me... wish me luck!

Tuesday, April 8, 2008

Tip of the Day - Finding the Best Books

When you're looking for books on a subject in a University's library, always check the ones the University rebind themselves. I've consistently found that the best books are the ones bound in the gray cardboard.

Monday, April 7, 2008

Stupid Subway Commercial

Anyone seen that $5 Footlong commercial? A bunch of people in random situations holding up five finger, then indicating a foot long, referring to Subways $5 12 inch sandwiches.

PROBLEM: Godzilla's 12 inches is wider than the buildings! That's so stupid, A foot to Godzilla should be tiny! The scale is totally wrong.

Sunday, April 6, 2008

The Preparation Begins

So Spring quarter hasn't even really geared up yet, and I've already started planning everything I need for my apartment next year. But hey, why not? My dad has already managed to snare me a free TV that supposedly works. The owner upgraded to an HD-TV so they had a perfectly good TV, which is now MINE!

So for the apartment dwellers out there: Was there anything that you forgot to bring your first year that you'd think other people would forget too?

Saturday, April 5, 2008

Aquarium Status

For all who are interested, here's how my aquarium is doing:
  • I've expanded the holes on the bottom of both flower pots so nothing will get stuck in them.
  • Tolstoy the Betta has started using his fins again and is swimming normally. There's still some chunks of fin missing and he's missing some scales on top, but it looks like he's going to be ok.
  • Shostakovitch the snail continues to eat algae and dive bomb everyone else in the tank.
  • Stalin the shrimp... wait, there's a shrimp in there? Oh yeah... look at that... (Yeah, he's still kinda hard to see. Yay ghost shrimp)

Yay Village Bakery

So the Village Bakery is this little hole-in-the-wall bakery in downtown Davis next to the train station. In all my majesty, I forgot that the University dining commons closes at 7pm on Saturdays, so by the time I realized what time it was (was playing Outpost 2), the DC was closed.

So 8:00pm, I ride down to the Village Bakery to buy a slice of pizza, but all they have is this veggie pizza with zucchini on it. I ask, "You got anything else coming?" Cashier: "I don't think so, sorry." Me: "Well I guess I'll take that slice in the back then." Cashier: "Here, I'll give you this for a $1 off since it isn't really what you want."

DUDE! When was the last time you've experienced customer service like that? I got a slice of pizza that I would normally never get, but for only $1.50 ($2.50 for a slice of pizza, good by my standards anyways). I'm glad this place is right across the railroad tracks from my apartment next year.

Tip of the Day - Protect Your Cards

On the back of your credit cards, instead of signing it, write "Check ID" I have had several store clerks mention that they're only required to check ID if the customer writes it on the back of their card.

Friday, April 4, 2008

First Day of Neuroscience Seminar

I had my first day of neuroscience today. The goal for this seminar is that we're working with the neurosci's new software to analyze CAT scans of seniors to compare the lobe sizes of cognitive elders against seniors suffering from disabilities such as Alzheimers.

Today they taught me how to get around on their Linux systems and how to run the software to analyze the CAT scans. First thing they asked me to do was copy all the files for my first subject into my home directory. When I used cp -R 2031/ ~ I guess they were impressed enough that at the end of the hour, Evan offered that I could work developing software for them instead of image analysis.

I'm not quite sure what I'm going to be helping them program, but it sounds a little more fun than what I did today. It was interesting, but tracing the brain in 140 frames of CAT scans does get a little tedious. Too bad this looks to be the only really exciting class I'm taking this quarter.

Tip of the Day - Where's the Door?

When you're trying to find the entrance to an office building in an industrial park, look in the back by the parking lot.

Industrial parks expect you to drive to the office, so if you walk or take your bike, you'll be looking at the back of the building.

Thursday, April 3, 2008

A Better Way to Convert ppm to jpeg in Linux

So two months ago I posted the scripts I used to convert ppm to jpegs in my Ubuntu setup. I knew it was poorly done because it renamed every file picture.ppm.jpeg, and it needed two seperate files to work. Thanks to commenter Manuel, I finally have a much better way to do it.

for pic in *.ppm
pnmtojpeg "${pic}" > "${pic/%ppm/jpg}"

Then just put that in your path somewhere, chmod +x ppmconv, and you're good to go.

To add it to your path, add this line to your ~/.bashrc file:
Then add whatever scripts you want into ~/bin to have them run. Right now the only other thing I have in there is my twitter script.

My dad and I were actually talking about this exact same solution to my problem on the way up to Davis last week, so I at least knew it was bad (Not to mention unstable...). Thank Manuel!

Wednesday, April 2, 2008

Aquarium Decorations

I screwed up. Over break I took a miniature flower pot and ground out an opening in the side and turned it upside down for my aquarium. It was adorable: a little cave for my Betta to hide in.

Unfortunately tonight my Betta freaked out while in the cave and tried to go out the hole in the bottom of the pot. It didn't work and he got himself stuck. I tried to break apart the pot, but couldn't and finally managed to work him out. He lost a large patch of scales on the top of his body and most of his front fins are mangled.

After some experimentation, I've figured out that using a philips head screwdriver to chip out the pottery works 100xs better than my Dremel anyways. Go figure.

Tuesday, April 1, 2008

Announcing The C Tips Wiki

It is my pleasure to announce the launch of my latest project:

This website will be a collection of lots of little tips and tricks in the C programming language. I love C because you can take the handful of small tools they give you and do some really cool things.
(Since I'll have this website, I will no longer bother all of my readers with my C tricks here, unless anyone says otherwise.)

If any of the programmers out there would be interested in contributing, please let me know and I'll give you write privileges.

Asking Questions in a Room of 200

Student: "How did you get from there to there?"
Teacher: "Where?"
Student: "That second line, right there."
Teacher: "There?"
Student: "No, nevermind."

I actually saw that dialog going on in class yesterday. I thought about it for awhile, and I realized several times I've not bothered asking a question because it would be too difficult to point out where I'm talking about.

My solution: I should start carrying a laser pointer with me. I have three classes of at least 150 students, and having a laser pointer with me would probably help motivate me to ask questions more often and get more out of my university experience.

I Hate April Fools

I really do. No doubt. It sucks.

On other news, my aquatic pets are looking a lot better. I've inched the water up to 88F and a teaspoon of salt per gallon to try and control the parasite outbreak. No signs of stress from anyone, they're all eating again.