Ross's profileThe Ross ReportPhotosBlogListsMore ![]() | Help |
|
7/25/2008 A Quick ASP.NET Web Parts Tutorial Using SQL Server 2008
After doing a fair bit of work with Microsoft SharePoint 3.0 / 2007 of late, I decided I wanted to expand my personal website beyond the capabilities offered at Live Spaces. Specifically, I wanted my personal website to offer some of the same capabilities that are available with SharePoint but couldn't use the SharePoint platform very easily at home since, of course, neither WSS or SharePoint work on non-Server Windows platforms. (Plus, even while I work for Microsoft, there may be issues with my setting up a developer-license instance of the software to run a quasi-personal application online - issues I'd rather not have to worry about.) So I decided to locate another "light-weight" portal alternative to host applications and information the way I wanted. Much to my shock, there is a fairly mature open-source project with an accompanying book that's been recently published that instructs you on how to go about building your own web portal - from scratch! (Well, if you really want to...which I don't.) The book is called "Building a Web 2.0 Portal with ASP.NET 3.5", which is very apropos. Because SharePoint is out-of-scope for this little project, I'd have to review my understanding of ASP.NET Web Parts once more (as I hadn't used them in a while). Web Parts were integrated into the .NET Framework 2.0, so they've been around for a couple of years. As the name suggests, they offer a means for web developers to isolate functionality into a smaller region of a single web page so that other functionality may be displayed alongside - exactly as would occur in a web portal. However, there a many options one can configure which gives Web Parts a lot of power and potential, but also generates a bit of a learning curve. And this is another case where the MSDN doesn't get you there especially fast. This is, in part, the motive for me writing this article; although it's also my intent to get you, the reader, to understand the context of each step I'm walking you through - but while focused on the goal of getting a couple of web parts going in as few steps as possible. Step 1: Create & Configure the Personalization DatabaseThe first hurdle one needs to clear is dealing with the fact we're not using SQL Server Express. It seems Microsoft is trying to get SQL Express running everywhere - even on desktops fully equipped with the much more sophisticated and powerful Microsoft SQL Server 2008 (or 2005 if you've yet to upgrade - these instructions should work for the elder database too). Web Parts are a technology that are almost entirely intended to work with a .NET Personalization Provider, which in turn is associated with .NET Membership and Internet Information Service (IIS) site providers. Indeed, you can get a peek at these various IIS web site options presented in the new IIS 7.0 management console on Windows Vista or Server 2008 by clicking on a web site and selecting "Providers" (ASP.NET area). The figures below demonstrate how to access the different providers from within the IIS management console. In fact, the one we're looking for likely won't be there - we have to create it, and the database where it will store its data. And, while it's possible for us to build a new provider programmatically using the instructions given us by the good folks at MSDN, Microsoft has generously provided us with a tool called "aspnet_regsql.exe" along with the .NET Framework 2.0 tools which greatly abbreviates this process:
Step 2: Create & Configure Host Web ApplicationAfter completing the wizard, we'll need to get a page with some web parts ready. This means we'll need to create a good, ol' fashioned ASP.NET web application. (This can be most easily achieved using Visual Studio 2008 or Visual Studio 2008 Express Edition.¹) We can use Default.aspx to start with, which we'll use to play host to a WebPartsManager control. Below is a sample of the control's configuration in the HTML source for the page:
Of course, the ID property can be modified to suit your own naming preference. As can the ProviderName of the Personalization tag the WebPartManager encapsulates. However, it is important to keep the name of the Personalization Provider, as you'll need to add this to the web application's web.config file.
But before editing web.config, we should first take a moment to make sure IIS has assigned a web site and application pool to the folder this application has been created in. Visual Studio doesn't do this for you automatically anymore, by default. So return to the IIS Management console, as discussed in Step 1 and simply create a new IIS web application. On both IIS 6.0 and 7.0, you'll be prompted with a screen similar to that depicted right (Figure 2.1; very similar in the case of IIS 7.0). Of course, you'll want to select a unique name and app pool for the new site, in addition to a unique port number. You'll also note the button highlighted in the image, labeled "Connect as..." - which results in a small dialogue (Figure 2.2) that allows one to configure authentication for the new site. Consideration of security is important when configuring any application using web parts. Although one can certainly have web parts without enabling personalization, they aren't anywhere near as useful without it for the simple reason it isn't possible to retain any information about any of the web parts beyond a single user session otherwise. However, in the interests of simplicity, I've configured this sample application to use Windows authentication (i.e. using the NTLM) so that the current Windows account will be acquired from the browser when the user hits Default.aspx and passed on through both to the .NET runtime and the SQL Server database. In a production environment, you'd have to consider using a service account and adding it to the dialogue in Figure 2.2 and then read up a little further in the MSDN documentation to figure out how to use other authentication models, such as Basic (forms) authentication, or whatever. All of this configuration metadata would be placed in the web.config and, ultimately, added to the data in the membership database.
It is here we'll also want to enable the Windows Authentication option and ASP.NET impersonation. The ASP.NET impersonation may also be useful in he scenario described earlier involving the creation of an NTLM service account for your own custom web parts application but, again, for this example we'll be sticking with simply enabling these two which means the user you're logged in as when you hit Default.aspx with your browser will be the credentials used to access the database and any other resources. So, having setup our new IIS web application and having created the application project in Visual Studio, it's time to move on to the web.config itself. Below is an excerpt of the pertinent blocks from the web.config of my sample web parts application:
On line 48, you'll notice we've gone with Windows authentication, making our application use the same security preference as that which we've recently setup in IIS. Then we create the registration for our web parts' Personalization Provider. Unfortunately, I've selected the name SqlMembershipProvider for the name of this web parts Personalization Provider instance. This might seem a bit confusing if you read some of the MSDN documentation concerning ASP.NET providers because there is a .NET class of that same name. But that class has no relevance to our efforts here, so just try to keep in mind that it's just a name for our provider here and not get it confused with anything else. Of course, it's certainly possible to have other providers defined here, but they would be redundant (i.e. storing our data in two different places at once). And it's possible to store personalization data anywhere you want - instructions exist on the MSDN website detailing how to create a custom provider. Thus instead of using a SQL Server database you could use a MySQL server, and XML file, an MS Access database - or even an MS Excel spreadsheet if you wanted to be really adventurous. Of course, such endeavors are beyond the scope of this article. There are two other attributes in the listing above of note; the first is the applicationName attribute, which simply identifies the application token in the membership database. This is needed because it is quite possible to have more than one application use the same membership data, which is what you might want to do if you wanted to maintain the existing credentials and preferences for several applications. Mostly, the default habit of developers is to have discrete membership databases for each application. The other attribute is our connectionStringName. As any web.config with a data-driven application needs to have one or more connection strings instructing the Windows ODBC drivers how to connect to them, our Personalization Provider simply needs the name of the string used to connect to our SQL Server database instance. The listing below is the one used with my sample web parts application:
Thus, the name of our connection string, "SqlServices", specified on line 26 is the name provided for the connectionStringName setting on line 53 of the pervious listing. (Note: both listings are from the same web.config file.) Of course, the connectionString attribute itself (also on line 26, above) is a fairly typical example of an ODBC connection string for a SQL Server database instance called "WebPartsTrial_Membership", hosted on the same machine as the IIS web server the web.config is stored on, using integrated NTLM security and thus the account credentials of the user hitting Default.aspx or any other web pages constituting the web application associated with that web.config. This concludes the basic configuration steps and coverage of rudimentary options for web parts applications. Now, if we refer back to Listing 2.1 we can readily see what the appropriate response is for the ProviderName attribute; and how that name refers back, ultimately, to the membership database itself. Step 3: Building Web Parts - The Easy WayTHIS SECTION IS STILL UNDER CONSTRUCTION - TO BE CONTINUED... ________________________ ¹ There are several components to Visual Studio Express (VSE), including Visual Web Developer 2008 (Express Ed.). Because each of the VSE tools are semi-independent, rather than integrated as the commercial tool, some of the basic features may operate differently. This outline was written using Visual Studio 2008 Team Suite (VSTS), which includes an amalgam of Visual Studio Development, Test, Architecture and Database editions. 7/24/2008 America: An Empire In Decline?Although The Daily Show with Jon Stewart is singularly devoted to comedy, its focus on current political events often betrays the show's focus away from satire to seemingly accurate political commentary and even insightful analysis. Okay, so maybe satire isn't all mere byproduct. But accidental or not, last night's recurrent segment called "Black on Black", hosted by comedian Lewis Black, exhibited a sound-bite-rich analysis leveling the argument the U.S. sub-prime lending debacle coupled with sales of several leading corporations - most notably including the sale of Anheuser-Busch, owner of Budweizer beer (which would definitely appeal to the show's viewing demographic) - were clear signs of an ongoing decline of the United States "empire". Everybody knows that empires fall. They can be the subject of a dramatic fall, like that of ancient Rome; ended with Visigoths or some other barbarian horde bursting through the capital city's gates or, through some pivotal battle like Waterloo. Or they can fall gradually and gracefully, like the British Empire; upon which the Sun never set at its peak, yet gradually contracted over a period of about 50 years, as much by the will of its own people as the subtle yet powerful political pressures of personalities like Ghandi who led successful movements for independence. So what does history tell us about the future of the United States, and what political force remains to fill the vacuum it would leave behind if indeed, the Sun is setting on the star-spangled banner? One big problem I have with those who argue (as many do) that the United States is an empire in the colonial sense is that the supposed "colonies" are, in fact, politically independent. There is no question, the United States exerts significant political influence over many parts where its key energy and economic interests lay - the middle east, in particular. However, were Iraq a U.S. colony, there would be efforts to setup complete American cities along with classic American institutions to govern the surrounding area, peopled almost exclusively by Americans. And, if we use Iraq as one example, there are a number of cases where the newly-formed Iraq government has successfully resisted efforts by the "home office" to exert direct control. Indeed, we could draw parallels between the influence exerted over Iraq's government and economy and that exerted over the Canadian government and its resources, and we'd find many more similarities than differences. Yet few would argue that Canada is either a colony of the United States any more than it is a puppet government peopled by Americans, loyal to the President. The American decline, if it exists at all, has more in common with that of the Soviet Union than ancient Rome or the British Empire. Although the political institution called the Soviet Union completely disintegrated, it's principal regime - the Russian government - not only survived but in recent years has staged something of a comeback. While this has come at the cost of civil liberties and the installation of a KGB demagogue at the center of political power, the Russian empire is very much alive and, arguably, on a much more solid economic footing which makes the cool disposition of its leadership toward the west potentially distracting. Like Russia, the United States controls a vast land area with a considerable resource base still available should the need arise (as it may well in the near future). And even should the well of resources in its own territories run completely dry, it need only turn to a historical ally to the north, Canada, with whom it is in an extremely tight economic and military alliance to assist. Perhaps most importantly, the American people are generally not disposed to fighting foreign wars without cause - particularly those whose conflict becomes measured in large numbers of casualties. The experience in Iraq is very probably the maximum level of conflict its population would ever allow without impeaching the President, demonstrating the U.S. simply hasn't got the political will to remain a colonial power. (And rightly so.) Thus, any decline of its political influence could not be outrightly measured in terms of a contraction of territories occupied. But it could be measured in terms of economics - so are there signs on that front? In short - yes there are. But they're not yet fatal in nature. They could become so if at any point the national deficit ever rises to the point beyond the government's ability to pay it back down again. And although that number is fast approaching the neighborhood of $5 trillion annually, the United States is a both large and extremely wealthy country. But if we look at per capita debt vs. national gross domestic product (GDP), the United States isn't even the most indebted nation. Far from it, in fact; and even extremely fiscally responsible nations like Canada are still playing catch-up, according to the Central Intelligence Agency's (CIA) world factbook:
* Figures cited are estimates yielded for the year ending December 31, 2007. So the final, terminal decline, if this is one, is still surely in its early stages. To a certain extent, the recent rises and falls of American fortunes are somewhat tainted by the seemingly meteoric rise of China and India - both countries enjoying the benefits of a large, still growing, prosperous middle class, forming demands for those things Europeans and North Americans have taken for granted for decades already. To many, there seems no historical precedent for this, and the success of an economic competitor that was rated as a seeming upstart in the past makes a decline seem more palpable. But there is precedent - and it even accompanies similar energy-driven economic circumstances: the energy crisis if the mid-to-late 1970s. Many of my friends (generally 5-8 years younger than me) can't remember, as they were too young. But I can, sadly. Yes, in the 1970s we saw a seemingly floundering U.S. administration being chastised by a belligerent regime in Iran, besieged by high energy prices and even fuel rationing (which we haven't yet seen) added to the sudden emergence of oriental economies. Back then it was Japan and its cheap, small car industry chomping at the heels of a then still powerful and rich American automotive industry. Yet by the late 1980s, those fortunes waned as financial crises (of an equally non-fatal nature) hit Asian markets. The United States not only recovered, but enjoyed two extremely prosperous decades to close out the 20th century - some say, the most prosperous it had ever had. The U.S. could recover - and the odds are it will. Historical precedent certainly agrees with that analysis. Unless Al-Qaeda becomes a whole lot more successful than it has ever been, the U.S. will remain the dominant political presence in the world for a number of years to come, barring some kind of major terrorist-engineered cataclysm or major international conflict, with the U.S. on the losing side. Such things are rare, and although there's the potential for such tragedy to unfold at any time, America's political decline beyond the point of pre-World War I influence, if and when it happens, will likely take many years. 7/16/2008 Canadians: Quick to Judge?I have flashes of bigotry toward Americans; or, more precisely, American culture. Of course, these momentary feelings change when I remind myself that generalizations are flawed and illogical, but sometimes I see or hear something that makes me think Americans are too quick to judge those who stand accused of crimes. And I reserved this observation toward Americans because I didn't see this same phenomenon evident in Canadian news reports about others here accused of crimes unless the evidence seemed relatively overwhelming. Of course, my "observations" are probably anecdotal and misleading. But what' not is the fact that recent reports about Canadians accused of crimes are generating a rough review in the court of public opinion. Last night, I write about Canadian Omar Kahdr who stands accused (but not charged) of killing an American soldier in Afghanistan and is consequently being held at Guantanamo Bay. Today, we can add the name of Barenaked Ladies lead singer, Stephen Page to the list of those "wrongfully convicted in the court of public opinion". Those so-convicted, it must be understood, could be so characterized even if they are eventually found guilty of the crime they're accused of. The problem I have with the visceral reaction of people either to Kahdr or Page is that virtually all of these people are basing their reactions on the accusation itself. Kahdr may even be guilty - but the evidence isn't overwhelming, although one can still fall back on the question "what was he doing in Afghanistan anyway?" (A question with a ready and obvious answer that doesn't necessitate Kahdr being guilty of anything.) In Page's case - the guy is actually pleading 'not guilty'. Not that it matters to a whole lot of his countrymen who seem to think that it's suddenly inappropriate he be caught singing to children just because American police (who're known for having a certain zeal with respect to laying drug charges) claim he was found in a house with two women doing cocaine. But the facts seem to point to the police not having a particularly strong case. I spoke of disappointment and exhibited frustration with people leaping to conclusions in cases like these. I've listened to many a radio programme with every ignorant buffoon alive phoning in claiming to have the answer with respect to what to do with Omar Kahdr - and that answer usually involved him being detained pretty much forever in GitMo; in some cases involving the crazy argument this involved due process (which not even either U.S. presidential candidates claims anymore), but mostly such people scarcely cared whether Kahdr's fundamental rights were observed or not. One woman (sounded like in her 30's or 40's) calling into CFRA radio's Lowell Green show this morning even tried to suggest that Canadians needed to suffer a large-scale terrorist attack so we would harden our view to cases like that of Omar Kahdr because, in her view, too much of the news coverage had been sympathetic to his case and the pleas of his mother. (As an aside I should quickly add Kahdr's mother, unlike her son, doesn't elicit much of my sympathy since she's largely responsible for her son being where is today - something for which she shows little sign of being ashamed. In my view if there ever was a case for someone being deported for her political views, she is it!) What the hell is the matter with people? Spectacle on GitMoOmar Ahmed Kahdr, a Canadian citizen born in Toronto on September 18, 1986, probably never saw any of this coming. Although the subject of speculation, it very much looks as if in 2001, while still very young, he was sent to the Middle East by his family (who openly support Al-Quaeda and are ideologically antagonistic about American foreign policy) to first be trained as an Al-Quaeda operative (some call him a child soldier) and then later serve in combat in Afghanistan resisting the American advance. At some point during the process where the Taliban regime was crushed by American alliance forces, Kahdr was caught in a firefight with a group of American soldiers. During this firefight, virtually everyone in his combat unit was killed or seriously wounded. And just when the skirmish seemed over, American forces advanced on the area formerly held by Kahdr's unit which included a small enclosure; the ruins of a building with a 6 or 7-foot high wall. It was from behind this wall that suddenly, one of the seriously wounded Al-Queda combatants threw a grenade, which landed fatally close to an American soldier. After the resulting explosion, American soldiers returned fire seriously wounding Kahdr and killing at least one (and very possibly more) remaining Al-Quaeda figthter nearby. Kahdr was treated for his injuries and then held at an American airbase in Afghanistan for a period of weeks or months. During this period, Kahdr alleges he was subjected to what he characterizes as "torture" by American military personnel. Eventually, he was flown to the American naval base at Guantanamo Bay, Cuba (nicknamed 'GitMo' in the contemporary media) where numerous additional interrogation sessions were conducted during which some degree of severe treatment is further alleged. Corroborating this is the fact that one of Kahdr's interrogators has recently been convicted of torturing prisoners. At the time of his initial incarceration by the Americans, Kahdr was 16 years old. Perhaps understandably, the Canadian government didn't instantly pressure the U.S. to return Kahdr to Canadian custody. Within 2 years, most unfortunately for Kahdr, a Canadian federal election resulted in a change of government and, with it, a marked change in Canadian policy concerning defending its citizens abroad. While Kahdr wasn't the only case of a Canadian left to rot in foreign custody abroad, the boy was left in the hands of the Americans with visits from Canadian officials happening very infrequently. With the release of the Kahdr video today by his defense team, there has been a great deal of debate on talk radio and amongst pundits concerning Kahdr's treatment and whether he should be repatriated. I have to say that as much as I passionately love Canada and what it stands for, there are times when I feel disappointed in my fellow citizens when it seems they don't share my views - particularly when the difference in those views occurs on such a fundamental moral level. This isn't the result of pride or hubris on my part so much as it is that I tend to believe that I mostly reflect the moral disposition of my country. I become anxious when, on rare occasion, I discover those fundamental views are not shared - regardless of the reason. According to much of the feedback witnessed today in the popular media sources aforementioned, Canadians tend to regard Kahdr with a degree of ambivalence. I wouldn't say this majority is overwhelming, but it is pronounced - and this is surprising. Canadians tend to take friendship with the Americans very seriously - we have a very close relationship with the United States sharing not only countless cultural elements but all sorts of relationships; ranging from business to personal with the threads of contact weaving the two nations so tightly it sometimes seems we're actually one. The assault on September 11, 2001 caused great revulsion and horror here and many of us - myself included - felt not just mere sympathy but a palpable desire to stand alongside our friend who'd had his nose bloodied by a cowardly attack from a morally bankrupt thug. Even the witless rhetoric of George W. Bush following the attack didn't weaken that resolve very much, although nobody I know hereabouts was terribly thrilled to hear comments like "if you're not with us, you're against us" nor the hardening of the Canada-U.S. border nor other post-911 measures which seemed to strain our renowned friendship. But we weren't that surprised either - everyone knew the U.S. was going to react very forcefully and with far less attention to the niceties of diplomacy in the process. And when Kahdr's name came up in the news as being involved as he was in the incident described above - it was hard to feel very much sympathy initially. The first question that popped into everyone's mind was "if he's not guilty, then what was he even doing there?" And the answer to that and other questions didn't come quickly. After all, it's not like anyone was in a mood to give the kid a microphone. But the facts are now well-known and among them is that, even in a time of war (which this isn't exactly), there are minimum rules for treatment - particularly of minors and particularly for minors who were most likely under an abusive parental compunction to join Al-Quaeda. And this is the part where I get very disappointed with my countrymen: it seems that they've forgotten this point. Too often, people (not just in Canada) are too-ready to be ignorant and forget little things like due process and all that means and why such things exist. Rhetoric like "but he killed someone" gets in the way of reason and drown out otherwise obvious arguments like "that's not proven yet", or "he hasn't even been charged with anything", or "repatriation doesn't mean he comes home and never faces trial", or "he's already been in jail nearly 7 years - without process, charge, trial, etc., etc.". There is a minimum standard for justice and I have to wonder whether that very soldier Kahdr is accused of killing was fighting just for the sake of fighting or if he was there because, like so many of his brethren, he was flighting to defend the cause of freedom - a world ruled by justice, not savagery, reason not rhetoric, peace and order not chaos and terrorism. And if the Canadian government is really going to cling to this idea - the last of any western nation to do so - that a trial at Guantanamo Bay can deliver these things with the full support of the Canadian people....then the Canadian people are far, far more ignorant than I ever would have thought possible and I feel genuinely sorry for this country of mine. Fortunately, I do have faith. I believe with these images playing that the severe, ignorant view that seemed to be taking hold (with some interpretation of that data by the punditry) will soften and that Kahdr will come home at some point, not too far off. It's said that, because of his experiences, Kahdr is feeling betrayed by everyone - very likely by the people of Canada. I hope we have the good sense to show that, as a people, we won't abandon our own and can recognize that even were he guilty (as he very well may be, I admit), there's still a minimum standard for even the guiltiest Canadians which we will all stand up for. Not because we favour the criminal over the victim, but because Canada stands for a minimum of human decency and justice - the things that our soldiers are in that country fighting to preserve! 7/15/2008 Canada's Own ZPF: The Police?The party known as "Zanu PF" which 'triumphed' in Zimbabwe's recent presidential election, led by 4-term incumbent president Robert Mugabe, marred by extreme incidents of brutal violence and condemned by the international community, is apparently a model for political discourse in Canada (of all places). Depending on which side of the issue you stand, activism aimed at reforming Canada's drug laws could see you locked up in jail for 20 years. Although there are some differences - at least if you're on the wrong side in Zimbabwe, you'll be detained in one of the nation's own jails, and on the pretense of violating Zimbabwe's own laws which Mugabe himself is, more than less, above. In Canada, the laws wouldn't see you jailed here at all; rather the police will outsource your imprisonment to the United States on the pretense or enforcing either Canadian or perhaps American justice - or both. Marc Emery the so-called "king of pot", a Canadian drug policy activist has found that out first-hand. Okay, in fact American law was violated in his case, and there are other differences. But even so, Emery faces a 20-year jail term for, it's alleged, mailing marijuana plant seeds to the United States. In defending himself in a television interview back in January 2008, aired on CBC Sunday, Emery called the border "an imaginary line" across which he shouldn't be prevented from peddling any substance he liked to consenting adults. It is this kind of statement which has really helped worsen his public image because, of course, most of us (myself included) don't see either the concept of nation states or the international boundaries which delimit them as being at all imaginary. Ironically, it isn't this fact which should serve to weaken his case. On the contrary, it is precisely because of the nation state concept and, more precisely, the sovereignty which partially constitutes it that Emery should not be extradited. Regardless of these more desperate-sounding of his arguments, his opponents argue his extradition is not a political matter at all; merely that he's imply violated American law and that this should be the only relevant detail which counts in the matter of his being compelled to face an American court. There is no political issue here, says the DEA. Of course, Zanu PF thugs harassing members of the opposition parties and accredited foreign journalists through detention on trumped-up charges during Zimbabwe's election campaign were not reported to be announcing to their victims that they were be mistreated because of the political situation either. So how do we know if the motives of American law enforcement are, as they say, apolitical in Emery's case? U.S. politicians have commented in the past about Canada's willingness to consider decriminalizing certain drugs and they're generally unfavourable. The American justice system equates possession of even modest amounts of a number of drugs as being penally equivalent to the most serious violent crimes, such as manslaughter. In legalizing pot, the American position would likely be one of seeing Canada has having legalized something like infanticide, manslaughter or rape. They may decide that our passports are virtually worthless, because in decriminalizing pot those convicted of possession would still be able to get proper travel documents, have access to employment as high officials in the government, be able to gain military security clearances, etc. For the Americans, it's a real problem and so there's plenty of incentive to discourage and make an example of Emery. Of course, none of this makes a very solid case for permitting the Americans to brush aside Canadian sovereignty nor should we be willing to toss Emery to the wolves. He could be more legitimately charged with mailing banned or controlled substances and be fined or receive an appropriate, lesser penalty. Indeed, it's puzzling that he has not been so charged - that the Americans are attempting to lay only the most serious charges, which only serves to give Emery the very platform he wants to promote his un-American heresy. And this is why it would be naive to suggest it's unlikely that real goal of the DEA is to make Emery a political prisoner. A Canadian citizen who resides in Canada and has committed no offence that would warrant serious jail time here faced with such harsh sentences in a foreign jail could be called nothing else. It is an ongoing question of liberty whether we in Canada should reconsider whether to penalize people for what substances they ingest of their own accord. And the Americans in taking this action against Emery are really trying to destroy such possible freedom, but (much more importantly) even the freedom for us as Canadians to choose what freedoms we recognize for ourselves. 7/11/2008 Inherited Windows Forms Control Causes Design-Time ErrorIt's been happening since the days of v1.1 of Microsoft's .NET Framework: you create a control which other controls in your Windows Forms application inherit from, the parent control itself works but all the child controls suddenly get an error in the Visual Studio (VS) IDE for one of a multitude of reasons (which VS won't explain): Have you ever seen a more generalized error message? It may as well be a big white 'X' inside a red circle with the word "Error" written next to it, followed by "You need to fix this....". I mean, it's a very pretty error message screen. But the stack trace (which would ordinarily be useful to us devs) only contains the internalized calls made by Visual Studio itself to render the control in the Visual Studio environment. Not particularly useful. So where does one begin? Will you look at websites like this with people like me who complain about errors of this sort. Today's error, in my case, was caused by one or more of the constituent controls contained by my parent control (as in the base class) using System.Data.dll and, for reasons still unknown, it has logic that causes the control(s) to not like rendering in 64-bit mode. Since my office workstation is a 64-bit quad-core PC, I must switch to 32-bit mode to make my design-time changes and then remember to return to 64-bit configuration before I compile my application. Switching between 32-bit and 64-bit configurations can be achieved, of course, by changing to the appropriate mode in the Debug toolbar drop-down (adjacent to the drop-down that toggles "Debug" and "Release" configuration options) or from within the solution configuration manager. Hope this helps some other poor soul from spending the 2 hours on the problem that I had to today. 7/4/2008 In Latina Googla
I was honestly impressed with Google today. Having studied Latin in University to compliment the raving lunacy that is my deep interest in Roman history (i.e. the history of the Roman Empire), I was reading some material on Wikipedia and discovered that among the localizations supported by Google is the very language spoken and used as the official tongue by the longest uninterrupted socio-political establishment in human history: Latin! Given that my work on the Microsoft Commerce Server team these past several months has included expanding my knowledge of localization technologies and methods, I got curious about how far their support for this "dead" language goes - they even use the ISO cultural symbols for the language in their search API; turns out just as English uses the symbol "en" and "ENU", Latin uses "la" and "LAT". (Am still looking forward to the day when Microsoft offers full support for a Latin CultureInfo, although I suppose I could build one myself were I so ambitious and discovered I had a hundred unemployed developers loitering outside my door craving nothing more than to be my indentured servants.) On an even less-serious note, Google also offers an Elmer Fudd-speak localization for its search service. Truly, they've thought of everything - even supporting the demand for tailored Internet applications whose origins herald from the land of Bugs Bunny. 7/1/2008 Gates Looks BackHe even posted his good-bye video to You Tube. How times really have changed! Take a look back at his legacy in this two-part video presentation: More videos I found interesting are indexed at my You Tube site. From BillG to RossH: A Personal Chronicle (Part 2 of 2)(Continued from Part 1.) I'd been flown out to Ottawa in spring of 2000 for an interview with Canada's largest software company, Cognos and was back in Winnipeg thinking the experience over. The phone rang, sure enough - and after completing an aggressive schedule of 5 consecutive interviews in my one day visit there, I was extended an offer. I decided I couldn't move forward as quickly with my career in Winnipeg and my concern over that missing Comp. Sci. degree suggested I needed to build solid experience where "the action" was. So off to Ottawa I went, leaving a lot of friends behind (who'd I'd come to dearly miss in the years following). Windows DNA and its related technologies were a solid and comprehensive answer to those posed by its competitors. Sun had to this point been trying to push Java increasingly as a platform, offering a number of related technologies (such as Java Servlets, which attempted to replace older CGI, or Common Gateway Interface technology used with legacy web servers). The dream of Sun was to replace the "fat client"; the euphemism coined to describe a computer that hosted installed applications which demanded constant maintenance and upgrades with a "thin client" like the Java NC, which would - it was proposed - be remotely managed and execute software applications on demand from a centralized server exposing fewer points of maintenance. But this computing model had already been tried before - the old mainframe / terminal approach that existed in the 1970s and early 80s and the market was righteously skeptical. And the number of Microsoft devices in the server room grew, particularly with respect to the number of Microsoft SQL Server databases being counted alongside their Oracle counterparts. But Windows DNA wasn't problem-free, nor did it take full advantage of the newer technologies produced by industry standards bodies that other companies were putting to use. Java continued to be a preferred platform for some applications, particularly those on handheld devices. And despite some stating that only companies like Apple and Google have a capacity to innovate, Microsoft responded with an innovation of its own in 2002: the .NET Framework. And with its introduction I had that same feeling I did when I saw that first web page load up in NCSA Mosaic years before: things had just changed forever. With .NET, Microsoft was able to create the industry's first real answer to distributed application development, leveraging its original platform Windows. But my own skills were centered on Windows DNA and although I'd been working at Cognos for two years by this point, I new I'd need to adapt quickly. A new sense of urgency arrived with the infamous ".COM crash" (2001) and an ensuring period of unemployment following cuts to Cognos' workforce that resulted. Again the writing was on the wall: Cognos' Infromation Services' commitment to Microsoft was always very lukewarm, having imported over a dozen Java developers to the formerly 5-developer team within the department I worked for originally. It was shortly thereafter my time at Cognos came to a close. It's funny how things always seem to happen for a reason sometimes (though they actually don't - it sucks being forced to look for work in a city inundated with unemployed devs, as Ottawa was then). Still, it did eventually present an opportunity for formal training with the newer .NET platform; lack of experience with which was hobbling my ability to find employment locally. I'd read a lot about the .NET platform beforehand, advancing my own skills - but obviously employers sought that piece of paper that said you had the required background. Yet during training, the advances seemed to be taking advantage of new, recently-developed technologies in a practical way to compliment the real and perceived deficiencies of the Windows DNA model. And there were many similarities with the predecessor technology, of course. But .NET was a lot more flexible, and would likely serve to keep Windows not only relevant, but a desirable platform for many years to come. As I steadily built up experience with .NET through work with a small web development company, it felt like in some respects I was starting over again. And it wasn't easy to find my footing - instead of a disagreement between partners jeopardizing the business, my first .NET assignment involved a young, disagreeable partner who's working style involved being ready to blame staff for his own mistakes. (He even had the audacity to give me a bad reference at a later date!) Later, as I experimented with contract work, I'd eventually get to work on a large project building business object for a training application platform with an extremely talented, and enlightened senior developer with whom I've maintained contact since. It was he who deemed me ready to make the switch from VB.NET to C# exposing another advantage of .NET first-hand: I made the complete transition in well under 2 weeks. (I'd find myself since, on many occasions, trying to persuade recruiters afterward that .NET skills were transferable between different programming languages for hires other than myself.) Microsoft has over the years managed to establish itself in the business environment through its Windows and Office products, but few recent commentators on Gates departure seem to understand that these products are platforms and just don't have equal competitors out there. Consumers see Google making a word pro and think that means Microsoft Word's day has come somehow. Google Docs offers only a fraction of the functionality that ships with word, lacks the extensive API Word offers, not to mention integration both with the much more numerous other Office applications and, through .NET and VBA linkages with many other kinds of applications, especially those where there's a pre-existing code investment based either in COM or .NET. I can't imagine a serious business today select Google Docs or the suite of Google office applications as its office automation platform. Because it's not a serious platform for automation. At least, not yet.
And yet that's Gates legacy. Across all these years I don't know how many times I've heard it said that Microsoft's day is done and Netscape will take over. Then it was Oracle's turn. Then Sun's with Java. Remember Linux - the "free" operating system and Open Source Software (OSS)? They were gonna take over too, but it turned out Linux wasn't free any more than OSS was. (How could they be? Nothing is.) And today, the next generation of the .NET platforms (2.0 & 3.0) are released and millions of applications are being written using them - so much so, that it's become virtually ubiquitous on the desktop PC for everything from business apps to games. Now that I've the opportunity to work for Microsoft too and as BillG leaves, I have to say a big "thank-you" for his role in building the company that gave me such an interesting and rewarding career. I know I'm not alone in offering this sentiment. As for Microsoft's own future, there's plenty of opportunity to still be had. Although their success in the public eye is often measured in response to the results of fierce competition in the consumer market, there's no real sense doom is at hand as pundits speculate about Gates' departure and what it means. Even so, they're right that Microsoft has got to do something to continue competing with Google where it makes sense to do so. The recent failure of the attempted Yahoo merger has for the moment blocked the software giant's effort to put itself on a more equal footing with search and some aspects of content, but there are new innovations coming which could well set the market on its ear. And there are a lot of very, very talented people working for Microsoft willing to try new ideas and build on the company's massive accomplishments still. In short, there's plenty of aces up this sleeve yet. Far from thinking Microsoft has seen its best days, I'm certainly not filled with any sense that Gates' departure heralds the end of era. On the contrary; it could well mark the beginning of another. |
|
|