Monday, January 27, 2014

Two Perspectives

I



The wooden floor creaked as Wolfgang stepped across the threshold into his dark apartment.  Tiny droplets of beaded water shook themselves from him as he climbed out of his overcoat, hung it on its peg and set his shoes on the mat by the door.  The small fringe of mud that had accumulated around the sole would be dry by morning.  There had been just enough of a rain to moisten the dust in the streets and leave a lingering smell of soggy dirt to permeate the outside air.  Inside smelled familiar, if a little stale. 

Stepping lightly in the silence of the dark, Wolfgang padded into the kitchen and lit a small oil lamp on the table.  Small sounds from the apartments above and below made their way through into the space; vague voices, footsteps, the sound of a chair being slid across the floor.  It was dark, but not so late that people would be sleeping.  For a long moment he stood mesmerized by the flame as it quivered gently and sent a dark wisp of smoke curling up into the world.  How perfectly straight the thin black line was, and so fragile.  The faintest whisper of his breath was enough to destroy it.  

At last he stirred, retrieved a bottle of wine from the cupboard, and looked around for his corkscrew.  He spied it on the small table in the living room next to last night's empty glass.  He uncorked the new bottle and held the glass up to the light while he poured.  In the living room Wolfgang set the full glass next to the empty one and lit a second lamp.  He sat down in front of his piano.  He rested his fingers on the keys.  

He closed his eyes and lowered his head for a moment and in the stillness an almost tangible silence wrapped itself around him.  No one in the adjacent apartments made a sound.  No breeze rattled the loose pane.  Even the building itself, which usually spent its time settling creakily as if perpetually trying to get more comfortable, was for the moment silent.  He began to play. 

Low and pensive, the first few notes floated from the piano and worked their way around the room.  Slowly they filled the space, growing bolder as he infused them with rich harmony, sculpted them with flourishes of whimsy, and sent them chasing one another joyfully through the air.  Soon they were an army and could not be contained.  They seeped through the walls and windows and into lantern-lit streets; a parade of sound and ecstasy, each chord a celebration of the last and a herald to the triumphant arrival of the next.   

Two apartments away a woman looked up from her book and nudged her husband awake.  "Hmm?" he said sleepily.  Then heard the music and sat up.  "He's playing again" she said.  The two sat together and listened intently as the music washed over them, until at last it slowly withdrew and settled back into itself.  As the last note took its bow and surrendered the stage once again to silence, the woman looked again to her husband.  He was smiling.  "What are you thinking about?" she asked.  "I don't know" he said.  "Everything".    

II


My house is quiet.  Everyone is asleep but me.  I descend to the basement and move silently through the almost absolute darkness to my office, where my eyes hungrily seek out the bits of light emanating from various electronic devices; the wireless modem, the router, the speakers.  It's enough to guide me to my big leather chair.  I sit and roll it forward a little until the keyboard and mouse are exactly the right distance.  The wheels settle into their familiar dents in the carpet.  At the touch of the mouse, my monitor transforms into a rectangle of light and reveals the room around me.

The glass top of my desk is littered with papers and the remnants or beginnings of countless projects.  Bits of wire, a pocket knife, chap stick.  A picture frame covered in puzzle pieces, and a picture of my daughter holding a sign that says "I love you to pieces".  She made it at daycare and gave it to me for father's day last year.  I love it, it makes me happy every time I see it.  My favorite acoustic guitar leans against the bookshelf to my right, and several other guitars rest on stands behind me waiting their turn, but tonight I don't think I'll play.  

I get back up and go grab a bottle of wine and take it back to my desk.  I bought it on the way home from work, it was six bucks.  My corkscrew is right in the little cubby there in my desk.  It has one of the arms broken off of it and I have to hold it a little oddly to get it to work.  I think briefly that I should get a new one, but I know I won't bother.  It works well enough.  I pour the entire contents of the bottle into the giant wooden mug that I bought at the renaissance fair this past fall and set it on the desk to my left to breathe.  I don't know why wine has to breathe.  I set the bottle down on the floor on my right, next to its twin.  

A little music perhaps.  I love music and it's a good thing too because it's everywhere.  It comes trickling out of my alarm clock in the morning, and in tinny refrains that echo from the little radio my wife listens to in the bathroom.  It plays in my car on my way to work, and from the Pandora app on my phone while I'm in the office.  It plays over the speakers in the grocery store while I'm getting whatever it is I'm supposed to stop and pick up that day on my way home.  It plays from my amplifier when I practice my guitar at full volume before anyone else gets home, and from the radio while I'm making dinner.  It accompanies every television show and every commercial.  It's in just about every corner of my world.  

