Gas Mileage TinyApp

If this keeps up, I’m going to have to put together a dedicated page for web projects. I hope it does keep up. I really love doing it…

My latest project following the FreeBSD backup script (bash), a host of system admin scripts too small to bear mentioning (bash, tcsh, perl), and the twice-built RAID crash victimized wine database (PHP, Smarty & MySQL) (in addition to the many projects no longer online), is a gas mileage tracker. It’s also written in PHP, delivered through Smarty, and backed by MySQL, but now with delicious pChart.

I originally used GoogleDocs and a GoogleForm to record the data, and I have data going back a few years. That worked well enough and did most of what I wanted it to do, but it didn’t do everything. Now that I have my own server(s) up and running again, I have the luxury of being dissatisfied.

What it Didn’t Do

  • Provide meaningful feedback after submitting the form. I want to know what was submitted immediately on the “Form Submission Successful” screen, and if applicable, how it relates to information previously submitted. That’s just good UI feedback that it’s missing.
  • Allow me to maintain and build upon my scripting/database chops. Working with GoogleDocs is easy, fairly extensible, and has the benefit of having a preexisting world class infrastructure (and all that entails) and environment in which to work. However, I’m a bit of a maverick in these things, and for my own projects I want things set up the way I want them. Their infrastructure and environment doesn’t allow me to build on the skills I want to build on. I have my own environment. I want to take advantage of it.
  • Allow me to maintain and build upon my UI design chops. I’ve always loved the UI design aspect of building web apps. There’s a few things you can do with Google, but I felt too constrained by their system, and wanted, again, things the way I wanted them.

It wasn’t all bad, though. Setting it up in GoogleDocs did effectively (if not intentionally) serve as a sort of rough draft for rebuilding it on my own server.

What it Did Do

  • Gave me a firm sense of what I wanted, and what I didn’t want, if not a solid workflow to follow.
  • Gave me a good sense of the basic information I wanted to collect, which was then easy to translate to MySQL tables.
  • The visualizations in the form of charts and graphs were good enough that I decided I couldn’t do without them, which gave me the desire to research PHP graphing/charting libraries. I settled on pChart.

Now, I have a small web app that lets me…

  • Track the gas mileage I’m getting for my car and how many miles I’m getting per tank.
  • Track how the price of gas is changing. Always up, but still…
  • Track how much I’m spending per mile on gas.
  • Track how often I fill the tank.
  • Keep tabs on how often I’ve changed the oil (I change it myself… a pox on paying someone else to do it), and how long until I need to change it again.

Soon, it will let me…

  • Track how many miles I drive over time, per week, month, year, etc.
  • Track how long between major service visits I don’t care to do (tires, brakes, etc.)
  • Implement multiple vehicles in the hopes that I can get my wife on board and using it.
  • Authenticate access so I don’t have to worry about the data being mangled by miscreants and malcontents. Obfuscation and low-profile domains will only work for so long (stay away, Noah! :) )…
  • Better UI flow… it’s good enough for me, but it’s rough. It’s fine on the desktop, but I need to clean it up so it works on the mobile platforms better.

Here are the charts I’m generating. I know, the gas mileage isn’t that hot. But the payments are $0, so there’s that.





Ye’ Olde English Billiards Parlour in the Basement

Light That’s what I want. That’s what I plan to have.

The basement of the house we’re negotiating on is unfinished. It’s already framed in (a very nice professional job, too), and awaits only drywall and finishing. However, I want to get the pool table installed now, and finish the room around it later. That means floor first, rather than the typical last.

Our plan for the moment is to install tile directly under the pool table and carpet tiles around that. The tile under the table will help support the table, won’t settle the way carpet does, and will provide a beautiful accent. The carpet tiles will grant the luxury of being able to take tiles up, put tiles down and cut tiles to size as I’m finishing up the walls. Then if someone… when someone spills their drink on the carpet we can just take the tile up, hose it down, let it dry, and drop it back into place. They make carpet tiles with a thick enough nap that the seams are invisible, so it’ll look just like a normal carpet floor.

