Saturday, May 4, 2013

Printing the Contents of a JTextArea

Last week I needed to print the contents of a JTextArea.  When I looked online for examples it was scarce and what I thought would be an easy task (like 5 minutes) turned into a 3 hour event.

There were a few reasons for this.  The first is that there were examples, but they were all dated. They were created for Java 1.4 and who still develops with Java 1.5 or older?  Secondly, some of the examples, particularly on Stack Overflow, took you down the path of using Graphics2D which isn't what I wanted since it only printed the displayable portion of your JTextArea.

Then I found the TextAreaPrintingDemo on the Java Tutorials site.  It helped out a lot.  Here's my final result.

private class PrintingTask extends SwingWorker<Object, Object> {

    private final MessageFormat headerFormat;
    private final MessageFormat footerFormat;
    private final boolean interactive;
    private volatile boolean complete = false;
    private volatile String message;

    public PrintingTask(MessageFormat header, MessageFormat footer,
            boolean interactive) {
        this.headerFormat = header;
        this.footerFormat = footer;
        this.interactive = interactive;
    }

    @Override
    protected Object doInBackground() {
        try {
            reportTextPane.setFont(printableFont);
            PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
            attributes.add(new MediaPrintableArea(0.5f, 0.5f, 7.5f, 10.0f, MediaPrintableArea.INCH));
            complete = reportTextPane.print(headerFormat, footerFormat,
                    true, null, attributes, interactive);
            reportTextPane.setFont(viewableFont);
            message = "Printing " + (complete ? "complete" : "canceled");
        } catch (PrinterException ex) {
            message = "Sorry, a printer error occurred";
        } catch (SecurityException ex) {
            message = "Sorry, cannot access the printer due to security reasons";
        }
        return null;
    }

    @Override
    protected void done() {
        message(!complete, message);
    }
}

private void message(boolean error, String msg) {
    int type = (error ? JOptionPane.ERROR_MESSAGE
            : JOptionPane.INFORMATION_MESSAGE);
    JOptionPane.showMessageDialog(this, msg, "Printing", type);
}

private void error(String msg) {
    message(true, msg);
}

public void print() {
    MessageFormat header = new MessageFormat("This is the Title");
    MessageFormat footer = new MessageFormat("Page {0}");
    boolean interactive = true;
    boolean background = true;
    PrintingTask task = new PrintingTask(header, footer, interactive);
    if (background) {
        task.execute();
    } else {
        task.run();
    }
}
I did find that once I started printing that the text size didn't render on the printer the same as viewed in the JTextArea. A hack I did to work around this was to set the font smaller (10) and return it to the original size (12) when it was finished. I'd like a cleaner method for rendering the print size a bit better. Any suggestions?

Monday, March 25, 2013

Test Driven Development in C


Found a good slide-show of Test Driven Development in C that doesn't use any heavy-weight libraries and figured I'd share...


Wednesday, March 20, 2013

RC2 Encryption in C

I recently had to implement a the RC2 Rivest (Block) Cipher in C. I didn't find too many examples so I figured I'd post mine here. This is a 64-bit block cipher with a variable key size.

This example uses the OpenSSL library.

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "openssl/rc2.h"

#define BITS 64

