comments edit

I’m sure you’re constantly asking yourself this, because I certainly wake up every morning in a cold sweat wondering. When you add a new project in Visual Studio.NET 2003 (friends call her VS.NET), you get the following dialog

Add New Dialog \ The beginnings of another bug ridden coding section…

Now looking at that familiar dialog underneath the “Project Types:” section, you probably noticed the usual suspects are there: “Visual C# Projects”, “Visual Basic Projects”, etc… But did you also notice there’s a few other folders there such as “Visual C# Projects for DotNetNuke 3”?

Now for the million dollar question: How do you add your own folder there?

Reading through what I could find online, I understand how to use your .vsdir and .vsz files to create a new template, but I couldn’t find anything that described how to create your own project type grouping.

So I did a little digging through the registry and found the following registry location:

HKEY_LOCAL_MACHINE\
    SOFTWARE\
        Microsoft\
            VisualStudio\
                7.1\
                    NewProjectTemplates\
                        TemplateDirs\

Just to make sure that adding keys to this location in the registry was sufficient, I brashly took Regedit (without even backing up my registry, an incredibly stupid thing to do), and created a new sub key, using SQL Query Analyzer and the newid() function to generate a new GUID for me. Under that key I added a sub key named “/1”. Under that key I set the following three values as seen in this screen shot.

Registry Settings \ Must this egotistical idiot use his last name in everything?

And here you can see the registry keys structure. The one I added is at bottom.

Registry Keys \ Ahh, “Haack” is nowhere to be seen. Forturnately it’s not a proper GUID.

So the next step is to create a VS.NET Setup and Deployment project to package my templates and add this registry setting automatically. Hope you can sleep peacefully now.

comments edit

I will neither confirm nor deny that this is where I used to work before going independent. I’ll only say that they’ll be doing some interesting work with .NET and it’s worth checking out.

We are looking for Software Engineers. If you have a minimum of 3-5 software development experience - including at least 2 years of C#, ASP.NET and SQL Server and if you are interested in a position in Los Angeles (right near Miracle Mile) please post a comment.

[Via wagnerblog.com]

comments edit

fire hose In my post entitled Drinking From an RSS Fire Hose I dealt with some of the issues surrounding the flood of incoming RSS entries within an RSS aggregator raised by Dare’s post “Nightcrawler Thoughts: Thums Up, Thumbs Down and Attention.xml”.

The Keep It Simple Stupid Solution\ Reading through some of the comments on both posts, I realize that for a great majority of users, a very simple system will satisfy their needs. One user mentioned that it’d be nice to be able to have items with specific keywords automatically marked as read. This is great if you’re tired of hearing about, say, Paris Hilton. Add the keyword “Paris Hilton” and no longer will you have to endure her name in your aggregator.

A Short Story\ I started to get a buttload of comment spam on this blog recently. I thought about using CAPTCHA, Bayesian Spam Filtering, etc… But in the end, I simply added a trigger modified from this one that simply blocks posts with a certain number of link. This resulted in a dramatic decrease in the number of posts about online poker and has been working quite well for me. At some point, I’ll probably need to employ more sophisticated tactics, but for the time being, this simple rule works.

Extensibily Model\ Personally, I think the initial solution isn’t a filter at all, but the extensibility model prototyped by Torsten.

Rules Engine\ On top of this, I’d probably build a simple rules engine plug-in similar to Outlook’s. For example, you might create a keyword rule associated with one of the following actions: Mark as Read, Flag For Review, Give Priority, etc… As my short story above illustrates (see, there was a point to it), a simple rules engine approach will often give you the 80% of the 80/20 rule.

The Goal\ The goal with this approach is to get something to the users quickly that will elicit feedback on what the pimped out “baysesian/collaborative/neural networked/throw dart at dartboard” filter should do. A collateral benefit is that users will inevitably create their own plug-ins (we hope) and we have the option to take the best ideas and integrate them as a first class feature.

[Listening to: So What’cha Want - Beastie Boys - Check Your Head (3:37)]

comments edit

Did you read about the Chinese online gamer who stabbed a competitor after the competitor sold his borrowed virtual sword?

One phrase in the article caught my attention:

