Sunday, March 26, 2006

X64 definitely DOA and beyond......

I have to rant right now at every dev house and driver maker and plug-in manufacturer in existence, not to mention the KING OF ALL FUCK-UPS MacroShaft. I waited a LONNGGG time before I made the jump with my brand new AMD X2 4400+ with 2GB RAM - NUMA on my mind - in Oct2005.

I should have waited until hell froze over. From IE32 crashing every 10 minutes AND TAKING DOWN EXPLORER, IE64 having no plugins and toolbars all the way TO MS THEMSELVES NOT HAVE SPECIAL FEATURES ON THEIR $100 Wireles Desktop, At least Logitech did, it was 5 months of a nightmare like being back in Redmond - shudders horribly and that was enough except that my dev efforts at home became severely hampered by Virtual Server R2 not working on X64 Pro, as advertised, which meant I couldn't test Client\Server SOA. Damnit Damnit Damnit.

Others are feeling the pain also as the "push to mainstream 64 bit computing" is, how should I say it, faltering even now. I have always said - after I left of course since there was no need in talking while an employee - that MS should be paying out grants for small comapnies to get things done and maybe get a penny or two per client. After all, you can't get more than 90% of the market. MS is and should be a solid stable release every year or so with new APIs and faster kernel methods with more abstraction.

This is all over the news as Vista Home - or LongerHorn as it's been called - has been yet again delayed for the consumer space. As a Windows workhorse in the time through "The Fall" I can say that it is through a lack of adequate testing of consumer space products like XP Home, I have no doubt that a lot of the functionality needs to be worked on to overcome issues that should have been caught much earlier in the cycle. I mean I can't remember seeing a "Home Network" setup anywhere with XP Home. Even things like System Restore weren't tested with Home - well hey I tried....

And through the worst of Vista's woes, the guys in charge decide that automation is more important than and even supercedes the tied and true methods of Dev\SDET\STE in equal measures dependent on component complexity. What a mess that thing will be in the hands of millions without it. And I don't think this Too little, too late change will do that much to make up for the manhours spent on actually fully implemting Aero into Explorer.....duhhhh, sounds familar. Hopefully the reported level of lockdown will prevent the "I Love You" times of the late 90's and actually run well on the 100s of 1000s of Dell machines that will be sold with it - hey, Dell barely pays for anything, but maybe they should start demanding REAL GRAPHICS from Intel.

As I have toally digressed from my rant about X64 I can say that I am typing this with XP SP2 wondering if I can get my $150 back for MS' attempt at moving to 64 bit. The good news is that my FireFox problems have been solved also, because I switched back in time for IE 7 Beta 2 which is pretty good at not keeping 100s of MBs of RAM while I cruise through "tab threads." Of course that's because IE 7 doesn't have an X64 beta. I'm even able to run other services in the same amount of space as the redundant 32\64 services on X64 with WoW - my systray has 15 items.

Did I say - in my best immigrant voice - Son of the bitch.

Sunday, March 19, 2006

Data Modeling In Windows

Howdy boys and girls, it's time for some code stuff now. This is an article - without the graphics - that I posted on MSD2D.COM a few months ago. Enjoy.

.Net Framework Series 2.0
Data Modeling in Windows
By Christian Howell

Data modeling: the words bring chills to some and visions of 14 hour days to others but with the tools available today such as UML (Unified Modeling Language) XML (eXtensible Markup Language) and CIM (Common Information Model) modeling your data becomes a matter of taking the customer requirements and matching class structures and interfaces to the data types that are necessary. Unlike the old days where a brute force model would work today’s software needs a more structured approach. With the world a few processor generations from “the gang of four” and Managed .Net as the “Center of the Windows Universe” abstracted components are the new keyword for flexible, extensible and secure code.

