Saturday, March 30, 2013

MySQL Change Column Name and Alter Column

-- Changing a Column Name

alter table courierJobAcceptanceTable RENAME tblcourierjobacceptence;

-- Modifying a Column Type


To change column a from INTEGER to TINYINT NOT NULL (leaving the name the same), and to change column bfrom CHAR(10) to CHAR(20) as well as renaming it from b to c:
ALTER TABLE t2 MODIFY a TINYINT NOT NULL, CHANGE b c CHAR(20);

Changing a Custom Button's Corners from Square to Round

#import <CoreQuartz/CoreQuartz.h>

_myButton.layer.cornerRadius = 8;
_myButton.layer.borderWidth = 1;
_myButton.layer.borderColor = [UIColor grayColor].CGColor;
_myButton.clipsToBounds = YES;

Converting NSString to NSDate

-(NSDate*) convertStringToDate:(NSString*)stringToConvert
{
    
    
    
    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];

    NSDate *date = [[NSDate alloc] init];
    
    date = [dateFormat dateFromString:stringToConvert];
    
    NSLog(@"convertStringToDate: %@", date);
    
    return date;
     

}

Friday, March 29, 2013

Objective-C Printing Various Objects


NSLog(@"%@", songTitle);
NSLog(@"%@", songDuration);
NSLog(@"%f", [songDuration floatValue]);
NSLog(@"%d", [songDuration integerValue]);

Monday, March 11, 2013

The Unfortunate Unstoppable Trend

This blog entry is based on a reading of this article:  http://www.nytimes.com/2013/03/10/nyregion/john-sexton-is-tested-by-nyu-faculty.html?pagewanted=2

This administrator (read management) discounts the advise of his employees.  Though his employees are the most educated members of society it doesn't matter.  In a global society workers of any stripe far outnumber employers.  Therefore employers feel free to discount and discard workers.  If this is the case for the most educated members of our society then how true is it for everyone else.

There is no choice.  These days one must become an owner.  Everyone is a free agent and free agents eventually must build a product, an enterprise, or some independent means of providing for oneself or risk being discarded if their skills ever become obsolete.  The 'us' in our global society has been discarded.  There is simply a 'you' and 'I'.  Maybe an 'us' exists in marriage but even that institution is deteriorating.  

I can only see one choice.  Create.  Develop.  Build.  Sell.  Then you can be free.  

In my case perhaps with humility and God's blessing I can create something lasting.  The era of the benevolent king is upon us.  Elon, Bill, Steve.  These men can provide lifelong employment provided people perform but only those of us who constantly push for innovation, new products, improvements can truly provide stability for employees.  

Create and innovate or die.  Or hope that you find a benevolent king.  Other than that you're on your own.  

To my soul finding a benefactor, a patriarch, is just unacceptable to my soul.  Just unacceptable.  I can not simply attach myself as a vassal to another man unless the man is extremely worthy.  Otherwise I simply can not.  I will simply have to forge my own path.  I will build my own team, forge my own path, and if the day comes where I can pledge my allegiance to another then I will.  Otherwise I will have to reign alone.

Sunday, March 10, 2013

Work List #2

Goals:

Started: 2/11/2013

1.  Watch twenty video tutorials on Core Data Implementation.

Completed: 2/14/2013

2.  Implement login persistence functionality on Courier.

2b.  Build non-Restful Functionality if login persistence exists on Courier.

2c.  Build "Email Address Doesn't Exist", register functionality on Courier.
-- Build Core Data Entity Model
-- Implement CDEM with the login.


