Random posts about trail running, computing, family-ing, thinking, and whatever else I choose to say.
Wednesday, January 31, 2007
Project Camelot Interviews Gordon Novel « Mysterious Universe
If you don't believe me, see for yourself (links above). I was actually interested in what he had to say for the first 10 minutes, then he got nervous and started fumbling his words together. It was painful watching him make stuff up on the fly. The interviewer was actually poking fun at him (or so I gathered). I didn't believe a word he had to say after about 15 minutes. There was clearly too much editing involved and it was obvious that he was tripping over his own stories. For example, he claims that he had never been to Area 51, and then later he claims he was there, but didn't see any underground bunkers, etc... Then he talks about the fact that we (Americans) have time travel, but can't release it and that there is a book on time travel out there that is "very accurate" in how it all works. He gives his opinions on everything controversial and made a complete ass out of himself as far as I'm concerned. He's a quack! Period.
Watching that video was a complete waste of time. I actually stopped it numerous times, but decided to finish it just so I could confirm this dude was full of crap. He is.
Watt-hour
I heard the term "gigawatt" tonight and decided to figure out exactly how many watts a gigawatt would calculate to in household terms. If I had a gigawatt saved and was able to preserve that energy for a period of time, how long would I be able to "live" on it (taking into account tv, lights, radio, computer, vacuum, etc...)? Sounds silly, I know, but amuse me... Before I can calculate this, I need to see how many watt hours I'm using today. What is a watt-hour?
Watt-hour - Wikipedia, the free encyclopedia:
Power companies produce energy - a good - which is often purchased by the customer in units of kilowatt-hours. Consider a setup with two 50W light bulbs (100W total) left on for 10 hours per day. The setup will consume 1kilowatt-hour per day. If a power company charges US$0.10 / kilowatt-hour, then those two light bulbs will cost US$0.70 over the course of a week. (See unit juggling for more information.)So a gigawatt would allow you to keep these two lights on for 10 hours a day for about 2,738 years. Or, in mathematical terms:
(1,000,000,000 watts /(100 watts * 10 hours))/365.25 days in a year = ~2,738 years
Realistically, I use more than 2 light bulbs. Let's assume that I pay about $120 for electric a month (which is kinda close). So in order to see how much time I could get from a gigawatt, I need to do more math...
$120 a month / 4.35 weeks = $27.60 a week
$27.60 a week / 7 days = $3.94 a day
$3.94 / $0.10 per kilowatt hour = 39.423 kilowatts a day
Now let's reverse the equation to find out how many years I can get on a gigawatt...
(1,000,000,000 watts / 39,423 watts a day) / 365.25 days in a year = 69.5 years
It would make sense to me that one day I might be able to purchase energy like this up front. Gigawatts, might be overkill, but who knows... We might have a higher demand for power in the years to come as well... We first need a device to store this energy. I would rather pay for power up front, than pay for it out the ass (play on words meaning after I use it). :) Allowing each home to store it's own energy would also solve the dreaded city-wide power outages (which just happened, last week).
Monday, January 29, 2007
Floppy Drive Wizardry
- Read the label on the floppy drive
- Create a new folder with that name
- Insert the floppy disk
- Refresh Total Commander
- Select all files from the floppy
- Copy the files to the newly created folder
- Wait until files are all copied...
- Rinse and Repeat
I decided that each year's set of disks was really a "Disk Set", and each "Disk Set" had multiple floppy disks associated with it (ie. W2 Program (Disk 1), W2 Program (Disk 2), etc...).
I got out my pencil and paper and drew up a mock version of what a UI might look like, then after about 10 minutes, I opened up VS2005 and started building the dialog. Once I got all the controls in place, I just started writing the code behind the various controls. The code behind the buttons is ridiculously easy, and the productivity of the whole "floppy disk project" was increased 10 fold. I just described the disk sets (ie. created the directories), and clicked 'import'. Once the app starts, it notifies me when I need to switch disks and I just switch disks and click enter. I created the app (start to finish) in about 2 hours; there were lots of small glitches to fix and various interruptions.
Here it is if you're interested in seeing it:
http://www.hardbarger.com/lucnjen/floppywizard.zip
It works like this:
- Define the 'temp' directory that all files will go
- Create a disk set (ie. 1998 Tax Programs, 1999 Tax Programs, etc..)
- Define the various disks in the disk set (ie. W2 Program, 1099 Program, etc..)
- Begin the import of the disk set
- Answer the prompts...
If you decide to download it, please let me know what you think. :)
Shimmy Shimmy!!
Programming Shims
- Learn all IDE shortcut key combinations
- Get a refactoring tool (ie. Resharper or Refactor! Pro)
- Write shims where possible (more later)
- Learn Regular Expressions!
- Find a scripting language you like and use it
- Find a good text editor (notepad++, editplus, etc...)
- Multiple Clipboards
- Macro Support
- Regular Expressions
- Customizable Shortcuts
- File Templates
- Allows Plug-Ins
- Learn to love and use macro's
- Etc...
He claimed that the little bit of work he did to figure out how to do this has really improved the overall productivity of the whole team. Developers just check-in their source files and their wiki's are updated automatically. Plus, the project leads and product managers were able to check the various wiki's with an accurate reading of what got done at the end of every day. They no longer had to wait til the end of the week and then rely on developers to remember to update their status pages.
I admit that I get caught up in writing shims a lot. I actually wrote one the other day in Excel. My mother-in-law is an accountant and every year, her and her secretary (who is actually her sister; my aunt-in-law if you will) have me print out daily schedule forms for them. I've tried to convince them to use Outlook or something similar to keep track of appointments, but they insist on the paper form...
Anyway, every year I have to create an Excel sheet that starts from the first week in the next year to the week of April 15th (unless April 15th falls on a weekend, in which case do that next week). Each page represents a single week and appointments run from 7am to 7pm in 1/2 hour increments on each page. I dread doing it every year because I always have to rebuild it or use last years file and modify / edit / format it accordingly. Last week I decided to just sit down and write a "shim" to do it instead. Here it is:
Sub CreateScheduleSheet()It works rather well and has already come in handy actually. I printed out the wrong year the first time, so I just came back home, ran the macro with the new year, and viola. It has some assumptions built into it, but it serves a single purpose and has already saved me a small chunk of time. Now I won't dread it when I remember I have to create a paper schedule next year during tax season.
Dim year As Integer
Dim eachDay As Date
Dim columnIndex As Integer
Dim rowIndex As Integer
Dim wereDone As Boolean
Dim thisCell As Object
' get the year
year = CInt(InputBox("What year do you need the sheets for?", _
"Year Entry", Format(Now(), "yyyy")))
' get the first date cell
' since the sheet has to start on a sunday, find
' the first sunday (on or before) the first of the year
eachDay = DateSerial(year, 1, 1)
Do Until Weekday(eachDay) = 1
eachDay = DateAdd("d", -1, eachDay)
Loop
' start at b2 and loop through all columns til we're done
wereDone = False
columnIndex = 2
rowIndex = 2
Do Until wereDone
' get the current cell and increment the column index
' if the date a saturday, skip a column
Set thisCell = Sheet1.Cells(rowIndex, columnIndex)
columnIndex = columnIndex + IIf(Weekday(eachDay) = 7, 2, 1)
' set the date and increment the date
thisCell.Value = Format$(eachDay, "m/d/yyyy")
eachDay = DateAdd("d", 1, eachDay)
' check to see if we're done yet (remember to end on a saturday)
If eachDay >= DateSerial(year, 4, 15) Then
If Weekday(eachDay) = 7 Then
wereDone = True
End If
End If
Loop
End Sub
Friday, January 26, 2007
The Top Ten Astronomy Images of 2006
I changed my desktop background to the image at the very bottom (the #1 astronomical image of 2006). It's amazing how small Earth is in the image. The post states that Cassini took the image and was one billion miles from us when it took the image... yeah... 1,000,000,000 miles away. Man!
Tuesday, January 23, 2007
I've been Flickred
Monday, January 22, 2007
Hardbarger Vacation 2007
Smooth Criminal
I was surfing the web and singing "Annie are you ok? Are you ok? Are you ok Annie?" over and over. I did it for a while, then realized I didn't have any music playing; I was sitting in complete silence. I decided to open iTunes and get zoned in. Low & behold, the very next song in my Party Shuffle was Smooth Criminal!!! BWHAT!!??
I'm flipping out! I haven't had my iTunes open since last Tuesday, so there is no way that I would have known (even subliminally) that this was next. Weird!
Five things you would never know about me unless I voluntarily told you
Here goes:
1.) I hung out with some pretty bad kids in my neighborhood growing up and I think I'm the only one of them that has never been to juvie. :)
2.) I have always thought my wife was out of my league. When we first started dating, I lost 60 lbs to try and get into her league. I guess it worked... she married me. The weight had nothing to do with it though, I've since gained most of it back and she still loves me. :)
3.) I saw a ghost when I was about 13 and it scared the shit out of me. I haven't seen one since, but the whole phenomenon fascinates me still to this day... What was that?...
4.) In high school people thought I was "popular", but I really wasn't. I was just nice to everybody (nerds, jocks, stoners, head bangers, preps, losers, everybody) and feel that this is why I got all of that attention my junior and senior years. I was elected onto the homecoming court, prom court, and given various superlative awards. I always felt out of place getting my name called with all the other "popular" kids at the big events. I thought it was cool that they were all nice to me. Maybe they didn't feel popular either??? Anyway, I will always feel like a chubby nerd on the inside. :)
5.) I was an extremely ugly baby and nobody liked me. My body was covered with rashes and I was completely bald for the first 2 years of my life. I didn't walk until after I was 2 because I was so overweight. People still call me Charlie Brown because of this "era" in my life. :) My mom says that she couldn't get anybody to babysit me either because I was such a mama's boy that I screamed uncontrollably if I didn't see her in my line of sight. MOMMY!!!??? :)
Friday, January 19, 2007
I'm Flickr Savvy Now
So here is the latest link dump for all of my online photo albums:
Hardbarger.com: http://www.hardbarger.com/photos
Picasa: http://picasaweb.google.com/lucas.hardbarger
Flickr: http://www.flickr.com/photos/20854535@N00
How in the world do the computer gods expect us to keep up with all of these competing sites?
CodeMash Agenda
Well, I'm here at CodeMash and I'm loving it. There are some really cool sessions. I went to one yesterday by Owen Taylor where he described Jini and the whole "grid computing" realm. It was very interesting and he had some cool demo that showed how it all works. Today I went to Scott Gutrhie's keynote on LINQ. I didn't realize how cool linq was until I saw him getting crazy with it. He described how we are all single thread programmers by nature and that this is a problem as we move more and more away from Moore's Law. In the future, we will be dealing with more and more multi-core machines.
Here is a problem area:
List<customer> customers = GetCustomers();
foreach(Customer cust in customers)
if(cust.Salary <= 40000)
DoSomething(cust);
With LINQ, all of the complexities are handled for us... No 'GetCustomers()' method to extract the values from a database or or XML file (or whetever). There is also no need to do the dreaded "for loop" with all the all the "if this, then that" crap. The complexities and tediousness is gone. Here is the new approach:
// syntax might be wrong, but...
var customers = from c in customers
where salary >= 40000 select c;
The beauty of this is that everything is handled "under the covers" for us. For example, if you have a quad core processor, each core will be able to contribute to the results of the query, not just a single thread. Pretty cool! There is more to it than this, but this is the one thing that stuck out for me. :)
See also: Generic Query Operators for .NET 2.0
Wednesday, January 10, 2007
Jazzy on Google Video
Lizzie filmed Jazzy being crazy one night on accident. She didn't realize that it was in 'camera' mode and the result was great... see for yourself. :) Jazzy is a clown by nature and this video says it all.
I figured this is a good first post of my video collection. I still have a slew of stuff I need to put on my pc from our camcorder. Maybe this post will motivate me. :)
Direct Link: http://video.google.com/videoplay?docid=7923672950936409171
First Real Snow of the Year
When the girls wake up tomorrow, they will be pretty excited. They got new snow boots that they haven't been able to wear yet. Looks like I'll have to go searching for those sleds in the attic tomorrow too.