Paint.NET, The Best Free Alternative To Photoshop For Windows

Paint.NET is yet another free alternative to Photoshop. It lets you do basic operations like drawing, has effects/filters, and it is free. I’ve heard it mentioned from time to time - but until recently I never installed it. For the heck of it I decided to give a go. Here’s my thoughts on it:

Paint.NET is similar to GIMP in several ways. However, unlike GIMP the interface is actually good, it doesn’t have a stupid name, it launches nearly instantly on my 3 year old PC, and it runs great.

On the bad side certain effects, like Gaussian blur, take forever. On Photoshop those sorts of things are usually pretty quick - but there is a noticeable delay in Paint.NET. In addition the interface isn’t quite as good as Photoshop - for example the zoom box is on the top tool box by default - unlike on PS where it is on the bottom. I suppose the only other major negatives I have about it are a lack of folders for the layers, and it doesn’t optimize for the web as well as PS, but it still does a pretty darn good job. I’m sure as I use it I’ll find other problems as well.

Needless to say I think I will be giving icky old GIMP the boot and I’ll start using Paint.NET on my Windows box more often. I think GIMP has more to offer, but the interface absolutely sucks and seriously - who the hell thought of the name “GNU Image Manipulation Program”? With lame names like that it isn’t a surprise so many non tech-savvy people don’t use open source programs.

PHP Benchmark - Indexed Arrays Vs Associative Arrays vs Classes

One of the most common PHP questions I receive is what is the best way to store data: indexed arrays, associative arrays, or classes (most likely with overloading). To answer this question I whipped up a quick little benchmark, which will return the time needed to A) store data via each type, and B) copy data for each type. This is not scientifically accurate by any stretch of the imagination - but I think it gives a pretty good idea which type is the quickest.

The Test

The script will run each loop 10,000 times by default, and this can be set via the $run_amt variable. The test will be run 20 times (set via $num_tests) and the results are added together, averaged, then displayed. You can view the output for each test by setting $verbose to true.

Here’s the script I used.

The Results

The results are in seconds:

Total Time:
Numerical Array: 0.2946305
Associative Array: 0.392692
Class: 0.364164

Averages:
Numerical Array: 0.014731525
Associative Array: 0.0196346
Class: 0.0182082

Conclusion

I tried running it on both my local server and the server that runs this site - and the differences between each data type were pretty much the same. Indexed arrays are the fastest, surprisingly classes (using overloading) were the second fastest, and associative arrays are in last place.

This isn’t very scientific, nor does it measure how much memory each type uses or how much CPU us required - but I think it gives a good idea which type is better.

I think if you’re going to be storing a little bit of data, it doesn’t matter which type you use. The differences were barely there when I ran the test with 100 loops instead of 10,000. However, when storing large amounts of data indexed arrays ($i[1], $i[50], etc) are probably the best choice.

If you can come up with a better test, go for it. I wrote this thing in about 10 minutes at midnight - so I wouldn’t be surprised if there’s a better way to do the benchmark. I have a feeling the results will be fairly similar though.

WordPress 2.5 Built In Avatars. Don’t Forget Echo!

One neat little feature of WordPress 2.5 is built in support for Gravatars via the get_avatar function. Simply use it in your theme’s comment loop in the comment.php file, and boom, you’ll have avatars. Nusuni Dot Com already supported Gravatars thanks to the plugin - but today I switched it over to the new function.

One little warning I’d like to pass along is make sure you use echo! While implementing it I did this:

<?php get_avatar($comment,64); ?>

There’s one big problem with that code - it doesn’t work! The solution to this problem was a simple programmer-error, I forgot echo! It took me almost thirty friggin minutes to figure that one out!

So yeah, make sure you use echo.

<?php echo get_avatar($comment,64); ?>

If this isn’t proof I’m an idiot, I don’t know what is.

Keep Your Commentators Notified!

During today’s little RSS reading ritual I realized something many blogs have in common - they don’t notify their commentators if their comment is thrown in the moderation queue or spam bucket. Now that isn’t very user-friendly, is it?

I really don’t get it at all. It only takes 3 lines of code to display a simple message if a comment needs to be moderated. Simply add this code in your comment.php file for your theme:

<?php if ($comment->comment_approved == '0') : ?>
<em>Your comment is awaiting moderation.</em>
<?php endif; ?>

Now that wasn’t hard, was it? The best place to add it is right next to the commentator’s name, so it appears as “Jeremy Says: Your comment is awaiting moderation.” Just do a search in the comment.php file for “comment_author_link()” and add it right after that.

7 Important Things I’ve Learned About The Blogosphere

Here are 7 important things I’ve learned about the Blogosphere since I started blogging 2 years ago:

1. Kids Get Easy Publicity And Traffic (Especially If They’re Rich) - It always surprises me how easy it is for kids to get publicity on the Internet. There’s a good dozen popular blogs out there written by kids. No matter how badly they write, no matter how horrible their grammar is, people continue visit them.

2. Adults With Money Are Also Popular - Of course, adults who make money are also popular. No offense to the following bloggers, but do you seriously think they’d be nearly as popular if they shoveled horse poo all day instead of blogging? Shoemoney, John Chow, Darren Rowse, Yaro Starak, Steve Pavlina, etc. I am not saying they wouldn’t be popular at all, I’m simply saying I bet a good chunk of their readership is made up of people who only like them because they all pull in 5+ figures per month. People love hanging around rich guys.

3. Boobs = Diggs - A while back Bart from Florchakh posted a lovely picture of the Ubuntu Girl. It was an instant hit, and made the front page of Digg. The link also made it around the Blogosphere a bit. Apparently those virgin diggers just love boobs.

4. Certain Bloggers Can Say Anything And Get Publicity - Mark Cuban and Jason Calacanis are perfect examples of this. I personally don’t give a hoot about their blogs, but I do care about the fact they could say “blah” and have it posted all over the place. For some reason the media and many bloggers have to go on auto-post mode when something appears with “Cuban” or “Calacanis” in the title. I am not exactly sure why those two are special in this regard, they just are.

5. People Love Plugins - I only e-mailed a few bloggers about the little Nusuni Technorati Links plugin I wrote. Daily Blog Tips wrote about it, and it soon got linked to from a bunch of other blogs as well. I am not sure about the total amount of traffic, but I bet it has brought in at least 5 thousand hits. Since I installed the Download Counter plugin It has had over 700 downloads. I installed the download counter after the big traffic came, so I have no clue how much it was downloaded in total (my guess is 2.5 to 3 thousand). Not bad for a few quick e-mails.

6. The Blogosphere Loves Google No Matter What - Despite the fact Google loves to screw bloggers the blogosphere still loves them. Yes, it’s a mystery.

7. There Are Blogs About Everything - There are blogs about girls drinking tea, there’s porn blogs, blogs about pet care, blogs about making blogs, and blogs about stamp collecting. Heck, there are even blogs about Internet dating (how lame is that?) There are blogs for everything!