1.  IMPLEMENT MODIFIED SAVE: DELETE SAVE PROCEDURE AND ONLY PUSH NEW VIEW CONTROLLER IF THE SAVE ACTUALLY WORKED
2.  CHANGE TIME PICKER TO ONLY ALLOW FOR FOUR HOURS BETWEEN CLOCK OUTS TO BE DISPLAYED
3.  IMPLEMENT GOOGLE MAP VIEW CONTROLLER AND PUSH GOOGLE MAP VIEW CONTROLLER (Can't be done.  Can only be done for iOS 5.0 and higher).
4.  MODIFY AVAILABLE JOBS VIEW CONTROLLER TO GET DATA FROM CORE DATA FRAMEWORK
5.  MODIFY AVAILABLE JOBS VIEW CONTROLLER TO GO TO GOOGLE MAPS BEFORE CONFIRMATION (Can't be done.  Can only be done for iOS 5.0 and higher).
6.  BUILD OUT TEXT BASED CONFIRMATION SCREEN.

Completed: 3/30/2013

3/30/2013 Pre 1pm Goals:

a.  Build automatic push to FinalConfirmationScreenViewController if a job with a not completed designation exists from CourierViewController.
b.  Build FinalConfirmationViewController
-- get Job Confirmation Data to Show Up on the Screen (1)
-- get the Buttons to change to the right color
-- get the Completed Button to connect to the completed procedure
     -- build completed table
     -- build insert into PERL RESTful Script when the job is actually accepted.
     -- FIRST THING: MIGRATE jobsObject.pm and selectJob.pm to Server
Build a RESTful Service for testCommittedJob:
-- Build a service that returns the courierID.

Goals Today: 4/7/2012

Get AvailableJobsViewController Done
-- Fix the AJVC to alllow job acceptence after FCVC
Get FinalConfirmationViewController Done.

     -- Solve availableJobsViewController if structure issue. (1)
     -- When the completed button is hit on the courier side. (2)
          -- first, change the job in Core Data to completed = YES (2a)
          -- second, a PERL script should launch that changed courierConfirmedDelivered  field to 1 (2b)
          -- third, the PERL script should check if the customerConfirmedDelivered field is == 1. If so, launch the script below. (2c)
     -- build a PERL Restful script when the job is completed (customer and courier both say the job is complete) (3)
          -- mark the job as completed in the order table (3a)
          -- build courierPaymentTable (courierID|jobID|amount|customerConfirmed) (3b)
          -- insert record courierPaymentTable (3c)
          -- mark the job as paid (Boolean) == YES in the app (new field) (3d)

c.  Plan Account Information Objective-C work    

c.  Plan Account Information Controller

7.  CREATE PERL BASED ORDER NUMBER FOR CONFIRMATION SCREEN.  RESTFUL SERVICE AT ORDER ACCEPTANCE CONFIRMATION.
8.  Implement a job done button and functionality.  The courier can say the job is done.  A courier completed will be updated with respect to that job in the DB.
9.  If the customer completed field is updated and equal to true the courier is enabled to go to jobs view controller depending on what his/her login-clock-in-capabilities are. 

-- Build and Test non-Restful Functionality if login persistence exists on Courier
-- Build "Email Address Doesn't Exist" functionality with register screen.  See if it all ready exists and if it can be implemented with existing Restful service.

3.  Implement clock in persistence functionality on Courier.

4.  Implement Job Accepted Persistence functionality on Courier.

5.  Build courier-Job Accepted Bridge Table on Courier.

  • courierID
  • customerID
  • jobComplete (bit)
  • TimeChosen (dateTime)

6.  Implement upon App Starting and Data within the Persistent Storage Mechanism movement to a particular ViewController on Courier.


  • If you're logged in -> ClockInVC
  • If you're clocked in -> Select Job VC
  • If you've got a Job-> JobDetailsVC
10.  Design Account Information VC

April 25, 2013:

Note:  Object Name:  coreCourierDataConfirmationObject.pm

11.  Build Customer Login Restful Design (Investigate First)

12.  Build Saved Addresses Data Persistence (Use sqlLite or better Core Data)

13.  Change the AddressViewController "Sign In Customer" to "Sign In"

14.  Build Restful service for AddressViewController:
  • Verify that the address is actually an address using Google Maps URL
  • Build an object that has two addresses.  Pass it on to the next VC.
16.  Build a complete job object. using:
-- customerObject: customerEmailAddress, customerID
-- Two AddressObjects each consisting of: address, City, State, ZipCode, Latitude and Longitude.
-- item object: pickUpPointDesignation, itemDescription, itemWeight, timePickUp, timeDropOff
-- insuranceObject: acceptedInsurance, estimeatedValue, itemAge, insuranceAmount
-- Persist all using Core Data

17.  Build a RestfulService to save the Order Information.

18.  Send a text message when the order is accepted.
18b.  Send a text message when an order hasn't been accepted within 20 minutes.
18c.  Make the order object persistent.

19.  Based on persistent data build a ViewController that displays Orders.

20.  Tie up finishing touches.

This should finish my first iPhone App!!!!

Tuesday, March 5, 2013

A Rethink to the Same Conclusion

I'm reading The Art of the Deal by Donald Trump.  It's the first book he wrote before he was The Donald.  He was just a down-to-Earth guy who made good (with a lot of advantages).  I'm a bit envious of his upbringing but it is what it is.  Nonetheless, he says that he thought about going into show business but decides to go into real estate instead.

Whenever I get frustrated with my progress on a piece of software I think about doing other things.  But I go down the exact same road.

Show business: it seems precarious at best.  While fun where do you start?  And what's the pay off at the end?  And what's the odds of payoff versus total loss?  And what's the timeframe for success?  And what does success look like?  All of these questions tend to conjure negative responses but especially the odds of payoff.  I've got my suspicions that most celebrities are not very wealthy people but are scrapping by.

The Restaurant Business:  it seems less precarious than show business but the amount of capital is higher and the payout seems lower generally.  Also the timeframe for success also seems somewhat long.  Ten years plus.  Maybe shorter but at my age my most precious commodity is time. I don't have any time to waste and can't afford a foray over the river and through the woods.  I could wake up on the wrong side of forty and have nothing substantial to show for it.  Unacceptable.

Technology:  The barrier of entry is low monetarily.  I've all ready paid the cost for the most part in terms of time for Internet/mobile businesses.  Anything I need to know I can learn relatively quickly. I'm confident of that.  I'm all ready doing it.  And I can have stupendous success in a relatively short period of time (2-3 years).  It's a no-brainer to reach success this way.  

Plus, after I have success I can partner with people in both show business and the restaurant business if I so choose to and get paid that way.  It makes perfect sense.

Different thought pattern.  More refined. But same conclusion again and again.

Update: Who knows?  Maybe I'll make 150 million, write a book, get some profile, and then do the show business thing without having to actually take any of the risk, put up any of the capital, and can have all the benefits of fun and fame and all that stuff.  And still run my wildly successful businesses.  I'll even have the clout to bankroll a small restaurant.  Boom.