Domain: msdn.com
Stories and comments across the archive that link to msdn.com.
Comments · 3,271
-
Re:Gunna hate this BUT
I am also a Sharepoint server admin and I would never recommend it to anyone.
As has been said already, it has a lot of really good ideas, all executed terribly. Search is so important, yet Sharepoint is very bad it. Yes you can drag and drop a whole hierarchy of files to add them to sharepoint, but woe to you if one of those files has a name that Sharepoint does not like http://blogs.msdn.com/b/joelo/archive/2007/06/27/file-name-length-size-and-invalid-character-restrictions-and-recommendations.aspx
-
Re:MS is not a hardware company
Woops, brain must've segfaulted and mixed it up with the Dreamcast.
After a bit of research (ie. reading the citations on Wikipedia), it seems that the OS is actually custom-made. However, I don't completely believe that - I suspect pretty large chunks of code, especially on the first XBox, were copied from Windows. 360 I can believe (it's not even x86 - it's PowerPC), but not the original. -
Re:MS is not a hardware company
Slashdot inexplicably submitted instead of previewing. Here's the source:
http://blogs.msdn.com/b/xboxteam/archive/2006/02/17/534421.aspx -
Re:Best book on the subject
Absolutely, feel free to share. All my Slashdot posts are under CC0 ~
And yes, it's a very good explanation of monads. The usual problem these days is that people come to know about them through Haskell, and the first place where they see them in Haskell is the IO monad, and so the association becomes very strong on unconscious level, and hard to untangle (which is absolutely necessary to really understand what they do). This tutorial does a very good job at that.
One other I know of is this, covering monads from C# perspective (complete with using LINQ as syntactic sugar for them). But it's rather less gentle in introducing the basic concepts. On the other hand, it uses real-world examples of non-IO monads (in particular, it demonstrates how Maybe and lazy sequences are both monads).
-
Re:Poor choice of language
here is a nice lecture on this topic: http://channel9.msdn.com/Shows/Going+Deep/C9-Lectures-Dr-Ralf-Lmmel-Going-Bananas
Just don't nest folds because you are to lazy to make higher order functions of them. The most efficient obfuscation mechanism i have ever seen
;) -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Efficiency is hard
Using locks and the like make it very easy to do multithreaded and parallel programs.
The big problem comes when you need multiple locks because you find your program is waiting more on locks than anything else which is gumming up the whole works, and that can easily lead to deadlocks and other fun stuff.
Another way is to consider lockless algorithms, which don't have such blocking mechanisms. However, then you get into issues where atomicity isn't quite so atomic thanks to memory queues and re-ordering done in the modern CPU, and thus have to start adding memory barriers before doing your atomic exchanges.
Raymond Chen (of Microsoft) did a nice write up of the lockfree ways to do things and what Windows provides to accomplish them.
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/05/10149783.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150261.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/06/10150262.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/07/10150728.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151159.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/08/10151258.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/12/10152296.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/13/10152929.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/14/10153633.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/15/10154245.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/19/10155452.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/20/10156014.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/21/10156539.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2011/04/22/10156894.aspx -
Re:Callbacks and Promises
Really the only difference between a synchronous and an asynchronous model is that you shift the burden (and the resources) of multitasking from the the operating system to the application. Under the hood, everything is always asynchronous. It's just that in a synchronous multi-threaded program the OS deschedules a thread whenever you do a blocking call, instead of doing it yourself. So you can consider threads to be syntactic sugar for any I/O bound program.
Both yes and no. Sure, the OS will use processing time to run another thread while one is blocked, but it has to preserve its complete call stack - e.g. on Windows, that's the default reservation of 1Mb for every thread, plus whatever it may have incurred on top of that. With async model, the continuation closure only needs to preserve what it needs to run after control is returned to it, which can be significantly less.
More importantly, you usually can't spawn infinitely many OS threads - they are more lightweight than processes, but they're still not featherweight, so there are limits - so you have to use a thread pool with a hard limit. Now, whenever one of your threads blocks waiting, that thread is a burden on your pool - it's scarce resource (you can't always just grab another thread from the pool to service a new request - there might not be any left!) tied up doing nothing. With async model, your pool is always 100% loaded, and you can service more requests than there are threads.
I disagree with the view that "headaches" of concurrency go away with a continuation model, because in a server environment, you often have to deal with shared resources, and I don't really see how this model helps (note that asynchronous model does not mean no threads...). The two concepts are orthogonal IMHO.
In a server environment, yes, absolutely.
I wouldn't say the concepts are entirely orthogonal, however - asynchrony does not require nor prevent you from doing concurrency, yes, but it does let you write some code that would otherwise have to involve many threads in such a way that it only needs one - really, it's just cooperative multitasking in that mode. And using that lets you forget about concurrency headaches. Of course, this is mostly handy for client apps.
In case of your example, a UI, instead of letting the OS take care of the state of the background threads, you now have to keep state yourself, needlessly complicating application design. For complicated tasks you will get enormous state machines.
If you write this in a language without syntactic sugar for asynchrony, yes, this can be tedious. But did you look at the link in my earlier thread? That's the kind of thing we're heading towards - the state machines would still be there, as complicated as needed to support your logic, but compiler would generate them from said logic encoded in almost exact same way as you do it today in an imperative language - expressions and conditionals and loops and exceptions.
F# already has this today. C# is getting it in the next major release, and a preview of the new compiler is available today. And EcmaScript has a proposal for a very similar thing for Harmony. More to come, no doubt.
-
Re:Callbacks and Promises
Really the only difference between a synchronous and an asynchronous model is that you shift the burden (and the resources) of multitasking from the the operating system to the application. Under the hood, everything is always asynchronous. It's just that in a synchronous multi-threaded program the OS deschedules a thread whenever you do a blocking call, instead of doing it yourself. So you can consider threads to be syntactic sugar for any I/O bound program.
Both yes and no. Sure, the OS will use processing time to run another thread while one is blocked, but it has to preserve its complete call stack - e.g. on Windows, that's the default reservation of 1Mb for every thread, plus whatever it may have incurred on top of that. With async model, the continuation closure only needs to preserve what it needs to run after control is returned to it, which can be significantly less.
More importantly, you usually can't spawn infinitely many OS threads - they are more lightweight than processes, but they're still not featherweight, so there are limits - so you have to use a thread pool with a hard limit. Now, whenever one of your threads blocks waiting, that thread is a burden on your pool - it's scarce resource (you can't always just grab another thread from the pool to service a new request - there might not be any left!) tied up doing nothing. With async model, your pool is always 100% loaded, and you can service more requests than there are threads.
I disagree with the view that "headaches" of concurrency go away with a continuation model, because in a server environment, you often have to deal with shared resources, and I don't really see how this model helps (note that asynchronous model does not mean no threads...). The two concepts are orthogonal IMHO.
In a server environment, yes, absolutely.
I wouldn't say the concepts are entirely orthogonal, however - asynchrony does not require nor prevent you from doing concurrency, yes, but it does let you write some code that would otherwise have to involve many threads in such a way that it only needs one - really, it's just cooperative multitasking in that mode. And using that lets you forget about concurrency headaches. Of course, this is mostly handy for client apps.
In case of your example, a UI, instead of letting the OS take care of the state of the background threads, you now have to keep state yourself, needlessly complicating application design. For complicated tasks you will get enormous state machines.
If you write this in a language without syntactic sugar for asynchrony, yes, this can be tedious. But did you look at the link in my earlier thread? That's the kind of thing we're heading towards - the state machines would still be there, as complicated as needed to support your logic, but compiler would generate them from said logic encoded in almost exact same way as you do it today in an imperative language - expressions and conditionals and loops and exceptions.
F# already has this today. C# is getting it in the next major release, and a preview of the new compiler is available today. And EcmaScript has a proposal for a very similar thing for Harmony. More to come, no doubt.
-
Re:Callbacks and Promises
Ultimately, what you want to do is to hide the whole call-with-continuation pattern that is the fundamental building block of async under a thick layer of syntactic sugar in the language, such that your async code looks almost exactly the same as the corresponding synchronous version, with marker keywords to identify "points of asynchrony" (where the rest of the code path is an implicit continuation, and a closure is generated for it under the hood). Kinda like this in the (yet upcoming) C# 5.0.
Good thing is that there is a proposal for this feature for the next major EcmaScript version. Hopefully it'll end up in the spec.
-
Dancing Bunny / Dancing Pigs Problem
Sure this is a great addition... for power users who are infallible.
But for Joe Average and power users who fall prey to it (who doesn't?), it doesn't address the primary issue - called the Dancing Bunnies or Dancing Pigs problem. And it's a problem with every OS today - Linux, Windows MacOS X, Android, iOS, and others.
A user will run through many hoops to get what they want. They'll root, jailbreak, install alternative app stores, etc just to save 99 cents for an app. Even if they have to do seemingly complex tasks like install an SSH server, run SSH, type command line commands, etc. It can be amazing how much technical skill the untalented suddenly have.
And the problem is, these are the people that get pwned. Jailbroken iPhones with default SSH passwords. Android phones with botnets installed (courtesy alternate marketplaces), Windows/OS X trojans running botnets, etc. Heck, even Bender skipped his antivirus check for pr0n.
And it's a really difficult problem to solve. Even if these options were global and set reasonably, you can anticipate some app telling you it works better if you do these things to let it get the permissions it wants.
Hell, see the latest Facebook spamming trends, where people are doing things like copying-and-pasting URLs or godawful long javascript blobs. We're at the point where really, the Honor System virus does exist.
-
Re:And we care why?
Now if they could only speed up populating the
.net and COM references dialogue box, and let me search/filter them I'd be happy.Does this help?
-
Re:Close, but no Cigar...
Don't go liking this PowerShell too much. If you dig into it you'll see that a shell which displayed images and such using WPF was built using PowerShell something like three years ago.
http://blogs.msdn.com/b/powershell/archive/2008/05/25/powershell-and-wpf-wtf.aspx
-
MS Research did some more useful research here
http://channel9.msdn.com/Blogs/TheChannel9Team/Kevin-Schofield-Tour-of-Microsoft-Research-Part-II-machine-learning
http://research.microsoft.com/en-us/um/people/horvitz/interrupt.htm - this is his stuff about email/IM interruptions
for example this one http://research.microsoft.com/en-us/um/people/horvitz/learninterrupt.htmI have only really watched the video myself, it's an interesting idea - using webcam, microphone and your calendar, try to estimate how much is your time worth (in dollars) at any particular point of time. I guess the guy was so annoyed with IM that he decided to dedicate his research to it
:) -
Re:Surprise
Good old Larry Osterman. He points out this very issue well (which is where I'm assuming you're getting the topic from).
-
[msdn.com]
Any Free [gnu.org] application that isn't digitally signed with Authenticode will get flagged by IE's "SmartScreen application reputation" filter [msdn.com].
What is your source for this claim?
I already linked my source in my grandparent post. If you want title and author before you click through: "'Stranger Danger' - Introducing SmartScreen® Application Reputation" by Ryan Colvin, posted on 13 Oct 2010 3:03 PM. From this page:
To help establish your application's reputation, consider doing the following:
Digitally sign your programs with an Authenticode signature
Reputation is generated and assigned to digital certificates as well as specific files. Digital certificates allow data to be aggregated and assigned to a single certificate rather than many individual programs.
-
How to get free software signed?
Your joke has a point. Any Free application that isn't digitally signed with Authenticode will get flagged by IE's "SmartScreen application reputation" filter. And as I understand it, existing Authenticode CAs sell certificates only to businesses, not to individuals.
-
Re:A silly question
That reminds me of a bit in one of the control registers on the original IBM PC/AT motherboard. It's function: Mask the non-maskable interrupt. That's kinda like dreaming the impossible dream, isn't it?
-
Re:Silly advice
As long as Windows applications are almost universally 32bit, this is pointless. As long as the system has 4GB, the rest is "nice to have for future", nothing more.
Second, even if each application couldn't use more than 4GB, all applications combined certainly can.
-
Re:People just don't line up in China, period!
People just don't line up in China, period! This Apple store incident does not come as a surprise to me.
It's not unusual, either. It's actually a one-dimensional mob that quickly degenerates. It's all about the push and shove, really.
And people in Japan also actually do tne orderly lineup thing. It's really just a Chinese trait.
I'm surprised there's an iPad fight at the Apple Store - Apple's been requiring people to sign up and reserve iPad2's (and iPhone4's) in its Chinese stores for a while now, to avoid all the mobs and crap that has happened.
Like scalpers buying 20 or 30 iPhone4's at a time at the Apple Store (which is unusual, since Apple restricts them to 2 per person), which led to Apple to requiring purchases to sign up online and reserve it ahead of time.
Apple hates scalpers and they've done all sorts of things thwart them, especially with things in tight supply like iPhone4s and iPad2s.
-
Coded UI Tests
Maybe this fits your needs: http://channel9.msdn.com/Blogs/kmcgrath/Introduction-to-Creating-Coded-UI-Tests-with-Visual-Studio-2010
-
Re:Don't do it...
Might not have much of a choice.
**gripes**
Here are my gripes about windows from an admin POV:
1) Unlike unix/unixlike OSes with Windows quite often you cannot rename/move/delete files/dirs that are in use. You might be able to do it in some cases, but not others, it's quite annoying if you are trying to atomically change/upgrade/update stuff without rebooting/restarting too much crap. You may think this is a small thing, but it has a major effect/limit on how you do stuff on windows (even Microsoft has to force reboots to change files).
So you may have to resort to stuff like this: http://technet.microsoft.com/en-us/sysinternals/bb897556Might not be as big an issue once you're large enough to use load balancers
:).2) The fine grained ACLs are good, but they often don't seem to work properly. On Win2k8 I've encountered cases where an account belongs to the Administrator's group but it somehow does not have enough permissions to rewrite/save a file that "full access" permissions to those in the Administrator's group. Why can't I open the file, change it and save it back? When I use that account to copy a file onto that file I get a "privilege escalation" prompt and if I "OK" it it overwrites the file. So the account is definitely in the Administrators group already...
3) I don't know why but lots of Windows stuff tends to have crappy logging by default. You often have unhelpful error messages that say "it hurts", but not tell you where it hurts, or what was being attempted, or what the target was. Some are even more useless! e.g. "UVD Information".
In theory this shouldn't be OS related but somehow I've had a lot less trouble figuring out what's going on from logs in linux/*bsd machines than from windows machines -e.g. it's faster/easier to figure out why email is not being received/sent with the former than the latter.
Searching for stuff in windows event logs is also a pain and a lot slower than using tail and grep on the unix/linux text logs.
4) Too often nobody seems to know what things actually do or how things actually work, not even people working for Microsoft - (e.g. this is not the full story: http://blogs.msdn.com/b/oldnewthing/archive/2007/10/08/5351207.aspx
Apparently there's stuff like a not very documented ITaskList_Deleted property which also affects how windows are handled...
Then there's the ServerXMLHTTP vs XMLHTTP - my colleague found out the hard way that there are cases where ServerXMLHTTP works and XMLHTTP doesn't - he still doesn't know why. I've not seen documentation on the real technical differences - this is light on the details: http://support.microsoft.com/kb/290761 ).As a result there are messageboards, blogs and docs filled with incorrect information.
And there's often no practical way to find out (unless you're an uberhacker who can disassemble megabytes of code in your sleep). With OSS stuff, at least you can look at the source and have a better idea (but sometimes you just go wow it's amazing that stuff even works, maybe I should use something else
;) ).**tips**
OK end of grumbling, here's what I use for when the automation breaks down ;).1) Add notepad, texteditor and hexeditor shortcuts to your SendTo folder. If you are unclear on where your SendTo folder is (because of roaming profiles or other weirdness), go to start, and run shell:sendto
Once you've done that you can right click on any file and open it with your editor/program of choice (add media player classic or VLC if you want
;) ).2) create a folder for utilities. e.g. c:\util or c:\bin and add it to your path (WinXP: winkey+pause, advanced, environment variables, system variables, path. Win2K8:start,right click computer, manage, advanced or something
-
Ha!
I haven't used MySQL at all, so i can't speak directly to it. However i did spend most of today trying to get Oracle set up for the new guy in the office. When we realized we had installed the wrong reason (we needed x86 rather than x64 for reasons that would take too long to go into) it took 15-30 minutes and several false starts just to figure out how to uninstall the old version. Oracle's installers suck. Oracle's "deinstallers" suck even more. Once you've got Oracle installed you find that their drivers are finicky. Then you find that the API is limited, the error messages are often ambiguous, the help available online is limited, and Oracle's website sucks.
I feel kind of ashamed saying it, but from the perspective of both a user and a programmer Microsoft SQL is better in just about every way. Maybe Oracle is much better for DBAs who have to support huge enterprise databases rather than tiny test databases, i dunno, but the face Oracle presents to everyone else is a sadistic one. This has been double so since Microsoft deprecated Oracle support in ADO. I thought supporting Oracle was painful before, but then i had to deal with ODAC! Half of me wants to curse Microsoft for the pain that put me through, while the other half forlornly hopes that perhaps that will convince people to stop using Oracle and it will die. (Unfortunately it's my job to suffer so our users don't notice the difference, and i'm sure there are a lot of other programmers in the same position, so it probably won't happen.)
It's clearly a very personal and obviously biased opinion, but when someone doing anything at all related to SQL says that Oracle is really helping them out, i want to laugh and laugh and laaaaaaugh. And then start crying.
*sigh* I should go to sleep now. I have to get up early tomorrow, go into work, and deal with Oracle some more. *shudder* -
Re:Good.
Sorry, I should have included the link. Miguel describes all the features in the most current version of Mono. At a Microsoft Developers Conference. Enuff Said.
-
Re:Not many tears
I'm not sure what you mean about parallelism being better in C# - can you elaborate?
I suspect he means Parallel LINQ, which is, of course, not a language-specific feature.
there's no equivalent that I'm aware of to something like java.util.concurrent (see previous comment about parallelism)
I'm not saying that it's as rich, but System.Threading.Tasks and System.Collections.Concurrent namespaces provide similar high-level building blocks in
.NET 4.By the way, this is about more than just parallelism - asynchrony is also neatly expressed via tasks/futures, and C# 5 will add some nice syntactic sugar for that.
As a platform though,
.NET has a way to go before it's really mature IMHO.It largely depends on the field of application. You have to remember that
.NET was originally marketed primarily for line-of-business desktop and web apps; in that role, you don't need e.g. a fancy collection framework, but solid database access and a fast UI framework is a must - and so those were prioritized. Consequently, there are areas where .NET is relatively underdeveloped compared to Java, and then there are other areas where it's on par or ahead.structs can burn in hell
Don't diss structs, they're immensely useful for direct, efficient interop with native (read: C/C++) code. With some care, you can even map them to C++ classes, hand-crafting vtables, if your compiler documents their layout.
I do wish we didn't have to use them outside of that area, though. Unfortunately,
.NET JIT is not (yet) good enough to do escape analysis and optimize reference type allocations to occur on the stack rather than heap where possible, like HotSpot does. -
Re:Masses reaction
Actually, and I'll probably get flamed for saying this, you'd be surprised how many have bought the "you just can't infect a Mac!" meme. I got called into an SMB a few years back, where the guy instead of listening to me and paying me to set up a sensible top to bottom least permission approach bought into the "can't infect a Mac!" meme and then was shocked! shocked I tell you, when he found out he got pwned thanks to one of his kids wanting to watch a naughty video and getting the DNS changer bug.
You see the problem is something we that have been in the trenches for quite awhile (I started with Win 3.x, what was that? 20 years ago?) sadly run into far too often, it is what I like to call "magical thinking". it is the "If I use product X I won't have to change my habits or anything, and I'll be unhackable" bullshit. Hell I remember when firewall resellers were pushing the "if you have a firewall you are invisible and untouchable!" and it was bullshit then and it is bullshit now.
NEWS FLASH...ALL OSes can be hacked, full stop. ALL OSes are extremely complex pieces of code, with interactions on top of interactions with third party code thrown in the mix just for shits and giggles. There is NO perfectly unhackable OS and if there was one that person could hire Bill Gates to shine his shoes. The last real legitimate gripe about Windows, the brain dead "hey lets run everyone as admin!" finally died hard with Vista, so frankly all OSes are on about the same footing, as in TFA it all comes down to what the malware writer thinks is profitable.
Think OSX is immune? Read TFA. Think Linux can't be pwned? Look at the Android malware or the KDE screensaver malware that spread awhile back or even this handy how to guide on writing Linux malware.
The ONLY solution is a top to bottom least permissions approach, not magical thinking. Least permissions and users not being so brain dead they actively help the malware writer is the ONLY solution.
As a final note let me give a recent example. I set up a box, had it locked down nicely, required password for admin, least permissions, yet it got pwned in under 45 days. Did I miss something? Nope, the user decided he just had to have Limewire, even though I told him not to, so he disabled the antivirus because it wouldn't in his words "shut up" and then promptly gave permissions to Limewire to do whatever it wanted. And boy did it, 60+ pieces of malware.
So in the end it doesn't matter what the OS, it doesn't matter what kind of permissions model you set up, if you have someone with admin rights that says "I want my emails from Melissa and you WILL let me have them!" then no matter what OS, you're screwed. An OS is only as good as the PEBKAC sitting in front of it.
-
Re:They need 4th and 5th Party HELP too!
-
http://forums.create.msdn.com/forums/93.aspx
-
http://forums.create.msdn.com/forums/93.aspx LOL
http://forums.create.msdn.com/forums/93.aspx
to see how "serious: the Microsoft phone is.
... A joke. It defines pathetic. -
Re:This is why zero-knowledge services are better
That's why I use CrashPlan, because even thought their *client* isn't open source where I can read it, their program lets me use servers under my control to see exactly what they're writing.(*) I'm happy with that. They also have different levels of passwords: lazy let-them-handle-it, or heres-my-half-of-the-key, but I keep the other half.
(*) Of course w/o source, they could be writing to their servers in a different or a decryptable format, I've not sampled the wire to see. But I trust that they're lazy and I can already see that they can encrypt locally -- I don't expect (but they could) that they'll create a totally different module just to send data to their own servers.
I could use their program for free with only my servers, or just run rsync myself. But if I'm that paranoid I shouldn't have my data connected to the internet anyway. -
Re:What's the catch?
Your hypothesis is incorrect. Microsoft does not hate software patents. To the contrary, for years they have been advocating software patents in countries that don't (yet) recognise them. And they are still at it.
-a.d.- -
Re:Nice, but I am sure the /. crowd...
exactly
After zillion clicks I got to actual demo:
http://channel9.msdn.com/Blogs/Peli/TouchStudio-Script-Your-Phone-ON-Your-Phone
Basically the SDK allows you write code text using menu of text choices. So if you want to feel like Stephen Hawking doing some scripting, knock yourself out.
What I see as a decent environment for programming for ANY device that does not have a decent keyboard and screen is an SDK running on conventional laptop, desktop seemlessly connected to the device. You hit Run on your laptop, your app is executed on your device.
The notion of programming while the only thing you have is 3x5 micron touchscreen is idiotic and juvenile.
-
Re:Why?
This is not a limitation of the compiler. You cannot set UTF-8 with GCC either. The actual system API refuses.
Bleh, you're correct
:( I have always assumed that SetThreadLocale(65001) would do that, since CRT goes to great lengths to validate that a locale is not UTF-8 (and I reasoned that, why would they, if they could just get an error from SetThreadLocale if it didn't support it?). But I went ahead and wrote a test app, and it's true - the call fails. I apologize for my mistake - should have verified it rather than relying on common sense.So I googled around to see if there's any explanation. The closest that it gets is the comment from Michael Kaplan (who is the Microsoft i18n guru, so to speak) on his blog post, which goes:
Adam Tue, Jul 4 2006 12:32 PM
Just wondering - is MS planning on making any version of Windows use the UTF-8 codepage (65001) by default (ANSI and/or OEM) at any point in the future?Michael S. Kaplan Tue, Jul 4 2006 12:43 PM
Hi Adam,
This is not in the current POR, due to the fact that the various "A" functions are simply not built to handle a stream that can be up to four bytes per character....Adam Tue, Jul 4 2006 1:21 PM
Why? Don't they use MB_CUR_MAX (or MB_LEN_MAX for static buffers)?Michael S. Kaplan Tue, Jul 4 2006 1:55 PM
Adam, are you kidding? These functions were written ten years ago, some even longer. It is lucky that even DBCS is supported here!Revisting thousands of legacy functions to make them solidly support UTF-8, working in both user and kernel mode, and asking the test team to run tens of thousands of new test cases in all of them, is simply too huge of an effort to ask of the Windows team.
And then he wrote a separate post, where it's plainly said:
And it is still true that UTF-8 (code page 65001) cannot be an ACP ("ANSI" code page") for a locale.
Apparently, 65001 is an "NT code page", whatever this means. So far I could find two actual uses.
First, you can set it as an input or output encoding for the console (which is separate from process or thread locale) - e.g. via chcp. This is really only useful if you have an 8-bit-clean program streaming UTF-8 data, and you want to view that in the console.
Second, 65001 is accepted by MultiByteToWideChar and WideCharToMultiByte (CP_UTF8 is #defined as 65001).
I suspect that if you forcibly set system locale to 65001, you would see the aforementioned breakage in *A functions if you try feeding them UTF-8 strings with 3-byte chars, but not before that. On the other hand, so far as I know, most *A functions in Windows actually call MultiByteToWideChar and then the equivalent *W function, so it's interesting what broken legacy code still remains there...
Assuming that a considerable amount still does, the explanation as to why it all works that way sounds plausible. Originally, Windows codepages were 8-bit (back in Win 3.1 days). The first time they had to deal with something else was during the first attempts to port it for Chinese and Japanese market (Win 3.2, IIRC?); and both of those encodings are double-byte, so the code was written with that in mind. I don't recall when UTF-8 codepage was added, but I'm pretty sure it was not any earlier than Win2K. On the other hand, UTF-16 was used as the system encoding since NT 3.1 (1993), and by the time UTF-8 was even introduced as a codepage, the plan to deprecate *A functions altogether was already at full steam. From that perspective, not rewriting the legacy *A code to handle anything more complicated than DBCS makes sense.
Although I think it would be best to ignore them entirely, if you wanted to make the POSIX subsystem obey them they must limit themselves to changing
-
Re:Why?
This is not a limitation of the compiler. You cannot set UTF-8 with GCC either. The actual system API refuses.
Bleh, you're correct
:( I have always assumed that SetThreadLocale(65001) would do that, since CRT goes to great lengths to validate that a locale is not UTF-8 (and I reasoned that, why would they, if they could just get an error from SetThreadLocale if it didn't support it?). But I went ahead and wrote a test app, and it's true - the call fails. I apologize for my mistake - should have verified it rather than relying on common sense.So I googled around to see if there's any explanation. The closest that it gets is the comment from Michael Kaplan (who is the Microsoft i18n guru, so to speak) on his blog post, which goes:
Adam Tue, Jul 4 2006 12:32 PM
Just wondering - is MS planning on making any version of Windows use the UTF-8 codepage (65001) by default (ANSI and/or OEM) at any point in the future?Michael S. Kaplan Tue, Jul 4 2006 12:43 PM
Hi Adam,
This is not in the current POR, due to the fact that the various "A" functions are simply not built to handle a stream that can be up to four bytes per character....Adam Tue, Jul 4 2006 1:21 PM
Why? Don't they use MB_CUR_MAX (or MB_LEN_MAX for static buffers)?Michael S. Kaplan Tue, Jul 4 2006 1:55 PM
Adam, are you kidding? These functions were written ten years ago, some even longer. It is lucky that even DBCS is supported here!Revisting thousands of legacy functions to make them solidly support UTF-8, working in both user and kernel mode, and asking the test team to run tens of thousands of new test cases in all of them, is simply too huge of an effort to ask of the Windows team.
And then he wrote a separate post, where it's plainly said:
And it is still true that UTF-8 (code page 65001) cannot be an ACP ("ANSI" code page") for a locale.
Apparently, 65001 is an "NT code page", whatever this means. So far I could find two actual uses.
First, you can set it as an input or output encoding for the console (which is separate from process or thread locale) - e.g. via chcp. This is really only useful if you have an 8-bit-clean program streaming UTF-8 data, and you want to view that in the console.
Second, 65001 is accepted by MultiByteToWideChar and WideCharToMultiByte (CP_UTF8 is #defined as 65001).
I suspect that if you forcibly set system locale to 65001, you would see the aforementioned breakage in *A functions if you try feeding them UTF-8 strings with 3-byte chars, but not before that. On the other hand, so far as I know, most *A functions in Windows actually call MultiByteToWideChar and then the equivalent *W function, so it's interesting what broken legacy code still remains there...
Assuming that a considerable amount still does, the explanation as to why it all works that way sounds plausible. Originally, Windows codepages were 8-bit (back in Win 3.1 days). The first time they had to deal with something else was during the first attempts to port it for Chinese and Japanese market (Win 3.2, IIRC?); and both of those encodings are double-byte, so the code was written with that in mind. I don't recall when UTF-8 codepage was added, but I'm pretty sure it was not any earlier than Win2K. On the other hand, UTF-16 was used as the system encoding since NT 3.1 (1993), and by the time UTF-8 was even introduced as a codepage, the plan to deprecate *A functions altogether was already at full steam. From that perspective, not rewriting the legacy *A code to handle anything more complicated than DBCS makes sense.
Although I think it would be best to ignore them entirely, if you wanted to make the POSIX subsystem obey them they must limit themselves to changing
-
Re:I am weary of anything Microsoft
2. can't stop to note that all the examples are LINQ-based. Is this an attempt to grow LINQ in a "standard"?
No, it's an attempt to promote understanding and usage of monads. LINQ is arguably the most widely used implementation of monads, it's just that many people don't realize it.
Brian Beckman's Don't fear the Monads
An excellent article explaining how LINQ is extensible to work with any monad
A video by Erik Meijer explaining the duality of IEnumerable/IObservable and IQueryable/IQbservable, as stated in the original article
-
Re:I am weary of anything Microsoft
2. can't stop to note that all the examples are LINQ-based. Is this an attempt to grow LINQ in a "standard"?
No, it's an attempt to promote understanding and usage of monads. LINQ is arguably the most widely used implementation of monads, it's just that many people don't realize it.
Brian Beckman's Don't fear the Monads
An excellent article explaining how LINQ is extensible to work with any monad
A video by Erik Meijer explaining the duality of IEnumerable/IObservable and IQueryable/IQbservable, as stated in the original article
-
It's been going downhill for a while now
First they rebranded the XNA website as App Hub to help push Windows Phone 7, then they had XBLIG displayed after avatar clothing They did at least attempt to help support independent developers somewhat recently, so they have shown some sign of caring.
-
Re:All against MS?
Your second point, when using Linq or Linq-to-SQL, if you have a complex SQL statement (i.e. it creates a temporary table) it balks and refuses to accept it, claiming the temporary table is illegal. I had to re-write a stored procedure so that parameters and results are returned to VS and afterwards change it back so that it uses the temporary table in order for it to work. I had better experiences with Entity Framework, but then, I haven't yet done any serious work with it.
Oh, L2S, and frankly I think even EF, don't play all that well with stored procedures, but then stored procedures and ORM are inherently conflicting approaches (ORM implies logic in the model layer, which is then separate from data layer, otherwise why bother with objects?). Yeah, I know that EF advertises stored procedure support. I've never tried it personally.
If your system is mainly SP-centric, and on app side all you need is data that is already processed on the database, you will probably do far better with plain ADO.NET (+ typed datasets for Intellisense convenience) over L2S/EF. You can still do small in-memory LINQ queries over them, too.
Then, working with two or three servers (development, sandbox and production) is a nightmare. The dataset gets thrown out of kilter and refuses to load in VS (not work, it does compile and work) making further development harder. If I change the body of ConnectionString (not the Name or other attributes, just the server name and log-in parameters in the connection string) the dataset refuses to load in the development environment, until the conn string is returned to the original condition.
This sounds tricky to help with (since it wouldn't be easily reproducible), but it would still help if you log it as a bug.
Let me tell you a good one. In
.NET 4 (yes the bleeding edge!) and previous incarnations, if you put a DatePicker in your forms (.aspx, WinForms. etc.) and the target is say, Spanish, when you tab from one DatePicker to another, the cursor goes to the month (remember, in Spanish we are talking about dd/mmm/yyyy) instead of the day field; if you try to put in 31 in the day field (first one) when the month is, say, September, it will not let you. So this makes it clear that internally the framework is still working with MONTH first, even when it doesn't make sense. One would think a multi-national company as MS could get this right after so many years, but no; we still have to struggle with small shit like this day in and day out. So much for internationalization.This is curious, because WinForms Calendar and WebForms DatePicker are completely different controls, and validation sequence logic is obviously also separate for both. I suspect it's not really an issue of working with "month first", though; more likely, the validation in both cases is a simple DateTime.Parse and see if it throws; and it probably auto-tabs away from the month field as soon as you type two digits, which triggers validation. So any invalid date input would trigger this, it's just that it's much easier to run into it with a day-first date format.
Anyway, this is a UX defect, and also worth logging on Connect as such. Worst case, it doesn't get fixed, but someone will keep it in mind for future UI frameworks.
As far as internationalization goes... Microsoft actually spends a lot of resources there (for some entertaining stories, read Michael Kaplan's blog - he's the MS guru when it comes to internationalization issues, particularly text and input related). Still, keep in mind that most of its workforce is in Redmond, and the majority of those are Americans. Awareness of the sheer scope of internationalization aspects only truly comes when you're from a non-majority culture, and run into various minor but annoying nits in your daily use of the products that