But other experts are calling for caution. “The ‘assets’ of one player could mean nothing to others as they are by nature just data created by game providers,” a lawyer for a Shanghai-based Internet game company was quoted as saying.

I don’t buy that argument as I told my friend Walter who wrote about this from a legal perspective. The argument that the “assets” of one player means nothing to others just because its virtual actually applies to all property, physical or otherwise.

If society in general decides that virtual assets are somehow inherently different than physical assets, then it behooves the gaming companies to create a microcosm of the real world within the virtual space. Think about it for a second. If I’m paying $20 to $40 a month (not to mention my time) to play some online game, I want to make sure that if someone swindles me of property that has real-world market value, I have some means for recompense.

Can you picture it? Using a portion of the online gaming fees, these gaming companies might neet do hire virtual police force where characters can resolve violations of the “law”. Likewise you might start a character to be a virtual lawyer to handle arbitration between characters. Heck, I’d probably create a character and provide consulting work within the virtual market

Look, your dragon slaying operations is suffering from bottlenecks at the weapons manafacturing plant. I’ve got some magic potions here that will integrate your Dwarven procurement system with an EERP (Elven ERP) system providing efficiencies in your supply chain. I can also build you a portal.

The problem with this of course is that a game world is not meant to be like the real world. For example most MMORPGs involve a lot of killing. Some even allow killing other characters. If my character were to kill your character and then take your stuff, should you be able to sue me for the real-world material value of your character’s possesions? That would certainly put a damper on the game.

I don’t think many game companies anticipated that virtual assets would command such real world market value and did not prepare for thes scenarios. It seems to me that they ought to require waivers from players indemnifying all other players and the company from any loss involving virtual assets. Either that, or put an in-game arbitration system in place and have players sign waivers stating they agree to resolve disputes via the in-game system first.

comments edit

Forgive me, but I really need to rant about shitty customer service. I’ve been burned bad by misinformation from ignorant and/or misleading reps. This time however, it involves our credit card company, Bank of America.

We received one of those offers where we can take a $10,000 loan for 6 months with no APR. Since we needed a short term loan we thought, “Hey, we’ll take that, use part of it, put the rest in the bank, earn interest on it, then pay it back in 6 months.”

Does a six month interest free loan of $10K sound too good to be true? We thought so. So we called customer service and double checked. We ran through various scenarios including asking,

So if we take this loan, and say make $1000 in purchases using our credit card, at the end of the month, if we only pay $1000 towards our credit card bill, we won’t have to pay interest, right?

The reply?

Yep

So we don’t have to pay the entire balance each month which would include this $10K loan, right?

That’s correct.

It’s a good thing we double checked today. It turns out in the fine print, “which we read multiple times”, there was this opaque clause that now makes sense since I know what it means:

By making a balance transfer and/or using these checks, you understand that future payments will be applied to Promotional balances prior to any existing or new regular balances on the account.

So simply put, if we take the loan, and make $1000 in purchases, and then pay $1000 towards our bill, we’ll now have $9000 as an interest free loan and a $1000 balance generating tons of interest.

Now you might say that’s what you get for not reading the small print. Perhaps. But it bothers me that the amount of effort they put forth into making the message clear that this is a “0% Promotional APR for 6 months!!!” dwarfs the effort to make the big catch very clear.

It was obvious to me that they want consumers to take the loan and then not be able to pay it off at the end of 6 months because they want interest paying customers. But I figured we’d be safe if we paid it off in 6 months. Not so. What infuriates me is that we called customer service and they egregiously misinformed us (which is a pattern with some other financial institutions I’ve dealt with).

In any case, we’ve figured out an easy way to take advantage of this offer and get a $10,000 loan free for 6 months. Simply take the loan with no balance on the card and stop using that credit card for 6 months till you pay it back. Use another card. I think it’d be great if thousands, nay millions, of people did just that and sent a big “Fuck You” to B of A. But that’s just me being vindictive. Not to mention I’d have to get a Slashdot sized crowd to read this. ;)

Ok, rant over. Thank you for your patronage.

comments edit

Jason Clark enlightens us on creating a stable application entry point at the wintellect blog. I highly recommend reading the whole discussion, but one of the key takeaways is…

A Stable Entry Method

