Wednesday, April 30, 2014

Final Exam, Question 11

This term I was teaching a Computer Data Structures class and I needed 5 more points for my final exam.  I decided to have some fun.  These are the top 10 student answers. Disclaimer: pigs are not computer data structures, even when they have hats.



#10: The Venn diagram of CS students and art students is almost two disconnected circles.




#9: This hat reminds me of bloodninja.



#8: Viking pig took the time to put on a vest and pants.



#7: Note the conspicuous absence of a hat.



#6: I would not think that getBacon would be a mutator method.



#5: This pig is in mourning, probably because of pig #6.



#4: I actually like the pig better than the lamp, but I'm not sure why the power outlet has a wizard hat.  A bowler seems more appropriate.



#3: I like the French pig.  The flower on the hat really brings it home.



#2: This pig is fancy, but smaller than a desktop computer from 1996.



#1: I don't think I can give this student 5 points because there's either a serious misunderstanding of enqueue and dequeue, or a serious misunderstanding about the way that pigs work.  I'm not sure if I hope that it's the former or the latter.



watch my videos on youtube follow me on twitter view my pictures on instagram view my profile on linkedin view my google+ profile

Friday, April 25, 2014

A year with the Nissan Leaf

So about a year ago I decided that I'd had enough of driving a normal car and wanted to try something out that seriously limited my ability to drive far away, look cool, or haul anything ever.

I used to drive a Jaguar X-Type and I loved pretty much everything about it (even looking like an old man) except for the nearly $300 I was paying to fuel it every month.  Turns out that 19 miles per gallon is expensive.  So, I decided to check out the Nissan Leaf because I'm a bit of a geek and a bit of an early adopter.   I was watching electric vehicles for a while and it seemed to be the first "practical" one - it had enough range to get you where you're going but wasn't prohibitively expensive.

I really wanted a Tesla but...

Not pictured: 2nd Mortgage

$69,900 is a lot of money, even with a $7500 tax credit.  They're awesome, but a Leaf with all of the options is just a touch more than HALF of the price of the base Tesla Model S.  So while a Tesla might make you look cool, $35 grand looks pretty good on anybody.

I was actually kind of surprised to find out how affordable the lease on the Leaf was.  A lot of that is due to the $7500 tax credit for EVs - the way I understand it the leasing agency gets the credit and they apply it to the leased amount of the car.  It works out pretty well - my monthly payment is only $262.  Add just a few dollars for electricity and the entire operating cost for this car is less than I paid for just the gasoline in the old one.  Not too bad.

FEDERAL TAX CREDIT?! THANKS, OBAMA

As far as driving it goes... I like driving the Leaf.  It's no Jaguar but it gets the job done.  It has two different switches for drive mode - D or B, and Eco On / Eco Off.  I'm not really sure what the B stands for (b'not fast?) but you get a much better range in B mode.  It's odd driving in this mode at first because you decelerate as soon as you take your foot of the "gas" pedal, but you get used to it and I'm sure it's better for the brakes.

The best thing about the car (for me, at least) is that it's like driving a computer on wheels.  I mean, if I were in the business of picking up chicks in my car, I'd be going out of business... but there are lots of ways to nerd out - LED panels, graphs, metrics - I just wish the thing had some sort of API.

Things that I love:
  1. Starting my car with an app on my phone.  Necessary in Pittsburgh winters lately.
  2. Easy bluetooth connection for music.  All of my Justin Bieber YouTube videos play flawlessly.
  3. USB port for music / charging.  I can fit the entire Wilson Philips catalog on a single tiny USB stick.
  4. GPS is good.  Easy to use and pretty accurate.
  5. In "D" mode with Eco Off, it's a pretty zippy car.  Lots of torque.  That's probably super impressive to everyone when you're driving a hatchback.
  6. In "B" mode with Eco On, it's a little more sluggish but you can take bigger round trips.
  7. The cost to run the car is only like $0.03 per mile which is close to free.  You can probably find 3 pennies on the sidewalk.
  8. My company has charging stations so the commute is well within range.  Actually it seems like more and more of these are popping up everywhere now.

Things that were a shock:
  1. Driving above 50MPH really starts to drop the available range.  The first time you notice this is kind of a kick in the tailfeathers.  All 3 of them.
  2. Extremely cold weather (like these lovely 2° F days from this balmy winter here in Pittsburgh) causes the battery to drain faster.  So, basically every day from November to April.
  3. The first time I really stretched out the range and had a frantic nailbiting trip home watching the range gauge the whole way.  Everybody asks, "What happens if you run out of battery?" and the answer is, "WE NEVER ASK THAT QUESTION"
seriously, never.

It's pretty good in the snow (I mean, as far as forward motion goes).  I have trouble getting up my driveway in lots of snow but I think everybody does.  It slides in sharp turns if the snow hasn't been cleared yet, but I've yet to slide around a curve or have trouble braking.

You get used to the fact that the practical range is only 70 miles or so.  At first it induces a lot of anxiety - if you're in a gas-powered car and you only have 30 miles left in the tank, you think, "OMG MUST GET GAS NOW" but you do get used to it.  It takes a bit of time to convince yourself that only having 30 miles left is OK if you only need 10.

I never installed the 220V charger.  The plain old 110V charges the car overnight.  There's only been one time I really wish I had one, though the wife's new car might change that.  She had a Volvo XC70 up until a few months ago and it was the same deal - she liked driving it but the 18MPG it was getting was not terribly attractive.  She decided to get a Ford C-Max.  It's only got a 21 mile battery but it should be better on gas one way or the other.  I'm interested to see how it compares.

So, EV isn't perfect yet - no charging stations on every corner and no 500 mile batteries - but it's getting better.

I'll still want to trade for one of these by summer.



watch my videos on youtube follow me on twitter view my pictures on instagram view my profile on linkedin view my google+ profile

Thursday, April 24, 2014

Learning to Program

I just created a new site called Coding4us as a way to teach people how to program.

I have a few other exercises I want to add to the site (including about 100 Java sessions) but right now there's a Tic-Tac-Toe program that can be written in about an hour.  If you've ever wanted to learn how to do some basic programming, or know somebody who would, take a look.


watch my videos on youtube follow me on twitter view my pictures on instagram view my profile on linkedin view my google+ profile