Shifted Bits Blog
Rotating bits, one shift at a time.
Rotating bits, one shift at a time.
Sep 12th
Originally it was perceived as such: She agree’d to let his likeness appear in the game, so what’s wrong? Is she REALLY that drugged up?
Jul 10th
So, about a week ago today, I got back from a trip up to the great white northern non-us state of Canada. I visited Elsie (innervoices), her family, and a mutual friend of ours who isn’t on this site. As some of you may have seen on my facebook account, I mentioned something about missing them already when I got home. This is for a very simple, and unequivocal meaning: THAT TRIP WAS AWESOME.
Jun 21st
So a few updates since last March, for sure.
First things first, (read: Gaming Related) I got me some Guitar Hero: Metallica. It’s a fun game if I need to waste some time and listen to some music and NOT be bored out of my skull. Gogo a waste of $100! Well, not really a waste, but you get my idea. I still play it every once in a while.
Apr 21st
I decided my first version wasn’t exactly flexible, so I rewrote it to parse out strings of dice rolls and then roll them.
/* * dice.c * * Created on: Apr 21, 2009 * Author: Mike Sherwood (coolhand2@gmail.com) * Modified on: Nov 18, 2009 * Author: Mike Sherwood (coolhand2@gmail.com) * Changes: Changed the if-series in modifySum * to be a select statement instead. */ #include <stdio .h> #include <time .h> #include <stdlib .h> int rollDice( int, int ); void modifySum( char, int, int* ); int main( int argc, char* argv[] ) { char* diceString = argv[1]; int amount, sides, modifier, sum; char mod; amount = sides = modifier = sum = 0; mod = '\0'; sscanf( diceString, "%dd%d%c%d", &amount, &sides, &mod, &modifier ); sum = rollDice( amount, sides ); printf( "Sum: %d\n", sum ); modifySum( mod, modifier, &sum ); printf( "Total: %d\n", sum ); return 0; } int rollDice( int amount, int sides ) { srand( time(NULL)/2 ); int i, value, sum; for( i = value = sum =0; i < amount; i++ ) { value = ( rand() % sides ) + 1; printf( "Dice %d: %d\n", i + 1, value ); sum += value; } return sum; } void modifySum( char mod, int modifier, int* sum ) { switch( mod ) { case '\0': printf( "No Modification\n" ); break; case '+': printf( "Add %d\n", modifier ); *sum += modifier; break; case '-': printf( "Subtract %d\n", modifier ); *sum -= modifier; break; case '*': case 'x': case 'X': printf( "Multiply %d\n", modifier ); *sum *= modifier; break; case '/': printf( "Divide %d\n", modifier ); *sum /= modifier; break; } return; }
Apr 20th
A bit of C code I russelled up to roll a specific die based off the arguments passed to it through the command line. It’s basically just a random number generator with addition properties.
/* * dice.c * * Created on: Apr 20, 2009 * Author: Mike Sherwood <coolhand2 @gmail.com> */ #include <stdio .h> #include <stdlib .h> #include <time .h> int main( int argc, char* argv[] ) { int number, sides, i, val, sum; number = atoi( argv[1] ); sides = atoi( argv[2] ); val = sum = 0; srand( time( NULL )/2 ); printf( "Rolling: %dd%d\n", number, sides ); for( i = 0; i < number; i++ ) { val = (rand() % sides) + 1; printf( "Dice %d: %d\n", i+1, val); sum += val; } printf( "Sum: %d\n", sum ); return 0; }
Mar 30th
My legs, are not as good as they used to be I have found. I only rode 3.3 miles today, and my legs were (and still are) dead. Granted I’m used to riding upwards of 8 every other day (and plan to go higher than that), but haven’t ridden that since last summer (because I went back to college and that kinda killed my bike riding).
Mar 15th
1.) Apparently I have a girlfriend now. Not an official one, yet, but she does call me every night before she goes to bed to wish me good night, and we end up talking for a good two hours (basically until one of us falls asleep.) Now Doc (Droakir, for those who don’t know), say nothing about this (as I have yet to confirm it) and I won’t have to kill you
Feb 26th
So, not much has really happened as of late, but a few things of significance. First, and most importantly, I haz a new phone! It’s the Samsung Alias. I switch to it from an enV, and I must say, it’s kinda cool having a flip phone and a whole holster for it and stuff. Though I miss the mass-text abilities from the enV. The Alias has smaller keys on it’s querty, so it’s kinda harder to type, that and the num-lock makes it weird to insert symbols and crap, but otherwise it’s a good phone. Nice quick and light.
Feb 9th
Man, it’s been a long time since I’ve been down there. I remember the first time I was there was with my family back in like, 95 or 96 or something. Everything was so fricken’ WHITE. We ran around, looked at things, had some fun. By the time we got back to the car sand was everywhere. Now, do realize that White Sands National park has a law that says “Do not take any of the sand home with you.” This law, is VERY hard to abide by.
Jan 28th
The Question:
How big would a database be (as in, how much hard drive space would it take up) if it were to store any and all combinations of passwords that included uppercase, and lowercase letters, and numbers, up to 8 characters long. This does not include special characters. I’m working strictly off the ascii table. Specifically Decimal values 48-57 inclusive, 65-90 inclusive, and 97-122 inclusive.