UBYTE *rc2_encrypt(const UBYTE *key,  UINT32 key_size,
       const UBYTE *data, UINT64 data_size)
{
    RC2_KEY rc2_ks;
    UBYTE *output;
    UBYTE iv[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

    if (key_size % 8 != 0)
    {
        printf("RC2 key size should be a multiple of 8!\n");
        return NULL;
    }

    output = (UBYTE *) malloc(data_size);
    if (output == NULL)
    {
        printf("Out of memory!\n");
        return NULL;
    }

    RC2_set_key(&rc2_ks, key_size, key, BITS);
    RC2_cbc_encrypt(data, output, data_size, &rc2_ks, iv, RC2_ENCRYPT);

    return output;
}

UBYTE *rc2_decrypt(const UBYTE *key,  UINT32 key_size,
       const UBYTE *data, UINT64 data_size)
{
    RC2_KEY rc2_ks;
    UBYTE *output;
    UBYTE iv[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

    if (key_size % 8 != 0)
    {
        printf("RC2 key size should be a multiple of 8!\n");
        return NULL;
    }

    output = (UBYTE *) malloc(data_size);
    if (output == NULL)
    {
        printf("Out of memory!\n");
        return NULL;
    }

    RC2_set_key(&rc2_ks, key_size, key, BITS);
    RC2_cbc_encrypt(data, output, data_size, &rc2_ks, iv, RC2_DECRYPT);

    return output;
}

Cheers!

Cherry Blossoms Bloom Dates Have Changed

Washington DC in beautiful in the spring.  Usually come the beginning of April I look forward to taking my wife and daughter to see the cherry blossoms.  We were excited to go this Saturday because they were expecting an early bloom.  But I just found out that they expect the bloom period to be April 3-6.  I guess we'll have to wait a couple weeks. :(


Sunday, March 17, 2013

Migrating from Google Reader to Feedly

Google announced on March 14th that they will be shutting down Google Reader on July 1st.  This was surprising to me because I've been using Google Reader for years.  But I guess if they can't get a lot of users then it's not worth keeping up.

Recently I posted an article reviewing an RSS feed reader called Feedly.  I've been using their reader on my iPad, Android phone, and just recently they've developed a Chrome client (much thanks!).

So I immediately wondered - what will happen when Google Reader shuts down??  Since Feedly is getting all my RSS subscriptions from Google, will the world end for Feedly when the infamous July 1st comes?

It turns out... not so much.

Feedly has us users taken care of.

It turns out that the developers of Feedly have been expecting for Google Reader to run it's course and have been working on a project called Normandy which is a clone of the Google Reader API.  When Google Reader shuts down, Feedly will transition over to it's new backend.  All without us users ever knowing the difference.

That's great service!

So if you're a Feedly user, who relies upon Google Reader for subscription information, don't fret - you need not do anything.  For all others who only use Google Reader, sign up with Feedly now and the transition will be seamless for you.

Tuesday, March 12, 2013

Sparrow: An Awesome Email Client for Gmail

When I first got my iMac back in January I started using the default email client that comes with all Apple computers.  I found that it was adequate but nothing special about it.  So I started looking in the App Store for alternatives.  I recently come across a great email client by Sparrow.

I was almost turned off by the extremely low 2.5 stars (yikes!) it was rated but then I started reading the comments.  I found that in October there were a lot of comments written up against the application stating that it was crashing, slow, or that it wasn't supported.  When I scrolled down I then found comments from people who had no idea what others were talking about, that the app worked flawlessly.  So what gives?  Why are all these people having issues but others aren't?

My suspicion was that someone is posting false comments and down-voting the application.  The first comment you read is negative and shows "83 of 93 customers found this review helpful".  It's hard to believe that this is true when there are more recent comments within the past couple months that praise the application.  Instead of bypassing this one, I decided to see for myself.

What I found was a very well designed UI.  I didn't experience the issues that others supposedly where having.  Perhaps they were running on older hardware or an older version of OS X.  I found that the application was very responsive and lightweight.  The interface is easy to figure out and just as easy to configure.


Here's what I liked most about the interface:
  1. Gmail integration is excellent.  For those of you who have a Gmail account you'll find that you can label and star emails, see your priority inbox, use one-key shortcuts, and use your contacts.
  2. The application connects to your Facebook account!  This is great for accessing emails and associating photos of people you might not have in your Google contacts list.
  3. Notifications on OS X work great.  A small pop-up is displayed on the top right of my monitor when emails are received.
  4. Sharing is fast and easy.  This email client allows you to integrate with DropBox to share files without having to attach them.  Instead it uploads to the cloud and provides a link to your recipient for them to access it.
  5. The conversations feature of Gmail is also available making it easier and faster to browse mail and respond quickly.
I've been using it steadily for the past 2 weeks and have not experienced any issues yet.  

The only downside to this application was that it cost me $9.99 to purchase.  Which normally isn't bad, especially when it's worth the price.  I don't mind supporting developers who have done a fantastic job. 

Update:  I did recently find out that back in July 2012 Sparrow was purchased by Google.  This is good news for the Sparrow team but probably not so much so for the Sparrow application.  Undoubtedly Google will use the team to work on other projects involving email and let the application degrade.  Which is exactly what we saw when Google released it's upgrades to it's Gmail mobile application a couple days ago.  

For now I'm extremely pleased with the application and hoping that development will continue forward, regardless of what company owns the software.

Got anything better that you'd like to recommend?  Let me know! 

Invest in Yourself - Run a Marathon

Last year my friend and colleague, Alex, signed up for the Baltimore Marathon. The Baltimore Marathon is a popular 26.2-mile long course that travels through the heart of Baltimore and attracts around 5,000 runners each year. Alex wanted to use the Marathon as a motivator for getting himself out of bed every morning and hitting the streets so that he could shed the 40+ pounds that it would take him of achieving his goal weight. Loosing 40 pounds is no small feat, nor is running in a full marathon, but Alex wanted to do both. And that's exactly what he did. 

Alex told me of the mornings he would get up at 5:00 AM to get himself dressed and go out for his morning runs. His weekly workout regiment was to run 4 short runs (easy or tempo runs), 1 long run (10+ miles increasing by 10% each week), and 1 bike ride (15+ miles) for cross training. If he got too tired or his body ached too much he would take a few days off so he could avoid injury. For 9 months, starting in February 2012 until October 2012, Alex kept this pace until the Baltimore Marathon occurred. Alex ran his race and he finished in a little over 4 hours and 17 minutes, which is a pace of 9:50 per mile!

Alex truly showed me what anyone could do if they have the will and desire to invest in themselves. Alex has 2 little girls, a wife and a demanding job as a software project manager. Training for a marathon takes time, especially long runs that could take over 4 hours to complete. However, his family didn’t sit idly by; instead they coached him by showing their support and giving him confidence that he needed more so than hydration (which is a must).

Before the race Alex lost the 40 pounds and achieved his goal. He even gained a better understanding of eating right and how fun running can be. However, a month after running in the Baltimore Marathon he was hit by a car during one of his weekly bike rides and injured his knee. The doctor told him that he would have to stop the running, but could continue biking. He was glad that he could continue working out, even if he couldn’t run in another marathon.

On a funnier note...

Before Alex told me about his goal of running a marathon and his new running hobby I thought he might have been experiencing some major health issues. During our weekly status meetings I noticed that he recently buzzed his hair and continued to loose weight. His cloths were really baggy too. Then one day, it struck me – he’s got cancer! Just by coincidence, a couple days later Alex came over and began talking to me about his new workout regiment. I immediately was relieved and then amazed at how hard the guy has been working.  Kudos to you Alex and to your family who supported you!

After talking with Alex a few times he invited me to run with him in the marathon.  But it was much too late.  I would only have 9 weeks to train in and I would probably have injured myself I did.  It was a good call.  However, it did inspire me to go ahead and register for the 2013 Baltimore Marathon.  For the last 2 years I've thought about it and I kept telling myself that I need to build up to it, build up my mileage, and I need to get comfortable with a half-marathon (13.1-miles).  Well I did that last year and I no longer have any excuses.  I'm doing it. 

Monday, March 11, 2013

Google has Updated Gmail's Mobile App

This morning Google released updates to the Gmail mobile app for Android, iPhone, iPad, Blackberry, and Kindle Fire users.  The improvements are nice touch to an interface that has went far too long without a makeover.  The pale blue colors of the older interface are gone and replaced with a smooth, crisp, look and feel that is very similar to the Sparrow email client that was developed for the iPhone.  Which isn't surprising since Sparrow was recently purchased by Google in July 2012.




The Gmail client still allows users to work in both an online or offline mode.  Users can also label emails, move to folders, mark as unread, or mark emails with a star to remember for later.




The only feature that this interface is still missing under iOS is the back and next buttons.  Android has the back button built into the hardware but this is still a nice feature that should be a native application function.

I'm glad to see Google updating their user interfaces.  If only they could update their regular email client, along with their Calendar and Contacts applications.  The Sparrow team has done well with this interface... hopefully they continue.  :)

Thursday, March 7, 2013

Telecommuting Is Here to Stay

Recently the new CEO of Yahoo!, Marissa Mayer, put out an internal memo banning employees from the right to work remotely.  Mayer's decision to do this was based on the desire to increase company productivity and have better communications.  I agree that there is a benefit to working closely with other software developers.  The ability to bounce ideas off of one another and help inspire and teach each other is highly rewarding, both to the company and to the employee as a professional.  It's also true that developers sometimes need to better communicate with each other and with customers.  However, I disagree in the way that Mayer chose to orchestrate these changes.

According to the memo issued by Jackie Reses, the head of HR at Yahoo!, she states that:
Beginning in June, we’re asking all employees with work-from-home arrangements to work in Yahoo! offices. If this impacts you, your management has already been in touch with next steps.
This means that everyone who works remotely, stay-at-home mothers, people who live offsite, etc., all need to report to a Yahoo! office.  This seems to be a quick-fix type of solution to a cultural issue at Yahoo! with communication and productivity.  The company obviously has issues with people taking advantage of the right to work from home.  Many companies do.

Just the other day I had an issue with an employee who didn't want to show up for a meeting.  Instead this person wanted to call in.  Under usual circumstances of the person being out of town on business or at home with a sick daughter (which I had to do on Tuesday) I understand the need to work remotely.  However, this person was literally 15 minutes away from the office, at their home.

Taking away an entire company's right to work remotely should be a last resort.  And perhaps it was Yahoo!'s last resort, but it should have been a issue discussed with the employees instead of a top-down command from an executive.  Employees are a company's most valuable asset.  Treat them as such.  Talk with them over social media - Facebook, Google+, etc. instead of issuing a 20th century memo.

Regardless of what's going on at Yahoo! telecommuting is here to stay.  Here's why...

According to Global Workplace Analytics, who has aggregated data from over 500 studies, here are the main reasons for companies to pursue or keep work from home programs:

  • National productivity would increase by $334 billion to $467 billion a year through telecommuting.  Based on the average teleworker salary, the increase would add up to over 6 million man years of work.  Cost savings could bring back many jobs that have been lost to foreign labor.
  • Telecommuting reduces traffic jams.  Traffic jams ob the U.S. economy of $78 billion/year on productivity.
  • Telecommuting reduces our foreign oil dependence by saving 281 million barrels of oil worth $22 billion in oil imports while slowing global warming.
  • Telecommuting takes pressure off our crumbling transportation infrastructure.  New roads are being built based on the needs of 10-20 years ago.  Less that 6% of our cities have kept the pace with demand over the past decade.
  • Employees are happier with telecommuting.  79% of people want to work from home and 36% would choose it over a pay raise.  80% of employees consider it a job perk.
  • Telecommuting reduces attrition.  14% of Americans have changed jobs to shorten their commute.  46% of companies that allow telecommuting say it has reduced attrition.

They also list the fallacies of telecommuting, but the list of pros far exceeds the list of cons.

Ultimately the decision to allow employees to work from home must be done on a case by case basis.  Not all employees are self-directed enough to get things done and ignore home distractions.  But there is a strong case with plenty of evidence to conclude that telecommuting is good for both employees and the company.  I'm certainly in favor of it and I hope managers of other companies see it's value.

Thursday, January 31, 2013

Feedly – The Best RSS News Reader by Far

A few years ago, back when I was a rookie software developer, I had a really good mentor (we should all be so lucky).  He shared with me that one of the key reasons for his success has been his passion for reading.  It really supplemented his thirst for knowledge and love of technology.  He said that as a developer we should be reading more content than any doctor would.  Now I’ve never been a doctor (duh) but I would think there would be a lot of reading in medical journals and books about the latest treatments, surgeries, viruses, etc.  Doctors have a lot of information to retain about their field and because the biological sciences are advancing at a very fast rate, it pays to stay on top if it all (as reflected in the number of patients they help).  The same applies to us developers.  Not too many industries evolve like the computing industry.  In the past 5 years we have seen a boom in cloud and mobile development.  For us to stay relevant and valuable as a programmer we must keep in the loop of the latest development technologies, even technologies we don’t use on a daily basis. 

For example, I recently learned played around with the Go programming language just to see what Google’s been up to and how modern programming languages are changing.  Not too shabby.

I try to learn a new language or API a year, but most of the time I just stay up to date with technologies I know and use often.  Which leads me to my latest discovery…

For anyone who has tried to use Google Reader on your iPad, you quickly realize that it sucks!  You can’t scroll.  What’s up with that? 

So I started looking around in the App Store for a new RSS Feed Reader.  I played with a few others until I come across Feedly

clip_image002

Feedly has a stylish interface and is very fast.  I like how it aggregates the content of my feeds into blocks where I can glance at them and determine if they’re worth my time.  I can also do small swipes to mark an article as read or do a large swipe to mark all the articles as read.  Of course, if you swipe in the opposite direction then it can un-mark them.

clip_image002[7]

Feedly connects directly to my Google Reader account to grab all my RSS subscriptions.  If I click on the Settings icon on the bottom left I can select which feeds or feeder groups I want to look at first.
I can also add, modify, or delete any of my subscriptions.

clip_image002[9]

Feedly provides clients for the iPhone and Android mobile platforms too.  Which views nicely on my Samsung Galaxy S3.

Screenshot_2013-01-31-16-37-06

The guys and gals at Feedly did a really nice job creating a responsive and stylish UI.  If you have to look at a screen all day then you know what that’s worth.  Check it out @ http://www.feedly.com/.

Remember doctors developers to keep reading!  Keep yourself marketable and stay hungry for more.

P.S.  If you’re reading this Tom, I know you haven’t slacked off in your teachings.  ;)

Friday, January 11, 2013

AbstractTableModel not Firing setValueAt

I had a friend come to me today about a bug found in one of his applications.  He had an issue when the user was editing cells in a JTable the user didn’t click out of the cell for the setValueAt method to be called prior to selecting the OK button to close the dialog.  This made the user’s last change not take effect in their database. 

The solution to this is that in the event listener or action for the button you need to get reference to the table and ask the table whether isEditing() is true.  Then you would get the current cell editor and after validating the last input value either call stopCellEditing() to commit the change or call cancelCellEditing() to undo the value.

if(table.isEditing()){
table.getCellEditor().stopCellEditing();
}
This would always commit the new value.

Thursday, January 10, 2013

Unboxing of the New 27” iMac

Last time I shared with you guys the debacle I experienced with UPS over the delivery of my new Mac.  The package was finally found and now I’m the proud owner of a Mac computer.  It’s been a while since I’ve spent a lot of time on a Mac.  In college they had Macs in the computer science lab.  I remember spending every night in the lab for about 2 months working on a compiler for a class I was taking.  The class was tough and the nights were long, but I still have fond memories for that class and the working on the Mac made an impression on me.  Developing on the Mac was a pleasurable experience even if the course work wasn’t.  Since then I decided that one day I’ll own one.  That was 5 years ago!

Why did it take me so long to make the switch from Windows to Mac?  The cost.  It’s hard to justify purchasing a computer with an Intel i5 processor, 8 GB of DDR3 RAM, and 1 TB HDD for $1,799 when you can purchase the same machine for around $900 from Dell.  The reason you purchase a computer like this is the user experience and the quality.  It’s no secret that Apple builds quality devices.  Take a look at the iPhone and iPad.  They are beautifully designed and have a seamlessly intuitive user experience with both hardware and software.

The box came with the following items:

  • The 27-inch iMac (2.9GHz quad-core Intel i5 processor w/Turbo Boost up to 3.6GHz)
  • Apple Wireless Keyboard
  • Magic Mouse
  • Power cord

I was really great to un-plug all my cords from my current Windows desktop.  I realized that there were 12 cords total.  I now only have 2 cords – the power cord and the Ethernet cord.  All other peripherals are Bluetooth.  Wireless is wonderful!

“Simplicity is the ultimate sophistication.”  - Leonardo da Vinci

Here are some photos of that day.

20130103_17212020130103_172406 20130103_172403 

You notice how my daughter goes directly to playing with the box.  We should all be so easily amused. :)

