Thursday, January 24, 2013

Shawshank Success

I knew I would be successful when three things happened.

First, when I woke up one Monday morning angry.  I was angry because I had to go to work.  But I enjoy working actually.  It makes me a bearable human being, being able to put my energy into something constructive and structured.  Rather what made me angry was the fact that if I didn't go to work someone would deprive me of my lifestyle.  Namely that my time wasn't my own, therefore my life wasn't my own, therefore I was a slave.  I used to say I wanted to be rich but I wasn't sure what that would buy me or what I wanted to buy.  I got very clear that afternoon at work.  I wanted to be rich because I wanted to buy my freedom.

Second, this actually happened today.  I imagine when Andy Dufresne started digging his way through the wall until probably about 1/3 of the way through he was frustrated, angry, depressed, upset, tired, hungry, bored, scared, and doubtful.  I imagine that sometimes he'd quit.  Sometimes he'd give up.  Sometimes his mind would wonder and he'd only put some effort into it.  But then there had to come a point when it just became a habit.  His being, his soul even, just became a tool.  He just began to dig.  He began to dig because digging just became his habit. It didn't bother him.  It didn't scare him.  He still became hungry.  But he was accustomed to it.  All of the emotion became routine and therefore managable and his being, not his mind, but his being began to just focus on the task.  This happened today.  Normally I go through a range of emotions depending on the day about working at my keyboard on my system.  Sometimes I feel like it.  Sometimes I don't.  Sometimes I'm frustrated.  Sometimes I'm eager.  Sometimes I'm driven.  Sometimes I'm bored.  But today it wasn't any of those feelings.  It was habit. My hand, without me really guiding it, simply went into my laptop bag, pulled out my laptop, turned it on, and began programming.  There was no thought, no emotion, nothing.  Just work.  My soul, my will, my hands, my being just became a tool.

Finally, I understood why I had to do what I had to do.  I always knew why I had to do what I had to do: why programming, building systems was the best route for me to get where I needed to go.  I knew that because I knew that building a system and making money off of it, having a global shop, that I was able technically to expand, and could be sold as a business thereby buying my freedom was the logical progression.  But there is a difference between knowing and understanding.  In the movie Shawshank Redemption, I'm sure Andy Dufresne thought when he was frustrated what other options did he have.  Everyone does when they're doing what they don't feel like doing but know they must.  How can I get out of this?  How can I move on without going through this?  Andy must've weighed his options.  One, work for the Warden  and accept this dirty crumb for a life.  Two, don't work for the Warden and become a lesser man thereby losing his soul (and what's a life worth without a soul?)  Finally, dig.  When you understand your only choice in life is to dig everything becomes crystal clear.  You dig.  And you dig with single minded determination because you understand there is nothing else but a single line of escape.  My choices were simple:  work for someone else forever and accept that crumb of a life, two, try to trade stocks or do some other venture and scrape by, never really getting to where I want to be and putting myself through a lot of emotional wear and tear until I was eventually exhausted of trying, losing my ambition to waste.  Or three, dig.  Program.  Work.  Build.  I chose the third.  

But I never really had a choice.

What I learned from Jon Stewart

Jon Stewart on Game Changers taught me to deflect high praise.  It suits me.  I don't really feel comfortable with high praise and Jon Stewart does it and I should do it too.  Just deflect it.  Be generous giving it out but deflect it when it comes.

Saturday, January 19, 2013

Great Bible Chapter

Great Bible Chapter

1 John 4

Proverbs 17:27: The one who has knowledge uses words with restraint,
    and whoever has understanding is even-tempered.

Proverbs 17:14: Starting a quarrel is like breaching a dam;
    so drop the matter before a dispute breaks out.



Romans 13:13: Let us behave decently, as in the daytime, not in carousing and drunkenness, not in sexual immorality and debauchery, not in dissension and jealousy. 

Psalms 73


21 When my heart was grieved
    and my spirit embittered,
22 I was senseless and ignorant;
    I was a brute beast before you.
23 Yet I am always with you;
    you hold me by my right hand.
24 You guide me with your counsel,
    and afterward you will take me into glory.
25 Whom have I in heaven but you?
    And earth has nothing I desire besides you.
