dotNoted

Icon

Observations of .Net development in the wild

More from the PAC

At the PAC, there was this beautiful data center which is quite a showcase. My 640×480 grainy spy-phone pic does little justice to the polish on these racks, with rows of sleek black HPs emitting a symphony of primary colors. (Wait, yes, I’m done with the prose.) Anyway, there were three of these racks, each another section longer on each side than the photo shows. This is more horsepower than many of the larger medium-businesses I’ve done work for… it shows the comparative wealth of MS, given that these were just a lab/marketing tool. That and what a good data center should look like.

-r

Filed under: Software Engineering

Cornerstone of good software – understand the domain.

My company, DigitalCommons, was invited by Microsoft to participate in a program aimed to encourage and provide access to resources to ramp quickly on the new Small Business Accounting for MS Office. I have to say that MS seems to be getting much better at 1.0 releases, producing a polished, user friendly product with great dev support. Although I haven’t used OneNote much, it looks cool, is easy to get to know, and is extensible. SBA even goes so far as to use the very same API that they expose to ISVs and other developers. 

I was at a hands-on lab in Building 20, the Platform Adoption Center, (I like to think of it alternatively as a brilliant showcase and some kind of opiate of developers), and in between grinding code for Intel, I was spinning some code to try out the API for SBA. I was stymied mostly by my shallow (mostly from evaporation, since I had a good course in accounting in college [ok only one, but how many do you need?]) of the basics of the science and practice of accounting. No one there could help me much except for a couple of devs from a company which does financial stuff. Fine. Let’s grep wikipedia:

List of accounting topics – Wikipedia, the free encyclopedia

Ah, there we are. I feel better about much of the API. A lot of my confusion about the design choices they made was due to my perspective. It is heavily biased by my varyingly deep understanding of numerous object models which define the APIs of most MS products (Office, .Net Framework, ADO, SQL Server components, MSI wrappers, ASDI… well, you get the idea). Object models have at least one root object, collections, and children objects. All entities are covered by objects (ideally). In the financial world, it is best to model items as classes (accounts), not objects, and just keep track of the quantity, since apparenly each item is identical and maintaining state (via properties) would be senseless. So the category is an object, not a collection. This was hard for me to overcome, but my desire to understand the domain helped me do it.

This leads me to reinforce my belief that the soul of good development is an understanding of the problem domain to at least the level of a lay-person, if not a journeyman. With this understanding comes some interesting inferences: niches for good software development will always exist, providing a good long term prospect for business, the offshoring movement will stablize or even reverse, open-source will only slowly migrate to areas which are now the staple of proprietary systems since there has to be incentive to develop a level of mastery over certain problem domains, whereas the incentive to build cool tools that have usefulness to the devs is inherent, and finally, developing software is a fast way to care about, and begin to master, a lot of various problem domains.

Because of the need (or compulsion, I suppose) to develop software for it, I have had to develop understandings of call-centers (help desks), exotic metal manufacturing and sales, product marketing through indirect channels, police dispatching and record keeping, tax assessment and property appraisal, 3D graphics and linear algebra, and vector calculus (for games, of course!). Now add accounting to the list. I hope to develop a campaign managment system for community development, and use SBA for the back-end. We’ll see if I can free up the time this summer, and inspire a few individuals to arise and assist me… I hope they like accounting. 😉

-rory

Filed under: Code Kaizen

Accidents happen because of bad drivers

Today, I lament the sorry state of database drivers on high-end platforms.

Probably everyone is familiar with this site (used to be over on Able Consulting):

http://www.carlprothman.net/Default.aspx?tabid=81

Almost everyone is there… and it’s good to see so many play by the Provider, Data Source, User Id, Password set of properties. There are a couple rouges, who insit on having things their way, but even Oracle went along for the joy ride of the developers who have to code against several platforms. All we have to do is remember these properties, and we can create a connection without drudging up the crufty PDF where it is inevitably underdocumented.

Not so with some of the more marginal databases which are seemingly drunk on their success (past or present), such the ilk of Informix and Teradata. They must buck convention and have developers do it _their_ way, which apparently, means they way which they can drop a driver out there and forget about it as the world of data access moves forward. Informix has gotten better with thier latest releases (finally). Teradata remains a psudo-database as far as I can tell. I don’t at all dispute it’s power for what it does so well, but not locking it in an ivory tower of "thou shalt not have an easy time developing applications which access these mountains of data" would be welcome adornment. Another words, the drivers are just not good, and need updating to make them easier to use on modern platforms.

If you are living in the more sane world of neighborly databases, give those 4 above mentioned properties a try in a connection string, and see if the don’t just work. If this is a possible approach, the following code will allow you to test out providers, making sure they are installed first.

string connectString = String.Format("Provider={0};DBCName={1};Database={2};Uid={3};Pwd={4}"

, ProviderTextBox.Text, ServerNameTextBox.Text, DatabaseNameTextBox.Text, UserNameTextbox.Text, PasswordTextbox.Text);

OleDbConnection connection = new OleDbConnection(connectString);

try

{

connection.Open();

StatusLabel.Text =

"Test Succeded!";

}

catch(OleDbException ex)

{

string msg = "";

foreach(OleDbError error in ex.Errors)

{

msg += error.Message +

"rn";

}

MessageBox.Show(

this, msg);

}

finally

{

if(connection != null)

connection.Close();

}

Filed under: Getting Data

PathGradientBrush

Man, what a whack piece of work this is. What was MS thinking?

I work with curved graphics a lot lately, cause basically the look better (use Windows 95 and then XP with the Luna skins… also see the Mac’s progression… less squares, more curves). Every try to color a curve with a PathGradientBrush? Basically, you can’t. That’s because it appears that the PGB does linear interpolation in coloring the area defined by the closed path. This gives the color gradients sharp edges and strange overlaps. The AddCurve method of the GraphicsPath object uses some kind of spline interpolation (I think it is cubic spline interpolation, but I’m not a mathmatician, so I don’t really know, but I get the concept. The link has some pictures of what the difference is between spline and linear interpolation.)

Anyway, I opt for alpha-blended, repositioned (both done with the Blend property of the LinearGradientBrush) fills on my curves. They look better, are easier to deal with, and, I think, more computationally inexpensive. It’s what the XP Luna interface uses to do the skinning of windows and widgets. Check out the pics… the gradients can be turned by a RotationTransform matrix. The InterpolationColors property allows more than a two color gradient. Layering linear gradients allows some sophisticated yet simple to achieve shading.

So, ditch the PGB and all it’s hassles and master the LGB. Unless, that is, if the PGB analog in v2.0 does spline interpolation of colors.

Thanks to Professor Adel Faridani, whose understanding and commitment to justice helped me understand the math.

-r

Filed under: .Net Graphics

Back at it…

Man, I have no life outside of work, it seems sometimes.

I’ve aborted work at Benton County to take up a much more interesting position at Intel, Corp. were I’m working on a system to help visualize data quality. Two new areas of focus for me to get this work done are computer graphics (mostly using GDI+ [i.e. System.Drawing.Drawing2D], although I’m playing with DX9 in my spare time) and rules engines. The latter finally brings together my long-held interest in intellegent agents and inference systems and my more recent interest in code-generation. The former has greatly expanded my understanding of linear algebra and numerical analysis. Finally, I can use the math above algebra in my everyday life!

Of course, the ramp at Intel was steep, and cranking it out was a full-duty cycle. Any time off had to be devoted to family. Whatever, you think. And that’s it. Ok.

So, let’s get into some good code…

-r

Filed under: Uncategorized