Thursday, April 30, 2009

Playing with XFS

I've been suffering badly from a hard drive space shortage as of late. My file server has a 250GB SATA drive in it that came with it when I bought the desktop in 2005. I've tried running it with two PATA drives in a LVM pool with most of the SATA, but for some reason becomes unstable. So how I have it configured now is a 15GB partition for /, mainly for my local apt-cacher proxy, and the rest (215GB) as /home/. Unfortunately, I've been running into problems because I'm running it at about 95% full.

ext3 and ext4 do an admerable job keeping disks from getting fragmented, but when you're running file systems that full, there isn't much that can be done to keep it from getting pretty bad. Recently I heard mention that XFS, developed ages ago, actually comes with a defragging tool, so I decided to give it a shot. Backed up all my files onto every other hard drive I have sitting around, reformatted /home/, and loaded everything back on. Ran:
xfs_fsr -v -m /etc/mtab
and after it finished, tried playing a few videos off the hard drive, and you could barely tell that it was reading. Much better than the chatter fest that was ext3.

Granted, this isn't actually any kind of quantitative analysis of ext3 vs XFS, but it does seem to be quite a bit happier. I really need to just break down and buy a 1TB drive. All of my problems would go away...

Sunday, April 26, 2009

Fluid Density Separation

I was making a batch of iced tea, and was pretty amused by what happened to it. I first heated the water, dumped in a tablespoon of sugar without stirring it, and steeped the tea for five minutes. I came back to this:

I found it rather amusing that the sugar all dissolved, but stayed saturated at the bottom of the jar, segregating itself from the tea above it.

Saturday, April 25, 2009

Davis Bike Collective

Went to the Davis Bike Collective grand opening this afternoon to check out their new location. They were previously called the Bike Church on campus, before the university kicked them out for code violations.

Their new location is just on the East edge of downtown, which is pretty much as close to my apartment as is possible. Their entire location consists of the garage pictured above, along with another room through the door on the left, and a courtyard, from where I took the pictures.

They don't have very many of their parts there, so I couldn't replace the stuff failing on my bike, but I did patch a tire, true a wheel, and finally figure out what was wrong with my front brake. The people there seemed pretty reasonable, so I can see myself coming back to volunteer.

Thursday, April 23, 2009

Quantum Mechanics Midterm Problem #1

You are gliding along in a revolutionary high-speed vehicle at a constant 0.8c. On the ground are two stations, X and Y, that according to ground observers have clocks synchronized and are 9.0×106m apart. Just as you pass station X, your clock and the station X clock read zero. Your passing station Y is an event. When this event occurs, what does (a) your clock read according to you, and according to someone in station Y, (b) the station Y clock read according to you, and according to someone in station Y, (c) the station X clock read according to you, and according to someone in station X?
Question by Randy Harris.

The first two parts of this problem are relatively simpler than the third, since they're both at the location of the event (glider passing station Y) so both parties will agree on what each clock says, since the clocks are in the same place in both frames. Classically, we would expect all the clocks to agree all the time, but since we are going ridiculously fast, it's not the case.

Part A - Clock on the Glider

This requires using the simple equation speed × time = distance. We want to know howw long it takes to travel between the stations, so solve for time:
t = d ⁄ v
The problem is that it won't appear to be 9.0×106m between the two stations, but some value less than that. This is due to the effect of length contraction, which causes moving objects to be shorter. The equation for length contraction is:
L = L0 ⁄ γv
Where L0 is the length of the object in a stationary frame, and γ is the Lorentz factor found throughout special relativity, as a function of v.

We use this length contraction formula to calculate the length of the path between the two stations in the frame of the glider. Once we know how far apart the two stations are, it's trivial to calculate how long it takes to travel between them.
L = 9.0×106m ⁄ γ0.8c
γv = (1 − v² ⁄ c²)-0.5
γ0.8c = (1 − 0.8²)-0.5
L = 5.4×106m

Now that we know how far the glider has to travel, we plug that in as the distance in the speed equation:
t = 5.4×106m ⁄ 0.8c
t = 22.5ms

So both parties, the glider crew and the observer at station Y will agree that the clock in the glider reads 22.5ms.

Part B - Clock in Station Y

This part is even simpler than part A, since the path between X and Y isn't moving in this frame. The only thing moving in this frame is the glider, which isn't a problem since the clock is only one place in the glider, so it's length contraction can be ignored.
t = 9.0×106m ⁄ 0.8c
t = 37.5ms

Again, since this clock is at the location of the event, both parties will agree that the clock says 37.5ms.

Part C - Clock in Station X

This is where the calculations start getting gnarly. This clock is not at the location of the event (glider passing Y), but is 9 million meters away from it, meaning that there is no requirement for the two parties to agree on what time it displays (don't you love relativity?).

In the frame of the stations, there isn't any problem. The clocks at the two stations are synchronized, and since we already calculated the time on the clock at Y, the clock at station X in the same frame will be the same: 37.5ms.

The problem is in the frame of the glider. From the glider's perspective, station X is moving at 0.8c away from it, so time dilation dictates that the clock in station X should show a time less than the 22.5ms that passed on the glider, from the gliders frame of reference.
This can be calculated using the Lorentz transformation for time:
t = γv (vx′ ⁄ c² + t′)

Calling the position of the glider the origin in its frame, the x location of station X would be -5.4×106, and the time in the glider's frame would be the time shown on the glider's clock: 22.5ms. Plug it all in, and we get:
t = γ0.8c (0.8 × -5.4×106 ⁄ c + 22.5ms)
t = 13.5ms

Now this is pretty crazy. You on the glider and another person on station Y's platform both look at each other, and agree what each other's clocks say, but then look back at station X, and disagree by 24ms. This also means that from the glider's perspective, every place along the path from X to Y is currently at a different time.

But that's relativity for you... and this has just been three weeks...

Friday, April 17, 2009

I Love Bacon

Thhhiiisss much! That is an entire mug filled with the grease of approximately 2 pounds of bacon that I've eaten over time. I do use a little bit of it with scrambled eggs, frying, etc, but it's such a tragically bad grease for you, I just haven't been able to keep up.

Friday, April 10, 2009

164 - 168MHz Radio Receiver

While up in Santa Cruz last weekend with my sister, Robert gave me a thingamajig he found in the University E-waste. I couldn't tell what it was, but once I got home and put power to it, it actually turned on (didn't expect it to work) and started scanning from 164MHz to 168MHz. I hooked it up to my 144MHz antenna and stepping through the channels for awhile, but never heard anything more impressive than static. From what I've found online, it looks to be a government band. Anyone know anything more about these frequencies?

Sunday, April 5, 2009

The SMT Challenge

Altoid tins are super popular as enclosures for a whole variety of different electrical projects (i.e. USB hub, iPod battery charger, a set-top box, the list goes on). They're just the right size for a 9V battery and a small PCB, but this is the 21st century; 2"x3.5" is child's play. I want to start seeing projects that fit inside the ultimate SMT challenge: Altoids Smalls. They're 2.5"x1.25", 70% as tall, and a whole hell of a lot more impressive.

Wednesday, April 1, 2009

Link Dump