26 My flesh and my heart may fail,
    but God is the strength of my heart
    and my portion forever.
27 Those who are far from you will perish;
    you destroy all who are unfaithful to you.
28 But as for me, it is good to be near God.
    I have made the Sovereign Lord my refuge;
    I will tell of all your deeds.



Friday, January 11, 2013

Force Installing with CPAN


CPAN is a powerful archive of Perl modules tools. It contains many modules to do just about anything one would want to do in Perl. In order to initiate a CPAN session via the perl comand line you can use the following command:
perl -MCPAN -e shell
Which will allow you to use CPAN in shell mode. Once you configure some settings you will be taken to a prompt. To install a module you can use
cpan> install LWP::Simple
The following will install the LWP::Simple package.
On occasion you may encounter errors in compiling the module. Some could be minor, some major. If you wish to force the installation anyhow you can use the force option
cpan> force install LWP::Simple

Thursday, January 10, 2013

Opening Files in Perl (Different File Types)

Windows

open(MYFILE, "C:\\Windows\\users\\pierce\\novel.txt") || die; # Right, but messy.

VMS

open(MYFILE, "DISK5:[USER.PIERCE.NOVEL]") || die; # VMS

Mac

open(MYFILE, "Drive:folder:file") || die; # Macintosh

UNIX

open(MYFILE, "/usr/pierce/novel") || die; # Unix.

Monday, January 7, 2013

Work Plan


Finding Latitude-Longitude: iTouch Maps

Reverse Geocoding: Reverse Geocoding Website

File Locations for Google Geocoding Module:

File Set 1:  
Path:  C:\Perl\html\site\lib\Geo\Coder\
-- Google.html
-- \Google\V2.html
-- \Google\V3.html

File Set 2:
Path: C:\Perl\site\lib\Geo\Coder\
-- Google.pm
-- \Google\V2.pm
-- \Google\V3.pm


http://www.go-for-me.com/test/AuthenticatePassword.pl?user=curtis.sumpter@gmail.com&pw=Pauline77&role=courier

Notes:

a.  Creating Random Numbers in Perl.  Coordinates for Upper East Side:
-- Lat and Lng
-- Right Top Corner:  40.783224, -73.944726
-- Left Top Corner: 40.787871, -73.955691
-- Bottom Right Corner: 40.760165, -73.961506
-- Bottom Left Corner:  40.764228, -73.973093

Coordinates for Upper West Side:
-- Lat and Lng
-- Right Top Corner: 40.791672, -73.974981
-- Left Top Corner: 40.796058, -73.974981
-- Bottom Right Corner: 40.768437, -73.981569
-- Bottom Left Corner: 40.772792, -73.993478

Midtown:
-- Top Left Corner: 40.771608,-73.990431
-- Bottom Right Corner: 40.748886,-73.970003
-- Top Right Corner:40.759744,-73.962064
-- Bottom Left:  40.760817,-73.998327 


Major Bounds:
-- Top Right: 40.783224, -73.944726
-- Top Left: 40.796058, -73.974981
-- Bottom Right: 40.748886,-73.970003
-- Bottom Left: 40.760817,-73.998327


Creating Bounded Random Numbers in Perl: http://perlmeme.org/howtos/perlfunc/rand_function.html

1.  Create Orders
 (tblOrderInformation)


-- I need customer ID (customerID) and customer Payment ID

(customerPaymentID) -- just grab one customer Payment ID from 
tblcustomerpayment

-- proposed drop off time (customerProposedDropOffTime)

-- proposed pick up time (customerProposedPickUpTime)
-- item description (itemDescription - Test File Items)
-- pick up special information (pickUpSpecialInformation)
-- possessor name (possessorName - Test File Names)
-- proposed payment amount (proposedPaymentAmount)
-- time order input into db (timeOrderInputIntoDB)
-- time order placed (timeOrderPlaced)

Goals: 1/17/2013

2.  Create Origin Address (tblOriginAddress) PERL Object

-- get the latest orderID by getting the 

latest time order placed into db from tblOrderInformation
-- Create random latitude and longitude.
-- Reverse geocode latitude and longitude to specific streets
-- Insert that originAddress1, originAddress2, originZipCode,
savedAddressIndicator = False, savedAddressName = ''
-- chill.

