You've reached the internet home of Chris Sells, who has a long history as a contributing member of the Windows developer community. He enjoys long walks on the beach and various computer technologies.
Saturday, Apr 6, 2002, 12:00 AM in Tools
RegexDesigner.NET
RegexDesigner.NET is a powerful visual tool for helping you construct and test .NET Regular Expressions. When you are happy with your regular expression, RegexDesigner.NET lets you integrate it into your application through native C# or VB.NET code generation and compiled assemblies (usable from any .NET language).

Features:
- Full source
- Interactive matching of .NET regular expressions.
- Syntax highlighted match results, including zero-length matches and hidden characters.
- Tooltips to display matched groups.
- Regular expression matching, replacing and splitting.
- Regular expression projects to save expressions, text to match and all regex options.
- Full code generation for C# and VB.NET for all regex operations.
- Compiled assembly generation.
- Full online help.
Thursday, Apr 4, 2002, 12:00 AM in Interview
Feeding the Engine
Adam Barr, 4/4/2002
On October 26, 1999, it was announced that Microsoft would be one of the four new components in the 30 stocks that make up the Dow Jones Industrial Average. This as a long-overdue recognition of the role of technology in the U.S. economy, and in particular of Microsoft's central place in the industry.
But Microsoft was different from the other three newcomers. It has no computer chip manufacturing plants like Intel, no chain of retail stores like Home Depot, no network phone lines like SBC Communications. Indeed, it's not "industrial" at all. Its product is software; its assembly line the brainpower of its employees. And while companies across America would naturally say their employees are vital to their success, for Microsoft in a large sense the employees are the company.
And that makes Microsoft very particular about who it hires.
Wednesday, Mar 13, 2002, 12:00 AM in The Spout
This is Not a Blog
Web Logging (blogging) is the wave of the future. Blogging is re-making the internet. Blogging is journalism where everyone is the journalist. Blogging is all that and a bag of donuts.
OK. I guess so. I like blogs. I read a bunch of blogs. But most bloggers feel like they have to update their site at least once/day and most do it far more than that. Because of this, their blog entries end up looking like this:
[burb] Excuse me.
It's not that I don't love to read a daily blow-by-blow of these peoples' lives... oh, wait, no, it is that. Maybe a little filtering would be handy?
And while we're on to the filtering thing, maybe we could drop the meta-comments about blogging itself? How cool could blogging really be if every other entry is about the power of blogging itself or, even worse, a link to somebody who linked to your cool description of the power of blogging?!?
Anyway, the spout is not a blog. I only update it when I think I've got something interesting to say (even if it's something that only I'm likely to think is interesting), I don't use any content management software (unless you count ASP.NET and FrontPage : ) and, except for this entry, I don't spend any time talking about the wonder of blogging itself.
Friday, Mar 8, 2002, 12:00 AM in Tools
.NET IM Client Classes
Inspired by my need to know who was calling without hauling my butt off the couch to look at the caller ID on the phone across the room (my father always said that "laziness is the mother of invention"), I built a couple of C# classes for managing an IM connection and an IM session. The test client is a console application that just sends messages and dumps whatever it gets from the IM server to the console, but I think it would serve as the code is the beginnings of a real IM client. It does the MD5 stuff properly and handles being redirected to another IM server, so the hard part of the protocol is already implemented. The sample itself is a handy little program that logs in as an IM user, sends a message to another IM user and logs back off again. Perfect for annoying your office mates. Enjoy.
BTW, Harry Pierson has made a number of updates to this core code to support his full-blown .NET IM client application. Check it out!
Wednesday, Feb 27, 2002, 12:00 AM in The Spout
HTTP is Dead?
Your friend and mine, Don Box, caused quite a stir yesterday with his keynote at European DevWeek in London. Peter Drayton has also written up a summary (which is much more technically meaty), as well as a commentary. There has been some quite spiriting follow up on this talk all over the Internet: the .NET mailing list, the Off Topic mailing list, the REST mailing list and XML Deviant on XML.COM. Also, while I absolutely agree with Don that the way we use HTTP today leads to trouble, I thought that Ian Griffiths, a fellow DevelopMentor instructor, had a wonderful point of view that he allowed me to share:
Guest opinion by Ian Griffiths
Basically Don seemed to be saying that there are two problems with HTTP (and saying HTTP is dead is just an effective way of getting people to listen; I was half tempted to start my Windows Forms speech at the UK MSDN DevCon with "The Web Application is Dead").
One of these is that HTTP is unidirectional. Surely .NET remoting shows that this isn't strictly true: individual connections are directional but it's entirely possible to do callbacks by having connections go in both directions. (Well duh.) The real problem is that the firewall architectures of the internet are designed to make sure the connections only go in one direction; it's not a problem with the protocol per se, it's a problem with the infrastructure. In order to fix this problem you need to change the infrastructure regardless of what you do to the protocol. And if you fix the infrastructure you don't actually need to fix the protocol, since we already know that it's fine on networks that don't deliberately break bidirectional communication.
Arguably one of the main obstacles here is the use of NAT - NAT makes it hard for a client behind a firewall to publish an endpoint. But NAT is fundamentally important because we'd have run out of IP addresses already if it weren't in such widespread use. So the only way to get rid of NAT is for everyone to upgrade to IPv6. This will presumably happen fairly soon since we will run out of IP addresses in any case in about 3 or 4 years. (Windows XP ships with IPv6 support by the way. Type "ipv6 install" at a command prompt if you haven't already. So Microsoft are quietly making IPv6 ubiquitous on the desktop.)
So presuming ipv6 takes off, that's a fundamental technical obstacle to the one-way nature of HTTP removed. But another one remains: just because IPv6 pushes the address exhaustion date out of our lifetimes (we hope), doesn't mean that firewall admins will let connections work both ways through the firewall. The bidirectional problem can only be solved with the blessing of firewall admins. And once you have that you don't actually need IPv6, strictly speaking - given a suitable protocol between the client machines and the firewall there's no reason that NAT can't be done in both directions. (Indeed my sub-$100 firewall appliance can do this on a statically configured basis. It is possible (if a little inconvenient) for machines behind the firewall to publish endpoints successfully.)
UPnP apparently has a solution for this. (A better one than static configuration.) It supports P2P network applications that require clients behind the firewall to be able to accept incoming connections. It defines precisely what you need: a protocol that lets a client machine negotiate with the firewall to open up a port for incoming connections. So it turns out that a technical solution to the problem already exists. (Without even having to invoke IPv6. Although we still need that, due to a shortage of address bits in IPv4.)
So the first problem already has a technical solution. Presume for a moment (and it's a big presumption) that these solutions can be deployed, and firewall admin policies set up so that they are broadly useable.
At this point, the second complaint Don makes - the fact that long-running requests don't sit well with HTTP - becomes much less of an issue. We just need to use separate HTTP requests for the request and the response. We connect to the server, send a request, along with some response endpoint info (a URL). When the server is done it connects to us, sends us a response. And we're done. I'm guessing it would probably be possible to write a .NET remoting channel that works like this. The only obstacle is the ability for clients to advertise endpoints.
So if a client can advertise an endpoint somehow (i.e. it can (a) convince the firewall to let a connection request come in, and (b) work out what the endpoint should be - it needs to be aware of any NAT translation going on) then HTTP can actually solve both the problems raised here. And as far as I can tell, *any* solution to the problems raised is going to have to allow the client to receive incoming requests. In which case why invent a new protocol? Once you've solved the fundamental problems in the network that stop you from doing this, HTTP is good enough.
The only issues are: (1) getting everyone to agree on how clients will expose endpoints (UPnP has had nothing but bad press so far, since the only thing most people know about it is that the first security hole discovered in Windows XP was connected to it somehow; so it might have to be something else...), and (2) convincing firewall admins to allow this functionality to be used.
Of course just because a technical solution exists doesn't mean it's a great solution. Given that this is a fair distance from HTTP as originally envisaged, it would doubtless be possible to design a protocol better suited to the job. But would the benefits be worth it? Everyone already has an HTTP stack and an XML parser - will they flock to implement a new purpose-built solution?
The problems raised in the ZDnet article can essentially be summed up thus: clients can't expose endpoints. To me, this doesn't look like a problem with HTTP, it's a problem with the infrastructure. Changing the protocol is certainly not sufficient to fix the infrastructure problems; it's not clear to me that it is even necessary.
So really this is a social problem, not a technical one. ;-)
If
you're interested in this topic or what other interesting things Don
will say next, he's giving the keynote address at the
Web Services DevCon on March 21-22 in
Beaverton, OR (10 minutes west of Portland).
Wednesday, Feb 27, 2002, 12:00 AM in The Spout
Please Say "Why"
As .NET demands new books and articles and the economy has given a lot of smart folk free time, the world is becoming inundated in .NET books, articles, talks and courses, many of which I am tapped to review. Some are wonderful. Some are awful. Most, however are *almost* good, the path to goodness well within the author's reach but for the answer to one question: "why?"
Most of my feedback is riddled with questions that start with why: "Why was it built this way?" "Why are there three choices and how do I choose?" "Why should I care?" Please, when you write, remember this question and answer it thoroughly and well. The why is *so* much more important than the how. The online documentation for .NET is fabulous for describing the how, once you understand the motivation for this class, that method or the other namespace.
Prose that provides the how is transient, but prose that provides the why becomes classic because the why itself is surprisingly applicable between technologies. At the very least, if you answer the why, it will save me work if I'm to review your prose.
Wednesday, Feb 27, 2002, 12:00 AM in The Spout
How Did You Get Your Start?
Standing in the rain, with his head hung low, couldn't get a ticket, it was a sold out show, heard the roar of the crowd, he could picture the scene, put his ear to the wall and like a distant scream, he heard one guitar, just blew him away, saw stars in his eyes and the very next day, bought a beat-up six string in a second hand store, didn't know how to play it, but he knew for sure that one guitar felt good in his hands, didn't take long to understand, just one guitar, slunk way down low, was a one-way ticket, only one way to go, so he started rocking, ain't never gonna stop, gotta keep on rockin', someday gonna make it to the top and be a Jukebox Hero....
Jukebox Hero, Foreigner
It's my understanding that once a musician reaches a certain level of notoriety, they are often asked how they got their start, so that the fan can obtain the level of success that the musician has obtained. Over the years, I've received quite a few of these kinds of emails, all of which flatter and surprise me, since I don't feel like I've obtained the level of success that I'd like to. Still, I'm happy to offer, if not advice, than a list of what I did to obtain a level of recognition in our little circle.
It all started in early 1994, when I went to work for DevelopMentor. Don's strategy, which remains in place to this day, was to give every instructor the opportunity for "stardom." He had just started to obtain his own notoriety in the industry with his flamboyant personality, teaching and answering every other question on the DCOM mailing list. From there, he used his political acumen to make friends with conference organizers and book publishers, working to add the same level of rigor to Windows development as he was accustomed to applying in the pursuit of his PhD.
Since Don is a fellow that gains happiness in togetherness (or, put another way, "misery loves company"), he dragged the rest of us into his world of course authorship, 24x7 mailing lists, speaker anxiety, article deadlines and demanding book editors. To find my place in this world, I did the following, leveraging the success I had in the early work to make the later work happen:
- Answered every other question on the DCOM and ATL mailing lists and continue to be very active on the .NET mailing list.
- Wrote and gave numerous courses and conference talks.
- Wrote a number of books and articles.
- Put up a web site dedicated, initially, to the various bits and pieces of code I'd built and then expanded it as I had more to say (which turned out to be quite a lot, apparently : ).
- Took as much consulting as I could to gain real-world experience, which I put into my other work.
- Asked fans and happy clients to post their comments on Amazon or allow me to post to my own web site.
- Crazy things just for fun, e.g. pose naked or misinterpret an email on purpose in order to post a humorous response.
- Made friends with the owners and producers of the technology in which I was interested.
- Threw a couple of conferences.
- Started (and stopped) a department to build software developer tools.
- Launched my own (budding) software development tools.
- Launched a couple of source available projects with folks from the community.
- Launched my own mailing list.
It seems like a lot, but practically everything I've done since 1994 has been published with my name on it, making me as much an agent for myself as an actual "musician" (I believe the phrase is "shameless self-promotion" : ). Based on this experience, here are the guiding principles that I try to follow:
- Do the right thing. My father always used to say that anything worth doing was worth doing right and that the right thing was easy to spot -- its was the hardest.
- You can't win if you don't bet.
- Be very thorough so that I can be sure of myself, leading to...
- Take a stand. Have an opinion. Defend my opinion until I have been convinced of my mistake, then admit my mistake and take up the opposite stand with equal vigor.
- Try a lot of things and don't be afraid to make mistakes.
- Be quick to give credit and admit mistakes, both in public and in private.
- Recognize opportunity and follow up.
- Get down to the real "why" of something, whether it's computer technology or another kind of technical discipline.
- Recognize the people, on the other hand, don't always have a "why," and learn to deal with it (I still work on that!).
- Always strive for quality over the quick and dirty.
- Concentrate on the things that I really want to do. I like to say "Only do those things that you can't *not* do," but in a down economy, I've learned to temper that with fiscal reality.
- Finish what I start.
- Make sure people are happy with my work and don't stop 'til they are.
- Have balance in my life. I have a wife and children that I love and spend as much time with as possible.
- Horse trade. I am always willing to offer what I have, e.g. experience, time, contacts, etc, for what I want, e.g. work, money, content, etc.
- Help other people find their own places. I'm constantly concerned with my friends and their happiness and will do whatever I can to help them get to do whatever it is that they "can't not do." This is a lesson I learned from Don. He helped me to become all that I could be and, in turn, I do my best to help others.
Actually, most of this I learned from Don, either directly or indirectly. I guess my only real piece of advise is to try to find someone you admire and to do what they do. Don was my main mentor, but I've had many over the years and they're invaluable, even if all I had was a beat-up six string...
Tuesday, Feb 19, 2002, 12:00 AM in Interview
Tough Interview
Chris Sells, 2/19/2002
I woke up this morning with a splitting headache. Just before I woke, I was dreaming that I was interviewing at Microsoft. They held nothing back. It was a group affair with several role-playing scenarios to see how I would handle them. At the end, they threw a mock wedding and sat Tate Donovan (Joshua from the Friends TV show) right next to me while he pretended to be a loud, drunk uncle. I ended up dragging him outside into the street and when he pulled a knife (he was also a Vietnam vet, apparently). I was able to get in one good shot before he "killed" me. Later I attempted to save face by explaining to Tate that I would've done better, but I was afraid to hurt him. Tate looked at me as if to say, "At Microsoft, we don't hold back." Tough interview.
Monday, Feb 18, 2002, 12:00 AM in Interview
More Reaction from Microsoft
2/18/2002
I've heard from several of my friends at Microsoft (and yes, I do have some...), that Microsoft is not such a terrible place to work, but nobody puts it better than Mike Byron:
"Huh. Ran into your Web page about Microsoft. I gotta comment on one thing I saw there:
'Over the years I've been collecting interview questions from Microsoft. I guess I started this hobby with the intent of working there some day, but now that I have a wife and two kids, that's pretty much out of the question.'
"Baloney. I've been working at Microsoft for almost 5 years. I have a wife and twin 7-year-olds. I have an active church life. I work around 40-45 hours per week, and have for the whole time. I have a GREAT time at Microsoft. I'm a veteran of Silicon Valley. Been creating mostly systems software since 1977. Microsoft is no different from most Silicon Valley companies --better hours than most startups, more driven than HP. I do work an occasional 50-55 hour week close to ship time.
"Now, there are people that work here with completely different stories. But I am in no wise unique. I have lots of friends in basically the same position -- 40 hour weeks."
Thanks for the quote, Mike. I'll try not to get you into "trouble..."
Monday, Feb 18, 2002, 12:00 AM in Interview
Reaction from Microsoft
2/18/2002
Here's a quote from an anonymous source:
"I was given your page address from a friend who happens to work at Microsoft and does interviews. He has told me that Microsoft has told all its interviewing employees to keep an eye on your page for ideas and thoughts."
Figures. I set out to help the interviewees and I end up helping the interviewers. Is there nothing that Microsoft can't leverage for their own benefit?
Monday, Feb 18, 2002, 12:00 AM in Interview
Smart is Not Enough
2/18/2002
Here's a recent Fortune magazine article about the MS interview process and the culture. Scary...
Sunday, Feb 17, 2002, 12:00 AM in Interview
Contacting Microsoft
2/17/2002
If you'd like to beg Bill directly for a job, his email is billg@microsoft.com. If you'd actually like an answer some day, send your questions to askbill@microsoft.com.
Saturday, Feb 16, 2002, 12:00 AM in Tools
Welcome to Genghis!
Welcome
to Genghis
Genghis is a set of extensions built on top of .NET and integrated with WinForms to provide application-level services in the same flavor as the Microsoft Foundation Classes. Genghis gets its name as the functional heir to Attila, a similar set of functionality built on top of ATL.
Disclaimer
Most of the Genghis classes were built by different folks and while every effort was made to keep things consistent by choosing .NET and WinForms design techniques, everyone does things their own way.
This work is the work of the individuals involved and does not represent any contribution of their respective employers. You are under no obligation to use any of Genghis at any time, but if you do, you are required to abide by the License.
Installation
You can download the latest Genghis source code from here. The Genghis archive includes this page, the source code to the Genghis class library, a series of samples showing off the various classes and a pre-built, signed version of genghis.dll in the redist folder. Notice that some of the samples use the Genghis files directly instead of using the compiled Genghis assembly. Either usage is supported by Genghis (except where it drives the WinForms Designer nuts).
Source Code Control
Genghis source code control has been moved to the Genghis CodePlex workspace. Thanks to GotDotNet and Rob MacFadyen for hosting the previous versions.
Building Genghis
Genghis is written in C#. Building Genghis requires Visual C# or Visual Studio.NET. Visual Studio.NET solution and project files (*.sln and *.csproj) are provided to build Genghis and all the samples. You should be able to load any solution file into Visual C#/Visual Studio.NET and build the project for yourself.
A NAnt build script (Genghis.build) is also provided. It is used to make the snapshot for Genghis, and is not designed for general use. You may wish to use this file to simulate the snapshot build process; please be aware that you will not be able to properly sign the release mode Genghis DLL (the private key is not provided in this distribution).
For Visual Studio.NET related build issues, please contact the Off Topic Windows mailing list. This is where the Genghis contributors have their discussions, and most of them will be familiar with Visual Studio.NET builds of Genghis. If you have NAnt related build issues, you should contact Mike Marshall (the Genghis build master) directly.
Thanks to Brad Wilson for the NAnt build scripts for folks without VS.NET.Bug Reports
Bugs will now be kept in the Bug Tracker section of the GDN Workspace.
Please do not send Chris Sells or any of the other contributors personal email complaining about Genghis. Also please do not post Genghis bug reports to any mailing list. A much better way to contribute to the life of Genghis is to submit the fix along with the bug report.
Submission Guidelines
- Submissions should be in the Genghis namespace (I don't think we'll have to worry about collisions... : ).
- Submissions should be single-file and stand-alone as much as possible. The goal is that Genghis can be built as a DLL and used as a whole or that bits of its source can be pulled into individual projects as needed ala atl.dll vs. atlwin.h.
- All code should be commenting using C# doc comments so that docs can be generated via Tools->Generate Source Comments.
- All source code files should include the copyright and license notice.
- All code shall be set to use spaces, not tabs, and a vanilla coding style.
- When hacking on existing code, thou shall conform to the existing coding standard of the file. Many coding standards are readable, but not when mixed.
The Genghis Group
This group is made up of official Genghis contributors:
- Chris Sells (9 features)
- Ethan Brown (5 features)
- Horst Veith (2 features)
- Michael Weinhardt (2 features)
- Shawn Wildermuth (2 features)
- Chris Burrows (1 feature and 1 sample)
- Paul Bartrum (1 feature and 1 sample)
- Matthew Adams (2 features)
- Ethan Smith (1 feature)
- Ramakrishna Vavilala (1 feature)
- Shawn Van Ness (1 feature)
- Peter Foreman (1 feature)
- Husein Choroomi (1 feature)
- Dean Cleaver (1 sample)
- Jeff Key (1 feature)
- Mike Marshall (current build master and 3 features)
- Brad Wilson (former build and CVS master)
Who Does What
If you'd got something you'd like to see contribute to Genghis, please let me know (multiple people are free to collaborate on a single feature).
Feature |
Owner(s) |
Progress |
Screen Shot(s) |
Command line parser |
included |
||
Completion combo |
included |
||
Control hosting status bar |
included |
||
Cursor changer |
included |
||
Custom check state treeview |
included |
||
Custom XP theming controls |
included |
||
File Search Engine |
included |
||
FileDocument class (doc/dirty bit management) |
included |
||
FindReplaceDialog |
included |
||
FolderNameDialog |
included |
||
HandleCollector for the world |
included |
||
Header group box control |
included |
||
Image combo |
included |
||
More robust validation ala WebForms |
included |
||
Most-Recently-Used (MRU) files support |
included |
||
MSN Messenger-style popup window |
included |
||
Multiple Top-Level Windows |
included |
||
Multiple-instance detection |
included |
|
|
Path resolution b/w UNC, local (including SUBST, etc) |
included |
||
Retrieving mapped drives |
included |
||
Retrieving shares |
included |
||
Screen Saver class |
included |
screenshot (sorta : ) |
|
Scrollable Picture Box |
included |
||
Sorting listview (including the little triangle thingy) |
included |
||
Splash Screen class |
included |
||
Status Bar Extender |
included |
||
WebCommandLineHelper |
included |
||
Window serializer |
included |
||
Wizard framework |
included |
||
| HtmlLinkLabel class | Jeff Key | included | screenshot |
| User-resizable panel | Ethan Brown | included | screenshot |
Gradient Progress Bar |
included |
||
Command updating |
sample |
||
Cool bars/Cool menus |
sample |
||
Docking App Bar |
sample |
||
A real image list control |
Matt Wilson (of Attila fame!) |
pending |
|
Advanced layout managers, e.g. grid/table |
pending |
|
|
Command routing |
pending |
|
|
Dynamically docking/undocking windows |
pending |
|
|
href exe-safe serialization framework |
pending |
|
|
Managed HTML display ala a C# port of Mozilla? |
pending |
|
|
Menu/toolbar editing ala Office or VS.NET |
pending |
|
|
Outlook-style Bar |
pending |
|
|
SDI, MDI and Explorer-style application wizard |
pending |
|
|
Tab-based MDI implementation (ala VS.NET) |
pending |
|
|
Tear-off menus |
pending |
|
Note: Anything marked with "sample" means that there's a sample included with Genghis that shows the current implementation of a feature but that it's not done enough to be part of the official Genghis component. Mostly the hold-up is integration with the WinForms Designer.
Documentation
The Genghis documentation is composed of the C# documentation comments as part of the automated build. Check redist\Genghis.chm for the latest.
SimplePad
SimplePad is an MFC application that should serve as a simple baseline for what Genghis should enable to be built easily. We currently need a raw WinForms implementation to help guide the Genghis development efforts. After building it, use Help->Help Topics to see the list of features that the MFC SimplePad application provides straight out of the wizard (also duplicated here):
- MDI application
- Multiple documents
- Multiple views per document that are updated as the document changes
- "Dirty" bit handling
- Title bar that shows the document with the current focus along with a dirty indicator, i.e. the asterix.
- File New, Open, Save, Save As, Exit and MRU
- MDI Window menu
- Separate icons for the application and the documents
- Association of the icons with the documents in the shell
- Dockable, floating toolbar
- Print, Print Preview, Print Setup
- Edit Undo, Cut, Copy and Paste.
- View Toolbar and Status bar
- Help Topics and About
- Context-sensitive help
- Status bar that updates when menu items or toolbar items are in "focus", as well as showing NUM, SCROLL and CAPS as these keys change. Since Microsoft has shown that no one looks at the status bar much, the auto-update as items come into focus is not a feature that needs to be duplicated in WinForms/Genghis.
- Command line launching of the application based on the application's file extension
- Drag-n-drop from the file explorer
- Double-click support from the file explorer (including routing open requests to a currently open application)
The current .NET implementation of SimplePad is now available as one of the Genghis samples. Thanks to Paul Bartrum and Chris Burrows for all their hard work on this!
History
-
03/09/04: Release v0.5:
- New HtmlLinkLabel class from Jeff Key that knows how to launch IE and EXEs directly w/o requiring you to handle the event
- Much prettier images in SimplePad from Chris Burrows
- Updated MRU code from Michael Weinhardt to match .NET event signature conventions and to fix a problem when using more than one MRU components on a single menu
- Updated FileSearchEngine code from Mike Marshall to check for whole words at beginning and end of line correctly
- Updated validation code from Michael Weinhardt with support for validating controls at a container level, e.g. validating controls on a tab instead of on an entire form
- New gradient progress bar from Mike Marshall
- Updated FileDocument from Chris Sells to match text of Windows Forms Programming to include more MFC-like features like a pluggable scheme for serialization handling, registration of document extension with the shell, and adding to recent docs, i.e. Start->Documents
- Updated HandleCollector from Ethan Brown to work with .NET 1.0 and .NET 1.1
- Performance enhancements from Ethan Brown in the MappedDrives and SystemShares classes
- New user-resizable panel from Ethan Brown
- Updated WebCommandLineHelper from Andrew Duncan to fix System.IO.FileLoadException in ieexec.exe
- Updated AniForm from Mike Marshall to support stacking ala SharpReader and fix a terminal server-related bug
- Updated cool menu sample from Chris Burrows with additional support for abstracting commands from click even handlers
-
4/25/03: Release v0.4:
- Everything tested under VS.NET 2002 & 2003 (except HandleCollector, which doesn't work under VS.NET 2003)
- Mike Marshall's AniForm -an MSN Messanger-style popup window
- Chris Burrows' Image Index Editor - a UI Type Editor for use with ImageList index selection
- Dean Cleaver's .NET AppBar implementation (a C# port of original code from Jeffrey Richter)
- Mike Marshall's File Search Engine: a text file search implementation with behavior similar to dev studio's "Find In Files"
- Matthew W. Adams' et. al. Themed controls
- Chris Sells's InitialInstanceActivator. The InitialInstanceActivator makes sure that only one instance of an application is started and when another instance is started, the first instance is passed the command line arguments passed to the initial instance
- Chris Sells's MultiSdiApplicationContext class for allowing multiple top-level Windows Forms
- Peter Stephens' changes to the CommandlineParser that fix some bugs as well as add the ability to skip the first argument
- Matt Berther's additions to the CompletionComboBox to fire an event when the text typed does not match any items in the dropdown
- Peter Foreman's splash screen implementation
- Chris Sells's newly improved WebCommandLineHelper class which now works with .NET 1.0 and 1.1, includes URL decoding and requires no additional permissions (although it does require a server-side HTTP handler, included as the ConfigFileHandler class that maps requests for foo.exe?bar=quux.config to the foo.exe.config file).
- Shawn Wildermuth's WizardSheet updates
- Chris Sells's Status Bar Extender for mapping status messages to Windows Forms controls
- Andre Van Der Merwe's CommandLineParser
changes as described below:
- Added ValueDelimiters: enum for ValueUsageAttribute which lets the user specify which (combination) of delimiters (space, : or =) will be allowed
- Added AllowOnOff: bool in FlagUsageAttribute to specify if a +/- suffixes can be used on the flag
- Added EnvironmentDefaults: string in ParserUsageAttribute, allows the user to specify defaults in an environment variable (ala DIRCMD).
- Modified
the Long&Short help generation functions to
- Format/pad flag/param names correctly regardless of length
- Show [+|-] prefix (if applicable) for flags
- Show [sp|:|=] delimiters (as applicable) for values
-
08/18/02: Release v0.3:
- Screen shots for everything.
- CVS repository available, as provided by our rmTrack sponsor, along with extensive CVS docs from Brad Wilson.
- MRU support from Michael Weinhardt, including both in-menu and sub-menu support.
- A much more robust set of validation components from Michael Weinhardt (Michael's been busy : ) modeled along the lines of the ASP.NET validation components, including required, regex, range and comparison validators.
- FileDocument component from Chris Sells for document/dirty bit handling.
- Wizard support from Shawn Wildermuth, including changing page groups on the fly!
- Custom state treeview from Chris Sells so that you can set and show all three checkbox states.
- A class to expose the WinForms HandleCollector from Ethan Brown so that you can put your own custom resources into it.
- A Screen Saver class from Shawn Van Ness.
- A bunch of file utility classes from Ethan Brown, including retrieving mapped drives, retrieving shares and path resolution b/w UNC, local (including SUBST, etc).
- A cursor changer class that works with the using block by Shawn Wildermuth.
- A WebCommandLineHelper class from Chris Sells to parse command line arguments from the URL used to launch href-exes.
- Update to the FileNameDialog from Deepak Shenoy to include newish flags.
-
6/10/02: Release v0.2:
- Updated ListViewSorter to be declarative. Look for Designer support ASAP.
- Generated new genghis.key and removed it from the distribution.
- Brad Wilson, our new Build Master, contributed a Nant build.
- Paul Bartrum and Chris Burrows contributed a mostly-complete .NET implementation of SimplePad, along with some sample command updating and cool menus implementations.
- Paul Bartrum also provided a window serializer and a preference class.
- Michael Weinhardt contributed an MRU sample.
- I contributed a custom state treeview useful for things like tri-state checkboxes.
- Minor bug fixes.
- 4/3/02: Released v0.1.
- 2/28/02: Set the license.
- 2/16/02: Posted this page.
Sponsors
rmTrack provided the initial hosting space and administration support for Genghis bug tracking and source code control.
License
Copyright © 2002-2004 The Genghis Group
Th is software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, subject to the following restrictions:
-
The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product, an
acknowledgment in the product documentation is required, as shown here:
Portions copyright © 2002-2004 The Genghis Group (http://www.genghisgroup.com/).
- No substantial portion of the source code of this library may be redistributed without the express written permission of the copyright holders, where "substantial" is defined as enough code to be recognizably from this library.
License Note
This license based on the open source zlib/libpng license. The idea was to keep the license as simple as possible to encourage use of Genghis in free and commercial applications and libraries, but to keep the source code together and to give credit to the Genghis contributors for their efforts. While this license allows shipping Genghis in binary form, if shipping a Genghis variant is the sole purpose of your product, please contact The Genghis Group for a new license.
Saturday, Feb 16, 2002, 12:00 AM in Interview
Microsoft Interview Questions
2/16/2002 The following are actual questions from actual interviews conducted by Microsoft employees on the main campus. Microsoft Consultants are sometimes allowed to have a life, so questions asked of them during interviews don't really count and aren't listed.
The questions tend to follow some basic themes:
Riddles
- Why is a manhole cover round?
- How many cars are there in the USA? (A popular variant is "How many gas stations are there in the USA?")
- How many manhole covers are there in the USA?
- You've got someone working for you for seven days and a gold bar to pay them. The gold bar is segmented into seven connected pieces. You must give them a piece of gold at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker?
- One train leaves Los Angeles at 15mph heading for New York. Another train leaves from New York at 20mph heading for Los Angeles on the same track. If a bird, flying at 25mph, leaves from Los Angeles at the same time as the train and flies back and forth between the two trains until they collide, how far will the bird have traveled?
- Imagine a disk spinning like a record player turn table. Half of the disk is black and the other is white. Assume you have an unlimited number of color sensors. How many sensors would you have to place around the disk to determine the direction the disk is spinning? Where would they be placed?
- Imagine an analog clock set to 12 o'clock. Note that the hour and minute hands overlap. How many times each day do both the hour and minute hands overlap? How would you determine the exact times of the day that this occurs?
- You have two jars, 50 red marbles and 50 blue marbles. A jar will be picked at random, and then a marble will be picked from the jar. Placing all of the marbles in the jars, how can you maximize the chances of a red marble being picked? What are the exact odds of getting a red marble using your scheme?
- Pairs of primes separated by a single number are called prime pairs. Examples are 17 and 19. Prove that the number between a prime pair is always divisible by 6 (assuming both numbers in the pair are greater than 6). Now prove that there are no 'prime triples.'
- There is a room with a door (closed) and three light bulbs. Outside the room there are three switches, connected to the bulbs. You may manipulate the switches as you wish, but once you open the door you can't change them. Identify each switch with its bulb.
- Suppose you had 8 billiard balls, and one of them was slightly heavier, but the only way to tell was by putting it on a scale against another. What's the fewest number of times you'd have to use the scale to find the heavier ball?
- Imagine you are standing in front of a mirror, facing it. Raise your left hand. Raise your right hand. Look at your reflection. When you raise your left hand your reflection raises what appears to be his right hand. But when you tilt your head up, your reflection does too, and does not appear to tilt his/her head down. Why is it that the mirror appears to reverse left and right, but not up and down?
- You have 4 jars of pills. Each pill is a certain weight, except for contaminated pills contained in one jar, where each pill is weight + 1. How could you tell which jar had the contaminated pills in just one measurement?
- The SF Chronicle has a word game where all the letters are scrambled up and you have to figure out what the word is. Imagine that a scrambled word is 5 characters long:
- How many possible solutions are there?
- What if we know which 5 letters are being used?
- Develop an algorithm to solve the word.
-
There are 4 women who want to cross a bridge. They all begin on the same side.
You have 17 minutes to get all of them across to the other side. It is night.
There is one flashlight. A maximum of two people can cross at one time. Any
party who crosses, either 1 or 2 people, must have the flashlight with them.
The flashlight must be walked back and forth, it cannot be thrown, etc. Each
woman walks at a different speed. A pair must walk together at the rate of the
slower woman's pace.
Woman 1: 1 minute to cross
Woman 2: 2 minutes to cross
Woman 3: 5 minutes to cross
Woman 4: 10 minutes to cross
For example if Woman 1 and Woman 4 walk across first, 10 minutes have elapsed when they get to the other side of the bridge. If Woman 4 then returns with the flashlight, a total of 20 minutes have passed and you have failed the mission. What is the order required to get all women across in 17 minutes? Now, what's the other way?
- If you had an infinite supply of water and a 5 quart and 3 quart pail, how would you measure exactly 4 quarts?
- You have a bucket of jelly beans. Some are red, some are blue, and some green. With your eyes closed, pick out 2 of a like color. How many do you have to grab to be sure you have 2 of the same?
- If you have two buckets, one with red paint and the other with blue paint, and you take one cup from the blue bucket and poor it into the red bucket. Then you take one cup from the red bucket and poor it into the blue bucket. Which bucket has the highest ratio between red and blue? Prove it mathematically.
Algorithms
- What's the difference between a linked list and an array?
- Implement a linked list. Why did you pick the method you did?
- Implement an algorithm to sort a linked list. Why did you pick the method you did? Now do it in O(n) time.
- Describe advantages and disadvantages of the various stock sorting algorithms.
- Implement an algorithm to reverse a linked list. Now do it without recursion.
- Implement an algorithm to insert a node into a circular linked list without traversing it.
- Implement an algorithm to sort an array. Why did you pick the method you did?
- Implement an algorithm to do wild card string matching.
- Implement strstr() (or some other string library function).
- Reverse a string. Optimize for speed. Optimize for space.
- Reverse the words in a sentence, i.e. "My name is Chris" becomes "Chris is name My." Optimize for speed. Optimize for space.
- Find a substring. Optimize for speed. Optimize for space.
- Compare two strings using O(n) time with constant space.
- Suppose you have an array of 1001 integers. The integers are in random order, but you know each of the integers is between 1 and 1000 (inclusive). In addition, each number appears only once in the array, except for one number, which occurs twice. Assume that you can access each element of the array only once. Describe an algorithm to find the repeated number. If you used auxiliary storage in your algorithm, can you find an algorithm that does not require it?
- Count the number of set bits in a number. Now optimize for speed. Now optimize for size.
- Multiple by 8 without using multiplication or addition. Now do the same with 7.
- Add numbers in base n (not any of the popular ones like 10, 16, 8 or 2 -- I hear that Charles Simonyi, the inventor of Hungarian Notation, favors -2 when asking this question).
- Write routines to read and write a bounded buffer.
- Write routines to manage a heap using an existing array.
- Implement an algorithm to take an array and return one with only unique elements in it.
- Implement an algorithm that takes two strings as input, and returns the intersection of the two, with each letter represented at most once. Now speed it up. Now test it.
- Implement an algorithm to print out all files below a given root node.
- Given that you are receiving samples from an instrument at a constant rate, and you have constant storage space, how would you design a storage algorithm that would allow me to get a representative readout of data, no matter when I looked at it? In other words, representative of the behavior of the system to date.
- How would you find a cycle in a linked list?
- Give me an algorithm to shuffle a deck of cards, given that the cards are stored in an array of ints.
-
The following asm block performs a common math function, what is it?
cwd xor ax, dx sub ax, dx
-
Imagine this scenario:
I/O completion ports are communictaions ports which take handles to files, sockets, or any other I/O. When a Read or Write is submitted to them, they cache the data (if necessary), and attempt to take the request to completion. Upon error or completion, they call a user-supplied function to let the users application know that that particular request has completed. They work asynchronously, and can process an unlimited number of simultaneous requests.
Design the implementation and thread models for I/O completion ports. Remember to take into account multi-processor machines. - Write a function that takes in a string parameter and checks to see whether or not it is an integer, and if it is then return the integer value.
- Write a function to print all of the permutations of a string.
- Implement malloc.
- Write a function to print the Fibonacci numbers.
- Write a function to copy two strings, A and B. The last few bytes of string A overlap the first few bytes of string B.
- How would you write qsort?
- How would you print out the data in a binary tree, level by level, starting at the top?
Applications
- How can computer technology be integrated in an elevator system for a hundred story office building? How do you optimize for availability? How would variation of traffic over a typical work week or floor or time of day affect this?
- How would you implement copy-protection on a control which can be embedded in a document and duplicated readily via the Internet?
- Define a user interface for indenting selected text in a Word document. Consider selections ranging from a single sentence up through selections of several pages. Consider selections not currently visible or only partially visible. What are the states of the new UI controls? How will the user know what the controls are for and when to use them?
- How would you redesign an ATM?
- Suppose we wanted to run a microwave oven from the computer. What kind of software would you write to do this?
- What is the difference between an Ethernet Address and an IP address?
- How would you design a coffee-machine for an automobile.
- If you could add any feature to Microsoft Word, what would it be?
- How would you go about building a keyboard for 1-handed users?
- How would you build an alarm clock for deaf people?
Thinkers
- How are M&Ms made?
- If you had a clock with lots of moving mechanical parts, you took it apart piece by piece without keeping track of the method of how it was disassembled, then you put it back together and discovered that 3 important parts were not included; how would you go about reassembling the clock?
- If you had to learn a new computer language, how would you go about doing it?
- You have been assigned to design Bill Gates bathroom. Naturally, cost is not a consideration. You may not speak to Bill.
- What was the hardest question asked of you so far today?
- If MS told you we were willing to invest $5 million in a start up of your choice, what business would you start? Why?
- If you could gather all of the computer manufacturers in the world together into one room and then tell them one thing that they would be compelled to do, what would it be?
- Explain a scenario for testing a salt shaker.
- If you are going to receive an award in 5 years, what is it for and who is the audience?
- How would you explain how to use Microsoft Excel to your grandma?
- Why is it that when you turn on the hot water in any hotel, for example, the hot water comes pouring out almost instantaneously?
- Why do you want to work at Microsoft?
- Suppose you go home, enter your house/apartment, hit the light switch, and nothing happens - no light floods the room. What exactly, in order, are the steps you would take in determining what the problem was?
- Interviewer hands you a black pen and says nothing but "This pen is red."
Friday, Feb 15, 2002, 12:00 AM in Interview
I Don't Provide The Answers
I've have several people ask for the right answers the these questions
but I just can't bring myself to publish them. It seems just too much
like cheating to me. Instead, consider this page a study guide. However,
if you'd like to know how M&M's are made,
that I can help you with. : )