Here’s the rough plan starting just as soon as possible after we take possession and move in:

  1. Pull down the ceiling tile framework the previous owner installed. Don’t need it. Don’t want it.
  2. Spray the ceiling black, or another dark color (the wife suggested a dark grey similar to the tiles we looked at) which will give the illusion of a more open space, and actually provide more space. I have a piston sprayer I used on my current ceiling. That’ll do.
  3. Install the tiles on the 45, with a border around those on the 90, with the whole area being just large enough to fit under the table. I have a professional tiler friend who has offered to help with this in exchange for beer.
  4. Make an appointment to have the table delivered and installed. This is key. It will become my deadline for everything above this line. It’s good to have deadlines. They keep us on our toes and getting things done.
  5. Install the carpet tiles around the newly installed table.
  6. Finish the basement as time and money allow, and play lots of pool in the meantime!

I’m a little worried about the weight of the table on those tiles, and potential breakage. Will an underlayment like ditera help, hurt or be indifferent?

For the rest of the room, I’m thinking of an old English pub feel, with nice dark wainscoting and other woods and stained stucco. :)

We have no reason to believe our plans to buy this particular house will fall through, but if they do, my rough plan outlined here remains, no matter what house we end up in.

The Dying of a Beloved Laptop

… well, maybe not quite yet. Vertical lines have started showing up the screen, though. First there was just the one, way over to the right of the screen and out of the way. This morning, a 2nd showed up right down the middle. Ugh.
Laptop LCD Screen Lines
My research points to a couple of things that could be the problem. Some say it’s a connector issue. Others claim LCD. I’ll do more research, but I’m inclined to think it’s the screen. Regardless, I reckon there will come a time in the nearish future where I’ll be forced to make a choice. The way I see it, I have a few:

  1. I can simply do without.
  2. I can buy a replacement LCD for ~$180 and install it myself or, with a little more money, pay someone else to do it.
  3. I can buy a new gaming class laptop.
  4. I can buy a non-gaming class laptop.
  5. I can take up the task of building a new desktop computer.

Anyone have any guesses which way I’m going to go?

I won’t simply do without. Nope. No can do. Next…

I’ll consider replacing the LCD, but the laptop is 5+ years old now, and is definitely showing its age. It’s had a good run, but I have to face the notion that it might be time to put it to pasture. Or at least relegate it to more mundane tasks that don’t require a full time monitor – or better yet, donate it to someone who can’t afford their own new laptop… it’ll still more than serve basic needs, and I have just the person in mind.

I’m not interested in a new gaming-class laptop. The ROI just isn’t high enough for me. If I’m going to spend that much cash, I want more machine that what’s offered in a laptop. I want more performance, more customizability, more upgradeability, and frankly, more control.

Nor am I interested in a non-gaming class laptop. The ROI might be better, but the performance just won’t bet there. I. Need. The. Fast.

That pretty much leaves me with building my own desktop. I’ve been batting around the idea of building a new computer for a few months now. It’s been 5+ years since I’ve upgraded that aspect of what my wife likes to call my “Command Center”, so it’s about time (and as much as things have stayed the same, my oh my, but have they changed!). I’ve put together a rough budget with a range of costs per component, and I could spend as little as a few hundred, or as much as a few thousand. We have a lot of expenses hitting all at once right now, but after a few months and things have settled down a bit (around my birthday), I think I might be able to make a go at it, even with the addition of a home NAS solution (which I’m still debating, to be honest).

I just hope that my laptop screen holds out until then. I’ve seen what happens when this issue is left alone, and it’s not pretty…

Der blinkinlichten ist lookenpeepers goot!

Wherein a little history, and new Blackburn Flea 2.0 USB lights are reviewed.

First, some history…

When I first built out my 2003 Kona Fire Mountain as a commuter way back in ’07, I mounted two Cat Eye TL-LD600′s on the front fork, one on each side pointing to the side, and two pointing towards the rear off the rear fender, and my Triple Shot rounding out as the bright headlight.
20110317_commute_01
This was a good setup, but I got tired of replacing batteries in the TL-LD600′s. They were also quite the protuberance on the fork up front. Eventually, and perhaps inevitably, the fork lights came off; one snapped off, and the other looked lopsided. Additionally, the Triple Shot, bright as it is, is heavy, and the separate battery is bulky, takes up valuable frame real-estate, and is not as convenient to recharge as I would have liked. I wasn’t really complaining though, and rode with just the headlight and taillight for a while. Then I didn’t ride for a while. Then I rode again, and nearly got plowed into twice in two days by people who clearly were not using their lookenpeepers.

That brings me to today. I’m back to my original setup, but this time with different lights. I still have an old TL-LD600 on the seat post. But on the fork I now have two Blackburn Flea 2.0 USB rear lights, each pointing out and to the side. For headlights I’ve replaced the heavy and bulky Triple Shot with two Blackburn Flea 2.0 USB front lights. I’ve gone the extra best-practice mile and mounted another on my helmet.