Properly modeling a consistent UI\Program flow is in and of itself an “evolutionary process” so the term data modeling even means different things to different people. This makes standardizing modeling methodologies even more difficult. There is also the difference between modeling an existing feature set in a new way and modeling a feature set designed from scratch. In this text the term means “developing features such that they can be accessed from multiple sources, from the Native UI to Collaborative services to testing harnesses.” The old paradigm was to gather what needed to be done and just write functions that did it and perhaps handing off UI duties to someone else. Today with feature sets and customer requirements for collaboration and interoperability growing exponentially an object oriented approach is needed to not only limit the amount of code necessary to implement feature sets and make them accessible between app domains but to make the UI easy to use and update.

.Net was designed with these issues in mind and does an excellent job of abstracting data objects and unifying Windows programs under a memory-managed platform; especially in the 2.0 version of the Framework. Of course it can’t handle every case without extension so an effort is needed so that complex objects such as Network Streams become much smaller sub-objects. Such a model might include; port, machine name\IP, permissions, headers, data streams so rather than trying to determine all of the ways you can use a Network Stream you can create XML Schema based scripts to combine the different sub-objects into platform or application specific descriptions. For example, only one feature needs to access the port and machine name while another can process the permissions. Another feature would then decode the headers and stream to determine further processing requirements. Another feature could be used for encryption of returning data streams to add an extra layer of protection. Depending upon the data, security and speed\concurrency needs any one of the accepted patterns, such as State or Strategy can be used to extend the initial program flow. .Net provides native encryption and compression algorithms for text streams and binary streams through the BinaryFormatter so custom strategies are rarely needed for those services.

In this model the 3rd party external client (EC) can then be any module on any machine in a domain or even on the Internet. The server is contacted by the client with a port number and machine name. Since Managed code enables programmers to use declarative security and Windows authentication much of the security overhead can be encapsulated in the calling thread of the client app domain. This abstraction also means that the client has to have access to the pre-compiled server code. The client can be extended to contain the interface for any 3rd party clients that need to have access to the server code. The server code is the middle tier of the abstraction and is needed by any 3rd party client. This also allows for a client\server interface between the entire Network Stream object as described above and any 3rd party tools. As long as the public portion of the request\response feature of the client remains consistent it is possible for the 3rd party client to extend to do more internal processing without requiring new feature requests.

Because of the encapsulation in the server feature permissions need to be correctly applied to the object space before the connection is even attempted. This type of abstraction also allows each property of the sub-objects to be independent of the others so you only need create one Permission object, one Validation object, and one Connection object for the application space. Since the data stream can be any type of .Net stream, this model allows the developer to use one object (class) for most data types since they can be copied to a stream with customizable headers. By creating a header template lookup, several different complex object types can be returned and decoded by the internal client response feature. The 3rd party client is then totally separated from the internal logic of the model. Only the public features in the internal client are exposed and since the data types are known by the 3rd party developer the objects can be extended for application or platform specific needs. This is especially useful for the ever-increasing amount of internet applications. By combining header templates with overloaded method types, all types of database info can be encapsulated between the server and connection spaces while also allowing for local\remote file access between app domains and physical networks.

With the .Net paradigm each of the sub-objects in the model becomes a class under the same namespace (DataAccess). Encapsulation allows that each of these classes can contain smaller objects which handle a part of the processing. This layered (n-tiered) approach means that different clients can access different parts of the model without having access to any other. That is the function of the request feature within the client (DataAccess.Client) space. It sits between the server (DataAccess.Server) and the 3rd party interface. By merely providing multiple overloads for request types, it is possible to control access to any data stream through any connection. The request feature also works in conjunction with the response feature to encode and decode as necessary while verifying thread identities for large numbers of concurrent users.

The server feature formats and forwards requests to the connection feature after validating input parameters from the request feature. This allows that the client request feature has no access to permissions, meaning that the server is isolated from any 3rd party requests. Since all of the methods in the server feature are internal, all calls to the connection feature must be routed first through the public request feature and then be approved by the server. By using a strong name object for each request, high levels of concurrency can be achieved while maintaining data integrity for each request. The server uses a queue to manage requests and responses. This queue contains request-specific information for thread coordination with the client request\response feature.

