Skip navigation

Category Archives: Coding things

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?

So, a couple of nights ago, I was programming a web comic downloading library, and I needed to test a few things, so I started writing a test application.

After about five to ten minutes and a lambada or two I ended Up with an application that writes to the console the total number of Friday’s since 01/01/0001(as far back as .NET would allow me to calculate).

After I had done that, I decided that I would expand my application to all the days in the week (as you do).

as this is slightly interesting(well to me at least) here is the output from when I ran my program a few minutes ago:

Number of days as of 16/02/2008 4:07:51 p.m.
Monday: 104726
Tuesday: 104727
Wednesday: 104727
Thursday: 104727
Friday: 104727
Saturday: 104727
Sunday: 104727

I have not published the code as it is rather ugly, but if you want it email me or leave a comment on this blog

Blogged with Flock

Tags: , ,

I have posted a development snapshot of the next version JRN, and the beginnings of a reddit clone at jbab

Blogged with Flock

Tags: , , ,

Python Imaging Library (PIL)

Blogged with Flock

Tags: , ,

Well, like almost any programmer, I have a large repository of small projects and other things like that I have worked on.

Well I have decided to start uploading them to an assembla space.

at the moment their is just Josh.BitmapHelpers (a few classes to help with modifying bitmaps)

technorati tags:, , , ,

Blogged with Flock

So, apology’s for the lack of bloggage recently, my laptop has completely died now (I should be getting a new one next week hopefully!)

Anyways, On with the announcement: I have been working of a java-script only version of JRN, this works via outsourcing the feed getting and sorting to yahoo pipes (although you can customise it to another source), This version of JRN is really just me playing around with java-script, but it might be useful for a light weight installation of JRN. It will be fully css-able, yada yada yida

Expect it before the weekend (It would be here sooner but the pipe feed I am using has 21tiers, not fun to play with…)

technorati tags:, , ,

Blogged with Flock

So for a site I am writing I needed an email me link on it, and I didnt want to be spamed, so I wrote a little javascript function, you might find this a helpful starting point for your own endevors:

function MakeNotSpamibleEmailAddress()
{
var part1=”jhekt”
var part2=”or”
var part3=”@”
var part4=”gmai”
var part5=”l.com”

document.write(“<a href=”+”mailto:”+part1+part2+part3+part4+part5+”>”+”Email Me”+”</a>”)
When I add CSS to my site I will use a similar function that use’s document.getElementById()

Heres the uglyest code I have written today

            if (matches.Count == 0)

            {

                matches = Regex.Matches(input, regex2);

 

                if (matches.Count == 0)

                {

                    if (isml == true) ml.Add(line);

                }

                else

                {

                    isml = false;

                }

            }

            else

            {

                isml = true;

            }

Whats yours?

technorati tags:, , ,

Blogged with Flock

Processing is a cool programming language, Its designed for things like data visualisation. It is based on Java so it’s really easy to pick up.

I’m getting excited…

technorati tags:, , ,

Blogged with Flock

So I fired up VS, opened up one of my little mini projects and found this (ROFL)

mGeo.Longitude = Convert.ToDouble(match.Groups[“Latitude”].Value);

mGeo.Latitude = Convert.ToDouble(match.Groups[“Longitude”].Value);

// display the actual map

throw;

technorati tags:,

Blogged with Flock