Entries from May 2005 ↓

Front Page Baby!

Well, I made it on the front page of my local newspaper today and no I wasn’t drunk or caught doing anything stupid.

Front Page
Picture provided by The Courier.

As you can barely tell, I am circled in red. This was at the Relay for Life walk-a-thon whose purpose was to raise money to find a cure for cancer. Since I know quite a few people who have either had or currently have cancer I have been support Relay for Life for the past two years. It is a good cause and the walk-a-thon is a lot of fun. It gives those who have cancer a chance to relax and enjoy life with their supporters.

I stayed the entire 18 hours event, walking from 3:00 AM to 5:00 AM and making sure there was entertainment between the wee hours in the early morning on the 21st. Playing karoke and various music, I made sure those walking around the track at that time were awake and had motivation for continuing their walk during the cold temperature as sleep deprivation set in.

I strongly suggest that anyone who has a chance to participate in Relay for Life do so. You will never forget those weekends.

By the way, the picture in the Newspaper was much larger and had a better picture of me that was easily noticeable. I will try and get that scanned in at some point so I can post it and give you a clearer image.

A Lot Happened Today

Today started successful as I sent out over 20 resumes between the hours of 2:00 AM and 6:00 AM through Yahoo HotJobs. After sending out the resumes, I hit the pillow and got some much needed sleep. At 2:00 PM, I woke up and found several emails regarding my resumes. One simply stated that there was an exact same position located closer to where I live and that I should also apply there, the others were primarily confirmations of receiving my resume.

At 3:15 PM I got a phone call from Kami’s brother asking me to take him to Kenton to pick up his car. So I quickly showered and got around and then took him to Kenton. Kenton is about a 45 minute drive. We made it in 30 minutes and then made it back to Findlay in 25 (for those of you wondering, of course we weren’t speeding! :-P). Anyways, we had plenty of time to talk and catch up on things, I really find him as a brother to me and he sees me the same way, so we talked about a variety of topics and just overall had a good time.

Kami at this time told me she rescheduled her car painting for the second week of June after talking with her Dad, as she got the feeling he wasn’t going to repay her unless it was for her car. This of course ticked me off! It is unfair for him to decide what the money should be used for.

When we got back to his house we ordered a few pizzas and ate dinner, then Kami and I left to go back to my place so we could go walking. When I got home, I noticed my new 250 GB Hard Drive arrived and was entirely pysched, as I was hoping it would come soon. As I was coming down from my excitement of the new hard drive, I also noticed I had three emails. One of which was over my resume. So I took a quick look and found a small programming project.

Hi Mathew,

Thank you for submitting your resume. Below is a small project we would like for you to complete, so we can evaluate your skills. Please return the completed project to me, and advise me how long it took for you to complete this project.

********

Write a class to override php’s built in error handling. The class should capture all types of errors, including user defined errors, and display a generic message to the user if the error would be considered fatal. The user of the application should never see a php error printed to the screen. The class should write errors to a user defined log file. Include example usage demonstrating custom handling of several different types of errors.

********

Thanks

Jason

Cool! I get to write a program in PHP. However, this had to wait, as it was time to go on a walk, after all Relay for Life is on Friday and I am walking from 3:00 AM to 5:00 AM. So during my walk, I couldn’t think of anything else other than the programming assignment. Wondering what problems it may involve, and how I could get around them.

When we got back from our hour power walk, I sat at my computer desk reading up on set_error_handler and a few other error related functions to help my understanding of the assignment at hand. After a bit of reading, I decided I needed to relax and calm down, as I just flat out work better when I am in that mental state. So, I watched TV with Kami for a while and then took her home so I could get to work on this assignment.

After a half hour, I come up with this as the assignment:

< ?php
  // Define Types of Fatal Errors
  define("FATAL_ERROR_1", E_ERROR);
  define("FATAL_ERROR_2", E_CORE_ERROR);
  define("FATAL_ERROR_3", E_COMPILE_ERROR);

  // Define User Errors and Notices
  define("NOTICE_ERROR_1", E_NOTICE);
  define("NOTICE_ERROR_2", E_WARNING);
  define("NOTICE_ERROR_3", E_USER_ERROR);
  define("NOTICE_ERROR_4", E_USER_NOTICE);
  define("NOTICE_ERROR_5", E_USER_WARNING);
  define("NOTICE_ERROR_6", E_CORE_WARNING);
  define("NOTICE_ERROR_7", E_COMPILE_WARNING);

  // Record Errors For:
  error_reporting(E_ALL);

  // Establish Class to Handle the Processing of Errors
  class errorHandling {
    // Define the Constructor to be executed on Error Generation
    function ReportError($errno, $errstr, $errfile, $errline) {
      // Open the File for Writing and Append the Error to the End
      $fp = fopen("error.log", "a+");

      // Write the Error to the Error Log
      switch ($errno) {
        case FATAL_ERROR_1:
        case FATAL_ERROR_2:
        case FATAL_ERROR_3:
          fwrite($fp, "FATAL: Error Found in $errfile on " .
                      "$errline reported as '" .
                      addslashes($errstr) . "'\r\n");
          echo "A FATAL Error occured, please see the " .
               "error log for more details.";
        break;
        case NOTICE_ERROR_1:
        case NOTICE_ERROR_2:
        case NOTICE_ERROR_3:
        case NOTICE_ERROR_4:
        case NOTICE_ERROR_5:
        case NOTICE_ERROR_6:
        case NOTICE_ERROR_7:
          fwrite($fp, "ERROR: Error Found in $errfile on " .
                      "$errline reported as '" .
                      addslashes($errstr) . "'\r\n");
        break;
        default:
          fwrite($fp, "UNKNOWN: Error Found in $errfile " .
                      "on $errline reported as '" .
                      addslashes($errstr) ."'\r\n");
        break;
      }

      // Close the Error Log
      fclose($fp);
    }
  }

  // Define Class Variable
  $errorClass = new errorHandling;

  // Function Used to Send the Error to the Class
  // For some unknown reason, PHP did not like
  // me using $errorClass->ReportError in the
  // set_error_handler function.
  function SendError($errno, $errstr, $errfile, $errline) {
    global $errorClass;
    $errorClass->ReportError($errno, $errstr, $errfile, $errline);
  }

  // Setup Error Handler
  set_error_handler("SendError");
