Software Developer Tip: RSS Aggregator + Google Blog Search

Large companies, such as Microsoft or Google, have entire sections of their company dedicated to things like PR (Public Relations) and paying attention to what the media says about them. As a small time individual developer, you probably don’t have time to track down everything that is said about your product. But, if you know how to use an RSS Aggregator such as RSS Bandit or Google Reader, then you can passively (efficiently) watch a lot of the buzz about your product.

The trick is to use the RSS syndication feature in Google Blog Search. Basically you do a search for your product’s name, and then you click on the button to get an RSS feed for that search query. Whenever you check in on your RSS feeds, you’ll know if people have been talking about your product in the “blogosphere.”

Step 1 — Go to Google Blog Search and type in your product’s name. Usually you want to surround it with quotes.

Step 2 — On the top right side inside the browser window, click on “Sort by date”. The default is to sort by relevance.

Step 3 — On the left side of the window, find where it says “Subscribe:” and then click on the format that you prefer (I use RSS, for instance).

Try it out 🙂 I use this to keep up on what people are saying about Paint.NET — both good and negative.

Paint.NET Help: Now with Windows Live Translator

One problem that a small software developer like myself faces is getting my software and its help content available to users that don’t speak my language. Translating something like the Paint.NET Help is a daunting task — it’s a lot of content, so it either takes a lot of time, or a lot of money.

Machine Translation (MT) gets a bad rep because it usually provides laughable, hardly usable translations. It is, however, very cost effective. So, I have added the Windows Live Translator widget to the Paint.NET Help. Hopefully it can help non-English users get the gist of the help content, while at the same time adding some more feedback into the Windows Live Translator system. Who knows, maybe someday it will be almost as good as a “real” translation 🙂

If you use this, then please send feedback via the “Is this translation useful?” link at the top of the Windows Live Translator shell.

PC Club stores close … I used to work there!

So, I just saw over at HardOCP that PC Club has shut down completely. We had around 4 of them in the Seattle area (Lynnwood, Bellevue, Tacoma, and I think one more), although only the Tacoma one was still around. I actually worked there as a “sales associate” in the summer of 2002, between my junior and senior years of college. I thought it was a pretty decent place to work, although apparently things went downhill after the founder passed away (whom I met — he gave me an eBay coffee mug which I still have).


PC Club in Lynnwood, WA, circa 2002

Some [possibly] interesting bits of historical info:

· I was the top grossing sales person there during the months that I worked (summer, and during Christmas break). However, my margins were lower than the others. The cause? I’m not sure, but it’s probably because I just told the truth, or at least my honest opinion, when customers asked questions! If someone was buying a computer and couldn’t decide between an Athlon XP or a Pentium 4, and asked “What’s the difference?”, then I replied with “You probably won’t notice much, other than the $100.” Because of this I sold more systems, albeit at less profit margin. I never sold one of the $1,000 Pentium 4 2.53 GHz chips … oh well 🙂
· When games like Morrowind or Unreal Tournament 2003 came out, we sold a lot of graphics cards. The big dog at the time was the GeForce 4 Ti4600, but we sold a lot of the Ti4400’s.
· The week before I started working there, the place was actually robbed. The manager was helping a customer with some questions at the front counter, and when he turned his back for a second the customer reached over and yanked a tray of expensive Pentium 4 CPU’s. Then he ran. If it hadn’t been for this, the store would have been profitable its very first month in operation.
· One time we had a very interesting fellow walk in carrying some computer almanac. He demanded to know how the computers responded to some math problem … apparently he thought that the Pentium FDIV bug was still around.
· The manager wanted us to try and sell the LCD monitors used by the POS (point of sale) computers. Even though they were obviously used and a little dingy (from fingers, post-it notes, etc.) he refused to sell them as anything but full price and new. “They aren’t used!” Umm, yes, they were! The customers he tried to sell them to weren’t exactly impressed (nor fooled).
· We had one guy come to the story regularly just to hang out and talk. He had a job as one of those guys who stands on the sidewalk wearing a sign that says, “Carpets For Sale!”, with a big arrow. He was a mostly normal guy, not a bother or anything … apparently they actually get paid good money to do that since it’s really hard to retain them.

Paint.NET turns 4!

According to the Roadmap page, version 1.0 was released four years ago on May 6th, 2004. Happy birthday Paint.NET!

As most people know, Paint.NET started as a senior design project at Washington State University‘s EECS department. When we finished the first version, it was meant as a “hey look we actually made something – neat!” project that we showed off to family and friends. A simple website was put up on the eecs.wsu.edu web server, and the project was neither hyped nor advertised once the semester was over. Fast forward a few months later, after I started working full time at Microsoft, and I was forwarded e-mail from some interns who had managed to find it and were asking about why it wouldn’t install on XP SP2.