Fortunately it doesn’t take too much effort to make your entry method stable. Here are some guidelines:

  1. Avoid type-loads of any kind in Main. Main should only call methods implemented in the same type definition.
  2. Do not implement a static constructor in the type that contains Main. (Avoiding static fields entirely is the safest way to go).
  3. Derive the type that contains Main from Object. This means that you need to hoist Main out of the type definition for your main form if you use Visual Studio .Net wizards to create your project.
  4. Keep the type that contains Main focused on getting your application started. Don’t think of it as the “Application” type that holds your application-level state.

[Via Wintellog]

comments edit

I’ve been playing with DotNetNuke at home and after an hour or two, VS.NET 2003 is typically using up around 150 to 200 MB of RAM as well as 200 MB of virtual memory. Web development on VS.NET is a big memory hog when the project size gets large enough.

Since I’m running on a paltry 512 MB of RAM (since when did 512 MB of RAM become paltry? I spent $99 to upgrade my Amiga from 512 KB of RAM to 1MB, but I digress) I thought it’s about time to upgrade my system.

Looking at prices today, I found a nice deal on a 2GB Kingston kit (2x1GB) for $278.98. Not a bad price, eh? I’m wondering if 2GB is just plain overkill. Then again, if I run some virtual pc instances, I might want that extra memory.

Compare this to a Kingston 1GB kit (2x512MB) for $94.48. 1GB is a lot cheaper. I should mention that I have a 800 MHZ FSB so I’m looking at PC3200 DDR 400 memory cards.

Oh, and this post is my new personal record for number of acronyms in a post.

[Listening to: Sapphirecut - Free your mind - Danny Tenaglia - Back To Basics (CD2) (5:45)]

comments edit

Good ideas get coopted. That’s what they do. For example, JUnit was coopted by the .NET community and ported into NUnit. However in NUnit 2.0, the .NET community innovated with the usage of attributes.

Now Java has caught up with TestNG (thanks to Kyle for pointing me to this). With the brand spanking new version of Java out there (JDK 5.0 aka Tiger), Java now has Annotations. This is pretty much equivalent to Attributes in .NET. TestNG takes advantage of Annotations and builds a unit testing framework around them that looks quite familiar if you regularly use NUnit 2.*.

And I’m certain both these platforms have borrowed ideas from even older platforms.

comments edit

ReSharper is no longer going to be the super bargain it currently is as they are raising the price. Even at $149, it’s a worthwhile product. But if you see yourself doing development with VS.NET 2003 for a long while (and don’t kid yourself, you will be), I highly recommend giving this product a twirl.

Well, the time has come for ReSharper to return to its originally intended price of $149 USD. The current $99 USD price was planned to be an introductory offer for the first month of its release, but we were having so much fun spreading ReSharper’s angelic features to the .NET world, we just kept it that way for the last 9 months! Womb jokes aside, we’ll be offering free upgrades from ReSharper 1.x to our new baby, ReSharper 2.0… is that a deal or what? And seeing that we don’t like to be spoil-sports, we are giving a month long warning before the new price goes into effect on April 5th, so take advantage of the $99 offer now, while supplies last - and don’t forget to tell your friends.

Get it here: http://www.jetbrains.com/resharper/buy/

-The JetBrains ReSharper Team

[Via JetBrains News]

comments edit

Today Akumi and I hiked the Paseo Miramar trail. To get there, simply take the PCH North till you get to Sunset. Take a right onto Sunset, and go up a little ways till you see Paseo Miramar on the left. Take it till it dead ends and look for street parking.

The trail itself almost instantly has gorgeous views of the Pacific and the coast line of Santa Monica. Unfortunately, today was a bit hazy. I was hoping for the clarity that most assuredly would have been the result had we hiked just after the rains.

The hike itself is around 5 miles (round trip) and at the end you’re greeted with a nice overlook.

Paseo Miramar Hike

On the way back, we met one of the native inhabitants of the Santa Monica Mountains.

Snake

comments edit

Chivas vs Osasuna soccer game

