You are currently browsing the daily archive for July 5, 2011.

Roberta and I ate lunch at a local place called Holly’s Lighthouse Cafe (I’d link to their home page, but it’s a overdone Flash site that I think could cause seizures, ya, that bad). Anyhow, while we were there having lunch we saw a neat old picture on the wall showing the building and street we were on from 1940.

We determined 1940 by using Google to research the movie playing at the movie house. It’s The Westerner with Gary Cooper. Released September 1940. The waitress was happy when we told her. She said people kept asking when the picture was taken and she had no idea. Now she does.

From 2011 Adventures

What I really love is the fact that the central sign says “The Pine Cone Cafe”. Growing up my grandfather used to take us to a Pine Cone in Lynwood Washington where they had the greasiest home made fries. I still remember sitting there as a child eating those fries with my Grandad. Driving there in the mid 70’s in a big old LTD style boat of a car. My grandfather using one foot for the gas and the other for the brakes. He’d go through brakes like you wouldn’t believe! I remember that, that and the smell of Cigars. Those are the memories I have of a Pine Cone Cafe.

Advertisements

I’ve run into a problem where one inventory set uses the Dell Service Tag (a 7 digit alphanumeric value) and a different one uses the Dell Express Service Code, a strictly numeric value. Now I need to marry the two inventories.

I’m screwed you think? Well, as it turns out, both numbers actually represent the same value. Only one is Base 10 (the Exp Service Code) and the other is Base 36 (the Service Tag). Which means, if I’m froggy enough, I can write a conversion tool that takes one and outputs the other.

Here is my first crude perl version of the code.  This Perl code will take a file full of Service Tags and spit out the Express Service Codes.

USAGE: ./dell_converter.pl mylist

mylist is just a file with a list of Service Tags. Be aware they have to currently be in upper case.

#!/usr/bin/perl

use strict;
use warnings;

#——————————————————————
# Written by Richard Hickey
# richard.a.hickey@saic.com
# 5 July 2011
#——————————————————————

#——————————————————————
# This program will take a Dell Service Tag and convert it
# into a Dell Express Service Code.
#
# The Service Tag is a Base 36 copy of a Base 10 Service Express Code
# So Server Exp Code 24692084176 base 10, is Service Tag ABC1234 base 36.
# numbers 0-9 are 0-9. Letters A-Z are 10-36.
#
# Service Tag ABC1234 converts to 22453156048
#     A = 36^6 * 10 = 2176782336 * 10 = 21767823360
#     B = 36^5 * 11 = 60466176 * 11 = 665127936
#     C = 36^4 * 12 = 1679616 * 12 = 20155392
#    1 = 36^3 * 1 = 46656 * 1 = 46656
#    2 = 36^2 * 2 = 1296 * 2 = 2592
#    3 = 36^1 * 3 = 36 * 3 = 108
#    4 = 36^0 * 4 = 1 * 4
#
#    21767823360 + 665127936 + 20155392 + 46656 + 2592 + 108 + 4 = 22453156048
#
# So the Service Express Code for ABC1234 is 22453156048
#
# usage dell_converter.pl myfile <enter>
# myfile is a file with a listing of Service Tag Numbers
#——————————————————————

#——————————————————————
# Read in the file
#——————————————————————
while(<>){
chomp;

#——————————————————————
# Variable initialization
#——————————————————————
my $ServiceTag;my @ServiceTag; # just initializing the arrays
my %value; @value{“0″..”9″,”A”..”Z”} = (0..35); #set each character to it’s value
my $base;my @base = (2176782336,60466176,1679616,46656,1296,36,1); #set each location to a 36base value

#——————————————————————
# Main body of the converter will  make sure the first line matches
# what we expect a service tag to look like and do the conversion
#——————————————————————

if(/^[0-9A-Z]{1,7}$/){           # Make sure the line looks like what we expect for a Service Tag
@ServiceTag = split //;      # split the line into component characters

my $ExpressServiceTag = 0;         # set the Express Service Tag value to zero for each iteration
for (my $i=6; $i>=0;$i–){         # count backwards through the arrays  BEWARE the minus minus, or – –  on the $i– looks like a single – not sure why
$ExpressServiceTag = $ExpressServiceTag + $value{$ServiceTag[$i]} * $base[$i];
}

print “$_ $ExpressServiceTag \n”; # $_ still references the Service Tag that was read in.

}
}

Blog Stats

  • 60,686 hits
July 2011
S M T W T F S
« Jun   Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  
Advertisements