Welcome to the .NET Developers Blog
This is an aggregated blog of .NET developers.
If you have a blog about Microsoft, .NET, XAML, WPF, Silverlight, etc... development
add your blog here.
Email me for any suggestions and feedback.
Minh T. Nguyen
|
|
|
XP Days Benelux 2010
Sven Cipido
- Posted 9/6/2010 11:45 PM
|
|
This year, the 8th edition of the XP Days Benelux takes place on November 25-26th
2010. The location is Kapellerput in Heeze (The Netherlands).
Together with my colleague Peter Doomen,
I'm selected as a speaker. The session we are going to deliver is the Frog Factory.
Read more about this session here and here.
All the info about the XpDays can be found here.
My thoughts, shares,... with .Net and Microsoft - The blog of Sven Cipido
|
EntitySpaces in a RIA Services Silverlight Application Development Scenario
Mike Griffin
- Posted 9/6/2010 10:14 PM
|
This video demonstrates how you can use EntitySpaces in a Microsoft RIA Services Silverlight
application development scenario. EntitySpaces works extremely well as your RIA data
architecture. But EntitySpaces doesn’t stop there, we also generate your Domain Services
and you Metadata rules (data validation rules). This is simply a must see video, we’re
really excited about this functionality.
Whether RIA Services is merely a buzzword you’ve heard bounced around or you’re a
seasoned Silverlight developer you should checkout this functionality. When you combine
EntitySpaces with RIA Services you will almost instantly be able to create professional
quality Silverlight applications.
EntitySpaces 2010.1.0830.0 is shipping now. Our RIA Services functionality (shown
in the video above) will be available in beta within a week or so. If you are interested
in participating in the beta please email support@entityspaces.net with
“RIA Services” in the title.
From Mobile Devices to large scale enterprise solutions in need of
serious transaction support, EntitySpaces can meet your needs. Whether you’re writing
an ASP.NET application with Medium Trust requirements, a Silverlight/WCF application,
a Mono application, or a Windows.Forms application,
the EntitySpaces architecture is there for you. EntitySpaces is provider independent,
which means that you can run the same binary code against any of the supported databases.
EntitySpaces is available in both C# and VB.NET. EntitySpaces uses no reflection,
no XML files, and sports a tiny foot print of less than 300k. Pound for pound, EntitySpaces
is one tough, dependable .NET architecture.
EntitySpaces LLC
Persistence Layer and Business Objects for Microsoft .NET
http://www.entityspaces.net
|
Things I like about Scala
John Tobler
- Posted 9/6/2010 1:56 PM
|
|
I'm excited about Scala (see Scaling the Cliffs to Scala ), one of the new Object-Fuctional languages that have emerged recently. So, what excites me? Let's list a few cool features.
-
Everything is an object
-
Functions are really and truly first-class objects
-
Mixins really rock! They bridge the gap between multiply inheriting from interfaces and multiply inheriting from classes.
-
Traits are like Java interfaces, but with implementations (behavior). They provide a mixin composition mechanism I haven't had in other languages
-
Scala's implementation of concurrency and its Actor Framework make it one of the most interesting new languages around.
I would recommend a study of Scala just for these benefits alone.
|
Displaying math in web applications and font embedding
Ondrej Svacina
- Posted 9/6/2010 9:29 AM
|
|
When some math creeps into requirements list for your new web application, you get a bad feeling. It’s a problem because although the MathML standard has been there for years, only Gecko based browsers and Opera support it natively (WebKit based browsers in their latest builds, KHTML with no support) and the biggest problem – Internet Explorer still does not support it in 8th version and MathML support in IE9 has still not been confirmed. You have a few options: - force your IE users to download and use an ActiveX MathML player – not quite a pretty solution,
- do some magic and convert (La)TeX formulas into images (Wikipedia approach) – there is mimeTeX and also an ASP.NET wrapper (but they render low quality GIF images),
- buy a commercial software (I found Equation Server for .NET, however, I didn’t try it),
- use jsMath!
jsMath jsMath is a fantastic open source javascript library that renders any TeX formula into a series of positioned spans. If the user has TeX CM fonts installed, it uses them directly; if not, it has a fallback to displaying basic glyphs as images but this process is transparent to you as a web developer. Deployment is simple. Download jsMath package from its homepage together with image fonts. Unpack image fonts into a subfolder called “fonts” of the jsMath folder. Now create a new ASP.NET web project/site and copy the jsMath folder to the root folder. Set any permanent port number in the project properties in Visual Studio because we need a fixed URL. Open the jsMath/easy/load.js file and set root property to the full URL of the jsMath folder. If your web site runs on the 6500 port on localhost, for example, it will loke like this: root: "http://localhost:6500/jsMath/",
(Of course, do not forget to edit also after deploy to your production environment.)
Now include this javascript into your .aspx file – I included it in my master page because I’m going to do math on almost all pages:
<script type="text/javascript" src='<%= ResolveUrl("~/jsMath/easy/load.js") %>'></script>
and let’s start doing math:
Some inline math: \(\sqrt{1-x^2}\) or \(ax^2+bx+c\),
jsMath will render this instantly:
If you wonder about the formula format, read any TeX or LaTeX manual.
Font embedding
With releases of Firefox 3.5, Safari 3.1 and Opera 10, web developers can use a feature called font embedding. It means that we don’t need to rely only on web-safe fonts and we can use any font by using the @font-face technique.
A common myth is that Internet Explorer does not support this technique. It’s false and the truth is that Internet Explorer has supported font embedding long before Firefox or Safari even existed – since IE4 (1997!). It supports, however, only one of formats specified in the CSS standard, called Embedded OpenType (.eot) but this usually is not a problem since conversion tools from TrueType exist.
Using the technique, we can almost always prevent the image-font fallback of our formulas even without requiring users to manually download and install CM fonts. Just copy all TTF and converted EOT fonts and include proper CSS stylesheets with EOT font for IE and TTF for all other browsers:
(this is just one font of 6 required by jsMath)
To make it easier for you, you may download the fonts together with the CSS file. Just include the CSS file in your pages or master like me:
<link href="../../Content/jsMath.css" rel="stylesheet" type="text/css" />
Now almost all your users will benefit from formulas rendered by CM fonts (at least IE, Firefox, Chrome, Safari and Opera! – that’s the vast majority).
As you can see, it’s all plain text – I can select it with no problems:
If you are curious, the first formula is converted to this HTML:
<SPAN class=typeset alt="\sqrt{1-x^2}"><NOBR><SPAN class=scale><SPAN style="POSITION: relative; DISPLAY: inline-block"><SPAN style="POSITION: absolute; TOP: 0em; LEFT: 0em"><SPAN style="POSITION: relative; WIDTH: 0.83em; TOP: -0.84em; LEFT: 0em"><SPAN class=cmsy10>p</SPAN></SPAN><SPAN style="POSITION: relative; WIDTH: 2.63em; TOP: -0.81em; LEFT: 0em"><SPAN style="BORDER-LEFT: 2.63em solid; HEIGHT: 1.5px" class=blank></SPAN></SPAN><SPAN style="WIDTH: 1px; DISPLAY: inline-block; MARGIN-RIGHT: -1px"></SPAN><SPAN style="MARGIN-LEFT: -2.63em" class=spacer></SPAN><SPAN class=cmr10>1</SPAN><SPAN style="WIDTH: 1px; DISPLAY: inline-block; MARGIN-RIGHT: -1px"></SPAN><SPAN style="MARGIN-LEFT: 0.22em" class=spacer></SPAN><SPAN class=cmsy10>À</SPAN><SPAN style="WIDTH: 1px; DISPLAY: inline-block; MARGIN-RIGHT: -1px"></SPAN><SPAN style="MARGIN-LEFT: 0.22em" class=spacer></SPAN><SPAN class=cmmi10>x</SPAN><SPAN style="POSITION: relative; WIDTH: 0.39em; TOP: -0.28em; LEFT: 0em"><SPAN class=size2><SPAN class=cmr10>2</SPAN></SPAN><SPAN style="WIDTH: 1px; DISPLAY: inline-block; MARGIN-RIGHT: -1px"></SPAN><SPAN style="MARGIN-LEFT: 0.05em" class=spacer></SPAN></SPAN> </SPAN><SPAN style="WIDTH: 3.47em; HEIGHT: 0.83em" class=blank></SPAN></SPAN><SPAN style="HEIGHT: 1.18em; VERTICAL-ALIGN: -0.16em" class=blank></SPAN></SPAN></NOBR></SPAN>
But remember. It’s all automatic and on-the-fly, you won’t even see this markup in View->Source.
Firefox and Chrome bug
There’s one more small glitch. Firefox and Chrome (and possibly also Safari) use an optimization which does not download and apply fonts specified by the @font-face rules if you don’t use them directly in the page markup. Since our formulas are parsed and converted by javascript and does not use directly any “font-family: jsMath-cmex10”, you end with fall-backed image fonts when using these browsers. This optimization is buggy because it does not take into account that you can set font-family css property also by javascript. My workaround is to use a dummy span with font-family set to jsMath-cmex10 (this is the font jsMath uses for testing whether the user has CM fonts) and some non-visible character:
<span style="font-family: jsMath-cmex10;"> </span>
Note that you can hide it by display:none because the font won’t be loaded.
Place it somewhere to your masterpage where it won’t get in the way to other content.
|
JetBrains Community Night at DevCon
JetBrains, Inc.
- Posted 9/6/2010 1:48 AM
|
|
From the 27th to the 29th of September, DevCon London is taking place. DevCon is organized by Software and Support, the great team behind conferences such as BASTA, JAX, PHPCon and many more. The conference is in parallel with JAX London so there’s for sure going to be a mix of crowds between .NET and [...]
|
NET Framework 3.5 & NET Framework 4.0
Anand Patel
- Posted 9/5/2010 9:29 PM
|
The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is hearty of development now & tomorrow for business applications.
Our dot.net consultant hides technical complexity & ensures deliver of better application. Radix has started development on net framework 4.0 to influence best technology for client projects.
Explore technical verticals of Radix consulting & development services from following sections.
|
Wer lesen kann...
Martin Hey
- Posted 9/5/2010 9:35 AM
|
|
Wer lesen kann ist klar im Vorteil. Hinter diesem Spruch steckt immer wieder etwas Wahrheit. Das hat sich auch heute mal wieder gezeigt. Für das Prüfen vom Verhalten von Websites in den verschiedenen Versionen von Internet Explorer bietet Microsoft Virtual PC Images an. So weit so gut. Ein Problem ergibt sich dann, wenn der Kennwortschutz greift und der Rechner geperrt ist, denn dann muss man das Kennwort des Benutzers IETest kennen. Und wenn man Microsoft kennt, dann ist es meist irgend eine Mutation des Wortes "password" - aber auch da gibt es noch mehrere Möglichkeiten. Manchmal ist es einfacher als gedacht denn die Lösung findet sich in der mit ausgelieferten readme.txt - aber wer liest schon die readme.txt. Daher hier der Tipp für alle Nicht-ReadMe-Leser. Das Kennwort der aktuell gültigen Images ist: P2ssw0rd
|
Amethyst - One Week Later
Huw Collingbourne
- Posted 9/4/2010 4:33 AM
|
|
It's been less than one week since Amethyst was launched and we are pleased to say that it has generated quite a bit of interest. The launch, and our announcement of a technology partnership with Midnight Coders, has been covered everywhere from Infoworld and InfoQ to some of the more influential technology Blogs, as well as international sites such as Le Monde Informatique. Flash and Flex Developer's Magazine also has two in-depth articles on Amethyst in this month's (...)
|
Tying it Together
Adron Hall
- Posted 9/3/2010 4:06 PM
|
I've been working through a project recently that I ended up creating an interesting abstraction of an assembly/classes between multiple web services projects. I wrote about it initially in Aggregated Web Services Pt I. In this blog entry is going to cover a few things, based on a full end-to-end implementation of a project from the WCF RESTful Web Services, to the ASP.NET MVC Site, and finally the jQuery calling those same services.
Simple Architecture
Before I got started, there is one thing I need to point out. The communication with Javascript/jQuery/AJAX has a lot of tricky bits one needs to be aware of. One of those is the same site origin and of course the famous cross domain solution issues. That is why in this walk through I will place the web services and the site pages in the same project, yes, WCF and MVC living happily in a single project. :) You can of course, if your architecture requires it, break these into separate projects, but for this example I'll have both in the same project.
|
F# Discoveries This Week 09/03/2010
Rick Minerich
- Posted 9/3/2010 3:46 PM
|
One of the greatest things about running this blog, other than having a structured way to read all of the F# community content, is that I’ve been able to watch the community grow in a very concrete way. Looking back to a year ago there was only six posts on F# over the course of a week, now we have well over twenty. It’s truly amazing to see. Now, on to the links. Audio and Video “In this second lecture in the series, Ralf digs into Type Classes, which are type system constructs that were originally introduced to provide a form of ad hoc polymorphism (i.e., an advanced form of overloading).” “I've got great news. F# is here and is poised to increase your productivity and reduce your suffering.” “Peter introduces the curriculum, lecture plan and lecture notes for the course "Programs as data" that uses the functional programming concepts in F# to teach students language concepts and implementation details.” Tools “This DZone Refcard will lead you through the basic essentials so that you can quickly move on to using this Functional Programming Language for creating some mind-bending code.” “F# packages and samples for use across platforms” “Right now TickSpec is intended as a lightweight framework to get you started with BDD using F#. It is standards based, supporting a subset of the Gherkin language, so should be easy to change to another Gherkin based framework like Cucumber, SpecFlow or StorEvil.” General “Of course, compiling them sources and observing all internal compiler activities, so to say “in action’.” “To make an assembler, I just parse with a series of regular expressions. F#’s active patterns came in super handy for this! In fact, the assembler turned out to be fewer lines of code than the disassembler.” “I had the (silly) idea of building a JavaScript-based emulator. Looking at Peter Monta’s Python-based disassembler and his object code listing, it looked simple enough to automatically generate script from David Cochran’s original bits. I wrote my own little straight forward 100-line disassembler in F#, producting an array of JavaScript functions” “The idea is simple; the computer works out all the possibilities for the next 3 letters, and then the human selects which prefixes “look promising” to investigate further.” “Below is the fuzzy logic reference code for module Fuzzy0. Tomorrow I’ll post an example of its use that explores some extensions of earlier techniques.” “The minimal wrapper in F# for Weka.” “So here's a suggested structure outline for those larger functional projects” “We’ve been working with the F# Team to get the samples for Parallel Programming with Microsoft .NET ported to F#.” “This is my 100th blog post, and to celebrate, I’m pulling out all the stops. This example will combine F#, fuzzy logic, WPF, and tomatoes!” “It shows how to make multipart conjunctive rules by storing the input sets in a list and using the “min” operator to combine the results into a truncation height. To do this, it adds vector versions of the fire and fire all functions.” “In this article we’ll review Windows Phone 7 support for the Visual Basic .Net and F# programming languages. Our goal is to demonstrate that Windows Phone 7 can indeed support F# and VisualBasic.Net code libraries and user controls.” “This step-by-step tutorial describes how to use the library in fsx script and C# project.” “I find that I use F# Interactive more for performance analysis, learning F#, and verifying Base Class Library behavior than for spiking or scripting.” Community “Yes you can, by using PHP COM class but it works only on Windows version of PHP5+ and needs no separate installation.” “I've used the Scrap Your Boilerplate and Uniplate libraries in the Haskell programming language, and I would find that form of generic programming over discriminated unions to be really useful. Is there an equivalent library in the f# programming language?” “What should be my steps from now on to become a better/professional F# programmer?” Teaching and Basics “This post is part two of a series of posts looking at syntactical examples of F# and C#. This post will supply you with easy to understand F# coding examples.” “I have recently been to a short F# presentation at HiQ in Arboga. One of the things that got mentioned was type inference.” “WebBrowser control is a control used to display a web page or web document. To create a WebBrowser control in F#, use the following syntax:”
|
Buenos Aires CodeCamp 2010
Andres Aguiar
- Posted 9/3/2010 6:51 AM
|
|
For fourth year in a row Infragistics will be sponsoring the Buenos Aires CodeCamp, and I'll be presenting on our experiences with the Entity Framework while building Quince. We've been using EF for 2 years and learned what works and what does not, how to architect applications around it, how to (ab)use expression trees to maximize code reuse, how to monitor roundtrips, etc. It’s hard to pick what to show as there are a lot of fun things to talk about. CodeCamp BA is always a great event and the number and quality of speakers increases every year. Check the Agenda! 
|
Gmail Priority Inbox
Kiruthik Nandha Kumar
- Posted 9/2/2010 11:30 PM
|
Gmail Priority Inbox
I was seeing a small link in red called "New Priority Inbox beta"
from yesterday. Today I clicked it... it said, Failed to activate Priority Inbox.
After couple of tries it got activated. So, What is it ??
This new feature if it works really as advertised will be really an awesome feature
for most of us. Simply to put up, it just prioritizes the mails for us. But how ?
Just it does it by watching our read/sent mails and also it gives us an option to
mark a mail as Important/ Unimportant.
And also there is a new mailbox view which categorize the mails as :
-
Important and Unread or
-
Starred or
-
Everything Else
I have subscribed to lot of newsletters starting from Techrepublic to DotNetSlackers
and etc. And now Im not reading all of them or at-least not all the issues. So the
quantity of the mail, then mails from Dell, HP, etc are just filling my mailbox. I
dont want to unsubscribe those and also I dont want to label and archive them. I want
it in my inbox. And also, sometimes, there is a possibility of missing a mail from
some person due to the number of these kind of mails. So, the better way is prioritizing
it. Thats what its all about !!
New Priority Inbox didnt read my old mails and its not showing any proper Important
and Unread messages. May be it need sometime to loop through mails etc.. Hope it works
as expected.
|
Sesame: Microsoft Dallas support
Fabrice Marguerie
- Posted 9/2/2010 6:59 PM
|
|
With the release of Microsoft Codename "Dallas" CTP3 and the features announced in the previous post, it became easier to add support for Dallas to Sesame Data Browser. The new version of Sesame published today allows you to browse Dallas datasets, as demonstrated below.
Creating a connection to a Dallas dataset in Sesame is easy. You just need a dataset URL and an account key.
The Dallas portal
In order to get an account key and URLs, you need to visit https://www.sqlazureservices.com and sign in with a Windows Live ID. You'll then be able to subscribe to datasets, such as AP Online (Associated Press) or business information from InfoGroup:

