The opinions expressed in these materials are my own and are not necessarily those of Microsoft.
Copyright © Microsoft Corporation. All rights reserved. Unless otherwise indicated, all source code provided is licensed under the Microsoft Public License (Ms-PL).
Had a question today about sockets with Vista from Chris Avis. I hooked him up with info on the Winsock Kernel (WSK). He was so pumped he decided to blog about it and thought I would share. If you are working with sockets and wondering what the future holds then you can definitely benefit from this post.
Make sure to give Chris a shout out while you are there :)
"Use your words, dude."
--Vic from Red vs. Blue Season II
In our last episode we discovered that Dr. Codd did great things for database technologies and covered a little history of databases. We also discovered that Mary-Sue was going to have Billy-Bob's love child while Jimmy-John tried to kick his addiction to Tootsie Rolls and ...er...sorry wrong episode. So we just learned the database stuff forget everything else. In the grand scheme of things, you can hopefully appreciate the magnitude of Dr. Codd's contribution.
Now I would like to turn our attention to the next big hurdle: vocabulary. Unfortunately, there is a great deal of confusion about some of the language used in database systems. In many cases there is little to no knowledge of the database vocabulary at all beyond "table" and "join" :P At this point you may be saying to yourself, "Man, I would really like a Diet Coke." If so, go get one I'll wait... Welcome back :)
Okay let's get down to business: Why should you give a crap about this stuff? I mean, many of you use databases every day why the hell do you need to learn anything more about them? The answer is simple and elegant: If you can't speak the common language of databases you will be (not might be) much less effective communicating with others. Most notably, you will not be able, in some cases, to clearly articulate what you need and why you need it when talking to database professionals. With all this build-up you would think I was showing you the cure for cancer. It's not quite that serious, but not having a common vocabulary is definitely a hindrance that can be easily avoided.
What are the words you need to know? I'm glad you asked!
NOTE: Those items denoted with an asterisk (*) are the official names used in relational database theory.
The Really Basic Basics
This section just lays out some extremely basic underpinnings to set the stage for more complex discussions.
Databases are collections of tables and other supporting items (like Indexes, Stored Procedures, etc... discussed later) that are used to store and/or manipulate data.
Table (AKA Entity*)
Tables are the fundamental building block of a database. They represent the collections of data that we store for later retrieval. Tables are also known as Entities (term taken from Set Theory in Mathematics). I know you have seen tables a gazzilion times but here is gazzilion + 1:
For the rest of this article we will essentially be breaking down the terms used to describe pieces of a table.
Columns (AKA Fields, Attributes*)
Columns store the individual pieces of data that we use in our tables. Each column is data about one thing. For example, the au_lname column stores the last name of each author in our sample table.
Rows (AKA Records, Tuples*)
Rows are collections of columns that represent all the information about one thing in a table. For example, in our table, each row consists of the author id, last name, first name, phone, address, city, and state. For example, the first row has all the information in our table on Johnson White.
The Not Quite As Basic As The Previous Basic
In this section we will dive a little deeper into the vernacular to explore some new and interesting terms you may not know about.
When we talk of rows and columns that is often where the story ends. Many of us don't delve deeper either because we don't know there is more or for other reasons. But there IS more. Let's take a look at some terms used to describe multiples in a table.
You can refer to more than one column using these common terms: columns,fields,attributes. However, there is another way we can refer to them as well. The term is called the degree*. Looking at our table we can see it has a degree of 6. That is to say, there are 6 columns in our table. Pretty easy stuff.
When talking about more than one row we can, again, resort to common terms: rows, records, tuples*. Okay, maybe tuples isn't common but you get the idea. However we also have a bit of verbal coolness we can apply here as well: cardinality*. The meaning of this word usually depends on context. For now, we will use the simplest definition of cardinality which is sometimes used to indicate the number of rows in a table. Strictly speaking this isn't the most accurate definition but will serve as a start. Later we will expand on this definition.
Conclusion, Sort Of...
Okay so we aren't really done but this is a good place to stop because as new things are introduced we will present their definintion at that time. Clearly there is much, much more to explore.
If you haven't heard yet, we are offering a new product: Windows Home Server. So just what the hell is this and why should you give a crap?
Here is a description taken from the main landing page at http://www.microsoft.com/windows/products/winfamily/windowshomeserver/default.mspx :
"It's time to brush the digital dust off your captured moments and media-for good. Introducing a simpler, smarter way for families to organize, share and protect photos, videos, music and much more. Windows Home Server brings it all together in a central hub, connecting your home PCs and making it easy to keep and enjoy your family's most important memories. Grandma will love it too."
Okay so I'm not so sure that grandma will start doing cartwheels when you bring this sucker home and we certainly haven't made this product to give a boost to the slumping hip replacement industry :P
No, we have created this product because it's about damn time. Society is evolving and we are getting used to information on demand. Having a simple, easy platform that will deliver those things people want in their homes like photos, shows, crack (just making sure you are paying attention), and all types of other digital media.
We will start seeing this in all kinds of products going forward like HP MediaSmart Server and other vendors as well. I think this is a great step forward!
Here are more links on this story:
I live in Dallas and use the glorious tollway system. I needed to get info about my toll usage so decided to hit the North Texas Tollway Authority (NTTA) website. Wow. I honestly didn't know what the app was written in until I looked closer (thank goodness it's on a compete platform) but know it is probably one of the worst examples of an application I have seen. It looks nice but performance is a total dog and it keeps bouncing me out when I try to generate reports. Nice. If you want to see this example of what shouldn't be done then visit http://www.ntta.org/ and see for yourself how interesting this thing is.
I guess if you persevere long enough you will find that things will start coming your way. Case in point: Second Life. I have been a proponent of Microsoft involvement in this area pretty much since the day I started. And I have been seen as a crack smoker for suggesting it pretty much since the day I started. Yep, good times! While my peers are obviously major techies and geeks like me and highly intelligent many still think a presence in SL isn't a good idea.
To be fair there are valid reasons for feeling we should stay out of Second Life. Not only have they traditionally been very bad when it comes to performance and support but they are also on a compete platform. Certainly, at first glance, it would appear that a Microsoft presence would be not only unwise but unwelcome as well. Actually, nothing could be further from the truth.
I had joined SL a long time before I came to work at Microsoft. At the time I was feeling it out as a new learning environment for a training business. It turned out at the time that the technology just wasn't mature enough to warrant an investment in time and energy. It showed promise though and I resolved to return later and see how things had improved.
So eventually I got the job at MS. I decided that I wanted to revisit this virtual world to see how things had improved. Service and support hadn't gotten far but they were beta testing using voice in-world so you could actually TALK to people. I mean, I dig the text chat but it just can't convey as much through text as you can with voice. Even today there are problems with using voice. For example, you can't restrict who can speak and who can't but I'm sure the Lindens will fix that eventually.
Overall, I was impressed with the progress so decided to see if there was any Microsoft presence in-world. Imagine my surprise when I found several Microsoft groups inside. I got in touch with some of the groups, had some con calls, and viola I was helping get the .NET Developers Group going. It was great! Tori Ashe, the head of the group, and I built the group up from around 40 members (if memory serves) to over 400 members.
So that brings us to the present day. I have many MS folks either joining me in Second Life or at least willing to listen to what I have to say. Event my good buds Rob Bagby and Larry Clarkin are starting to open up. I think we will all have a group hug next :) Heck, Larry even wrote an article about it. Granted there are still many detractors but I find that as I "keep the faith" on SL people will at least begin to listen. I think in the end that is all I really want. I don't need total acceptance just acknowledgement.
So on to the moral of the story: if you have something that you are trying to get people to understand don't expect them to get it out of the gate but hang in there and you just might find people will listen.
I don't know how much you have been impacted by the daylight savings issues. Personally, my schedule is funky enough without having to worry about DST. When I was in Kansas (see previous post) the clock in the hotel said one thing my computer agreed with it but my phone was the rebel and was an hour off. Good times :P
To help people out who may be experiencing some time displacement (without quantum foam) then here are some helpful links and insights:
On November 4th (Sunday aka Tomorrow) daylight saving time in North America will end, one week later than normal just to screw people up more.
More details on the new DST start and end times can be found at http://www.microsoft.com/time.
For info on how this impacts our products shimmy on over to http://support.microsoft.com/gp/dst_prodlist
And for things that are really critical hit http://support.microsoft.com/gp/dst_hottopics for more information
If you are into mobile stuff then check out http://www.microsoft.com/windowsmobile/daylightsaving/default.mspx
This info comes from my bud over at http://blogs.msdn.com/mthree/archive/2007/11/03/dst2007-fall-back-110307.aspx
Well, it was a fun two day jaunt to Kansas. I flew the good 'ol American Airlines and arrived with out incident yesterday. The Avis counter took a billion years to get me processed (like a deer) and there were only two couples ahead of me. Not sure what that was all about. I really, really need to get on the preferred list so I can just run in and grab my car. I hate to wait just to sign the contract. I mean that is all I did, nothing special.
I loved the countryside that I passed as I-70 unfolded before me on the way between Kansas City and Topeka. I think living in Texas for so long has made me miss the actual changing of the seasons that other parts of the country get to experience. There where tons of old farmhouses and other old Americana lying about that really gave the journey a kind of Norman Rockwell feel.
So I get to the hotel (Residence Inn) and the folks are nice but the place is in some funky hidden area behind a strip mall. Not sure what the deal was with that. I tend to stay in Marriott properties to scarf up the reward points but find myself lately wondering if I should give other chains a shot. It's nothing in particular that Marriott has done per se but it is kind of annoying not having a wired connection sometimes. This is going to be especially problematic as I start up the new 26 part webcast series that I have committed to for the year. WTF was I thinking?
Without a doubt I have decided to only stay in the places where I have a kitchen area. When we did the Halo 3 Event at UT Austin my buddy Brad booked our rooms at a Residence Inn and I have been hooked on the kitchen thing ever since. I sometimes feel dirty spending a little extra out of my T&E to get the cool suites but I justify it by rationalizing the need for comfort as much as I travel. ON the up side they do give free breakfast and dinner ;)
Zain Does Topeka
So today I was greeted around 11am by Don King (head of the Topeka DNUG). I like Don he seems to really want to help his members out and have their interest at heart. Although I have never seen it myself, I have heard of UG leaders who only take the position to get recognition for themselves. While this works a little it is very easy for us to spot the ones who are really committed (like David Walker in Tulsa) and those who aren't.
For the record, it is just as easy to spot the "swag hounds" (my term for folks who come to Microsoft events just for the swag). There is always a little greedy glint in their eyes and they approach any sign-up table scanning the length of the table to see what swag they can get. I think there has only been one time I just wanted to b-slap an attendee and he was a swag hound. This guy in Tulsa came in once after we had put everything back on the truck and wanted some swag. I told him there wasn't any as it had all been put on the truck but we would get him some for the next session in one hour. Apparently that wasn't good enough and he demanded some swag. Needless to say he didn't get any but I always find it interesting to see who will come to an event to learn (and if they get swag that is just a bonus) versus those who come (in some case many miles) just for the free stuff.
But I digress. The Topeka meeting was a fairly full room with, I would guess, around 50 people attending. Anyone who speaks for a living knows that crowds have personalities. Not just the people in the crowd but the crowd itself. I am happy to report that the Topeka crowd is very friendly. They asked intelligent questions and really seemed interested in hearing about Windows Presentation Foundation (WPF).
After the lecture, I spent a few minutes with Don discussing how we can help get more members in his group. The main point that I felt needed to be made is that we can't possibly touch every person by going to them individually. It just isn't possible. We depend on the DNUG's to get our message out and to provide valuable feedback on a variety of topics. I would hope that any professional coder is part of a user group in their locale. If not, then please join one ASAP.
Now, just to avoid being a hypocrite, I was not regular part of any user group before I joined Microsoft. I would have liked for someone to convey the importance of joining user groups. In my career as a trainer and consultant I can't recall ever having a consistent connection to MS. I realize now how much I missed by not being part of some group.
Thankfully the folks in Topeka don't have that problem. They are a great bunch and it was a pleasure to hang out with them. Looking forward to going back! :)
So I'm sitting on the plane and thinking that it would be a good idea to have a series of articles on some fundamentals. What fundamentals? You might think that I would bust out with some coolness on how to work with algorithms or something like that, but no. I have a better idea!
What about a series of articles on the crap that gets missed by most programmers. You know what I mean. Things like how networks work or how (and why) databases do what they do. I find it shocking that there are so many programmers out there today that don't know these basic parts.
I know that some you will read this and think I'm on crack. I mean after all why should we learn the intricacies of how these things work. What do we care? Seriously. Does it really matter? I think it does.
To get things started, I thought we would begin with a trip (not sure why but the Crystal Method just popped into my head) into the world that is the DBA's domain. It's interesting that even words like "domain" are so abused that we can't often understand how to speak with those not of our profession.
If we really want to go waaaaaaaaaay back, we would find that databases, or at least the concept of them, have been around for millennia. In fact, the earliest known "database" (that I am aware of, at least) was a bone found in some far off cave that was (presumably) used to track how many kills the cavemen (cavepeople? what is the p.c. word these days?) had made. Just to clarify, these weren't early serial killers they were tracking animals that they had killed. No one is sure why but I am pretty sure that the one with the most kills probably got a free copy of Vista :)
Many ancient cultures are known to have tracked their property using a variety of methods. Stores of grain, for example, had to be accounted for and, yes, they even had taxes back then. Except back then when you didn't pay your taxes you got much more than just a fine ;)
If you were to look at how we tracked data, you would find that we went from bones to clay tablets to paper (with a few incremental steps in between). Interestingly, once we got to paper we really didn't evolve much. We used paper for thousands of years with very little change at all for data storage.
Then along came computers. They would revolutionize data storage, right? Well, not exactly. When computers first came along all that we did was take the information on paper forms and put it all in computers. The only problem was we didn't eliminate the main problem with storing data on paper: duplication of data.
We had all this data for, say, a customer (name, address, phone, etc...) and then we had data for an order (customer name, address, phone, order number, etc...)--clearly there was duplication of data. In fact, this duplication had plagued us for quite some time!
The answer came in the form of a genius: Dr. E. F. Codd. He came up with a theory for data storage the eliminated the duplication issue (among other things) by creating relationships between the data. His ideas were rooted in an area of mathematics that deals with sets of information and used this in his application of the "Relational Database Theory".
What I want to do over with this series is to introduce you to the wonder and glory of relational databases. I know many of you know "how" to get data from a database but do you know "why"? I want to go back over the fundamentals to introduce some things that may have gotten lost in the shuffle. By doing this I think we can gain a better understanding of "why" we are doing the things we do.
Niel Patrick Harris would be proud. I had one of those moments yesterday when you say to yourself "Wow, I really was being [insert word here]". The epiphany came when I went to the doctor this morning. I had to go in for some kind of funky ultrasound on my liver because they think it is a "fatty" one. First off, what the hell is a "fatty" liver? I always thought that only people who drink a lot had trouble with their liver; since I don't drink much does it mean that I'm a big 'ol fatty and my liver is trying to give me signals? Thankfully there appears to be nothing major that can happen with a one of these but it certainly needed to be looked at.
So there I was chilling at the Insight Diagnostic Center to get some insight into my liver. It was early, about 8am, and I realized that I needed to be on a bi-weekly conference call that the Developer Evangelist team has from 8-9am. No problem, I had signed in already. Did I mention that I was so out of it that I put my name on one slot and my other information two slots down. Yep, I was one alert puppy.
Not wanting to disturb the other folks I decided to walk outside for the call. It never really occurred to me that they might actually call my name anytime soon. So I get on the call with Chris and Phil to talk about what we are doing and how we are doing it and if we like pie--the usual stuff. About 30 minutes into the conversation I start thinking that maybe they have called my name already.
Now, picture this, I have my Motorola Bluetooth earpiece on and am holding my BlackJack (don't get me started on the many ways I hate my phone) in one hand. I am still on the con call when I walk into the building and ask the receptionist if they have come for me yet. Sure enough they had. Damn. So I tell them I'll be in the lobby and I'm wondering if they will make me wait a gazillion years to get the ultrasound. Nope. They called me in about 5 minutes. Surprised the heck outta me.
The nurse that meets me doesn't look happy. She told me they had called my name for 15 minutes and I hadn't been there. Okay so I apologized to the nurse and said I was on a conference call then and was still on that same conference call. So as I'm talking to my teammates she says I have to get off the phone during the ultrasound. Makes sense to me as I don't want the phone messing up the results somehow.
We get though the process just fine (except for the goo they put on you, at least they warm it up first) and I get to see pics of my liver. Not sure if it is just me but all I really saw was some blobs on a black and white screen--nothing special. I wonder if it is one of those things that if you stare at it long enough it will show you something. Unfortunately, I didn't have time to find out as the nurse was hurrying me up to get ready for the next patient.
Now comes the moment: I asked the nurse what it is about cell phones that messes up ultrasounds. She responds, "Nothing, it's just rude." WOW. Of all the things that I was thinking that was not one of them. When I am with other MS employees we are constantly checking emails, on phone calls, etc... even while we are with each other doing stuff. It's just the way we live our lives. I would even go so far as to say it is a survival mechanism we have to have in order to try and stay on top of the mountain of info coming at us all the time. Being rude just never occurred to me and that bothered me a great deal. I decided to make some changes.
I went to dinner later that night with my wife and decided to put the phone on silent. I also ditched the earpiece and resolved to not check my email at dinner. I managed to get through dinner that way but did have a weak moment during the movie we went to where I checked my email real quick. I guess we all need to think about not just who we are talking to but who is right there in the room with us. I am reminded of an exchange from Star Wars Episode I:
"But Master Yoda said I should be mindful of the future...""But not at the expense of the moment. Be mindful of the living Force, my young Padawan."--Obi-Wan Kenobi and Qui-Gon Jinn
I guess we could all pay a little more attention to the moment...
I must be in a linking mood... I added Larry the other day and now I'm adding Keith Combs to my list. Keith and I have spent many hours on the road together doing the Microsoft Across America (MSAM) events and I consider him one of my closest buds. He recently transitioned from doing the TechNet events into a different role (happens all the time at Microsoft) so he isn't traveling with me anymore--I miss my road pal. If you see Keith out in wild make sure to tell him I said "hi" and check out his blog too it totally rocks! :)