Went to watch a friendly between Chivas USA and Osasuna of La Liga (Spanish premier league) at the Home Depot Center Saturday night. Thanks to a soccer buddy Ed (who happens to work for Fox Sports World), Akumi and I were sitting in some pretty nice seats. Near the end of the rather unexciting game, we were invited by Ed’s friend to see the luxury suite. And when he said “THE” luxury suite, he wasn’t kidding. It was the stadium owner’s double sized suite right on the 50. Very nice.

code comments edit

Saw this post on Consult Utah’s Weblog

Is anyone else getting tired of writting:

...
private bool _autoAccept;
...
public bool AutoAccept 
{ 
  get {return _autoAccept;} 
  set {_autoAccept = value;} 
} 

I’ve pretty much decided that it is just preferable in these cases to just make the member variable public.  I’m am being bad?  ;-) 

My answer? I think he should be publicly flogged, smeared with tar and feather, and paraded around town in a pink tutu.

Ok, that might be a bit extreme. I don’t really believe that.

I think using a public field is fine in some cases. If the interface is unlikely to change. If you’re not writing library code. etc… If you can easily refactor it later if necessary. I’m not a complete and total purist about this.

Now before you OO purists get on my case, I’d like to point out that I always use full properties because I HATE FxCop warnings in my code. ;) Also, I have a nice little code expansion template in Resharper. I simply type

prop<TAB>

and I get a full expansion of the property, allowing me to fill in the type and private member name. You can see a description here.

Resharper also has an ALT+INSERT shortcut for generating code snippets, but I find my little expansion to be faster for me.

Although I’m not an OO purist nazi, I do think that the encapsulation benefits of properties are worth the trouble, especially when they aren’t much trouble.

comments edit

A while ago I introduced you to Twiggy, our skittish Italian Greyhound. Well she’s no longer the skittish type. Skittish was so five minutes ago she tells us. Now she’s acting more like her full sized Greyhound cousins by being a total couch potato.

Especially now that I work from home and she’s free from her exercise pen during the day. Her main agenda item for the day is making sure to find a nice sunbeam to lay in as evidenced in this photo taken today.

Twiggy Finds Her Beam

She works very hard to stay in the sunbeam as evidenced by this photo taken two days ago.

Twiggy struggles for the beam

I’m trying to get her to pull her own weight around the house. She eats, sleeps, pees, and poos but doesn’t give anything back. So I tried to get her to write some code for me while I went to get a drink, figuring I could give the client a discount for work she does, but this is how I found her when I got back. Lazy dog.

Twiggy Sleeps On The Job

comments edit

Firehose So now that you’ve subscribed to your 4000 feeds, how do you keep on top of the flood of incoming items? Dare talks about this, “the attention problem”, that faces power users of RSS (and ATOM) aggregators such as RSS Bandit.

Ideally a user should be able to tell a client, “Here are the sites I’m interested in, here are the topics I’m interested in, and now only show me stuff I’d find interesting or important”. This is the next frontier of features for RSS/ATOM aggregators and an area I plan to invest a significant amount of time in for the next version of RSS Bandit.

One way to think of it is that there’s a cacophony of content out there. You want an automated system to filter out the noise and allow through the music.

There are several difficulties inherent in any automated system designed to filter content based on your tastes and preferences. Often times, you don’t really know what you like till you see it. So how does the automated filter know if you’re going to like something or not? Well, you can train it by rating items. You can perhaps incorporate ratings of others. You can build rules about which content you like and dislike.

All of these methods run into the problem that your likes and dislikes tend to evolve and change over time as a product of your life’s experience and automated filters tend to narrow the items they allow through. If you set up hard rules for filtering data, you need to make sure to change them over time. A constant task of tweaking. If you’re using a system that requires you to train it based on an initial set of sample data, you have to make sure the training set is not to small or narrow. Otherwise the filter will only bring in items that meet some narrow facet of your personality. Collaborative filters are particularly prone to this problem. Think of how drab a lot of music on your mega-radio stations are today, a result of a gigantic collaborative filter. I doubt I could train a human to filter items for myself, much less an automated system.

This is not to say that filters can’t do a half-way decent job of being a personal editor. They can. The point here is that a really good filter has to allow a bit of noise through. My favorite radio station right now is KCRW, especially the show Metropolis. I don’t necessarily like everything Jason Bently spins, but I’m constantly being introduced to music that I’ve never heard of that I end up really enjoying. I believe that’s a result of a filtering system (human DJ) that allows some bit of noise through in order to expose listeners to new items.