20130103_174300

Installation was supper simple.  Just select your timezone and enter your Apple ID.  It automatically syncs information from your iPhone and iPad via the iCloud.  A very nice feature that works out of the box.

Everyone has their person preferences of software.  Here’s what I’ve installed first:

  • Xcode 4 – An integrated development environment for C/C++/Objective C programming.
  • Amazon Kindle – For reading my books on my Mac and syncing to my Kindle device.
  • Mint.com QuickView – I use Mint.com as a free finance management tool.  This app is great for showing managing transactions and viewing spending by category.
  • Google Chrome – Of course the greatest browser!  It syncs my bookmarks over my Mac and Windows machines plus my Android phone.
  • pwSafe – Tool for storing all my complex passwords.  Can be used with DropBox or Skydrive to sync to other computes for access from anywhere.
  • SkyDrive – Yes this is a Microsoft tool but great for storing files in the cloud.  Glad they made a Mac App!
  • MarsEdit – A desktop editor for blogging and comparable to Windows Live Writer. 

These are some of the good ones I’ve found so far.  If you have any suggestions on the latest apps you love, let me know!

Thursday, January 3, 2013

A Sudden and Ignominious Failure of UPS

Happy New Year!

To start off this year I need to tell you a little story.  It involves a kind-hearted woman, a mean delivery man, and a sad little programmer who was given the grandest gift of all.  The beginning of this story starts off in early December when my wife, the kind-hearted woman, ordered me the new 27" iMac for Christmas.