?>

The above code works great for undefined indexes and probably other errors, but I couldn’t get it to work for a Parse Error and that may be an impossible task to do, but I was hoping I could. Anyways, after I sent my assignment off, I decided to play a few games of pool and work on my E-commerce Application. Later this morning, I plan to send out more resumes this time from monster.com.

UPDATE: PHP.net confirms my thoughts as on the documentation page for set_error_handler they state:

Note: The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.

The Ups and Downs

Life is humorous and horrid at the same time. Today, my girlfriend’s Dad told her he would pay her the money he owed her by having her car repainted. I know, I know, sounds a bit wrong. First thing that ran through my head when I heard the news was: “What’s the catch?”. Well, that later was somewhat apparent when she had a more indepth conversation over the issue with him later.

The catch was, it had to be on a particular week that worked for “his” schedule. Now let me give you a bit of background here. Two years ago, my girlfriend paid some pretty high expenditures adding up to 1,600 dollars, for her Mom and Dad. Shocked? I was when I found out how much she paid. Now, factor in the fact that he runs his own business. More specifically, he runs a Financial Planning business, whose income is as sparatic as contract work. Now factor in the fact that he has stated numerous times over the past two years that he would repay her and it has yet to happen.

Picture of my Girlfriend, KamiOkay, now back to the days events. I get a call around 3:00 PM from my girlfriend (pictures will be up later, I promise!) regarding the fact that her Dad offered to repay his debt to her by having her car repainted for 1,920 dollars and some odd cents. Normally, the boyfriend would be happy to hear such news, but not me! First thing that went off in my head were sirens and they were not friendly sirens that warned you have a possible tornado, but no, they were dreadful sirens warning me of multiple tornados that have been spotted on the ground.

Kami and I My thoughts began to wonder as my girlfriend couldn’t talk very long (she had an eye appointment), and I began wondering why the debtor got to choose what the money went towards. That seems logical enough, doesn’t it? If I owed you 2,000 dollars and said I would repay you by buying you a new computer, knowing you had credit cards to pay off and student loans to pay off, would you be happy? Or would you want a check for 2,000 dollars so you can use it how you need it.

The second thought that entered my mind was, “Who’s priorities are being met here?”. I knew for a fact, that my girlfriend’s priorities were her credit cards being paid off, and I know for a fact that when it comes to finances or cars, her Dad would choose cars everytime! No offense to car lovers, but a car is a mean of transportation, nothing more! Now, I give those of you who built your car from scratch or made major modifications to your car an excuse, as you have time and money put into it. But her Dad, buys these cars, and not just regular cars, but “salvaged” cars. He does not fix them up, but buys the expensive cars that were salvaged due to floods, or other issues and were eventually fixed back up to a driveable state. Someone please explain to me why the repainting of the hood, front bumper, rear bumper, and the driver’s front-side panel is more important than paying off your credit cards and a portion of your 20,000 dollars in student loans.

Just wait, it gets better. My girlfriend, full-heartedly believing he would go through with this, set up a time to have her car repainted (first week in June, I think). When she told her Dad, her Dad flipped out at her!! Supposedly her Dad said the second week in June would be a good time… Now get this, not only does the debtor want to tell her how to spend the money, but also when!! What the Hell is with that!

Now let me give you a bit of background about my girlfriend. She too runs her own business. In fact, it is a Cleaning business. She is the only employee and has a client base of 20+ individuals and 2 businesses. She works anywhere from 30-40 hours a week cleaning homes around the city of Findlay and including Arlington. Now, wouldn’t it be a safe assumption to say she knows when she can have her car repainted? Meaning, she knows which week will be the slowest, or easiest to reschedule (if necessary)? I THINK SO!

Her Dad requested the second week in June because it would be “financially a better week”. WHATEVER! In other words, this means he does not currently have the money he owes her (cause he spent it on his new cars, bushes, and trees for landscape) instead of doing what was more important and settling his debt with his oldest daughter! How many of you would have done what he did? Buy three new vehicles and landscape instead of repaying your debts.

You can see how ticked I am with all of this. Her parents have no idea how to prioritize. It isn’t even funny. Normally, I would sit back and laugh at how stupid people can be, but when I see what they do, I am filled with pity for their children. Promise after promise is broken. The parents continue to say “Yeah, I will get you a basketball hoop” and six months go by and no basketball hoop. Instead, the parents bought a new vehicle that was well over 10,000 dollars instead of forking out 150 dollars for a basketball hoop, or paying back their daughter 1,600 dollars.

I seriously want comments on this. Am I out of my mind for being upset over this? Is my thinking out of line or entirely abstract? I honestly think my thoughts were right on. Can anyone find any justification for her Dad’s actions? Let me know.