The connection feature is the final segment of code and is responsible for processing the headers in the request and retrieving the data stream from storage or creating a new entry. The data can then be encrypted for return. By defining your requests with text scripts it is then possible to have requests come from multiple sources including the Internet for easy transfer. In this feature the emphasis is placed on speed rather than security. This allows optimization of this module without affecting the security of the response feature. This feature handles any external storage interfaces such as SQL databases or XML files by simply overloading access methods based on the header processing. This model can be easily extended or adapted to handle different types of application models. This feature is the most complicated since it has to be coordinated with the design of the storage medium. In the case of databases the developer needs to work well with queries and stored procedures while a file system access application needs to handle NTFS well and some apps need to deal with both while handling transaction concurrency.

The key to this type of model is that “most” usable patterns have already been discovered and can be extended as necessary. Most of these patterns are based on the common File, View Edit, Tools, Options, Help environment (The standard Windows Menu\UI paradigm). Of course, it is never a good idea to try and write initially to a pattern, since the differences in application features and requirements mean that in one case a State pattern may be more efficient than a Strategy or Factory pattern for two apps that perform similar functions. When modeling data for consumption and display the key is to remember that any data can be described using a combination of native .Net types and that the description of the data is ALWAYS more important than the features that use it. In many cases personal or financial information is consumed and must be protected by the interface. By ensuring first and foremost that the data remains consistent throughout the process refactoring will then be useful for optimization. The feature set will then expand as testing of current features continues. This is known as an evolutionary design cycle. It means in essence that you should always keep your code simple and always design your features with testing in mind. Some people consider this method to be “designing to the interface and not the implementation.” Another way of saying this is the user doesn’t need to know the details only the data. For any object space overloading the public entry points enables different types and amounts of data to be processed by the same internal server. By keeping with the abstracted component methodology, you will avoid creating complex methods that don’t allow for high levels of granularity with your object space.