Some noise is essential to a good content filtration system.

In any case, the effort to add filtration to RSS Bandit is of particular interest to me. Having studied Bayes theorem and read up a small amount on autonomous agent systems, I’m really excited about the potential for intelligent filtering in RSS Bandit. In particular, one method of filtering I like is creating de-facto editors via assignment. For example, like Dare, I read everything by Don Box. So I might assign a rule that always includes items by Don. But I might also go a step further and think that anything Don links to will probably be of interest to me, so I might state that everything he links to should be subscribed to automatically (perhaps based on my filtering rules based on how much I trust Don). Effectively, Don becomes an editor for my aggregator (without even knowing so). He becomes a content DJ.

comments edit

In part 1, I bored you with excrutiating detail about how we keyboard shortcuts are implemented in RSS Bandit. In this second more exciting part, I’ll outline how to use a tool I wrote for editing shortcut settings. You can consider it sort of an unofficial RSS Bandit Power Toy. When we really nail down a nice UI for editing shortcuts, we’ll possibly add this as a configuration dialog within RSS Bandit. But for now, this is an experimental utility, use at your own risk.

To get started with the utility, download a debug version here.

First Time Usage\ Figure 1 shows a screenshot of the editor as it looks when you first run it (assuming you don’t already have a ShortcutSettings.xml file in your application data path). When you launch the editor, it automatically checks the default application data folder for a file named ShortcutSettings.xml. In this case, none was found so everything is blank.

Shortcut Editor - First Time \ Figure 1: Shortcuts Editor, no file specified.

Create a ShortcutSettings File\ The next step is quite simple, click on the Create button to specify a location to save a copy of the default settings file. The Save File dialog opens in the application data directory (see figure 2). This is where you’ll want to save the settings file unless you’ve modified your RSSBandit.exe.config file and specified a different location for RSS Bandit’s application data by adding an appSetting entry for “AppDataFolder” (generally not recommended).

Shortcut Editor Save Settings
Dialog \ Figure 2: Shortcut Editor Save Settings Dialog.

Modify Settings\ Once you click the “Save” button, you’ll see that the “Menu Shortcuts” and “Filter Shortcuts” are populated. Setting a menu shortcut is as simple as selecting the command you want to change in the “Command” droppdown and selecting a new value in the “Shortcut” dropdown and then clicking the “Set” button.

Setting Filter Shortcuts (PreFilterMessage method) works a bit differently. Next to the “Command” dropdown you’ll see a list of “Keys”. Each entry in this list corresponds to a <keyCombination> entry in the config file (as discussed in part 1). To add a new entry, click on the “Add” button which brings up a Shortcut Entry Form as in figure 3.

Shortcut Editor Entry
Form \ Figure 3: Shortcut Editor Entry Form.

This little form implements IMessageFilter itself, so when you click in the text area, it interprets your keystrokes and displays the keys you’ve pressed. You can specify a key combination by pressing the individual keys one at a time. For example, if you wanted a command to be invoked by pressing ALT+F4+F5 all at the same time, you’d type ALT followed by F4 followed by F5.

When you are satisfied with your key combination, click “OK”. This will result in a new key combination being mapped to the command as shown in the closeup in Figure 4.

Shortcut Editor Detail With New Filter
Entry \ Figure 4: Shortcut Editor Detail With New Filter Entry.

Saving Your Settings\ Finally, don’t forget to click the “Save” button to save your new settings. This will bring up a dialog (like the Create button did) allowing you to specify where to save the file. Feel free to save multiple versions of these settings files and share them with friends and family.

If for some odd reason, a change you make causes RSS Bandit to crash a horrible flaming death, merely delete the ShortcutSettings file or Create a new one and start from scratch.

Conclusion\ If you’re a keyboard control maniac, I hope this temporarily satisfies your thirst for being able to configure keyboard settings within RSS Bandit. As this is an ongoing project, there will be improvements and your suggestions will be taken into consideration.

comments edit