The new iMac is stunning.  It's only 4 millimeters thin on the sides and has a gorgeous display.
After ordering the computer Apple announced that only the 21" iMac would be made available before Christmas day.  The 27" would be shipped between January 2nd and the 8th.  After my wife ordered it on December 2nd our UPS tracking number reported that we should expect the arrival on December 31st!  Well that's great!  I would get it 2 days earlier.  Hooray!

On December 31st I decided to take the day off and wait diligently for the UPS guy to arrive.  While I waited I was upstairs taking apart my current computer to box up and put away.  You know... in that place where past PCs go to whither away in time.  Otherwise known as the closet.  During that time I realized that the time was 12:38 pm.  The package was supposed to arrive at noon.  Hmm... guess he is running late.  At 1:15 I got worried.  I took out the tracking number that Apple provided me and looked up where my package was.

What the?!  The package was already marked as "1st delivery attempted"!  It said that I wasn't home to receive the package.  Well that's absurd because I've been here the whole time.  I even have a loud mouthed dog that notifies me when people are at the damn door EVERY time.  There's no way that he showed up, knocked on my door or rang my door bell, and come to the conclusion that I wasn't home.  Even my wife and daughter was home and nobody heard a thing.

Of course, I immediately get on the phone with UPS.  Correction, my wife gets on the phone with UPS, because we all know if you want anything information out of customer service then you have to send in the pissed off wife. ;)  She tells the UPS person about the truck that didn't stop at our house and asks about the possibility of meeting the truck or having it stop back by later, but it was New Year's Eve and nobody was willing to go out of their way to correct this wrong that was done to me.  So instead, since UPS is closed on New Year's Day, we chose to pick up the package on the next day, January 2nd.