Tools such as NUnit ( give developers a way to test their features individually or as a live client. Script languages based on XML schemas or UML are much more efficient because they have no code overhead. The same parser that is used for the client scripts can also be extended to include test parameters and environment settings. With tools such as NUnit you need to adhere to the format set aside which sometimes causes increases in the amount of code necessary to determine success of a given test case. It is of course possible to plan for using these types of tools through a script\parser interface but again the idea of modeling is to limit the amount of code you have to write and maintain. Component-based scripting does this and more. It enables “cut and paste” editing, ease of storage, no need to recompile to add new requests. Of course adding features for processing the data in scripts requires new code and schema elements but this type of model means that new features are separated from existing features and lessen the chance of regression failures. This abstraction also enables you to make tools based on a subset of features; such as, setting up initial environments, creating database tables, create web pages using XML\XSLT, or viewing XML documents. All that is needed is a custom client space. Below are listed the basic data objects necessary in each object space of the model. These are determined by either writing out a paragraph or two describing the necessary functionality or the data that needs to be exchanged. The .Net Library 2.0 contains advances in C# such as anonymous methods, which allow “inline” delegates; iterators, which add the “yield return” and “yield break” methods to reduce amount of code necessary for base collections; nullable types, which allows value types to assign null to the type instance; generics, which allow templated base classes for collections of any .Net object type. Look for coverage of these new features, coming soon.

Client Data Objects

RequestType – complex

Server Data Objects

IOPermissions - ACL
WebPermissions - SSL

Connection Data Objects

AccessPermissions – ACL\Thread

Saturday, March 18, 2006

The History of American Politics and other nonsense

After watching The St. Patrick's Day issue of Bil Maher I am in the mood to entertain the 4 people who have read this blog. Political races in this country have debilitated into a contest to see who can get their head farther up the asses of Corporations. Corporations who have a vested interest in keeping the money away from most people; who have a vested interest in the corraling of cheap labor in our nation's prisons; who have the ability to get oil loving idiots elected through carefully placed propaganda. The list goes on but I don't have the time or desire to.

This country claims to be free, but as Bil Maher pointed out more supposedly "less FREE" countries have elected female leaders. The female politician on tonight's show was more like Bush in drag, spouting the party line on every subject from policing the world while this country swirls around in a quagmire of legal and illegal drugs to beleiving that the other guy is worse so we shouldn't believe in them.

The war in Iraq is more like a show of patriotism than a necessary factor in the "war against tyranny." Is it more tyrannical to tell people to shut up and lock them up if they don't or to tell people they are free and fire them from their job for having an opposing viewpoint to the current idiot in office?

To have a politician actually count soldiers - who by the way are SUPPOSED to get in line - as good examples of support for ANY WAR is asinine at best and dangerous at worse. Don't get me wrong I spent time as an AIRBORNE PARATROOPER ASSIGNED TO THE 82nd in NC so I believe in the sanctity of being shot at for your country. But when it comes down to it, I would rather have the masculine lesbians take my spot in the lineup. I really don't like dodging artillery rounds and roadside bombs which is why I went with a geek trade.

I can say that I am always amazed by political discussions. Even when they are based in humor. Tonight I found out that most people are assholes BECAUSE they are idiots that can't figure out how to NOT be assholes. We talk about how much we are doing for these other countries who don't have a history based on the oppression of a WHOLE RACE of people while even today if left to their own devices coroprate structure woul dREMAIN OLD AND WHITE. Even in Nazi Germany, they didn't have signs that said NO JEWS. Sure they gassed a bunch of non-Aryans but they didn't gain power on their belief in the "INALIENABLE RIGHTS OF HUMANS." This is not to say that I would like to live somewhere else but that is not because of the "freedom" in this country but because I was born here and don't want to learn a totally new culture and language.

Comedian Richard Belzer surprised me with his view on political affiliation. He actually realizes that Remocrats as he called them are just the same assholes who have gotten the richest country in the world into 9 TRILLION DOLLARS in debt. And then they propagandize the lack of frugality of spending in the black community. Wow talk about BULLSHIT. No wonder I think people should only vote for what color toilet paper their cultural/ethnic group should adopt.

Journalist Michele Mitchell chimed in with the fact that the Iraq war is nothing like WWII, where the country who ACTUALLY attacked us was in turn retaliated against. At this point there have been upwards of 25000 casualties in this "war" with no end in sight. This has seriously depleted our number of active COMBAT troops. Most people don't realize that seriusly injured troops don't return to combat duty for weeks, sometimes months. Me personally I am a firm believer in fighting your own battles. There would be a lot less wars if these old greedy MEN - usually white - would just fight with each other if they don't agree, but no they would rather have some person who probably doesn't even understand the purpose get out there and put there lives on the line. Or better yet if they would STOP believing they are ANY BETTER than the others we could all work together on something more than a platform in orbit that serves little purpose.

That brings up this point of technological superiority. Americans are stuck on this as if the average one of us will ever invent, create or discover anything other than the fact that their children are doing drugs, their toilet is stopped up because of their HORRIBLE DIETS or that the burning sensation they feel is not love. I personally think that as technology increases the average American whether native or immgrant gets dumber. This extends to the rest of the world but at least they don't have a few psychotic "scientists" who create horrible weapons to convince people of their MORALITY and righteousness.

That brings us to the MAJOR thing I disagree with Bill about. Intelligent Design. It's been in the news and even commented on by yours truly but in his mind is just a fantasy. Sure, I don't expect to see a "Creator" or a picture of him, but then the world turned out to be round and the Earth turned out to NOT be the center of the universe, so technology DOES make things possible. Of course the fire and brimstone preachings of sometimes barely literate theologians who are so in touch that they think some Creator would tell them to NOT HAVE SEX doesn't help. They can't even keep that. They are like those rats that become gay when kept away from the female of the species - a totally HUMAN IDEA by the way. IF left alone mice would be happily bangin gtheir "women" rather than becoming so horny that they would stick their dick in anything.

Anyway this is getting kind of long and I'm going to stop now but "I'll be back."