Interesting things to know about the first version of Paint.NET, in no particular order:

· It took 15 weeks to complete, from start to finish.
· It was about 36,000 lines of code.
· It was distributed as a raw MSI, instead of an installer/wizard EXE.
· It required Windows XP SP1 as the minimum OS. There was no support for 2000.
· And, because of a typo, it did not work in Windows XP SP2! Changing an equals operator, =, to a greater-than-or-equals operator, >=, fixed this.
· Plugins were not supported.
· We used a CVS server that was running on an XP box that doubled as one of our development workstations. It was in the EECS computer lab that other people had access to, and we had to tape a piece of paper on to it that said, “SERVER – DO NOT TURN OFF!”
· We did not have a bug tracking system. We either fixed bugs immediately as we saw them, or put them in to an Excel spreadsheet (mostly the former).
· I made the floating windows translucent after observing that most people didn’t even try drawing in the occluded areas when I handed them a tablet PC with Paint.NET on it (“hey you, draw something!”). It was if that area of the canvas didn’t exist. Once the windows were made translucent, this went away! Usability studies really do work.
· For the first month or so of development, the status bar had no information in it. Instead, it had the text: “I am the status bar!!!!!!!!!1111”

Paint.NET v3.31 is now available!

This is mostly a servicing release to fix a few important bugs that have been causing some people a lot of headaches. You can get it in the usual ways: either via the built-in updater (Help -> Check for Updates), or directly from the website: http://www.getpaint.net/.

Changes since v3.30:

* New: Enabled integration with Window Clippings, which is a high quality screen capture utility by Kenny Kerr.
* Fixed: Fixed a crash with the Open/Save dialogs if the Documents or Pictures directories were either inaccessible or if the user did not have certain file system permissions.
* Changed / Fixed: The hotkey for Adjustments -> Levels is now Ctrl+Shift+L instead of Ctrl+Alt+L. This was preventing certain characters, such as the Polish ‘ł’, from being typed.

For this update I’ve also worked with Kenny Kerr to enable integration between Paint.NET and his Window Clippings utility. It now has a built-in “Send to Paint.NET” action so that when you take a screenshot it will automatically send it to Paint.NET without a filename (“Untitled”). Before, this had to be done manually and it was a bit clumsy because it would show up in the File -> Open Recent menu with a long, computer generated file name. It was also tricky to ensure that the alpha channel, which Window Clippings captures correctly for Vista/Aero effects, made the trip correctly.

To kick this off, we also have a special deal — for the month of May we’re knocking $4 USD off the price of Window Clippings for Paint.NET users! Now it’s only $14 USD instead of $18 USD.

You will also see this offer when you install Paint.NET v3.31. I use this program myself, and it saves me a ton of time when I make screenshots, e.g. for the Paint.NET help and documentation. I really like how it automatically captures all of the Vista/Aero effects, such as the transparency and the drop shadow. I highly recommend it.

Paint.NET v3.31 is on the way

I’m shooting to have a version 3.31 release by this Thursday, May 1st. There’s a nasty bug that’s come up in the v3.30 code base that I need to fix! The problem occurs with my use of the native Win32 API, SHGetFolderPathW(). If your Documents or Pictures folder is on a network share, and that path is unavailable (network down, haven’t typed in credentials, etc. etc.), then Paint.NET will almost certainly crash when you go to Open or Save. The fix is simple enough, of course, but this is causing a lot of headaches and an inbox full of crash logs for me.

In other news, the weather here in Kirkland is great* and I’ve got the week off. I can finally reliably finish Green Grass and High Tides in Rock Band on Expert (4 stars), and Grand Theft Auto IV comes out tomorrow.

* Well, for now … who knows what tomorrow will be like!

Paint.NET merchandise store is now open!

I signed up for a Cafepress account awhile ago but never got around to adding merchandise to it. This weekend, I finally uploaded all the images and set up the products:

The Official Paint.NET Merchandise store: http://www.cafepress.com/paintdotnet/
Paint.NET Merchandise Store

There are shirts, a mouse pad, mugs, stickers, buttons, hats, and a tote bag. If you have feedback on the selection, either leave a comment or join the discussion on the forum here: http://paintdotnet.forumer.com/viewtopic.php?f=12&t=24051

Over the next week I’ll add links to the store added in other places, such as the main website. For now I’ve got the link here on the blog and on the forum. Cafepress doesn’t leave much room for profit, so this is mostly a promotional tool. Which means that if your intent is to send $20 to Paint.NET then we’re both better off if you donate directly. Purchasing a $19.99 shirt via Cafepress only nets me $1 or $2. If you want a shirt, then by all means buy one – but if you want to donate, then just donate 🙂

