Skip navigation

Category Archives: Handy

So, Josh has been a bad blogger. And some things have popped up with a member of the family having terminal cancer, so yeah.

Anyways, on with the letting my code fly.

Today I am gonna get free a tool I created a while ago called Image ripper. The basic idea behind it is that somebody is having lunch or something with a client, and they start diagramming something on a napkin or other non suitable bit of paper and would like to get that into Visio or Word or something like that without redoing the diagram.

It’s a command line program, written in c#, full source is included (should be rather easy to understand).

The way you use it is (from the command line and in the directory the program is) ImageRipper.exe templatefilepath checkfilepath outputfilepath.

The first thing is the path to what I call the template image (I.E If the diagram is on a napkin, the template file would be a blank napkin).

The second argument is the path to the file to check (I.E the napkin or whatever that your diagram is on).

The last argument is the file that you want to be the output file, it will create it if the location doesn’t exist

so as an example ImageRipper.exe c:\images\templatefile.jpg c:\images\checkfile.jpg c:\images\output.jpg

The way it works is that It loads both images into separate System.Drawing.Bitmap classes and then comparing the images pixel-by-pixel, if the current check image pixel is different than the template image pixel, then it will add a pixel to the output images bitmap

Obviously this works best with scanned images.

Any Questions, feel free to leave a comment and I’ll get back to you as soon as I can.

Here’s the link.

As with all my apps that I set free, feel free to-do whatever you want with this, I’d like a email if you do anything cool with it commercially. If you blow up or have vomiting and nausea or anything else bad while using my software, I’m not responsible, so there mmmkay?

Another handy tip

Instead of:

IF (SELECT COUNT(*) FROM Table1 WHERE ... ) > 0

use

IF EXISTS(SELECT * FROM Table1 WHERE ...)

Really this post is more for me but it might be useful for you

via Mladen

technorati tags:, ,

Blogged with Flock

Just a quick note for all those .NET developers out there, If you are after a easy was to create / parse RSS and ATOM and OPML, have a look at Argotic

technorati tags:, , , ,

Blogged with Flock

For future reference: (http://)?([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?

This place does really cool wallpaper.

Makes me wish I had a vista box or a Mac just for shear awsomness points.

technorati tags:

Blogged with Flock

Just as I have posted on my not posting for a while, what happens?, I find something that I want to talk about (sigh).

Anyways here is a little notetaking application that I wrote, full source is included.

technorati tags:

Blogged with Flock

Having a wiki on your desktop is  unbeavablably handy, I like StickWiki (one page self modifying wiki) set as an active desktop item, it rocks!

Recently, I needed to download a lot of files that I had in a file on my computer, so I threw together a quick console program to download files given a text file with the URLs in it. It worked first time around perfectly, and Im quite proud of it, I think that other people could use this program, here is the source for it…

            List<string> files=new List<string>();

            System.Net.WebClient downloader = new System.Net.WebClient();

 

            string location=Console.ReadLine();

            StreamReader filereader = new StreamReader(location);

 

            while (!filereader.EndOfStream)

            {

                files.Add(filereader.ReadLine());

            }

 

            foreach (string n in files)

            {

                try

                {

                    Console.Write(“downloading file “+ n + “: “);

                    downloader.DownloadFile(n, Path.GetFileName(n));

                    Console.WriteLine(“Done”);

                }

                catch (Exception x)

                {

                    Console.WriteLine(“failed, reason: “+ x.ToString());

                    throw;

                }

            }

 

            Console.WriteLine(“done!”);

            Console.ReadLine();

its pritty self explanitory, and it did what I want it to, so I didnt really test it that much

Blogged with Flock

A mate of mine has just set up a free PHP hosting website thing, I have set up a account there and stuff like that(even though I am a microsoft fanboy, I still want another tool in my belt), here it is

Heres a link to 150 cool microsoft downloads, rocking!!