Latest Entries »

It’s not really something I hate about Java, more about books about Java and people who program in Java.  Every book and introduction to Java covers how to use checked exceptions, and the IDE tools all auto generate catch blocks that look like this:

try {
  // some code
} catch (IOException e) {
  e.printStackTrace();
}

 

I have noticed that new Java programmers typically just write their methods to throw Exception so that they don’t have to deal with these checked exceptions, and then someone tells them to do this instead, and then I have to beat it out of them later when they work with me.

Logging an exception is not the same as handling an exception!

I would rather have methods just throw an exception instead of handling it badly.  So here are my rules for exception handling:

1) Don’t catch exceptions, just let them escape your method.

2) If you are implementing an interface and you can’t throw the exception that you need to, or if your method would need to throw 3 or more different checked exceptions, it is ok to wrap an exception in some other exception type, but you must include the original exception as the cause.

try {
  // some code
} catch (SpecificException e) {
  throw new GenericException(e);
}

 3) When rethrowing an exception don’t log it.  Let the receiver log it if they want.  They might have a perfectly good way to recover from that exception.  Can you imaging how annoying it would be if File.open() threw a FileNotFoundException and also logged it?  

4) If you are implementing the top level Runnable of a thread or an executor task, you must catch and handle all exceptions.  This is the one place where logging the exception might be the right answer. If you let it escape you will terminate your thread, or in a ScheduledTaskExecutor, you will stop the future tasks from running if you let an exception escape.

I feel like I should write something here about working for Google, but I really don’t have that much to say.  So I work for Google, in Boulder CO, though I have not actually seen my office yet, since I am in training in Mountain View, CA.  Training, at least, is just like being in college!  There is a huge campus, 1000′s of people milling about, and you go to classes and then do homework on your laptop. There is even hazing of newbies. (sort of, it’s just silly hats) The difference is, everything is secret and I can’t tell you about it, and the food is free.

If you would also like to work for Google, they are still hiring (smart) people like crazy.  If I know you, and you don’t currently work for 21CSI (I have a 1 year no-recruit contract there) send me your resume, and I’ll get it to a recruiter.  My office (Boulder) in particular is trying to hire people, so you might even work with me if you apply there.

I have been pleasantly surprised at how friendly and helpful everyone has been.  Total strangers will walk up and say, “Hey Noogler, we’re going to get some lunch, wanna come?”

I’m a bit overwhelmed by the sheer amount of things I need to learn though, Google has so many internal tools and systems to learn.  I suppose, when you have 23,000 employees and millions of customers, off the shelf tools just don’t cut it.

 

I reported a bug in the Objective-C runtime in gcc.  Alright, it was a while ago, actually it was 5 years ago.  I thought it was hopeless and would never be fixed, even though I submitted a test case and a patch that would fix it along with the bug report.  But miracles do happen and it was just fixed!  Sadly for me, I stopped programming in Objective-C with gcc about 4 years ago.  So go report some bugs in something!  They might just get fixed.

So you decided to move from blogger to your own hosted wordpress with your own domain. Great! But now we need to send your visitors to your new site without breaking all you’re page links. There are lots of instructions for this on the internet but they don’t work.

Here is what worked for me:

  • Import the site into wordpress: http://www.mrgarylee.com/converting-a-blogger-to-a-real-blog/
  • Fix the page slugs to match your old blogger site: http://justinsomnia.org/2006/10/maintain-permalinks-moving-from-blogger-to-wordpress/
  • Redirect your feed to the new site, in blogger Settings->Site Feed->Post Feed Redirect URL: http://www.YOURNEWSITE.COM/feed/
  • Redirect your old site to the new one.
    • Log into blogger
    • Revert to classic template
    • Paste in this template (and fix the urls). This template is an utter hack, but since blogger doesn’t give very many options for template tags that actually work, this is what we have. It is very important to use the meta redirect with a timeout of 0 since the search engines should treat this as a permanent redirect and update the urls in the search results.  That is also why javascript based redirects are no good.

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="<$BlogLanguageDirection$>">
      <head>
      <title>Moved to http://www.YOURNEWSITE.COM</title>
      <MainPage>
      <meta content="0;url=http://www.YOURNEWSITE.COM" http-equiv='refresh'/>
      </MainPage>
      <ArchivePage>
      <meta content="0;url=http://www.YOURNEWSITE.COM/archive/<$BlogPageTitle$>" http-equiv='refresh'/>
      </ArchivePage>
      <Blogger>
      <ItemPage>
      <meta content="0;url=http://www.YOURNEWSITE.COM/<$BlogItemPermalinkURL$>" http-equiv='refresh'/>
      </ItemPage>
      </Blogger>
      <meta content='NOINDEX, NOFOLLOW' name='ROBOTS'/>

      <$BlogMetaData$>
      </head>
      <body>
      This blog has moved to <a href="http://www.YOURNEWSITE.COM">http://www.YOURNEWSITE.COM</a>
      </body>
      </html>

    • That will send visitors to your new site, but it will send them to some odd pages, which will not be found on your new site. So add these rules to your .htaccess file to get them to the right place:

      <IfModule mod_rewrite.c>
      RewriteEngine On
      #For my funny redirect rule
      RewriteBase /
      RewriteRule ^archive/(.*)January\ ([0-9]{4})$ $2/01/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)February\ ([0-9]{4})$ $2/02/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)March\ ([0-9]{4})$ $2/03/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)April\ ([0-9]{4})$ $2/04/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)May\ ([0-9]{4})$ $2/05/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)June\ ([0-9]{4})$ $2/06/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)July\ ([0-9]{4})$ $2/07/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)August\ ([0-9]{4})$ $2/08/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)September\ ([0-9]{4})$ $2/09/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)October\ ([0-9]{4})$ $2/10/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)November\ ([0-9]{4})$ $2/11/ [QSA,R=301,L]
      RewriteRule ^archive/(.*)December\ ([0-9]{4})$ $2/12/ [QSA,R=301,L]
      RewriteRule ^http:/.*\.blogspot\.com/(.*)(\.html)$ $1 [QSA,R=301,L]
      RewriteRule ^http:/.*\.blogger\.com/(.*)(\.html)$ $1 [QSA,R=301,L]
      RewriteRule ^([0-9]{4}/[0-9]{2}/.*)(\.html)$ $1 [QSA,R=301,L]
      </IfModule>

150 milliseconds of reasons that is:

Chart generated by site24x7.  Using the Quick Cache plugin.

It’s been painful, since there are no converters from b2evolution to WordPress, but it’s finally done. This site is moved to WordPress. I don’t know if I like the theme, but I was tired of my old eyeball theme anyway.

There is a new improved budget form posted on the Excel Budget Form page.

This should fix the complaints that were in the comments.

http://www.wikihow.com/Opt-out-of-DNS-Redirection

I was trying to VPN into work this weekend, and I could not connect to any servers at the office.

The problem was that cox (my ISP) was intercepting all of the DNS requests and sending me to their stupid search page, and the office DNS server never got a chance to answer.

The solution was found at http://www.wikihow.com/Opt-out-of-DNS-Redirection

Post moved to http://www.bettis.org/cruise-review-carnival-fantasy/

Yes, it has now been two years since I paid off my last consumer debt.

This last year Amy & I taught 3 Financial Peace University classes, and mostly just kept plugging along. My net worth went backwards this last 12 months, down $22,885, but that was just the stock market. We are set to pay off our house in less than 15 years, and we have more savings each month.