Note: Only CTP3 services are supported in Sesame.
Once you have a subscription, you can visit its preview page. This is where you'll find the URL you'll use in Sesame. Here is for example the page for AP Online:

The URL for AP Online is highlighted in blue on the above picture. Your account key is available on the "Account keys" page: 
Dallas in SesameNow that you have an account key and a URL, you can create an OData connection in Sesame: 
Here is the result for AP Online if you click on GetBreakingNewsCategories: 
Copy a category ID and click on GetBreakingNewsContentByCategory. Paste the category ID in categoryId and type 5 for count: 
After clicking on Open, you'll get data in a grid, as usual: 
You can also locate the news items on a map: 
Known bugs-
A bug in Dallas CTP3 prevents the "Load more" button to work correctly in all cases.
- Dallas CTP3 does not support all filter operations. Namely, the EndsWith, StartsWith, Contains, DoesNotContain and IsContainedIn don' work with Dallas datasets.
Please give this new version a try. As always, your feedback and suggestions are welcome!
|
Deploying and Using jQuery with a SharePoint 2010 Sandboxed Solution
Jan Tielens
- Posted 9/2/2010 12:24 PM
|
|
If you’re an avid reader of this blog, you probably now that I’m quite a big fan of the jQuery Javascript library, especially in combination with SharePoint sites. For a while I’ve been trying to find a mechanism to deploy jQuery and add a reference to it on all SharePoint pages of a site, by just using a Sandboxed Solution. The first part, deploying the jQuery file, is really easy; this can be done in a Module in a SharePoint project. The second part was more of a challenge; making sure the jQuery file got referenced in all pages of a SharePoint site. My initial thought was to do this by using the AdditionalPageHead Delegate control, but it’s not possible in a Sandboxed Solution (you need to deploy the .ASCX to the SharePoint root). My second thought was to use the new ScriptSrc attribute you can use in a CustomAction (I wrote about this attribute some time ago). But initially I was under the impression that the ScriptSrc attribute could only target Javascript files loaded from the SharePoint Root (the \LAYOUTS) folder, resulting in a no-go for a Sandboxed Solution as well. Daniel McPherson stumbled upon this issue as well, but neatly solved it using Javascript to add the reference dynamically.
But apparently you can make use of the ScriptSrc attribute to reference files from the Virtual File System (e.g. a Document Library in a site) as well! (thank you Frederic Dobon for mentioning this!). The trick is to use the ~SiteCollection prefix in the ScriptSrc attribute, for example:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction ScriptSrc="~SiteCollection/SiteAssets/jquery-1.4.2.min.js" Location="ScriptLink" Sequence="10"> </CustomAction> </Elements>
It’s that easy! For your convenience I’ve uploaded the source code and the resulting SharePoint Solution (WSP file) to CodePlex.
|
The crime that is Windows DPI handling
Oliver Sturm
- Posted 9/2/2010 10:56 AM
|
I was just looking into the whole topic of drawing something on screen in a .NET WinForms application, so that it appears in the “correct” size. I found a number of issues around the handling of screen resolution and DPI, and in order to remember what’s what, and perhaps help somebody with the same problems, I thought I’d write it all down.
Some definitions
For a start, what does DPI really mean? It is often confused with “resolution". That is of course not wrong, but still very confusing. The term “resolution” is usually associated with displays – or perhaps that’s just my understanding. But when I hear somebody talking about resolution, I expect to hear things like 1024x768, and I’m sure I’m not alone. This kind of resolution information defines the total number of pixels that can be displayed.
Resolution alone doesn’t tell me everything there is to know about how a picture is going to look when displayed. The reason is that there’s a second factor that’s also important: the size of the display area. On a 15 inch screen, 1024x768 used to look okay. On your 21 inch flat screen it’s probably not so great.
That’s where DPI comes into play. It means “dots per inch", and that’s what it defines: the number of pixels an output device can render per inch of physical real estate.
For example, my old Dell 2001 FP is a 20 inch screen. That’s of course its diagonal, the size of the visual area is 16x12 inches (I’m surprised to find that this means exactly a 20 inch diagonal - well done, Dell!). It has a native resolution of 1600x1200 pixels. Easy maths - that’s 100 DPI!
On the other hand, I’m now using two 28 inch screens at a resolution of 1920x1200. Their size is 23.39x14.57 inches. DPI in horizontal direction is 82.1, in vertical direction it’s 82.4. With a large screen like this, DPI tends to be much lower because resolution isn’t keeping up well these days with the growth of screen sizes. It is also interesting that the two values I calculated aren’t identical - the difference seems large enough to think that it’s not down to measuring errors. Of course this is perfectly well possible, because DPI values in X and Y directions would only be identical if the pixels on the device were perfectly square.
Why is DPI relevant?
So why bother knowing these precise values for DPI? Well, it’s simple: because unless you know these values, you can’t predict how large something is going to appear when displayed. On printers, for example, knowing the DPI “resolution” of the output is very important. If you print a line that’s defined to be an inch long in your DTP application, you expect it to be an inch long when it comes out of the printer.
Although it surprises some people, the same is true for displaying something on screen. An application should be able to display a document on screen in such a way that an element which is going to be an inch long on printed paper is also an inch long on screen. This is easily possible when taking DPI into account, and entirely impossible when ignoring it.
Just in case you still think that’s a weird idea – think about it. When displaying a simple UI element, like a button, or perhaps a piece of text. Is it more useful to configure the button to be 80 pixels wide or 2cm? Does a text height of 10 pixels (I’m talking about labels or the like) give a better result or rather 4mm? In conjunction with text there are other measurements like pt and similar, which confuse things further. The point is, without taking the actual screen DPI values into account, you just don’t know what size something is going to have when the user sees it.
Of course some people realized the importance of DPI a long long time ago. In conjunction with computer displays, the standards DDC and EDID allow your computer to receive information about its size directly from your screen, which of course allows the computer to calculate the DPI values depending on the current resolution.
So what’s wrong in Windows?
There are several things that go wrong in Windows. For a start, it doesn’t seem that display drivers typically evaluate the EDID information to find out about DPI values automatically. I’m not an expert on this level, but I guess it would theoretically possible to do this on the driver level, and maybe there’s even some influence over the actual Windows DPI configuration that the driver has, but which is not passed on to the end user of the system. Maybe some graphics drivers do something in this regard, I don’t know.
It doesn’t matter all that much though, because Windows has always (largely) ignored or misinterpreted DPI for its own rendering of its UI. Very recently things are starting to change a bit with the introduction of vector based graphics through WPF and Silverlight, but of course it’s going to take ages until things change for the majority of applications that make up the OS, as well as 3rd party apps.
There are a few places where Windows takes DPI into account to some extent. For one thing, there’s some sort of scaling of UI elements going on, which usually results in rather crazy looking layouts. I don’t know anybody who really understands exactly what’s going on there, and I’ve never found it relevant enough to look into this and understand the details. There’s one other thing though, which most people have observed at one point or another: the “large fonts” setting in Windows.
I seem to remember that traditionally you could only choose between “normal” and “large” fonts. These days, i.e. in Windows 7, there’s a dialog that lets you select a “percentage of normal size” for your font display. So far, so good – this is of course a valuable feature to have.
If only they did it right…. let’s think about it. As I said above, knowing about DPI allows me to render a piece of text in such a way that it appears exactly 8mm high on screen. For example. If I want that piece of text scaled by 25%, I’ll render it to appear at 1cm height on screen. Again, knowing my DPI makes it possible, and if I can see 1cm high text better, that’s great.
On the other hand, what MS does defies any logic I can come up with (having accepted long ago that there are always several different kinds): they go and change the DPI value for the display depending on the “font size” setting. They just claim that my display has a DPI value different from what it really has. Wow.
As a side note
They don’t even get it right! Check out these two screen shots (from Windows 7, in spite of the appearance):
 