When they’re all set to blinkin, I am quite a sight to behold, and after all, that’s the point, isn’t it?

On to the review…

Construction

The lights are very small and light, which is a nice change of pace from my old Triple Shot. As far as construction goes, they feel moderately sturdy, but not quite as solid as I’d like. That goes double for the helmet mount. The base that sits against the helmet is metal, but the bracket that slides into the slot on the light itself is plastic, and I’m worried that it’ll snap off. I’m playing pretty careful with it to push that day out as long as I can. I’m a little disappointed with that piece, and would have expected only metal for the price of $15. Still, it’s possible they went plastic to save wear on the light chassis, which is itself plastic. I’ll entertain the possibility, though I’m pretty sure it was a cost thing.
blackburnflea20usblights_09
blackburnflea20usblights_14
Lighting Modes

The four LED headlights have three modes: a rather bright standard, a much brighter overdrive and the standard blinking. I rode this morning in the dark with the headlights set to overdrive and the helmet light set to blinking. This afternoon I set them all to blinking. Run times are quoted as 3 hours on steady, and 5 hours for flash. It’s not stated whether steady is for standard or overdrive modes. I suspect overdrive to be less than 3 hours. I probably won’t time them to see, but that should provide a solid week of riding to and from work without recharges. If it’s less than that, I keep closer track, but otherwise I’m not worried about it.

The four LED rear lights (which I have on my fork) have three modes as well: all-on steady, flash (all lights blinking in unison), and chase (alternating blinking between two pairs). Run times are quoted at 6 hours steady, and 12 hours flash. I suspect 12 hours is for chase mode, and flash to be somewhere in between, but again, I’ll only keep close track if they’re obviously falling short of those times.

Brightness

Both front and rear lights are, as one would expect from LEDs, very bright. Rated at 40 lumens, the front lights aren’t anywhere near as bright as my 130 lumen Triple Shot, but two running in tandem illuminate the urban landscape aplenty for my purposes, and they’re nowhere near as bulky. I wouldn’t take them on singletracks at night, but for daily street use, they’re plenty sufficient.

Charging

They charge via a little USB dongle. The light sticks attach to the dongle via two magnets, which also serve as the charging contact points. I found the holding power of the magnets more than sufficient, and was able to charge three of them at once in my D-Link USB hub. The first charge took about half an hour per light before each was fully charged and the charge indicator went from blinking red to blinking green.
blackburnflea20usblights_13
I bought one set that came with a solar charger, but I’ve not tried it yet.

The button that serves as the USB charge indicator, and that you use to turn on and off the lights and switch modes, also serves as a running charge indicator. After you shut the light off, it’ll glow green to indicate a charge of 75% or more, orange to indicate a charge between 25% and 75%, and red to indicate a charge of 25% or less. That’s useful insofar as knowing about how much charge you have left, but not really useful in knowing how much time you have left. Still, it’s probably enough… red simply means charge as soon as you can.
blackburnflea20usblights_04
Price

At ~$25 per light, they’re cheaper than a lot of options out there, but if you want more than one, the $$’s add up. Still, the charging method definitely offsets the initial price.

Mounting

They mount to the frame via custom made Velcro straps, with protective strips on the non-sticky side to help protect the frame. The straps need to be completely removed in order to properly charge them, which means they have to be remounted after every charge. That’s not a big deal to me because they’re very easy to mount, though it might be to some. The ability to quickly move them around the frame, or share them with friends in need outweighs, at least for now, the inconvenience of having no permanent mounting bracket. That said, it shouldn’t be too tough to rig up a permanent mount (perhaps using the, albeit plastic, helmet mount) if one were so inclined.
blackburnflea20usblights_01
The rear lights have what look like belt straps on them that the Velcro frame mounts slide through. They also allow them to be strapped directly into loops, belts, or wherever else you can find that fits. They’re allegedly compatible with certain helmets. Unfortunately, mine isn’t one of them.

Conclusion