I’m not sure why I didn’t do this two years ago, it was rather easy to set up and the response so far has been very positive.

Paint.NET v3.30 — Final release now available!

It’s finally here! You can grab it via the built-in updater from the Help-> Check for Updates menu item, or go get it straight from the website at http://www.getpaint.net/

Enjoy!

Changes since v3.22:

  • New: Italian translation.
  • New: Ability to save PNG’s at 8- and 24-bit color depths.
  • New: Ability to save BMP’s at 8-bit color depth.
  • New: "Auto-detect" bit-depth option for PNG, BMP, and TGA file types. It will analyze the image and determine the lowest bit-depth that can still save the image without quality loss.
  • New: "Fragment" blur effect, by Ed Harvey
  • New: The "Polar Inversion" distortion effect has been enhanced to allow changing the rendering offset, and the behavior for "edge" pixels (clamp, reflect, or wrap).
  • New: For developers, added a Color Wheel control to IndirectUI for use in effect plugins.
  • New: For developers, added ability to customize certain properties of the effect configuration dialog via IndirectUI.
  • New: For developers, IndirectUI can now be used to write configuration UI for file types.
  • New: For developers, IndirectUI has a new radio button control type for enumerations, and some new property constraint rules.
  • Changed: Most effects and adjustments, including plugins that use IndirectUI, have been visually refreshed. The new look is cleaner and more compact. These changes are shown in more detail at https://blog.getpaint.net/2008/03/10/cleaning-up-the-ui-for-paintnet-v330/
  • Fixed: Various UI issues with the Levels adjustment.
  • Fixed: When pasting text into the Text tool with Ctrl+V, it would hide the nub for moving the text.
  • Fixed: If the startup tool was set to the Zoom or Pan (Hand) tool, then the toolbar would render incorrectly.
  • Fixed: Thumbnails for PDN images now include transparency, which improves their appearance in Windows Vista.
  • Fixed: In some cases, an exponential property slider would get "stuck" at some values when using up/down keyboard keys. This mostly affects some effect plugins.
  • Fixed: When using keyboard navigation, sometimes the File menu would scroll its items out of view.
  • Fixed: Some crashes that were tracked down to out-of-bounds coordinate values in certain effects.
  • Fixed: The installer would fail if Paint.NET had never been installed before, and was being installed to any non-default directory. This bug only affected version 3.22.

Paint.NET v3.30 Release Candidate 1 is now available!

Well this has been an interesting release to push out the door … all sorts of interesting hurdles have come up including hardware threatening to fail, myself being really busy with other cool stuff at my day job, translators with food poisoning (they are better now thankfully!), and pyrochild’s computer refusing to work with a test build (pyrochild is an active and popular member of the Paint.NET forum). Have no fear though, it’s almost ready to go! I had a few code changes since Beta 2 so I decided to push out a Release Candidate instead of a "Final" build tonight. If all goes as planned, the final release will be pushed out this weekend.

As usual, you can get this build from the built-in updater (Help -> Check for Updates), or by downloading it straight off the website: http://www.getpaint.net/

Changes since Beta 2:

  • Fixed: Various UI issues with the Levels adjustment.
  • Fixed: When pasting text into the Text tool with Ctrl+V, it would hide the nub for moving the text.
  • Fixed: If the startup tool was set to the Zoom or Pan (Hand) tool, then the toolbar would render incorrectly.
  • Changed: Enabled some compiler settings which improve security via support for DEP (/nxcompat), and Windows Vista’s Address Space Layout Randomization feature (ASLR) (/dynamicbase).

As an aside, on April 1st the GIMP website had an interesting version of the Wilber image, and I have adopted it for my forum avatar for the time being …

Validating .NET/RESX translations easily with LINQ-to-XML

One of the tools I finally decided to sit down and write was a "ResXCheck" utility. RESX files hold the string resources for many .NET programs, including Paint.NET. At build time, these are compiled into a binary format and then stored in a DLL, or a RESOURCES file (Paint.NET uses the latter). The binary format is simply more efficient to access at run-time, and resgen.exe can even be used to convert between the two formats.

Essentially, a RESX is an XML files with a big list of name/value pairs. I will refer to these as string names, and string values. The XML looks like this:

<data name="GradientTool.HelpText">
  <value>Click and drag to start drawing. Holding shift constrains the angle. Right mouse button reverses colors.</value>
</data>
<data name="GradientTool.HelpText.WhileAdjusting.Format">
  <value>Offset: {0}{1} x {2}{3}, Length: {4} {5}, Angle: {6}°. Holding other mouse button will move both nubs.</value>
</data>