A few clicks of my mouse and my media player is up.  What do I want to listen to tonight?  I don't know the answer to that, so I queue the entire library and put it on random.  Who knows what I'll get, it could be anything; I have quite a bit of music.  It starts playing a song but it's not one I want to listen to right now.  I've heard this one too many times lately.  Click.  Nah.  Click.  Heard it.  Click.  Heard it.  Click.  Wait what's this?  Yes, this is perfect.  I settle in, and peer at the title of the track as it scrolls across the little display.  It reads:  "Wolfgang Amadeus Mozart". 


--------------------------

The art:
I: http://debrahurd.blogspot.com/2012/07/abstract-piano-art-painting-keyboard.html
II: http://jenn-thinkingoutloud.blogspot.com/2013/04/pencil-art.html

Tuesday, January 14, 2014

Roman Numeral Calculator

I'm a noob programmer and wrote this for practice, it's kind of cool though if you happen to have a compiler and all that and want to check it out.  I haven't built in the part to convert the answer back to Roman Numerals yet, and there isn't a way to verify that what you input are legitimate Roman Numerals either, it just takes whatever you put in and tries to make sense of it, so if the input numbers are bogus the output will be too.  Makes sense. 

Here's what the output looks like:


Nothing flashy, but it's functional.  


#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
using namespace std;

char RomanNumeral[10];
float numberarray[10];
float number1, number2;
float ans;
float convert();
float temp = 0;
int again();

int main()
{
     cout << "Roman Numeral Calculator\n\n";
     cout << "_____________________________
__\n\n";
     cout << "Enter the first Roman Numeral:  ";
     convert();
     number1 = temp;
     cout <<"\nEnter +, -, *, or /: ";   //add, subtract...etc. 
     char action;
     cin >> action;
     cout << "\nEnter the second Roman Numeral: ";
     convert();
     number2 = temp;
     
    //Perform the selected action on the two numbers
     if(action == '+')
         ans = number1 + number2;
    else if(action == '-')
         ans = number1 - number2;
    else if(action == '*')
         ans = number1 * number2;
    else if(action == '/')
         ans = number1 / number2;
    else
         {cout<<"Error, please try again";
    main();}

cout<<dec<<"Answer: "<<ans<<endl;
again();
return 0;
} //end main

float convert()
{
    for(int y = 0; y < 10; ++y)  //reset the arrays
        {
            RomanNumeral[y] = 0;
            numberarray[y] = 0;
        }
    cin >> RomanNumeral;        //get user input

for(int y = 0; y <= 10; ++y)   //Populate the number array with decimal values, allowing for upper or lowercase roman numeral entries
    {
        if((RomanNumeral[y] == 'I') || (RomanNumeral[y] == 'i'))
            {numberarray[y] = 1;}
        else if((RomanNumeral[y] == 'V')||(RomanNumeral[y] == 'v'))
            {numberarray[y] = 5;}
        else if((RomanNumeral[y] == 'X')||(RomanNumeral[y] == 'x'))
            {numberarray[y] = 10;}
        else if((RomanNumeral[y] == 'L')||(RomanNumeral[y] == 'l'))
            {numberarray[y] = 50;}
        else if((RomanNumeral[y] == 'C')||(RomanNumeral[y] == 'c'))
            {numberarray[y] = 100;}
        else if((RomanNumeral[y] == 'D')||(RomanNumeral[y] == 'd'))
            {numberarray[y] = 500;}
        else if((RomanNumeral[y] == 'M')||(RomanNumeral[y] == 'm'))
            {numberarray[y] = 1000;}
    }

temp = numberarray[0]; //set the variable equal to the first value in the number array

for(int y = 1; y < 10; ++y)  //This is where the magic happens
    {
        if(numberarray[y] > numberarray[y-1])
            temp += (numberarray[y] - 2*numberarray[y-1]);  //the 2 multiplier is key.  without it the program adds the value back in and ruins the answer.
        else if(numberarray[y] < numberarray[y-1])
            temp += numberarray[y];
        else if(numberarray[y] == numberarray[y-1])
            temp += numberarray[y];
    }
cout<<"\nDecimal equivalent = "<<temp<<endl;

return(temp);  //Send decimal equivalent back to main
} //end convert

int again() //Run main again or bail out of the program
{
char selection;
cout<<endl<<"Another calculation? y/n ";
cin >>selection;
if((selection == 'y')||selection == 'Y')
    {
        for(int y = 0; y<10; ++y)
            {
                numberarray[y] = 0;      //reset numberarray to all zeros
                RomanNumeral[y] = 0; //reset letterarray
            }
        number1 = 0;
        number2 = 0;
        temp = 0;                            //everything is reset to zero for next round
        main();
    }
else
    {
        cout<<endl;
        cin.ignore();
        system("pause");
    }
return 0;
} // end again