Taoffi's blog

prisonniers du temps

Windows Vista / Windows 7: To pin or not to pin, that is…

Have you ever tried, in Windows Vista or 7, to pin to the start menu (or to the task bar), an item whose name contains ‘documentation’?

Well, that is simply impossible (and, above all, forbidden!)

(You may have a look at this discussion… hope the link will still be aliveJ)

 

Why?... and Who decided this?

 

Why?

In Windows Vista or 7, you cannot pin to the start menu (nor to the task bar), any item whose name contains one of the following words (quite long list... long list J):

·         Documentation

·         Help

·         Install

·         More Info

·         Read me

·         Read First

·         Readme

·         Remove

·         Setup

·         Support

·         What's New

 

Note that this doesn’t still tell us any useful information about WHY are these words excluded from ‘pinnable’ items. And what logic is behind this choice?!

Nobody and no literature want to explain something plausible about this mysterious choice.

 

Still you can do It!

Curiously enough, you can still pin an item whose name contains one of these blasphemed words. Without even going to the famous ‘Registry’, just try the following:

·         Rename your item to be pinned (example: remove just one character of ‘documentation’ to obtain something like ‘documentatio’);

·         You can now pin your item to whatever you want;

·         Rename again the item to its original name;

·         Rename the pinned item to the name you like.

 

Who?

As for ‘Who’ decided and designed this genius (customs-office-attitude-like) feature?... It seems that those are the same Microsoft’s young people playing with Windows Interface, under the name of “Application User Model ID” to deliver us some awesome features (like sub folders hysterically bouncing down when you expand them: see this post).

They, apparently, continue to care about us in Windows 7

God bless them all… hope they will still be there in Windows 8.

 

Is it a shame?

As you may have noticed, the link to http://support.microsoft.com/kb/282066... The page where this design is confirmed doesn’t exist anymore!

 

Sorting dates: Ascending, Descending OR…

This is a small story, yet with something special:

Once upon a time, there was a list of events stored into a database table. Each event had (evidenceJ) a date.

A friend of mine asked me to sort these event items.

I asked, as you may imagine: Ascending or Descending?

 

But this, apparently, seemed too simplistic for him…

- I want the most recent to appear first. He said.

- Well, that means you want to sort in descending order.

I gave him a demo of data sorted in descending order…

- No, he said, that is not what I want!

 

After a short discussion, I understood that what he wanted was:

·         To first have the incoming events (i.e. those located after “today’s” date… sorted in an ascending order)

·         Followed by older dates (sorted in ascending order)

 

I first thought: can ORDER BY do something else than sorting in ascending / descending?...

As the answer was, evidently, No… I said: Sorry, but that is not possible!

The question remained in my mind however. And I started looking for a solution (for myself!)

The experimentations didn’t in fact last long, the solution was quickly found:

 

All what we need is to:

§  Categorize dates according to their location relative to Today (or any other logic);

§  Give each category a ‘sortable’ value (integer for example)

§  Sort by the category’s value, followed by the date value.

 

Example:

SELECT TOP (100) PERCENT

      event_date,

      description,

      CASE WHEN event_date >= getutcdate() THEN 1

            ELSE 2

      END               AS date_category  -- categorize date

FROM         dbo.sight_conferences

ORDER BY date_category, event_date

 

 

Screenshot of the output data sample

 

 

 

The key part of this code is the logic of categorizing dates. In this sample, categorization was quite simple (set a category according to date location relative to Today). But, of course, we can use another logic scheme to obtain data sorted accordingly.