So, what’s my final take on them? Traffic was pretty light today, but those cars I did encounter showed every sign that they saw me. There were no close calls at all, and I certainly felt better having the directional light on my helmet. All the blinking made for a very cool and eerie strobe effect that lit up reflectors everywhere! In the dark of the morning, they were bright enough for me that I wasn’t worried about potholes, stray cats or zombie arms reaching out from sewer drains.
blackburnflea20usblights_06
I have to take some points off for the construction, though. Though I’m sure they’ll last as long as I want them to, the lights don’t feel quite as solid as I’d like,. The helmet mount feels like it could break at any time. I’m pretty sure I’ll be taking them up on their (limited) lifetime warranty for that piece. Until then, I’ll be handling them with kid gloves to put that day off as long as possible.

All in all, I’m going with 4 out of 5 der blinkinlichten after my first day with the lights. Points revoked for construction, but more points given for size, price, performance, convenience, ease of use and charging method.
Blackburn Flea 2.0 Front LightBlackburn Flea 2.0 Front LightBlackburn Flea 2.0 Front LightBlackburn Flea 2.0 Front LightBlackburn Flea 2.0 Front Light NeGaTiVe

Twice in Two Days

That’s how many times I was nearly hit by a driver not paying attention. I don’t know that there’s any way to compare that to the average ride for the average rider, but for me, it’s twice the number of near misses I’ve had for the last three four years. My own memory is very likely faulty, but I only remember one other instance.

91st & Lowell Yesterday morning, I was heading south on Lowell and turning left onto 91st when a woman heading east on 91st Terrace went straight through the intersection towards 91st St after I was already well into my turn. She, in effect, wanted to share precious intersection space with me. I saw it happening, easily adjusted my course and we pulled into the eastbound lane side by side with me in the middle and her next to the curb. She sped ahead with a look of shock (reproach? distaste?) on her face and I moved to the right behind her. I tried to catch her at Foster – you know, for a friendly reminder about paying attention – but the light turned before I got there and she was gone. Oh well.

King's Cove & Brittany This morning, I was much closer to home at an intersection within an apartment complex. I was heading east on Kings Cove Dr, and the driver heading north on Brittany St and turning west into me. When I say “into me” that’s exactly what I mean. In spite of my rather crazy bright light (ok, only 140 lumens) and bright fluorescent windbreaker, the driver clearly didn’t see me and just pulled out. I saw it coming though, and easily engaged pulled into the oncoming lane with a rather loud, throaty and heart-felt “WATCH WHERE YOU’RE GOING!!” I’m sure they only heard “WAt wer yr gn…” I looked back and they were stopped (in the middle of the road). I can only hope they had to stop b/c their own inattentiveness lanced adrenalized terror through their chest. That might be too naïve though.

Rather than continue the focus on the well covered topic of driver inattention, I want to turn the focus away from what others are doing, and point out two things:

  1. I made it safely through both scenarios because I was paying attention, was planning ahead and was riding defensively. I can’t help whether drivers are paying attention, or if they’re reading, writing, putting on makeup, eating, using their mobile phone to text or talk, or any of the 10,000 other things people do instead of drive, but I can help whether I’m paying attention, and at the end of the day, that’s what’s going to keep me rubber side down.
  2. These back-to-back near incidents inspired me to do something I’ve needed to do for some time. In the first case, it’s entirely possible that, because of my bike’s position relative to the woman driving and the position of the lighting on my bike (front and rear only), she just didn’t see me. Additionally, it was that low visibility dusk/dawn period. I’ll give her that. So, I’ve ordered a helmet light I can flash in people’s eyes, and two rear lights I’ll attach to my fork pointing to the sides. I used to have that setup, but I let it slide through exchanging this bike for that, that light for this, etc., you know how it goes. I’m also looking into some highly-reflective tape for my pannier and frame (nod to CommuterDude for the tips on electrical tape and placement).
    Blackburn Flea 2.0 RearBlackburn Flea 2.0 RearBlackburn Flea 2.0 RearBlackburn Flea 2.0 Rear

So, there you have it. I’ve had two near-encounters with inattentive drivers in as many days, after zero encounters in years. I’m sure it’s a statistical anomaly, rather than an indication of things to come, but just to be sure, I’m ramping up my visibility.

Just do me a favor will you, don’t tell my wife about this. She worries enough as it is. :)

Biting the NAS Bullet

UPDATE 2011.03.09 – I think I got a handle on it. I’m still pursuing the subject of this post, but I’m no longer worried about the backups.

I’m done.

I’ve given up on USB based backup solution. Sunday morning has become my standard “find out what went wrong with the full backups last night and see what I can do to fix them.” I tire of it. Granted, the failures this weekend were because I ran out of room on my little 80GB USB drives. Totally my fault. It was just a matter of time. I wasn’t paying attention and the backups failed. Fortunately, that’s all that happened, as opposed to something more insidious. At least it wasn’t some sort of kernel panic, or soft-updates issue again.

I could easily solve it by spending a few bucks on a larger drive, but that would just be another stopgap. I want a solution that will carry us a few years and then some.

So, I’m thinking NAS*. Something that would serve my family’s needs (which amounts to my wife and I at this point, but we’re really hoping for a little papoose sometime here real soon). That means a lot of storage space. That means seamless connectivity with our existing machines, and that means dead simple to use.

I could spend a few hundred dollars on hardware and many hours putting together my own FreeNAS server from pieces parts (or any one of a number of other free options). Or I could spend a few hundred dollars and a few minutes on an OOTB solution.

I’m leaning towards the OOTB solution.

Sure, it’s not as proudly geeky as a home grown solution, but my gorgeous wife doesn’t appreciate geekery as much as some of you and I do. She appreciates things that work and work now. If I’m going to spend this amount of time and money, she has approval powers – it’s just part of that thing called Happily Married. Frankly, the older I get, the more I agree with her. So, OOTB NAS it is.

So far, though I’m still keeping my eyes and mind open, I’ve narrowed my choices down to:

Synology Disk Station DS410
Synology Disk Station DS410j
Netgear ReadyNAS NV+
Netgear ReadyNAS Ultra
Netgear ReadyNAS Ultra Plus
QNAP Systems 419P+
Thecus N4200Eco/Pro
Seagate BlackArmor NAS 400

Each of them fits my base requirements:

  1. Interoperability between Windows, Mac and *nix machines
  2. Function as a print server
  3. Four drive bays for RAID5 or better (hot swappable a huge plus)
  4. Small physical footprint

Each of them will do the job. So now, it’s a question of features, performance, future-resistance and of course, price.

I’ll be researching each of these models (and any others that come across my screen in my research) over the next couple of weeks (or less).

* Yeah, I know NAS != backup. This is just a step in the right direction. For backups of the NAS, I’ll grab a big 1 or 2TB disk, throw it into my dev server, and rsync the data from the NAS to it. I’ll keep my backups scripts running for my server data, but I’ll point them over NFS to the NAS, rather than to flakey USB drives.

Treacherous Driving after Dodgeball

Tonight was Jami’s school’s Annual Dodgeball Tournament. Yours truly was a referee, and it was a blast, as always.

The drive home, however, was not. We’re in the midst of Pappa Winter’s last ditch effort to put as many drivers in snow bound icy ditches as possible. He almost got Jami, too. She was driving about 45mph north on I-35 on a sounding lead straight line, when out of the blue she starts careening off to the left and towards the concrete barrier. I’m driving a few car lengths behind her at this point and watch as she compensates properly against the fishtail to straighten out… and then watch helpless as she over-compensates and starts sliding sideways back towards the ditch on the other side of the road. Fortunately, there wasn’t anyone else around us, and the only thing she hit was a guide pole with her rear bumper, and that not very hard at all.

I should point out that, aside from that slight overcompensation in straightening herself out the first time, she did everything right. She turned the wheel the right way, didn’t brake or accelerate, and she wasn’t going very fast at all to begin with.

I pulled over to the shoulder, put on my hazards and tried to call her but it was busy. I was about 200 yards ahead of her, and was about to get out when she started to move again. She had, apparently, gotten out and pulled the bent guide pole out of the ground and thrown it a away into the snowy ditch. Adrenaline can be a great thing… until it hits your stomach and puts it in knots.

I waited until I saw her pull out and pass before I pulled back into traffic. We slowly, and without further mishap, made it home.

Pool Table and Rec Room Furniture Moved

We’re not completely beat, but we’re certainly tired.  Moving our rec room furniture out of one friend’s basement, and into two others will do that I suppose.

I hired out the pool table itself, preferring to have someone experienced in dismantling pool tables do that job.  It was taken to one friend’s basement, along with two barstools and the light this morning.

This afternoon, I, my wife, and the couple from whom we bought the whole set, moved the rest of it into the garage in our Southern Home.  That includes the captain’s chair, the player chair, four rolling chairs, a high top table, and a flip-top poker/game table, and a 60″ standing bar.  Thankfully, we had a family truck to use, which meant we had to make a couple trips, and put stuff in cars as well, and make two trips to boot, but we didn’t have to pay anything for it.

One step closer to having a usable pool table!