computers

HOW TO NOT HANDLE EXCEPTIONS: GDI+ GENERIC EXCEPTION Posted on 06/09/10 at 1:13PM
[ mandlar ]

A few months ago at work, I came across the worst possible exception I have ever seen thrown by a program:

A generic error occurred in GDI+

For those who don’t know, GDI+ is the graphics library for Windows that is supported in .NET via the System.Drawing namespace.

So, what is so bad about this?  It doesn’t tell me why this error occurred!  There is no inner exception passed along.  If I don’t know the source of the problem that is causing the exception, then how can I prevent the exception from being thrown?  Heck, how can I even catch this exception and know what to do with it? Did the memory get full?  Was a file not found? Is a file being used by another process? Did the world blow up?  WHAT THE HELL HAPPENED?

After a quick search on StackOverflow I came up with a number of possible sources of the problem, but at best we are guessing because the exception tell us absolutely nothing!

And the list goes on and on with further suggestions.  The thing that baffled me is that my GDI+ exception occurs randomly.  It doesn’t happen every single time I run my GDI+ functions.  I think it has to do with some sort of file lock going on, but honestly, I have no idea because the GDI+ generic exception is a worthless piece of information.  I re-wrote my code to ensure that all file handles are closed after being used.  I even tried copying the bitmap created from a file into a NEW bitmap to remove the dependency between the bitmap and the original file.  Nothing.

Personally, I would love to meet the developer who thought swallowing up the inner exceptions was a fabulous idea and reprimand the hell out of him or her. And why hasn’t Microsoft updated the library with better exceptions?

So, the moral of the story folks is to don’t write code like this:

1
2
3
4
5
6
7
8
try
{
     // one or a million lines of code
}
catch (Exception ex)
{
     throw new Exception("A generic error occured in [program name]!");
}
Posted in computers | No Comments »
NEW TOY: DELL STUDIO XPS 16 Posted on 03/04/10 at 7:41PM
[ mandlar ]

Another new toy I recently splurged on was a new laptop!  My poor IBM Thinkbad R52 from college is starting to reach the end of its days and my ancient desktop is fairing no better.  I heavily considered getting another IBM Thinkpad because of how well my R52 has held together being thrown around everywhere in a book bag at college.  But I found their laptops to be extremely expensive to get similar specs (or better) specs from a Dell laptop.  And I’ve had decent experience with Dells in the past (both as a computer technician and user) so I decided to stick with what I know best (rather than HP or any other well known brand).

So what did I get? A Dell Studio XPS 16.  Even Leo Laporte uses one of these! The specs on mine are as follows:

  • Intel Core i7 720QM 1.6GHz (2.8 GHz Turbo Mode, 6MB Cache)
  • 4GB, DDR3
  • 15.6 inch Wide Screen 16:9 1080p Full HD WLED LCD
  • Built in webcam with facial recognition
  • ATI Mobility RADEON HD 4670 1GB
  • 500GB 7200RPM HDD
  • 8X DVD+/-RW
  • Bluetooth
  • 9 cell battery!
  • Windows 7 Home Premium 64bit

This laptop runs circles around my desktop.  The i7 processor is a QUAD CORE.  Processing pictures in Lightroom on my desktop took forever, but on my laptop it is incredibly snappy! (For reference, my desktop is running an old AMD Athlon single core processor with 2GB of memory.)  The screen is amazingly beautiful, whether looking at my pictures or watching a movie. Unfortunately there was no Blu-ray drive option when I built the laptop, so I’m not able to fully take advantage of a HD screen unless I’m streaming HD videos (but neither do I own any Blu-ray DVDs). The 9 cell battery lasts for hours and hours and hours and hours (at least 3+ if it is not processor intensive). I also love, love, love Windows 7.  I was the guinea pig for Windows 7 at work and it is the best thing to happen to Windows since XP.  Vista doesn’t exist in my mind. I haven’t gotten around to testing out the video card with any games since I don’t play many PC games anymore (hello Xbox 360!), but it should be a decent gaming card (not an Alienware, for sure).  My primary intended use of the laptop is for programming and photo processing. Also, a weird side note: the laptop doesn’t have a numpad (not even a function key enabled one).

The only thing I was upset about with the laptop and Dell was the fact that it took nearly a month to receive the laptop.  I ordered it at the beginning of February and did not receive it until the end of February (including one delay in the shipping of the laptop).

Overall, I’m quite excited to finally have this blazingly fast laptop in my hands and it has so far met or exceeded all of my expectations!

Posted in computers | 5 Comments »
WELCOME TO THE WEBSITE, NOW HOSTED BY GODADDY! Posted on 05/29/09 at 9:04PM
[ mandlar ]

If you are reading this, then you have reached the correct website.  Please make sure you update your bookmarks to http://www.bryandenny.com and RSS feeds to http://www.bryandenny.com/index.php/feed/

Eventually I will have http://www.mandaria.net point to http://www.bryandenny.com

Please remove all references to http://wwwx.cs.unc.edu/~denny/ because my department will eventually delete my CS account.

Posted in computers | No Comments »
DREAM SETUP Posted on 02/24/09 at 9:05PM
[ mandlar ]

I’ve posted this before, but the guy updated his setup.  It looks even slicker than before.

One day…..

Posted in computers | No Comments »
LOCAL WEBSITE DEBUG Posted on 02/23/09 at 11:16PM
[ mandlar ]

Without my 360 around, I’ve been trying to be productive with the website.

Yesteday I setup a local version of the website using an Apache server with PHP installed.  I then pointed the base “home” directory of Apache to my local copy of my Website from Source Control.  Therefore when I edit the website in Source Control, I only have to go to localhost and test it before uploading it live.

I did however encounter one problem with PHP and MySQL:  “Your PHP installation appears to be missing the MySQL which is required for WordPress. ”

After some Googling, I found out that the simplest solution is to copy the “libmysql.dll” file from your PHP installation folder to Windows/System32.  That instantly resolved my problem (after restarting the Apache server).  Make sure you also have the MySQL module installed for PHP (see a setup guide for details).

I figured I’d jot this down incase anyone else has a similar problem out there, or if I come across it again.

Posted in computers | No Comments »
ON THE DEBATE OF FACEBOOK’S TERMS OF SERVICE Posted on 02/18/09 at 1:28PM
[ mandlar ]

I say, forget it all and go to: http://www.friendface.org/

Posted in computers | No Comments »
KOREANS LOVE THEIR COUNTER STRIKE Posted on 02/11/09 at 9:30AM
[ mandlar ]

This is too good to pass up.   AJ just sent this to me this morning.  He is teaching English in South Korea.

[8:49 AM] AJ Sams: so one of my kids today threw an eraser at another kid when i wasn’t looking
[8:49 AM] AJ Sams: so the other kids were trying to tell on him, and didn’t know how to say it in english then finally one kid shouted out
[8:50 AM] AJ Sams: he goes “fire in the hole” and made a throwing motion
[8:50 AM] AJ Sams: i couldn’t stop laughing

Posted in computers | No Comments »
REORGANIZING MY PROGRAMMING PROJECTS Posted on 02/05/09 at 3:02PM
[ mandlar ]

As of today, I am doing something new in regards to my current programming projects: I’m going to put them under source control!  Why would I care to do such a thing?  Because I am tired of my programs being only accessible to my laptop or desktop.

Therefore source control will help solve many problems:

  • Organization.  All my programs are in one place.  I can easily back these up on a schedule.  I know where to find an old program if I need to re-use some old code.
  • Versioning.  Opps, did I delete something 3 or 4 days ago and I want it back?  Source control keeps track of all my changes to a project.
  • Remote Access.  I have it setup such that no matter where my laptop is, I can connect to my source control server on my desktop and get to my projects.

I’ve been meaning to do this for awhile because I have a really bad habit with this site: I don’t have a good, consistent local copy of my website.  Everything is scattered around in a mess.  And if I make a change, it is permanent.

So starting today, I’ve put my website under source control.  Additionally, I am using source control for my first Comp 524 programming assignment.  And whenever I get the free time, I hope to import all of my previous programming assignments and projects into source control.

Technologies I’m currently using:

  • Subversion for source control server (specifically, VisualSVN)
  • Subclipse to work with my projects inside of Eclipse
  • EPIC to program in Perl in Eclipse (required for my Comp 524 assignment)
  • PDT to program in PHP in Eclipse (for the website)
Posted in computers | 1 Comment »
WHAT I DID OVER CHRISTMAS BREAK Posted on 01/17/09 at 10:55AM
[ mandlar ]

The new SouthData, Inc. website was what I spent about 80% of my time on.

Posted in computers | 1 Comment »
FACEBOOK STATUS ON YOUR WEBSITE Posted on 01/04/09 at 2:42PM
[ mandlar ]

I’ve been working through this problem on StackOverflow (my favorite Q&A website for programming), and you can find my question there.

I couldn’t get the Facebook API to work quite the way I wanted it to.  All I wanted it to do was return my current Facebook status, but it would only do it if 1) I was logged in to Facebook and 2) I was logged in as myself or a friend of myself.  I couldn’t get any sort of offline_access permission to work, and perhaps I wasn’t looking in the right place.

Instead I went with the RSS feed route.  And you can too by following these few steps:

  1. Get your Facebook status RSS feed here: http://www.new.facebook.com/minifeed.php?filter=11
  2. Download a PHP function program called StatusPress (meant for Wordpress, but can be used in general).  Edit this function to your needs, as it is it gives a list of your most recent statuses with a timestamp included for each one.
Posted in computers | 4 Comments »