Microsoft Screwed Up Activities API Docs - It's addService NOT AddService

UPDATE: jst ROCKS! - I was able to do exactly what he said and I now have both cases of APIs working in my extension.

OK, this is really starting to bother me because Activities are starting to show up and they don't work on Firefox because Microsoft screwed up the documentation.

The correct syntax for adding an Activity (per my conversation with Microsoft) is:

window.external.addService('FindInWikipedia.xml');
as documented here
NOT

window.external.AddService('FindInWikipedia.xml');
as documented here. (I have no idea what the whitepaper says - I can't agree to the license agreement.

Note the lowercase a at the beginning. Even though both work on IE, USE THE LOWERCASE addService!

You would think people would have just cut and paste the code from the Activity Providers site and got it right.

Incidentally, if anyone knows how to create an API in Firefox that will work with either case, that would be great. Then I could work like Internet Explorer.

New Activities, Updated Operator and More

I've made version 0.6 of Firefox Activities available in the Add-ons Sandbox. If you like it, please review it so I can get it moved out of the Sandbox.

This version has a working preview for Firefox 3, as well as management of activities. It's very close to the Microsoft version. The only thing it is lacking at this point is the button that appears after you select text. I'm looking at that.

I also had to make Operator 0.9.1 available due to some translation issues and some interaction issues with Firebug.

Finally, if you are a fan of GTD, I shall shamelessly plug my friend Andy Mitchell's extension, GTDInbox which turns GMail into GTD central.

Enjoy!

An Analysis of Microsoft Activities

People seem to think that because I implemented Microsoft Activities for Firefox that I am agreeing with Microsoft's solution. That conclusion is not correct. I simply implemented Activities because I thought it would be fun. But in the process of implementing it, I've learned a bit about it, and I'm going to provide some of that information here.

Clearly when I first saw Activities, I thought "man, that looks a lot like Operator." And that motivated me to take a closer look. But what's interesting is that I believe Operator and Microsoft Activities share a common ancestor: Live Clipboard.

Microsoft introduced Live Clipboard two years ago their PDC. The basic idea was to put a little orange scissors icon on web pages and allow people to copy and paste data from those web pages to other web pages and to applications. The data that was copied was a microformat, so it would maintain its identity. So for instance, you could copy an event from a web page and paste it into Windows Live Writer. It seemed like a good idea, but it had some problems:

  • Required HTML and JavaScript hacks
  • Scissors mean cut - they don't mean copy and they don't mean paste
  • Finding places to paste the data was difficult
  • No one wants to put an orange scissors icon on their web pages

But they did get one thing very right - the use of microformats to encapsulate the data.

Really, though, the problem is that people don't want to copy and paste data; they just want to be able to send that data to the place they want it to go. That's where the idea for Operator came from. The idea was to take the microformats and create actions to allows data on a web page (microformats, RDF or other) to be sent directly to a web service or native application. This is the idea of the web as a switchboard. (See Alex Faaborg's presentation) Incidentally, Live Clipboard was one of the first actions I created for Operator!

Activities looks like it is trying to solve the same problem. This quote from the readiness page is very telling:

Activities are contextual services to quickly access a service from any webpage. Users typically copy and paste from one webpage to another. Internet Explorer 8 Activities make this common pattern easier to do.

So Microsoft ended up coming to the same conclusion that we did: you need to be able to execute an action directly on a web page, not cut and paste. Unfortunately, in creating Activities they lost the one component of Live Clipboard that was useful - the structured data (microformats).

Activities acts on three contexts in a web page, a selection, a link or the document itself.

The selection context is the least useful of all the contexts. It takes selected text and sends it to a URL, similar to what search already does. It's essentially a search with preview. It does not attempt to interpret the text it sends or validate it.

The link and document contexts both act on a URL and they are definitely more useful. The reason they are more useful is because a link implicitly provides more data than selected text. You know it is a link, therefore you can do more interesting things with it like add it to del.icio.us or digg it.

The fact that links are more useful then selected text should tell us something; the more data we have about what we are acting on, the more choices we are able to give a user that they might actually want to do. If you really want to see this in action, check out BlueOrganizer from AdaptiveBlue. This shows you the power of knowing the type of data that the user has selected.

So by leaving microformats (or any semantic markup for that matter) out of Activities, a lot of the usefulness is gone. I much prefer using Operator to right click on a calendar item and add it to my Google calendar (assuming it is marked up with microformats).

Activities has caused me to realize one thing though - we really need to work together to define an XML syntax for defining actions. I'm hoping to work with the folks at Adaptive Blue and maybe Microsoft to make that happen.

And if you are looking for an update to my Activities extension, I'll have something soon. It's working much more like the Microsoft implementation and allows you to manage the activities better.

Operator 0.9 is available

NOTE: There is a problem with the zh-TW, hr-HR, cs-CZ, pt-BR and ru-RU translations. I'll post a 0.9.1 when I get this worked out. Unfortunately this makes Operator 0.9 unusable in those languages because for some reason Babelzilla replaced the strings with blanks (not what I asked for).

Operator 0.9 is available. This was mainly done so I can get my t-shirt, although it has been overdue.

I've talked about what is in this release before, but to repeat:

This version includes:

  • Songbird support!
  • Fixes to make sure things work in Firefox 3
  • Menus no longer magically disappear on some pages
  • hCards supports nested menus to access actions (more logical than trying to use adr for multiple addresses)
  • adr is no longer on the menu by default (you can add it, but it has no default actions)
  • Nested microformats are now handled per the spec as best we can figure it out
  • Performance should be much better (and it has been in my experience)
  • If a microformat is not visible, it doesn't appear in Operator (You can turn on a preference if you want to see all microformats)
  • Actions for MapQuest and Amazon.com
  • A new RDFa parser based on the new spec (pages will need to be updated)

Unfortunately, I don't have more detail on the RDFa situation. Elias sent me a new parser, and I included it. Please bug him to know what needs to change on pages. And I apologize to the existing RDFa users out there that I have broken.

Also, there were some performance problems with the release candidate that were definitely addressed. Hopefully things should be speedy.

Enjoy!

Group Policy Extension for Firefox

I've been working with Cesar Oliveira from Seneca College to put together some initial attempts at group policy support. Here's his comment from bug 267888:

Since there doesn't seem to have been any communication from the assignee for
over a year, I am guessing that he is no longer working on it. With big help of
Michael Kaply (mkaply), we went into a different approach with this bug.

Instead of doing our own ADM template, we decided to do an implementation using
generic IE policies (gpedit.msc) that both browsers can share. For example,
setting the home page and enforcing full screen, and even disabling tabs! This
won't be the best solution, because Firefox and IE are different in many ways.
But it gives us something to start with, as IE is already in the corporate
world, we might as well try imitating some of their success ;)

We haven't implemented every policy (only slightly over a dozen). And it
definitely needs some polish to the functionality and the code. There are some
ways to get around certain policies (we don't do any preference locking), but
it is certainly better than not moving forward.

The code was designed to go into the mozilla\extensions directory. It works
with the latest version of Firefox3 (Firefox3.0b5pre), but not Firefox 2
(started using fuel). You can check out the source code via svn:
svn://cdot.senecac.on.ca/ff-ad/trunk

I am also making available an extension you can use. I haven't done much
testing with it, other than it installs and works with no tab browsing and
enforce full screen:
http://matrix.senecac.on.ca/~cdolivei/files/grouppolicy.xpi

I also made a list of policies that we implement. Please feel free to look and
give feedback.
http://spreadsheets.google.com/pub?key=pqlMBxIY5x3i2yeezToYGfg

So now I am requesting community feedback. What is going to stop this from one
day getting into the tree (I assume everyone on the CC list wants something
like this in)? Other than using IE's policies, of course ;)

I think I got everything. If something is not working, feel free to email me.

This is really a first step, but I hope people will try it out.

Microsoft Activities for Firefox - New Version

I have an update for Activities that adds preview and fixes some bugs. If you just want that, skip to the end of the post.

One of the things I realized as I worked on this extension is just how amazingly easy it is to write Firefox extensions. When you combine great technology (Firefox extensions), great people (like Mark Finkle, for example), great documentation (developer.mozilla.org, XULPlanet) and open source, it's amazing what you can produce and how fast you can produce it, as noticed in Compiler from Wired.com.

Compare this to my experience with Internet Explorer.

One of the things I wanted to do with Operator was make a version for Internet Explorer. I spent a few weeks trying to find good documentation on creating a toolbar for IE, and I have to say it was sorely lacking. I got a basic HTC working, but compared to my experience working on Firefox extensions, it was just SO painful, I gave up. I realize I'm not a Windows programmer, and that might have helped, but I just couldn't believe how hard it was to create extensions for IE. It's not even called a toolbar, it's called a a toolband which started me off in the wrong direction!

In a way, that was kind of sad because I was feeling like my focus on web development and in particular Mozilla and Firefox browsers was limiting my skills so that when it came to things like Windows development, I was at a disadvantage. (I've been working in the browser space and the development of web browsers for over 12 years). Hopefully, though, what I've actually done is cultivated a set of specialized, but very useful skills so that when other opportunities come up, I'll be able to take advantage of them. Especially since it seems like my work at IBM is requiring less and less of those Mozilla/Firefox skills.

So all that to say, I've thoroughly enjoyed working on the Microsoft Activities extension and the other extensions I've done and I hope that there will be more opportunities to do that, whether inside or outside IBM. Maybe I'll have a chance to talk to some folks about that at SXSW this weekend.

On to the new release. Version 0.3 of Microsoft Activities for Firefox is available (make sure you didn't grab the 0.2 that was up for a few minutes this morning). Features include:

  • Preview mode (only in FF3)
  • Problems adding services in FF3 have been fixed
  • Issues with query parameters fixed (all current services have been tested)
  • UI is updated immediately when a new service is added
  • Activities menu identifies the context you are acting in, and activities are limited based on that context (selection, link, document)
  • Built-in link to take you to the IE8 Service Gallery
  • Verified it works on Mac OS X

Interaction with the preview window is a little quirky, but I'm working on that. Surprisingly it seems to work better than IE8.

Enjoy!

More Microsoft Activities for Firefox (Calling out Microsoft)

I've made lots of progress since yesterday. I hope to have a new version available today. I thought I'd start the day by calling out Microsoft for not even following their own spec (and you too Yahoo!). What part of 320x240 preview window do you not understand? (And yes there is stuff offscreen even if the scrollbars aren't there)

You can check out other providers (who got it right) here.

And one more thing - is it AddService or addService? The reference page says "AddService" but links on the Service Gallery say "addService." (I got an answer - it's addService)

Microsoft Activities for Firefox

After looking at Microsoft Activities in IE8 and noticing that they look suspiciously like my ideas around actions in Operator, I decided to implement them in Firefox.

For your downloading pleasure, here is a first pass at Activities support in Firefox. I haven't actually looked at IE 8, so what I did was based on the page about Activities I saw this morning. You can install activities from the Service Gallery, and then if you open a new window, those activities will be active (they don't become active in the page you download them from - working on that). To use an activity, highlight some text and right click on it.

If folks think this is interesting, I'll keep working on it. Enjoy.

Note this doesn't support previews yet - I'm working on that.

Operator 0.9g (Release Candidate) available

I'm making a release candidate for Operator available hoping that I can shake out any last bugs in it. It's available here. Note the release candidate is English only. I have it on Babelzilla at this moment getting translated.

First the caveat - RDFa support is not baked in this version (as in RDFa the old way doesn't work, and RDFa the new way doesn't work). That's mainly because the RDFa spec was in flux. I think it's done now and hopefully we'll have the RDFa parser before I release the official 0.9.

So what is going to be new in 0.9? Lots of bug fixes and improvements to general interpretation of how microformats work. I detailed this in a previous post, but here are some highlights:

  • Songbird support!
  • Fixes to make sure things work in Firefox 3
  • Menus no longer magically disappear on some pages
  • hCards supports nested menus to access actions (more logical than trying to use adr for multiple addresses)
  • Nested microformats are now handled per the spec as best we can figure it out
  • Performance should be much better (and it has been in my experience)

I hope some people will try this out and let me know how I did. I'm trying to get 0.9 out next week for SXSW. Thanks!

ONE MORE THING: If your microformat is hidden (via CSS or otherwise), it will no longer display in Operator by default! You need to turn on the "show hidden microformats" preferences. See this post.

Exemptions, Allowances and Deductions: How to reduce your federal tax refund

Update: I've created a new calculator for 2014.

A little change of pace. Let's talk taxes.

One of the things I do in my spare time is facilitate Dave Ramsey's Financial Peace University. I'm also one of Dave's Certified Counselors. One of the situations that comes up a lot (especially this time of year) is people getting large tax refunds. They don't understand why large tax refunds are bad and they don't understand how to use the allowances or exemptions on their W-4 (PDF) to reduce their refunds. I'd like to try to clear things up. Note that I am not a tax professional or an accountant, and your situation may be fact dependent. If you need specific advice, your should go to a professional.

Why tax refunds are bad

Just to be clear, tax refunds are a no interest loan to the government. Every dollar you get in a tax refund is a dollar that you could have taken home at some point during the year. I see people struggling to make their bills month to month, but getting large refunds. They don't realize that they could be bringing that money home in their paycheck instead of waiting to get it in April by changing their allowances. This would help a lot of their struggle.

What are allowances?

Before we talk about reducing your refund, we need to clear up the concept of allowances vs. exemptions vs. deductions, since this is what causes much of the confusion. The W-4 form (PDF) allows you to specify your allowances (sometimes called exemptions). It also provides a some worksheets to help you try to figure out your allowances. Most people rely on these worksheets to figure out their allowances without looking at their overall tax situation. These worksheet attempts to guess what deductions you will have on your taxes so that it can then compute how many allowances you should take. It might work if you are filing a 1040EZ (PDF) or have a simple tax return, but for most people it simply doesn't cut it. So how do I determine my allowances? We'll go into that in a minute, but let's again define our terms. Allowances or exemptions are about the amount of money that is taken out of your paycheck during the year. Deductions are about things you deduct from your income when you do your taxes.

So how do I determine my allowances?

Generally it is pretty difficult to predict your taxes for the following year. So what we are going to do is attempt to use the refund you got this year to modify your allowances so you get less of a refund next year. We're going to do that using a worksheet I created. This worksheet will allow you adjust withholding allowances interactively to see how they will impact your take home pay. Let's take a specific example (Note I completely made these numbers up.)

Bob is paid weekly. He makes $1000 dollars a week. He does not contribute to his 401(k) and he does not have any health care expenses taken out of his paycheck. He is single and is not claiming any allowances, so the government is taking out the maximum amount of income tax. He did his taxes and he discovered that he got a $3000 refund. He wants to know how he can take that home instead of giving it to the government. Here are the steps to follow:

  1. Figure out how many paychecks you have left this year. Bob is did his taxes on April 15, so he has approximately 38 (52-14) paychecks left this year.
  2. Divide your refund by the number of paychecks left in the year to get the additional amount you want to take home each paycheck. For Bob, this is about $79 (3000/38).
  3. Fill out the information in the worksheet using a current paycheck. This is to verify that the worksheet is computing your data correctly. For Bob the government should be taking out $169.70 each paycheck for taxes. He can look at his paycheck to verify this.
  4. Change the withholding allowances on the worksheet to adjust your take home pay so that it is increased by the amount you want. For Bob, our target is $832 ($753+$79). By adjusting the allowances on the spreadsheet, we see that five would take us over our target, four would take us under. Most people would rather get a refund, so Bob should set his allowances to four.
  5. Fill out a new W-4 form (PDF) and submit it to your payroll department. Some companies might provide an online way to do this.

Note that you can also use this method to take home money during the year if you know FOR SURE you are going to be getting a tax credit. For instance, if you adopt a child, you get a tax credit of $10,960. Instead of waiting to get that as a refund, you can simply adjust your allowances so that you get that money during the year. Only do this if you KNOW the adoption will be finalizing before the end of the year!

Some people might find that because they give a lot to charity or have a lot of deductions, that they might need to set their allowances over ten. When you try to do this, your employer might say something scary about needing to notify the IRS if you go above ten. Don't worry about it. It's just a formality. There is nothing wrong with going above ten allowances as long as you are not doing this to try to avoid paying taxes during the year. When I adopted my children, my allowances went way over ten. It's not a big deal. The important thing here is not to use this method to take home all your money and then pay a lot at tax time. If you do this, the IRS will start requiring you to pay quarterly taxes. Our only goal is to reduce our refund.

Finally, if you know you are going to be paying capital gains or some other extra tax, this computation might not work for you. So be careful.

So to summarize. You don't want a big refund. Take your money home during the year. Use my 2008 Withholding Allowance Calculator to figure out how to adjust your allowances.

Nerd Note: The amount of each withholding allowance is based on your marital status and your pay cycle. It is also dependent on the specific amount of your pay (the percentage changes as your pay goes up). If you are curious how this works, you can read IRS Publication 15 or just read my JavaScript code.