On January 2nd my wife goes to pick up the package in Laurel, Maryland.  It's about a 30 minute drive from our house.  When she arrives she finds out that they don't have the package!  What?  You said it would be there!  Immediately my wife asks for the manager and attempts to gather some information from the lady.  She found out that the driver locks the truck up on New Year's Eve, leaves it in the UPS parking lot and doesn't unload ANYTHING until after their first shift when they come back on the 2nd.  The lady instructs my wife to come back between 8pm and 9pm that night and it will be off the truck and we can pick it up.

I decided to let my wife sit this one out since most of the work is done.  The package should be there when I arrive at 8 pm, right?  Wrong.  I show up promptly at 8 pm.  The package is not there.  The UPS lady says the truck is running late and that it should arrive shortly - it should be here in 10 - 15 minutes she says.  I waited for an hour and a half.  At 9:30 walked up to the lady and asked about the status of my package.  She types on her HP computer for a moment.  Leans her head to the side and says "huh".  She begins to tell me that they couldn't find my package, that it's LOST!  How the heck does UPS loose a very expensive computer?  Argh!  It this point I was a "little" mad.  I call my wife.  She calls Apple.

Apple has wonderful customer service!  The Apple representative held our hand and said everything is going to be alright.  He filed a inquiry with UPS to find the package and setup to have another new iMac directly sent to our house.  This guy is great!  It wasn't even Apple's fault, it was the mean delivery guy who failed to knock on our door, but the Apple rep. took care of it.  During our phone calls with UPS we always got a dry attitude and little information.  I'm sure that they get these issues all the time and have become numb to how their customers feel when they lose a package.  The difference between the service at Apple vs. UPS was amazing to me.  This is my first iMac and with service like that it defiantly won't be the last.