Now, as you can see I’m asked to enter the “percentage of normal size". I haven’t measured precisely, but I can believe that in the second shot, the height of the text is roughly twice that of the first shot, so the scaling of the font itself may be correct. But, tell me: how does that relate to the information that says “… at 192 pixels per inch"?
Logically, I can see two different scenarios. Number one, I have an element that is, say, 100 pixels wide. When displaying it at a DPI of 96, it would be just over an inch wide. At a DPI of 192, it would be just over half an inch wide. The higher the DPI, the smaller the object, if it has a fixed width in pixels.
Number two, I have an element whose size is not described in device pixels, but rather in a “real world” measurement, like inches or centimeters. If I have an element that is one inch wide, then I’d have to draw it over 96 pixels at 96 DPI and over 192 pixels at 192 DPI. Right? Right.
How MS manage to claim that the size of 9pt Segoe UI grows while the “fake DPI” grows as well, is beyond me.
Oh, and the “point” they are referring to? That’s a real-world measurement, called Point. According to its modern definition it measures 0.3527mm. Go figure.
Moving on – so why might they choose an approach of scaling by DPI? At a glance it seems like this might be a good idea if the objective is to scale your entire UI at once. By claiming to have a DPI that’s only half as large as the one I really have I would effectively double the size of everything on screen.
I think this would look crazy, rather like one of those magnifying glass implementations in pixel based drawing programs. I also think it also doesn’t make all that much sense for a computer UI – after all, there are many elements of varying importance on screen, and while I may want some of them to be larger so I can see them better, that doesn’t apply to every separator line and similar graphical gimmick. I’m almost sure MS don’t do this either.
… and there’s more
Okay, so it appears that Windows has at least some semblance of an understanding of DPI internally, regardless of the funny ideas with font sizes and large vs small DPI values. One minor issue, comparatively speaking, is the fact that you can only configure one DPI value, while it seems obvious that there should be two, one for the horizontal and one for the vertical direction. Well, I’m calling it minor… I’m sure it can be a rather big issue when carefully designing documents for large print output on your high res display while using a compromise DPI value that’s the same for X and Y.
More important is something else though: Windows enforces a particular range of DPI values. The 100% item in the dialogs shown above is the minimum value you can enter. Remember my 28 inch screens I described above? They have a DPI of 82. It’s impossible to configure Windows to this value. Why? Brilliant, just brilliant.
and some unknowns
I honestly don’t have a clue what the “Use Windows XP style DPI scaling” checkbox is for in the dialogs. I can’t use it either, it just goes on and off on its own.
Something for developers
If you’re a developer, there’s not too much you can do about the OS’s non-grasp of DPI information, but unfortunately you’re the one who gets criticized by customers if your display looks funny. Whatever use it is, there is some at least some functionality in Windows that lets you query DPI information to the extent that the OS is aware of it.
Generally this is quite simple and it’s been supported by Windows API calls forever. There’s a helpful function called GetDeviceCaps that you can call with a device context handle and a constant value called either LOGPIXELSX or LOGPIXELSY (hey, finally separate values! where should they come from at this point…?) in order to retrieve DPI info. Of course there’s a lot to do wrong when using Windows API functions – here’s an example, with the caveat that I’m not checking for errors from the API functions like I should. Oh, and I’m abusing Size as a container for the value pair. Well, if you just copy&paste, that’s your own fault :-)
[DllImport("user32.dll", SetLastError = true)]
public static extern bool SetProcessDPIAware( );
[DllImport("gdi32.dll")]
public static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr GetDC(IntPtr hWnd);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC);
public static Size GetScreenDPI( ) {
// no error checking here - being lazy
var dc = GetDC(IntPtr.Zero);
try {
return new Size(
GetDeviceCaps(dc, (int) DeviceCap.LOGPIXELSX),
GetDeviceCaps(dc, (int) DeviceCap.LOGPIXELSY));
}
finally {
ReleaseDC(IntPtr.Zero, dc);
}
}
The pinvoke definitions are courtesy pinvoke.net.
Oh, and I found one thing that a lot of blog posts showed “wrong": they call CreateDC and DeleteDC instead of GetDC and ReleaseDC. My example simply retrieves the device context that already exists for the desktop, instead of creating a new one. I believe that should be much more efficient. Some other examples I found also leave out the bit with LOGPIXELSY – not something I would do. Can’t be that lazy.
Now, if you try this code, you may be a bit surprised to find that you don’t seem to get actual DPI information back. There’s a reason for that: MS think you’re going to do no good with it, and therefore they don’t give it to you unless you prove that you’re in fact clever enough. That means you need to call that function at the top of the example, SetProcessDPIAware, during your application initialization – otherwise GetDeviceCaps will just not tell you what the real values are. Great, eh?
Note: MSDN suggests you don’t use SetProcessDPIAware directly, but instead add an entry to your application manifest. See here.
Graphics != Graphics
Finally, I found a lot of blog posts that suggest you could retrieve DPI information from instances of the .NET Graphics class. This is true, and while I haven’t tried it now to confirm, I expect it will return the same values as the Windows API functions above. But there’s one important thing that the blog posts I’m talking about don’t usually stress: make sure you know where that Graphics instance comes from!
Think about it: why would the Graphics object have DPI information if it was always the same? No, the reason it has that information is because it depends on the graphics context the object represents. If you haven’t created a Graphics instance yourself, don’t assume what its resolution is. It might represent an image with whatever resolution, or perhaps a printer object with a very high DPI.
If you want to use Graphics for the purpose of retrieving DPI info, make sure you hold an instance that refers to an on-screen drawing context. And perhaps consider not using it at all – yes, it’s convenient, but it’s got a lot of overhead compared to simple API calls like the above.
As a final note
I’m not an expert in typography, and I’m describing everything in this post as logic seems to dictate, and according to my knowledge. I’m sure I’ve got at least one thing wrong, and if you know what it is, please let me know and I’ll fix it.
|
Top Tips for Passing SharePoint Exams 70-667, 70-668, 70-573 and 70-576
Joel Jeffery
- Posted 9/2/2010 9:05 AM
|
Exam TipsHere’s a rundown of my best practice tips when sitting the Microsoft SharePoint 2010 Exams. Hopefully there’s something here for everyone, whether you’re a SharePoint Administrator (70-667, 70-668), or a SharePoint Developer (70-573 and 70-576) – or just preparing for Microsoft Exams in general. Before we start our list of practical exam tips, I’m going to give you an extra tip for free: Read more on Top Tips for Passing SharePoint Exams 70-667, 70-668, 70-573 and 70-576… Technorati Tags: 70-563, 70-576, 70-667, 70-668, Exams, MCP, SharePoint 2010, Tips, Training
|
“Open Standards”, il giorno dopo
Andrea Saltarello
- Posted 9/2/2010 8:31 AM
|
|
Ricapitolando: - Lo stream era effettivamente h264, ma VLC (1.1.14 per Windows) non be ha proprio voluto sapere di visualizzarlo; in compenso sull’iPhone si vedeva benissimo quindi ho seguito così l’evento
- Ho fatto benissimo ad attendere la presentazione della nuova versione di Apple TV, così ora sarò ancora più sicuro nell’acquistare il WD Live HD <g> Peccato, se a quel prezzo e con quel fattore di forma avesse supportato almeno DLNA ci avrei potuto fare un pensierino. La mancanza del supporto FullHD, dato il prodotto, IMHO non è una penalizzazione eccessiva: in fondo, Apple TV è un “aggeggio” per fare streaming via Internet, e temo che nemmeno negli USA la banda sia sufficiente per fare streaming real time di contenuti 1080p.
- iTunes 10 visualizza a sx la thumb della copertina dell’album, e a dx l’elenco delle canzoni. Ottima idea: se non fosse che Windows Media Player e lo Zune player lo fanno da anni, oltre che “ottima” sarebbe stata anche “originale”
- Anche il “social network della musica” è una idea interessante; *2 anni addietro*, quando acquistai lo Zune, fu uno dei primi servizi che attivai: guardavo la mia pagina del profilo beandomi che i miei “top ascolti” fossero: Afterhours, Depeche Mode, Joy Division, Cure, … E nel sapere che i 4 gatti che lo bazzicavano lo avrebbero saputo. Al pari del punto precedente, sono contento che anche in questo caso le fotocopiatrici di Cupertino abbiano funzionato bene <g>
P.S.: Tra parentesi, l’idea del social network era talmente interessante che Microsoft l’ha ormai praticamente ridotta ai minimi termini, mentre Apple la cavalcherà e tutti crederanno che sia una sua idea. Un po’ come inventare XMLHTTP (e quindi AJAX) per poter implementare OWA e poi dimenticarselo lì per *anni*, e poi tutti a credere che ad innovare sia stata Google quando pubblicò Google Maps. Cose che succedono, se il marketing te lo fa Topo Gigio <g>
|
Krefeld: Vortrag UI/UX-Grundlagen am 15.9.
Roland Weigelt
- Posted 9/1/2010 10:46 PM
|
|
Am 15. September bin ich in Krefeld bei der netug-niederrhein zu Gast und werde dort einen Vortrag zu User Interface Design und User Experience halten. Aus der offiziellen Ankündigung: Viele Entwickler behaupten von sich freimütig, überhaupt kein Gespür für die Gestaltung von Oberflächen zu haben und können mit dem Begriff "User Experience" noch weniger anfangen. Wer es dabei belässt, macht sich die Sache jedoch ein wenig zu einfach, denn häufig ist es nur ein kleiner Schritt von einer schlechten zu einer durchaus akzeptablen GUI. Dieser Vortrag stellt einige grundlegende Gestaltungsprinzipien vor, gibt praktisch einsetzbare Tipps und klärt u.a. was zugekniffene Augen und das Wissen um Fluchtreflexe mit Usability zu tun haben. Es handelt sich dabei um eine leicht erweiterte Version des Vortrags, den ich auf der See# Party in Kreuzlingen (Schweiz) gehalten habe – sozusagen der “Director’s Cut”. Die Veranstaltung beginnt um 19:00, weitere Informationen (Veranstaltungsort etc.) auf der Website der netug-niederrhein.
|
Twitter sucks and must be run by amateurs
Jeff Putz
- Posted 9/1/2010 10:14 PM
|
|
I can't say that I've ever known any kind of Web-based service to suck as much as Twitter, yet be as simple and popular. It really boggles the mind.
As just a regular user, it can be annoying enough with the constant outages and failures. As a developer, it's even worse. In my case, I put a simple hook in CoasterBuzz to publish links from our news page using our cstr.bz short URL's. At the time, you could do simple authorization, as well as OAuth. Since I wasn't dealing in nuclear secrets, and the .NET libraries for OAuth and/or Twitter were somewhere between weak and non-existent, I took the path of least resistance and did up some basic auth against a super simple RESTful URL. It took all of five minutes. And hey, all the docs said is that they'd support basic auth for a long time (or something to that effect).
Then yesterday, I noticed that the publishing is failing. I look at my error logs, and it's 401'ing. I do some looking around to find that they've turned off basic auth. To add insult to injury, I see this on their blog:
Fortunately, developers have known about our transition to OAuth since last December, so they’ve had time to update their apps."
Wow, really? Everyone knew? It's news to me. I pushed out my silly stuff in February, and there was no mention anywhere of any intention to discontinue basic auth, or dates or anything else. Lame.
So I'm chatting with a friend about this, and as we're chatting, lo and behold, e-mail from Twitter lands in our inboxes simultaneously. It contains this gem:
"Over the coming weeks, we will be making two important updates that will impact how you interact with Twitter applications. We are sending this notice to all Twitter users to make sure you are aware of these changes... Starting August 31, all applications will be required to use “OAuth” to access your Twitter account."
You know when this would have been great information? Weeks before September 1, when the e-mail arrived.
My issue is not about using OAuth (however much I'm annoyed that the once simple API is not simple anymore). In fact, the technical merits of using it aren't even an issue to me, as it took less than an hour to fix the problem, and most of that was just evaluating libraries. What annoys me to no end is how unprofessional these kinds of changes are. People are building businesses around Twitter. It's not OK to pull crap like this.
Between this and the annoyance of intermittent outages for the world at large, I can't understand how Twitter is the only game in town. I realize there's a critical mass issue, but the world is a fickle place, especially when it comes to the Internet. Perhaps it's because no one wants to get into a "business" that, to date, has no business.
|
How to Clear the Squid Proxy Cache in Windows
Lance Robinson
- Posted 9/1/2010 8:24 AM
|
For some reason directions for clearing the Squid proxy cache (in Windows) seemed hard to come by on the web, so I thought I’d post them here. Hope this helps someone: - Run MMC and load the services snap-in, kill the running squid process.
- Empty Squid’s cache folder (e.g. C:\squid\vars\cache\).
- Run Squid with the –z parameter to rebuild the cache folder structure (e.g. C:\squid\sbin\squid.exe –z).
- From the services snap-in of MMC, restart the squid service.

|
Race Conditions Don’t Exist
Udi Dahan - The Software Simplist
- Posted 8/31/2010 5:29 AM
|
|
Not in the business world anyway.
The problem is that, as software developers, we’re all too quick to accept them at face value. We don’t question the requirements – in all fairness, it was never our job to do so. We were the ones that implemented them, preferably quickly.
For example
Let’s say we get the requirement [...]
|
Simple Dependency Injection using a Custom MVC Controller Factory
Michael Ceranski
- Posted 8/30/2010 7:29 PM
|
|
Whenever I develop an MVC application there is always some degree of data access required. As a best practice, I usually define a interface that my repository objects will adhere to. Creating an interface is generally a requirement for Dependency Injection (DI). DI is a very important pattern if you plan on doing any unit testing later on. For the purpose of this demo, I am going to keep things simple and only create a fake repository. Here is the code: public interface IRepository
{
Person GetPerson( int id );
}
public class FakeRepository : IRepository
{
public Person GetPerson( int id )
{
return new Person { Id = id, FirstName = "Mike", LastName = "Ceranski" };
}
}
Obviously, in a real-world application you would probably utilize the Entity Framework or LINQ to SQL in order to implement the IRepository interface. However, for the purposes of this demo the FakeRepository illustrates the point. Moving on, the next step is to create a base controller class which all of the other controllers in the application will derive from. The BaseController class has a IRepository property which gets set by the constructor. By having this constructor we can easily “inject” our repository objects.
public class BaseController : Controller
{
public IRepository Repository { get; private set; }
public BaseController(IRepository repository)
{
Repository = repository;
}
}
So now its time to create the "Person" controller which inherits from the BaseController class. We also add a single action named "Details" which will get return a Person model from the repository:
public class PersonController : BaseController
{
public PersonController(IRepository repository) : base(repository) { }
public ActionResult Details( int id = 1)
{
return View( Repository.GetPerson(id) );
}
}
So at this point you may think your work is done, right? Well, if you were to run the application at this point and try to view the Details for the person with the ID 1 (“/Person/Details/1”) you would get an error stating that “No parameterless constructor is defined for this object”. That’s because the default controller factory used in MVC always uses the default constructor to create a controller. Since our PersonController does not have a parameterless constuctor defined, the application throws an error. Obviously, we will need to do a little more work in order to make MVC use our DI friendly constructor. Luckily this is easily accomplished by creating and registering our own custom controller factory. Here is the code:
public class CustomControllerFactory : DefaultControllerFactory
{
public override IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
{
string fqn = string.Format("MvcApplication1.Controllers.{0}Controller", controllerName);
Type controllerType = Type.GetType(fqn);
if (controllerType != null)
{
var repository = new FakeRepository();
return (IController)Activator.CreateInstance(controllerType, repository);
}
else
return base.CreateController(requestContext, controllerName);
}
}
The code above overrides the CreateController method. It uses the Activator.CreateInstance method to create the controller using our custom constructor and passes in a new instance of the FakeRepository class. So now the final step is to register the CustomControllerFactory in the Global.asax:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
ControllerBuilder.Current.SetControllerFactory(typeof(CustomControllerFactory));
}
Now, when I run my application and access the URL "/Person/Details/1" I get the following results:
The end result is a MVC application which allows you to easily inject repository objects for testing purposes! The sample code is attached.


