ATTENTION ALL FANS!!! THIS BLOG HAS MOVED!!!
go to: http://www.taotekaching.com

Showing posts with label picasa. Show all posts
Showing posts with label picasa. Show all posts

Saturday, March 07, 2009

Duplicate Files, Hash Codes, SQLite, and Me…

My wife’s been getting on my case about having a gazillion different hard drives with everything and our mothers on them all around the house.  I mean, come on everybody, she just wants her pictures in one @%$!# spot!  She also “misused” Picasa, and now has a bunch of duplicates on her laptop (she doesn’t read my blog, so I ain’t worried she’ll read that).

So, out shopping for Little Liam last weekend, and we decide to pop into Circuit City’s closing-its-doors blowout sale.  I grabbed her a 500 GB Western Digital external drive and, when we got home, proceeded immediately on a simple solution to shut her pie hole.

The result: MyPicturesConsolidator!  It is a WYSIWYG image grabber, duplicate detector, and file-copier-consolidator all in one, gorgeous package!

Ok, this program is NOT a work of art, but may contain some good stuff you can use, and it works pretty solidly, so…

mpc

How it works:

First, you select where you want any pictures it finds to get copied to:

mpc_dest

Second, select the logical drive you want to scan for pictures.  I included a Refresh Drive List button for changing between USB drives:

mpc_src

Third, click Find My Pictures!  And you’re good!

Behind the scenes:

I wanted a “list” to be maintained that kept track of files we’ve gone through.  I decided to use a SQLite database that would hold MD5 and SHA1 hashes of the pictures.  A good side effect of this is, just take it with the exe and SQLite dll to another computer along with your destination drive (or network share path, etc.), and the duplicates list maintained in the SQLite db should work golden for you.

MD5 and SHA1 generation is, for lack of a better phrase, retardedly easy via .NET.  An MD5 hash of a file, for instance, can be had in one line of code:

byte[] md5Hash = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(System.IO.File.ReadAllBytes(filename));

The code is here.  Go ahead and take a look.  There’s some dumb things I’m doing in there that deal with my wife’s needs (i.e. Picasa uses file creation dates, ergo I try to find the earliest for her when I can, etc.).

~ZagNut

Submit this story to DotNetKicks

Wednesday, April 30, 2008

Thick-Clients, Web Apps, and Me...

I have a question for any software developers / engineers / architects out there:

Everyone is going ga-ga for web applications, partly because AJAX has brought thick-client-like behavior to the web client, etc etc. But there is still something to the plain ol' think-client. Downloading an application and running it locally -- it just seems more tasty. A case can be made, too, that thick-client applications haven't fallen behind, and may even be taking a somewhat new form: the portable application. With portable applciations, no installation is necessary; just unzip and run. Data is stored relative to the application's execution path. And by carrying said application on, say, a USB stick, the data is persistent and the application can be run anywhere (so long as on the same operating system, which leads to another item of discussion).

So the question is:
Do you think thick-client applications are more "popular" than web apps with the general public? That is, may there possibly be a preference by the average user for a local application vs. a web application?

I'd have to say that there is, perhaps only subconsciously, but there is. So long have we all had to use applications "locally" that, even with fantastic Google applications, we find ways to integrate them into our existant local applications. I am writing this entry now using w.bloggar from my thumb drive, not via the web interface provided by Blogger. My wife uses Picasa frequently -- the downloaded application. Google offered a Microsoft Outlook calendar syncing tool, which, combined with forwarding GMail to a Hotmail account and using Office Outlook Connector, has provided me with a "virtual" Exchange service.

The next great revolution could come with a portable JVM written in Java (he he), which could then run applications from a thumb drive on any computer, no matter the OS.

Anyways, your thoughts all?

Submit this story to DotNetKicks