Keyboard You might not know this, but RSS Bandit supports customizing keyboard shortcuts via an XML configuration file. The reason you might not know this is because it is an undocumented feature. Since I implemented adding customizability to keyboard shortcuts, I thought I might as well document how it works as of version 1.3.02.26.

First, I’m going to delve a bit into how Keyboard shortcuts are implemented in RSS Bandit before I highlight a tool I wrote for modifying the settings without having to dink around with the XML. As you read this discussion, imagine that I’ve placed a

using System.Windows.Forms;

at the top of this article. (Or for you VB.NET lovers out there, an Imports System.Windows.Forms).

Methods of Handling Keyboard Events\ There are two methods for handling keyboards shortcuts in RSS Bandit. The first is by simply setting a Shortcut property of a MenuItem instance to a proper Shortcut enum value. Perhaps a very simple example will make it clear.

MenuItem item = new MenuItem();

item.Shortcut = Shortcut.AltF4;

In the above example, the key combination of Alt and F4 is mapped to a menu item. When the user presses the key combination of ALT + F4, that is equivalent to the user clicking on that menu item.

The second method is by implementing the PreFilterMessage method of the IMessageFilter interface on the main form.

This method allows us to intercept Windows messages (specifically keystrokes) before they are dispatched to a control or the main form. Here’s a snippet of the implementation of the PreFilterMessage method:

public virtual bool PreFilterMessage(ref Message m) {

    bool processed = false;

    const int WM_KEYDOWN = 0x100;

    const int WM_SYSKEYDOWN = 0x104;

 

    try {

        if (m.Msg == WM_KEYDOWN   m.Msg == WM_SYSKEYDOWN) {

           

            Keys msgKey = ((Keys)(int)m.WParam & Keys.KeyCode); … SNIP …

At the end of this snippet, you’ll notice there’s a variable named msgKey of type Keys. This is a bitmask of the pressed keys that we’ll use to determine which shortcut is being invoked. Make note of it as we’ll mention it again later.

Associating Settings to a Command\ Ok, so now that we have a rudimentary understanding of how the code can handle a keyboard event, let’s look at how we configure the settings. As you might guess, we have two ways to configure a keyboard shortcut based on whether it falls under method 1 or method 2. In both cases, a keyboard shortcut is associated with a command name. For example, the “cmdCloseExit” command closes and exits RSS Bandit. Since there’s a menu item associated with this command, we simply associate a Shortcut enum value to it.

For the command “GiveFocusToUrlTextBox”, however, we need to use the PreFilterMessage approach. So we specify a comma separated list of Keys enum values. In this case, we have two different key combinations mapped to that command - F11 or Alt + D.

App Data Path\ These settings are configured in a file named ShortcutSettings.xml. In a default installation of RSS Bandit, that file is compiled into the executable as a resource. However, you can override the default settings by placing a file named “ShortcutSettings.xml” (in the correct format) in the User Application Data folder for RSS Bandit. On my system the path is

C:\Documents and Settings\Phil\Application Data\RssBandit\

This file is a bit fragile, so be careful if you modify it by hand. It requires that every shortcut command have a definition. Below is an example that shows the structure of the shortcut settings file. You’ll notice that under the root <shortcut> node, there are two main nodes: <menu> and <keyboardCombinations>

<?xml version="1.0" encoding="utf-8" ?> 
<shortcuts>
    <menu>
        <shortcut display="true">
            <command>cmdNewFeed</command>
            <shortcutEnumValue>F4</shortcutEnumValue>
        </shortcut>
        ... more shortcuts ...
    </menu>
    <keyboardCombinations>
        <shortcut>
            <command>GiveFocusToUrlTextBox</command>
            <keyCombination>F11</keyCombination>
            <keyCombination>Alt,D</keyCombination>
        </shortcut>    
        ... more shortcuts ...
    </keyboardCombinations>
</shortcuts>

Now we get to the reason for that whole discussion of the two types of shortcuts. In order to configure a shortcut correctly, you need to know which type it is, which is easily done by looking at the existing ShortcutSettings.xml file.

Configuring a Menu Shortcut\ Configuring a “menu” shortcut is very easy. Just specify a valid Shortcut enumeration value in the <shortcutEnumValue> node.

Configuring a Keyboard Combination Shortcut\ Configuring a shortcut that’s invoked via PreMessageFilter’s a little more complex. First of all, it’s possible to have more than one key combination map to a single command. Hence the multiple <keyCombination> elements. For each <keyCombination> you can specify a comma separated list of valid Keys enumeration values.

One thing to note with the keyboard combination shortcuts is that it is possible (in some cases) to have the same key combination mapped to two different commands. This is because some commands are dependent on which control has focus. Unfortunately, the dependency of a shortcut on a control is not clearly mapped via the configuration file. That is definitely something worth looking into for a future release. The potential drawback to adding a controlname to the settings schema is the performance penalty of using reflection to determine if a control has focus. The potential benefit is that it may enable the code to be cleaner in the PreFilterMessage method.

Invoking a Command\ So now you’re ready to press a key on your keyboard, what happens next? Well in the case of a menu shortcut, that’s handled by the operating system. For the nitty gritty, check out this blog post. The menu items are assigned their shortcut value via the ShortcutHandler class I wrote. This class reads in the configuration file and a menu item is mapped to its Shortcut enum value by simply calling

public Shortcut GetShortcut(string command)

In the case of a keyboard combination shortcut (i.e. PreMessageFilter), things are a little more tricky. We have a big chain of if else statements that run through the commands and checks each command to see if it was invoked and if the control associated with that command has focus (see snippet below).

if (this.listFeedItems.Focused && _shortcutHandler.IsCommandInvoked(“CollapseListViewItem”, m.WParam))

The IsCommandInvoked method first extracts a Keys enum bitmask from the m.WParam value passed in, which represents the keys that the user has pressed and is equivalent to the msgKey variable described earlier (I told you I’d get back to it). Afterwards, it iterates through each <keyCombination> value associated to the command being checked and combines the comma separated values into a Keys enumeration bitmask. This bitmask is compared to the extracted bitmask. As soon as a match is found, it returns true, otherwise it returns false. In this manner, we can determine which command is being invoked by a key combination.

Ok, So How Do I Configure Keyboard Settings Without Mucking Around With XML?\ Well now that I’ve given you this background, which probably contains more than you’ll ever want to know about how keyboard shortcuts are implemented in RSS Bandit, I must defer to part 2 of this series where I describe a simple utility I wrote for setting up shortcuts.

comments edit

Forgive me for not doing a thorough search for prior art, but I noticed this post by Oleg Tkachenko in which he’s in need of a decent server-side aggregation code base.

The reason it caught my attention is that “server-side” is my specialty. That’s where I’ve spent the great majority of my time in my various day jobs. But doing server-side work is like living underground. Every once in a while, you need to get cleaned up, shave, and poke your head aboveground and let humanity see your face. That was partly my motivation in haacking on RSS Bandit. I wanted to get more exposure to working on a “client-side” product. (The other part is that it was such a kick-ass product, I had to get involved.)

Taking the core RSS Bandit “NewsComponents.dll” and slapping it on a server for simple server-side aggregation probably wouldn’t take much work at all. What’s would be more interesting (and a lot more work) is taking it a step further and building a full-featured web-based aggregator.

Using so called “Ajax” techniques (which is really just a repackaging of existing technologies, including Microsoft’s proprietary XMLHttpRequest object and should be called POXSCRIPT for Plain Old Xml and Scripting), I can envision a web-based RSS Bandit that looks and functions quite similarly to the rich client. We could call it “RSS Bandit Web Access” as a nod to “Outlook Web Access”.

Now, the need for such an undertaking is dampened by the fact that RSS Bandit has a very nice synchronization mechanism so that using it from multiple computers isn’t a huge pain. Necessity being the mother of invention, this feature makes it so that I personally don’t see a web-based version as a huge necessity.

The other dampener is that I do have to pay my bills via billable work now. This would be the type of project I’d love to dive into and work on full time. The temptation would probably be too great and I’d neglect so many responsibilities to do so, becoming that underground mole I mentioned earlier. ;)

Anyways, this is just food for thought. How popular would such a package be? How many people have a web-server to install it on?

[Listening to: Intec Jimpy / Talkin (Terrantella Vs Redanka Remix) - Sasha - Global Underground Ibiza CD 1 (7:03)]