Completed: 1/17/2013 @ 1:08 am.

3.  Create Destination Address (tblDestinationAddress) PERL Object

-- use order ID

-- Create random latitude and longitude.
-- Reverse geocode latitude and longitude to specific streets
-- Insert that destinationAddress1, destinationAddress2, 
destinationZipCode, savedAddressIndicator = False, savedAddressName = ''
-- chill.

Completed: 1/18/2013 @ 12:57 am.

Tomorrow: 
Add an error catching algo in the code where if there is no zip code empty it and start over.
Build complete inserting job algorithm.  

Change the object to take the argument from a query string
Build out random getProposedPaymentAmount (Range 5 - 25)
Build out random getItemSize (lightweight, mediumweight, heavyweight)

Add the necessary columns to the DB

Add the necessary columns to the Production DB

Completed: 1/22/2013 @ 10:08 pm.

Migrate all the necessary scripts to GFM Server

Completed: 1/24/2013 @ 9:55 pm.

4.  Plan jobs upload algorithm
-- Plan:
-- Match the two arrays (destination and origin)
-- Find out which locations are closest to the user's location and take those 10 jobs.  
-- Find out which are the best paying and take those 5 jobs.  
-- Increment the job sent for all five of these order ids by +1.
-- Build JSON Object for those five jobs.
-- Send the JSON back to the screen.

Completed: 2/12/2013 @ 11:15 am.

-- Test in browser

Completed: 2/14/2013 @ 10:00 pm.

Test Information:
cid=25
wl=lightWeight
lat=40.780034
lng=-73.949098

http://www.go-for-me.com/test/testJobsObject.pl?cid=25&wl=lightWeight&lat=40.780034&long=-73.949098




5. Build Custom UITableView
-- Jobs:  Tomorrow: 2/26/2013: Step 1:  Get the data output working correctly.
-- Thursday: 2/27/2013: Step 2:  Get the display to work correctly.

http://stackoverflow.com/questions/13548764/nsmutablearray-not-showing-in-uitableview
http://stackoverflow.com/questions/14317098/nsmutablearray-properties-to-populate-uitableview
http://stackoverflow.com/questions/5977033/uitableview-with-nsmutablearray

-- Load JSON object into UITableView
-- On UITableView Load the orders.
-- On touch a map of the pickup point and the drop off point. 
-- On the bottom of the screen confirm or deny 
-- Build an automatic three minute countdown.
-- Build a auto refresh function at the three minute countdown's end.

http://www.go-for-me.com/test/testSelectJob.pl?cid=25&jid=139
-- Test URL

-- Build jobSelected.pm function. (Tomorrow)
     -- Mark that job as taken.
     -- Mark that courier as taken.

-- Build config file to remove passwords and server names from PERL files.

Question Marks:

1.  Address the weight issue.

2.  Address the job lock questions.

3.  Give a two-minute countdown for jobs.  Send out jobs for
five people at most.  Then when you refresh get new jobs.
--  Build a time ticker that counts down in the iPhone App
before jobs refresh.
--  Build automatically unlock all jobs and refresh

Update:  Work List Complete!  3/9/2012

Screen Sliding Functionality:

http://stackoverflow.com/questions/4741880/slide-a-div-offscreen-using-jquery

-- Crazy Cool.

Wednesday, January 2, 2013

Man oh Man: Tired and the Most Important Year

Today I learned how to use GIMP (thanks YouTube) and built three buttons for stuff.  It was great.  Really great but I am tired.

This year is so important. 

2013 Goals:

1.  Be enrolled in a Masters of Statistics program.

2.  Have 50,000 USD in the bank.

3.  Have three web businesses up and running and making a profit.

All so important.  Huge.

Man I'm tired.  But I'm also gratified.

It's funny.  Whenever I write an idea down and post it on my wall they happen.  I posted what I wanted to get done yesterday and today it's done.  It's really great that I got that stuff done.  But I have to be careful.  Who knows what tomorrow may bring.  But it is in God's hands.

Look at the birds of the air: they neither sow nor reap nor gather into barns, and yet your heavenly Father feeds them. Are you not of more value than they? -- Matthew 6:26

Tired.   Good night.