All that happened last night between 8 pm and 11:30 pm.  This morning I woke up and called the UPS Customer Service at 8:30 am.  They said that they received the inquiry from Apple and started looking for the package.  At 1:49 am that night they found it!  Of course I asked the lady to prove it.  I've been told that a couple times before.  She said she just went back to the storage room and touched it.  Wonderful!  So at lunch today I took a little extra time off and drove the 45 minutes (each way) to the UPS facility to pick up the package.

It's now in the back of my car as I write this.  I'm going to open it as soon as I get home and have an "unboxing party".  My next blog post will be written from the desktop of my new iMac.

Cheers!

7 Years to Digest... Damn You Wrigley

Today I'm just sitting there listening to music, writing code, and chewing gum when suddenly I swallowed my piece of gum.  At that point I realize that damn it - that piece of gum is going to be in my system for the next 7 years!  Or is it?  Is that folklore true?  I haven't swallowed a piece of gum since I was a kid trying to hide it from my 4th grade teacher.  I needed to know the truth... so I turned to Google.

According to an article published by John Matson of the Scientific American, it's a lie!  It has very little basis on fact.  Of course gum doesn't fully digest.  The sugars are broken down but the majority of the rubbery substance remains intact.  It often takes between a day and 7 days to pass through your system.  Whew!  Crisis averted.