The RESX files for translations are in the same format and should have all the same string names. The <value> elements should have different text in them however (it should be translated!). At runtime, both the translated and original RESOURCES files are needed — the latter is used as a "fallback" in case a string is not defined in the translation. Whether this is an error is up to your translation process and resource loader code. Sometimes you want that behavior, such as if you have the base "EN" (English) translation and then some strings must vary for "EN-US" (U.S. English) or "EN-GB" (British English). You can store common string definitions in "EN", although usually it is better to completely duplicate the content, and use a tool to maintain the duplication.

Having worked with RESX files on Paint.NET and elsewhere, the following problems come up:

  1. You could use the same string name twice. The RESX compiler will simply grab one of them, either the first or the last (I can’t remember). This is a problem if you go to update a string later and you change the wrong one. Then, your changes might not show up in the main program and you won’t know why. And you’ll have a heck of a time figure it out.
  2. A translation could be missing some string names. If this happens, generally the fallback text (usually English) will show up. That is probably not the desired behavior, although in Paint.NET there are a few places where it’s okay. Translating a technical acronym for a pixel format, such as "A8R8B8G8", isn’t really necessary.
  3. A translation could have extra string names defined. This is likely to happen if strings are removed from the original RESX, but the translation hasn’t been updated yet. This will not cause any errors, it is just extra cruft that can accumulate if you don’t pay attention (most professional translation teams have tools which handle this case automatically).
  4. A string value could have "malformed" formatting tags. In the XML listed above, the second text has formatting tags such as {0} through {6}. These represent values which must be supplied at runtime by the application. There are two hazards here. One is that you could have formatting that String.Format(…) doesn’t like, such as having a { without a closing }, or vice versa. The other hazard is if a translation defines extra formatting tags, such as if a {7} was added above. Then your application will crash when it goes to apply formatting to that string. This is mostly a problem when strings have not yet been updated for a newer version. The translation may define fewer formatting tags, and this may or may not be an error. You may have a formatting tag that represents a piece of text that is not necessary to display in a particular translation.

Luckily, all of these can be checked for with some simple automation, which is what I have done with ResXCheck. I will be including its code in the next Paint.NET source code drop (for v3.30), and plan to tag it as "public domain" (just the utility, not Paint.NET itself). In the mean time, here’s a little utility function that can help you load a RESX and convert it to an IEnumerable of type KeyValuePair<string, string> (duplicate string names are not removed — this is important for being able to check #1 above).

using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using System.Xml.XPath;

// Given a file name for a RESX, returns a non-consolidated list of string name/value pairs.
IEnumerable<KeyValuePair<string, string>> FromResX(string resxFileName)
{
    XDocument xDoc = XDocument.Load(resxFileName);

    var query = from xe in xDoc.XPathSelectElements("/root/data")
                let attributes = xe.Attributes()
                let name = (from attribute in attributes
                            where attribute.Name.LocalName == "name"
                            select attribute.Value)
                let elements = xe.Elements()
                let value = (from element in elements
                             where element.Name.LocalName == "value"
                             select element.Value)
                select new KeyValuePair<string, string>(name.First(), value.First());

    return query;
}

To check for duplicates, a simple query such as the following is all that’s needed:

var resx = FromResX("strings.resx");

var dupeItems = resx.ToLookup(kv => kv.Key, kv => kv.Pair)      // 1
                    .Where(item => item.Take(2).Count() > 1)    // 2
                    .SelectMany(item => item.Select(val =>      // 3
                    &
#160;   
new KeyValuePair<string, string>(item.Key, val.Value));

// 1 — converts from KeyValuePair<string, string>[] to IEnumerable<IGrouping<string, string>> — essentially a list of keys, each of which has a nested list of values
// 2 — finds any key which has 2 or more values in it. the "Take(2)" is an optimization
// 3 — convert back to a list of key,value pairs (probably not necessary if you use the "T-SQL" style syntax)

You can then do a foreach() over this virtual list and print out the key,value pairs. I could have written that query using the more succinct "T-SQL" style query syntax, but I hadn’t yet learned it when I wrote that part of the code. ResXCheck was a little project I took on to force myself to learn more about LINQ. Surprisingly, it only took about 2 minutes to learn the more compact query syntax.

I’m quite happy with LINQ. It’s letting me do some powerful data manipulation with very succinct, expressive code. And it’s very simple! I’ve already found a few mistakes in my RESX files, and they will be easy to fix. This tool will also help volunteer translators who publish their translations on the forum. I know it is hard to validate these things for correctness sometimes, especially for problem #4 list above.

Oh and for fun I made the utility parallelize the processing so you can validate "N" number of translations at the same time. Sadly, on my quad-core box it only dropped the validation time from 560 milliseconds down to 300. If I only have 50 more translations, then I could really stress it! 🙂