Tuesday, February 28, 2006

My first Ruby

Well, I have been playing with Ruby for a few days now. I finally found something at work that I could legitimately use it for, so I had to give it a shot. To demonstrate its power, here is the code for a web server. Now, I don't have to install one each time someone wants to download a file from me since GAIM's file transfer mode seems to be broken. Anyways, try and you will like...GUARANTEED!

require 'webrick'
include WEBrick

if ARGV.length == 1
s = HTTPServer.new(:Port => ARGV[0], :DocumentRoot => Dir::pwd)
trap ("INT", proc{s.shutdown})
s.start
else
puts "Usage: ruby webserver.rb port"
end

For some reason, alot of the sources I found online didnt mention calling the proc function with the shutdown block. Without this, I was getting a segfault in the Ruby shipped with Ubuntu 5.10. Go figure. Maybe some day I'll be knowledgable enough to track down whats going on?

Saturday, February 25, 2006

Typical Saturday

It's kind of sad when you have to cheer against athletes from your own country because they make total asses of themselves. Sometimes I'm not so proud to be an american.

In other news, we finally had our whole team together today...at least most of it. Too bad I didn't play very well. Gonna have to practice a little harder.

Wednesday, February 22, 2006

against the law

Here is your fun fact of the day...apparently this guy named Frank Benford noticed one day that the number 1 appears much more often than you might expect as the first digit in any numbers you are likely to encounter in daily life. Given some random numbers, you might think 1 out of every 10 would have the number 1 as the first digit...not so says Mr. Benford. In fact, if you look at things like census data, news papers, and even the Dow Jones daily average, the number 1 appears about 30% of the time as the first digit. A formal mathematical version of Benford's findings exists in the form of Benford's law, and is often used in statistical analysis to find cheaters and such. So, the next time you plan on cheating on your taxes, which is probably quite soon I would imagine, make sure you familiarize yourself with Dr. Benford or you might have the IRS kicking your ass.

Tuesday, February 21, 2006

absentia

Ugh...

Spent the last two and a half days of work moving stuff from one floor to another in my building at work. What does this involve you ask? Well, since these are special areas, the movers arent allowed to help us move much of anything other than furniture. This means I have to disconnect all of the computers (about 40), move them, and set them up in the new labs. Ok...not too difficult. The fun starts when you realize that the new labs are half the size of the old labs. After rearranging the furniture layout, compressing everything, and smashing my fingers a few times, everything is pretty much in order. Now, I just have to wait for stuff out of my control to happen so we can actually get some network access. Funny how dependent I am on the internet these days. Time to pray for another lab-wide power outage to give me a little R&R...

Sunday, February 12, 2006

Snow RoX



Well, seems I have been negligent in my weather geekiness. Unforgivably so. After, or some might say in the midst of one of the worst winters in recent memory, we get a surprise snow storm that dumps more snow in my back yard than anywhere else on the east coast...with the exception of central park in NYC. How much snow do you ask? 21" measured by me personally and a whole bunch of other people around the Columbia area.

Not only was the snow abundant, but it came down incredibly quickly. The storm lasted approximately 12 hours, meaning we averaged almost 2" per hour during that time. At approximately 2 a.m. I was driving home during the height of the storm (dont ask me why) and I saw numerous flashes of lightning. My first experience with a true thundersnow storm was memorable indeed. Can't wait for number two...could it be next year?

Thursday, February 09, 2006

give and you shall receive

Learned something interesting today. If you start off a phonecall with a question to engage your audience, you are twice as likely to make a sale. If you give someone something, they are twice as likely to reciprocate when you ask for something in return. If I can somehow combine these two techniques, I will quadrouple my chance of convincing people to do things they wouldnt normally do. Now I just need to go read The Art of Deception...and figure out what I want to get...:P

Wednesday, February 08, 2006

insecurity

OK...so I am attending this conference at work on computer security...and of course parts of it are supposed to be secure. Basically, I hand over my drivers license, they look up my name on a piece of paper, and give me a little badge to wear.

So lets see...whats on this badge...a little printout of my name and company. On top of that, they put a little circle shaped sticker that is the color of the day. This sticker is supposed to signify that I have special clearance to attend the sessions.

Lets pretend I am not really Rodney, but instead Odney from some evil place and that I want to attend this gathering. I can walk in, look at somebody's badge, pretend I forgot something like my license in my car, go to Walmart, buy $2 worth of supplies, and have a badge ready to go in 5 minutes.

What is the point of all of this security if the people responsible for making things secure cant even run a conference right?

Tuesday, February 07, 2006

oh the pain

No posts in a whole week...whats the world coming to? Well in the past week, my football team lost (boo pittsburgh), my vball teams lost in a devastating fashion, and I am STILL sore from football practice on Saturday. Did I mention that football practice was fun, even though it was cloudy, rainy, and only half the team shoed up? Did I permanetnly damage myself? I dont know but I have to play volleyball tonight on legs that can barely stand up so wish me luck. Aside from that, things are good here :)