Since this year's 2009 Scripting Games are open ended and not scored, I thought I'd post my entry for each even as I write it.
For Event 1:
Read a file, and find the shortest line containing text. To me, this did not mean blank lines, or lines with only a space " ". I wanted only lines containing A..Z or numbers.
$s="a"*255;Get-Content "c:\scripts\Personal Information Cards_ADV1.txt" | %{if(($_ -match "\w") -and ($_.length -lt $s.length)) {$s = $_}};Write-Host $s
$s="a"*255; this sets my variable to a known long answer. The variable $s will contain 255 a's.
Get-Content "c:\scripts\Personal Information Cards_ADV1.txt" Read the contents of the text file into the buffer.
%{if(($_ -match "\w") -and ($_.length -lt $s.length)) {$s = $_}} Using the buffer, parse through each line "%", and look for "\w matches any word character, meaning letters and numbers.".
Write-Host $s - when the loop is completed, write-the contents of the $s variable to the screen.
The final answer, using the text document provided, I get a, probably first, 4 letter word in the document.
Monday, June 8, 2009
Tuesday, May 26, 2009
Memorial Weekend Sunday
About two hours of my day had been lost, after an unfortunate collision with this sign. Going home from the hardware store, I lost control of a trailer load of bricks and took out this "One Way" sign.
View Larger Map
View Larger Map
Monday, April 13, 2009
Top Reasons I <3 My Current MP3 player.
I've been using MP3 players for years. Long before the iPod became popular, I had my Rio player in the car. Over the years, I have come accustomed to listening to audio-books while driving into work. My latest device is my favorite so far.Yes, my latest MP3 player is the one built into my Sony-Ericcson z550a cell phone. My wife has an iPhone and, personally, I like this better. Mainly because it's not an Apple product, but also for many ease-of-use features.
Top 10 Reasons I love this MP3 player (in no particular order)
- It's always charged - When I used the Sansa or RIO players, I had to carry a separate charger or lots of rechargeable batteries. Now that the MP3 player is also my cell phone, I have only 1 charger in my car. Best of all the charger was only about $5 for the "OEM Charger".
- I can delete files - While listening to audio-books, I VERY seldom want to listen to a file twice. With this, after I have finished with a story/chapter, I can delete it.
- Removable media - This means infinite space for music, podcasts and audio-books. For about $10, I purchased an internal 4GB memory chip for this device. This is enough space to put several chapters on it, plus a good portion of music, for when the stories run out. (Seeing that it came with 2 USB connectors, I can load it at work or at home.) If that ever fills up, I can buy 3 more.
- Flip top - Personally, I despise touch-screen devices. Put them in your pocket, you hit a button and lose your place, screen gets scratched so much easier, and you always have to lock. Flip saves that and I won't break the screen.
- Pausing - When my MP3 and phone were separate devices, I'd always have to pause the story before answering the phone (or chance missing something in the story). Now that they are integrated, the music stops and restarts automatically when I am on the phone.
- Internal speaker - The other day, I was out with the family when they all decided to run in to a store (potty break I believe). I was determined not to follow, so I sat on the bench outside, fired up the current book and listened to it through the mono speaker. Great solution when without a car adapter or headphones.
- Metal case - This case is slick. Yes, nice looking, but also slippery. Grabbing it out of my pocket, I've dropped it a few times. Best of all, it's lasted. The edges are scuffed, but the screen is not cracked.
- Excellent battery life - I've gone 4 days between charging with my normal usage.
- Functional interface - the interface is designed to work with only one finger, the buttons respond as expected, no needing a stylus or two hands to operate it. My Sansa and an older Motorola MP3 player had buttons that were stiff, making it very easy to skip a file instead of fast forward. One Rio had a peg to control scrolling between selections, which required delicate, little fingers. At 6' tall, I don't have delicate, little fingers.
- Price - Personally I hate spending (lots of) money on tech. More than once, I've bought a new shiny gadget, only to have it drop in price, or get completely discontinued within 6 months. I like these consumable purchases, to stay disposable. If I lose the phone, I am inconvenienced, but not bankrupt. I (hesitantly) bought this phone off eBay for less than $100.
At this point, I don't see much a reason to get a new phone. I have quite a few things that I really like about this phone and they are still selling the accessories to keep it running. On the other hand, there are a few reasons I may upgrade.
- Bookmarking - This is the idea that I can set a bookmark in a file, then come back to it at any time. The Rio devices had this (and the Motorola but it used the Rio OS) functionality, but I haven't seen it again. This is great for switching between music when driving with the family, and audio-books when driving solo.
- Better web browser - I'd love to be able to search the Internet and download files. An integrated podcatcher (hey, the iTunes store can be this, if only they met my other wishes)
- Wifi/802.11 integration - If I could connect up to my wireless Internet at home, save downloading those files (over the better browser) using my wireless Internet.
- Improved large file handling - Currently my MP3 player does not handle files over 1hr very well. It is easy to lose the current place in the file.
- Standardized connectors - The headphone jack is a customized connection that integrates into the power adapter. Nice when using the OEM charger and this adapter, but if it breaks..
Subscribe to:
Posts (Atom)