|
Thoughts Inspired By Ruby
John Sheehan
- Posted 8/30/2010 3:32 PM
|
|
Double disclaimer action. I wrote this a few days ago and sat on it because it doesn’t actually have much of a point. If you’re looking for some great cohesive point, it is not here. It’s a rant and has a couple good points, but again, nothing cohesive. Proceed at your own risk. Also, like [...]
|
MySQL Connector/Net 6.2.4 Maintenance release
Reggie Burnett
- Posted 8/30/2010 1:48 PM
|
|
We’re happy to announce the latest maintenance release of MySQL Connector/Net 6.2.4.
Version 6.2.4 maintenance release includes:
Enhancement that allows a procedure to be recreated with a different number of parameters
Fixes for 29 bugs
For details see http://dev.mysql.com/doc/refman/5.1/en/connector-net-news-6-2-4.html
MySQL Connector 6.2.4 :
Provides secure, high-performance data connectivity with MySQL.
Implements ADO.NET interfaces that integrate into ADO.NET aware tools.
Is a fully managed More >
|
Partial Sitecore Cache Clearing by Item
David Peterson
- Posted 8/28/2010 7:18 PM
|
Sometimes you just want to clear part of the Sitecore cache and not the entire thing. Taking a page out of the Staging module philosophy, you can easily clear cache by specific items. First, make sure you understand the basics of Sitecore cache and how requests are handled. The example method below, clears an enumerated [...]
|
Double-Click Click Boom!
Steve
- Posted 8/26/2010 11:40 PM
|
|
Computerworld – Less than 24 hours after Microsoft said it couldn’t patch Windows to fix a systemic problem, attack code appeared Tuesday to exploit the company’s software. Also on Tuesday, a security firm that’s been researching the issue for the past nine months said 41 of Microsoft’s own programs can be remotely exploited using DLL [...]
|
SharePoint Document Libraries and Horrors Oh My
Bil Simser
- Posted 8/26/2010 10:33 PM
|
|
I thought I would capture a few ideas around document libraries and share with the rest of the class. These are not “best practices” as I don’t want to sound too preachy so let’s call them “pretty good practices that you might want to consider if you have some time” (which is far too long for a blog title, hence the one I came up with is going to have to do). SharePoint Fight Club The first rule of SharePoint. I want you to repeat after me. “SharePoint Document Libraries are not file shares.” Good. Now say it again. Good. Remember this, above all other things we’re going to talk about here, and you’ll be golden. Document Libraries are not File Shares I have to repeat this here because it is key. If your users are asking you to put a file share into SharePoint then you need to beat them upside the head when they talk about “replicating the folder structure” or “like for like” or “make it just like *that* (and points to file share)”. If you really must make some kind of analogy and your audience knows something about databases (even Access), rather than saying document libraries are like file shares say “document libraries are like databases”. While SharePoint sits on top of a database it’s kind of irrelevant what the backing store is (side note, Dear Microsoft, please make a pluggable store for SharePoint in the next version) a list or document library is pretty much like a database. A document library may “look” like a file share just because it lists documents (which originated as files) and contains folders (assuming you left this feature on, more on that later) but it’s more like a database than a file share. Each document is just a blob associated with metadata (title, size, date, author, etc.). A team once built a “document management system” in Oracle using… wait for it, blobs associated with tables with columns to hold the metadata for the blob. I laughed when they couldn’t store certain types of blobs and spent a ton of time trying to index the system and build a web UI on front of it (and yes, SharePoint was in the environment, that team chose to talk to me after they built it in isolation). True story. Would you create a folder in a database? No. Great, let’s move on. Working Online Something that is going to be a big hurdle for your users (and yourself if you haven’t got into the mindset) is that you do not need to create new documents on your hard drive. Ever. I see this behavior all of the time: - Start Word/Excel/PowerPoint
- Create content
- Save file to “My Documents” or some such silly place
- Start browser
- Navigate to SharePoint site and document library
- Click on Upload
- Navigate to find document on local drive
Really. Drives. Me. Nuts. With the Office integration with SharePoint 2007 or SharePoint 2010, you’re able to fully integrate your editing experience with SharePoint. If you know your document is going to go into SharePoint then either a) save it to SharePoint when you’re done or b) launch a New document from the document library (which in turn will open the client app and save back to the SharePoint library by default). It’s really simple to show users but will take some coaxing to get them to do this. Of course not everything belongs in SharePoint but it drives this SharePoint guy batshit crazy when I see documents in My Documents, a USB drive, a network share *and* SharePoint (of course every location has a different version). Start using the tools as Microsoft intended you to and you’ll be in a better place. Do_x0020_not_x0020_use_x0020_spaces_x0020_in_x0020_names When you first create a new document library please don’t name it “Project Documents” or “Expense Reports – March 2010” or “Famous kittens I would like to juggle”. Instead name it “ProjectDocuments” *then* go back and change the name in the library settings. The reason why is when you create a new document library and call it “Project Documents” it takes on an internal name of “Project_x0020_Documents” and accessing that library in the browser will result in a url of “Project%20Documents”. That’s fugly not to mention a PITA to deal with. Make everyone happy by crunching the name then going back to rename it to something more human friendly. Frankly I wish SharePoint did this automatically (like it does for publishing pages) but until that happens, we should make a mental note to do it ourselves and be good SharePoint citizens. Hint: This is my golden rule for lists, columns, and views too! Don’t Get So Attached The worst sin (well, one of many) is some guy sending me an email with a document attached to it, usually about a minute after I get the alert the document was added to the library. Better yet, the document copied to a dozen people on my team. I can see the need for this if you have external users who don’t have access to your SharePoint site so that’s perfectly acceptable but you should really compose an email to them with the attachment and send the link to your internal team (I know, two emails are better than one? Your internal team doesn’t need the attachment). It’s really simple to get a link to the document. Right click, copy shortcut, paste. Another tip when pasting the url into an email is to write a word to describe the document (or even “Document is here” is fine too) and highlight the word or phrase and hit Ctrl+K to create a shortcut. SharePoint links can get somewhat long and ugly so pasting that directly into an email can break up the readability. It’s an extra keystroke but worth the effort IMHO. Lather, Rinse, Repeat If you do live in the world where you are interested in versioning is important then go over the draft/publish model with your users. Draft versions have two attributes. First they’re minor versions (0.1, 12.3, 8,348,23.58,328). They’re incremented each time you check a draft version in (and have major/minor versioning turned on). Second, they’re only visible to people that have edit capability on the document library. For example you have some requirement document that’s going to evolve and perhaps go through a few public versions (say one version for each phase; architecture, design, construction, etc.). The team agrees to use versioning and you twist their arm into a using draft/publish model. It’s really simple. Every time they have a minor edit, they check it in (leaving it in draft). The team juggles around reading it, making comments, pontificating, whatever until they’re in agreement of the contents. Then the custodian of the document checks the last version in and chooses to publish it. It becomes the next major version up and visible to readers of the site. This works well because all of your minor edits are behind the scenes (and the number of them can be limited if you choose) and people get to see the polished product. Then it’s back to draft modes and “dot” versions, the cycle repeats itself, until the next major change. Treat documents as living entities that grow up (like an application, or a kid but without the mess) and maybe apply Semantic Versioning to them (publishing a major version when there’s something useful to communicate rather than bumping up the major version on every check in). This will cut down on the chatter between the team and readers don’t have to keep asking what the big change from 1.0 to 2.0 was (remember to add comments when you check in a major version). Document1-draft.doc How many times have you seen a document named this in a document library? True, you might not have versioning turned on but c’mon people. Really? That’s like using zip files for version control when you have a perfectly good SCM system in-house. The best part is that you look in the doclib and see Document1-draft.doc, Document1-final.doc, Document1-final.docx, etc. Sit down with your users and explain the virtues of versioning. Maybe it’s not for them and maybe they don’t need full blown major/minor, draft, publish versioning. That’s fine. However if they’re going to be working on documents that evolve and need to be reviewed it’s probably time to show them a draft/publish model. Bottom line, if you see the –draft, –final behavior then nip it in the bud before it becomes a problem. You don’t have to call your user out in the daily stand up and berate them in front of the team, but be supportive and helpful. Not everyone is a SharePoint Guru like you (and for good reason). SharePoint Inception There are some people that have done some nice things with folders (Laura aka “@wonderlaura” Rogers has a great article on Per Location Views). I feel these are exceptions to the rule. Systemically it probably stems from the file share stigma. People organize information using folders so it’s natural to them. The problem is that (remember?) document libraries are *not* file shares. Stop treating them like that. Folders are like IFRAMEs. They were a great idea but as time went on, without people knowing any better or good ways to use them, they became ugly and nowadays IFRAMEs are pretty evil and frustrating and we don’t have a lot of them around. We’ve grown past them. Now let’s move on from folders. A few things about folders that make them different from nuclear reactors: - Document libraries have a path limitation (actually I think the limitation is on IE or maybe even HTTP) so nesting lots of folders inside of folders chews this up real quick. Trust me when you exceed the path. The error message you sometimes get is a blank screen.
- You generally have to know where something lives in order to find it. This can lead to dozens of clicks on folders depending on how great your folders are named.
- Folders are neither discoverable (other than the top level ones) nor searchable. Metadata is.
Folders don’t help organize information. Yes, I create a folder named “Expense Reports” but that doesn’t mean my smart users are going to put expense reports in them. Or a folder named “Architecture”. I guess I’m going to expect Visio drawings or stickmen or something in here but what happens when I start seeing server inventories in spreadsheets. Is it architecture or detailed design (or a document misfiled from some other project). Metadata and Content Types help you organize information. Folders attach a fixed path to a document. If you drop something in a folder that’s how you retrieve it. If you decide one day to simply move it up or down the folder hierarchy, guess what? All those links are now broken. Using metadata to organize information means “I don’t care where this is but I know what it’s about”. Get into the habit sooner rather than later. Where Am I? Just a bit of a follow-up to using folders. One of the worst things you can do is drop a document library onto the home page of a site. Your site is for information. Try putting announcements, tasks, or pictures of kittens on your team/project home page. Not documents. If you put a document library on the home page and have folders-from-hell enabled have you noticed the evil that is unleashed? No. Take a look again. Click on a folder. Now another one. Now another. Keep going until you’ve descended into the 9th level of Hell. Now take a good look at that url in your address bar. Go ahead. Click it. Now send it to someone with a note “I left your termination notice here” and paste in the link. When your unsuspecting suspect clicks on said link, nine times out of ten, he or she will be taken to… THE HOME PAGE of your site. Cool beans. Note that I said “maybe” so it’s not a guarantee but it’s also not very pretty. Like any Jessica Simpson movie pretty. And your users will grumble and gripe and blame SharePoint, not Jessica Simpson. The other pro (or con depending on how full or empty your glass is) you get from dropping that beloved document library on your home page is the all important bread crumb trail. Pro or con, the breadcrumb trail that you see above a document library when you’re navigating through it is gone. It only exists when you send your users to the doclib itself so forget any navigation up the levels of Hell (or even knowing where you are if you care). Metadata, metadata, metadata Oh but Bil, I can’t find my documents without putting them in a folder called “My Documents”. Now after you noodle on that statement for a minute think about it. You unleash the fury of SharePoint on your team spouting commandments like “THOU SHALT PUT DOCUMENTS INTO THY DOCUMENT LIBRARY” and your team has no clue how to organize documents in a document library (let alone their own desktop) and you yell at them for not “categorizing” or “classifying” them properly. Give yer head a shake. You can’t bash people for playing the game incorrectly if you don’t give them the rules to the game. Metadata is king in the SharePoint world. If you need to organize your documents dump them into a doclib and stick a column on said doclib called “Category” (or “LOLCATegory” if that turns your crank). Make it a choice field and let users add their own or make it a lookup into a list (or better yet use the metadata feature in 2010 but if you’re on 2007 we live in simpler times). Then create a view grouped by category. Create some searches on the category column. Create some views for categories the team feels important like “Important Architecture Documents” or “Things I would like to do to Bil if I could”. Pretty soon the team will be happy because they don’t have to spend 3 hours looking for a document that’s in front of their face. Note that the space-in-names rule doesn’t apply to choices in a choice field. It doesn’t form a url and SharePoint doesn’t go tossing in its “_x0020_” macro on you. Be wild. Breaking Boundaries One final question about document libraries is how much is enough? How many document libraries do I need to store my documents. The answer my friend is “it depends” (oh you knew I was going to say that). Only you or your team or the collective wisdom of whomever is using the library knows what the right division is. There are a few factors you can use to decide where to draw the line. Size might matter (although less so in SharePoint 2010). You might want to break up document libraries based on security. While you can apply security to (gasp) folders or items in SharePoint, it might make more sense to just seclude off a library for privacy. Remember when you created the first team site and got a “Shared Documents” library for free? There’s nothing but fear and common sense preventing you from creating a “Team Documents” and only allow members of the team to have read access (“Unshared Documents” just sounds a little badly in the grammar department). I can tell you I don’t know what the right division of document libraries is but I can tell you what the wrong one is. One document library per document. Yeah, I’ve seen it. It’s evil. Christmas Time Okay, to wrap up let’s just remember two key things: - Document libraries are not file shares
- Dumping files into folders is not organization
I’m sure there are more than two key things you can take away from this, but I had to end this post or else face eviction from my home. Enjoy!
|
|