Friday, March 26, 2010

Enabling ICS

I'm on fire this week. Another small help for our everyday use that I decided to post here since it took me quite a while to find it on the net.

I was trying to enable ICS (Internet Connection Sharing) on Windows Vista and always got this error message:

"An error occurred while Internet Connection Sharing was being enabled.
(null)"

Well, I Googled it and found this post which gave the solution, which is to enable the following services:

  • Application Layer Gateway Service
  • Network Connections
  • Network Location Awareness (NLA)
  • Plug And Play
  • Remote Access Auto Connection Manager
  • Remote Access Connection Manager
  • Remote Procedure Call (RPC)
  • Telephony
  • Windows Firewall

In my case, the Windows Firewall was the culprit. It's not ideal to have to have Windows Firewall running just to enable ICS, because I already have Symantec Firewall protecting me, so I hope Microsoft correct this sometime in the future.

Tuesday, March 23, 2010

Google in China

All this stuff about Google standing up to China's government, Chinese hackers et cetera has left only one question in my mind: why Google's front page is different in China?

What happened to File Assossiaction under Vista, Seven?

Back to my help-you-do-it articles...

One thing bothered me for a while: our dear Microsoft removed the file associations item that was under the Tools Menu.What the hell? I never quite understood why MS does that sometimes. Information Architecture is very important, and regrouping items might make things better for the user. However, those grouping and organizations should reflect what the user (us!) believes to be the right way to sort the information.

I mean, when asked the question, "where is the right place to put <something>?", the answer is usually "where most users think it will be!". So Microsoft, where do *you* think your users look for file associations? Where it has been for more than a decade, under the Tools menu!

When I was looking for it, to fix an association that another badly planned application decided to break, I immediately went to the Folder Options, under the Tools Menu and looked for the association, which was no longer there.

Before I panicked I decided to Google it, and found out that the associations are now under a specific application called Default Programs, under the Control Panel.

The Default Programs application is a more user-friendly version of the old File Associations tab. It lets the user change the default program that will open an file (based on the extension, as it's the custom in Windows), change the association between file extensions and programs, set the autoplay defaults, and even use a profile-like thing to rapid switch configurations for associations (which is done in order to enable the user to quick return to a Microsoft setting, of course).


So far, so good. If you need to reconfigure your file associations, you should look at this wizard.

HOWEVER, where is the "advanced" button? None. Microsoft thinks all of us, users (even those with a Enterprise Version of Windows Vista) are dumb. So there's no way to change how the application is executed, like, for example, which parameters would be provided when calling a program to open a certain file. in my case, I was simply trying to tell windows that Java jar files are opened by calling java -jar JARFILE.

Well, enough complaining. How do we do it? There are two shell utilities, ASSOC and FTYPE, that enables us to do it. If changing the place of the interfaces was a bit unfortunate, I must say that the new solution is way better. ASSOC and FTYPE lets us create a N to N association between file types and extensions, and it's much more clean than the way it worked with the old interface.

You must take two steps in any order when defining the associations:

Define the File Type
A file type is a kind of "profile" for your file (I think file class would be an even better name). You name it anything you'd like and informs how it's opened. On my Java JAR example:

FTYPE jarfile="C:\aplic\Java\jre6\bin\javaw.exe" -jar "%1" %*

where %1 is the filename that Windows will gladly pass to your application and %* tells windows to "pass everything else to the program the way you received it". The last one doesn't make much sense in Windows, but the truth is that the shell will also use this list to open files, so if you simply type the filename on the prompt, you end up opening the file.

Create the Association
Now, for the association itself,

ASSOC .jar=jarfile

which is quite intuitive: you tell Windows to threat files with .jar extension as jarfiles.

Tuesday, March 9, 2010

Sorry Chrome










Should I be surprised that Chrome doesn't work with this GOOGLE website?

Elements and Attributes in XML

Today I got myself wondering about when to use differences and attributes in XML. The general understanding is that the question is very philosophical, depending on how your system is designed and, even more, on how you understand the data in your application.

However, the subject isn't new and there are a lot of articles on the web that already deal with the issue. So, instead of repeating what other, more experienced people already wrote, I'd rather appoint readers in the right direction: