Tuesday, August 17, 2010

Kinect … first thoughts

image I had a chance to play with Microsoft’s Kinect directly this weekend and I have to say I’m pleasantly surprised and impressed. 

Unlike a lot of the press surrounding the device (from a few fan sites by people who have admittedly not actually played with it, but said it “seemed like” when watching others …)  there were no glitches or sluggishness.

In fact I found it if anything a bit more responsive than my Wii at home – but that could just be my imagination.  What I do know is the play experience didn’t suffer from any visible lag I could tell.   The interface locked on to both me and my son – and there was none of the annoying “Stand On One Foot” calibrating I found annoying with the Wii.  In the time it took for the two of us to walk into the room, face it, and be given all of 20 seconds of instructions – which consisted of, “You may want to move back to give yourself more room”, the unit was ready to go.

 imageYou can see samples of our experience in the video they took of us playing.  This is a short video edited down, our actual play time was a complete set on the obstacle course game… which was a combination of an obstacle course and an amusement park ride.   The more you jumped the faster the platform you were on went – grabbing objects, leaning, ducking and jumping were very intuitive.

Like I said, there was no real need for an instruction manual and the system calibrated to us pretty much instantly.  At the end of the game we were treated to pictures of some of our more … ahem… Classic moves, which was very reminiscent of amusement park rides that feature pictures of you screaming your head off and other wise embarrassing yourself publically. 

Now, one thing I was a bit concerned about was how much room will this take to be useable in my home.  The demos were in a “demo” living room in a trailer about 1/2 the size of an actual living room.  I really think with a larger room the experience might be better but it was certainly usable in the cramped space we had.

How does it, over all, game+system+play experience compare to a Wii?  Well obviously the graphics quality beats the Wii totally – it’s a far more sophisticated graphics engine and rendering technology so there’s a certain win for it there.  Playing casual games isn’t really my thing but to be honest even though the game we played reminded me of Wii resort a bit – the feeling is much different.  Perhaps it’s the lack of having to hold something or being tethered to that wireless controller, or maybe it’s just the ability for two of us to flail about like idiots next to each other without the need of floor sensors – whatever the reason, yes it’s a better experience, but it goes beyond that and I haven’t found the right words to describe it.  Freedom?  Seems to fit the feeling best.

I know – I know – the Wii gave us freedom.  This gives us… even more freedom.

Will I buy one?  My son informs me … Yes… yes we will.  And when it comes to games I listen to him. 

Saturday, July 24, 2010

$35 Laptop in India…

I’ve had a few emails about this story – which is all over about a $35 laptop made in India.

Theres a lot of misunderstanding apparently about this.  First of all – it’s not a $35 Laptop.  It’s a proto-type for a laptop which the people on the project have said it should cost $35, and on mass scale would drop down to $10 a laptop.

That’s all fine and good but having a bit experience around this kind of thing lets inject some reality into the Public Relations statement.  I would urge caution and research before expecting to see one of these, for that price, any time soon.

Don’t get me wrong anyone who knows me knows this is a cause near and dear to me and I would totally love to see any low cost computing device in the hands of children.  But this is not the first time that we’ve seen some pretty incredible claims about such technology – and it’s not even the first time that India has made some petty incredible claims about low cost devices.  Last year India announced they had a 7 pound ($14 USD ) laptop in development, which – btw – this is probably the unit they were talking about.  Such price shifts are pretty common in the development phase of any hardware and the fluctuations can be a few dollars or a few hundred dollars.  And this is what you should keep in mind when you see a story like this.

 

CNN Report on $35 laptop.

This is a proto-type.  Those are their words – not mine.  PROTOTYPE.   It’s a very finished proto-type – but it’s still just a proto-type, and that means that no – they don’t have the final costs on this device.  We also don’t know how finished the device is. 

It’s running … but that doesn’t always mean a lot.  What’s the battery life?  How durable is it?  etc., etc., there’s a lot of things which might need to be worked out before all is said and done that can radically affect the price on this from a hardware view point.

There are economies of scale in production to consider, as well as the profit that manufacturers need in order to be able to produce those economies of scale.  Consider similar projects to this one – and this has been a major factor in their costs.  This project will most likely suffer similar issues because of the hardware costs.

Understand that the cost of something isn’t just the development of the software and the design of the product.  Once you’ve made the proto-type someone has to make X,000,000 or however many of them.  And these need to be available as soon as sales start happening.  So the Catch-22 reality is that in order to sell X,000,000 units to get the price down to make them affordable – you have to have already SOLD X,000,000 units to get that price from the manufacturer to make them.  Or… you need a manufacturer willing to take a $35 x (X,000,000) risk for you. 

Now, maybe I’m wrong… and they’ve got this all dialed in.  It’s most likely with a achievement such as this that when you see something this polished it’s been accounted for up to a level.  But there are, and will always be cost shifts in production of anything, so I would really caution people who are hoping for a $35 laptop that they set their expectations accordingly.  Doing this will insure that when the units do come out the press on them is more accurate and not a lot of negative “they promised but couldn’t deliver” posts from the blogosphere.   

Friday, July 16, 2010

Tech Pundits the ‘Fox News’ of IT…

(please let me know if I got the level of sensationalism right)

Headline… ”Is the Shine Off the Apple?”. 
Headline… “Can Microsoft Still Compete?”
Headline… “Microsoft Bing Yahoo make gains… Should Google Worry??”

Here’s the bottom line…

Apple’s fine – and everyone still loves them, despite the whole iPhone4 antenna thing, it’s just most pundits, like Hyenas, aren’t able to bring something down on their own – so they need to rip flesh off in small chunks before going for the kill as a pack.

Microsoft’s more a player now than ever before – they just are playing on a different level than most pundits.  Microsoft plays the long game, they always have.  Moving pieces on the board slowly and deliberately.  So don’t expect them to tip their hat. 

A quick search reveals that Microsoft’s biggest strength is not as a open competitor and never has been.  They wait for markets to stabilize and provide enough incentive to guarantee financial success.  Then when they have enough of a market to justify going all in – they do so, it’s fast and hard - and they usually win.  It’s a poker strategy they live by and this isn’t going to change any time soon.

Google (and Any Smart Company) should always worry… in this world your only as good as your last success.  Google has done an amazing job for a company with one product that they don’t charge for.  Open-mouthed smile   But they are Google.  And they are very very good at understanding numbers and forecasting.  If they have anything to worry about it’s that business and economics will change their model and make their cash cow obsolete.  So – Microsoft and Yahoo, yeah they’re competition but Google’s greatest competition is the same thing that Steve Jobs and Bill Gates worried about… that somewhere out there is a kid in a garage with an idea. 

Headline… “We really have no clue what’s going on in IT.  We just put up headlines and make extreme statements to force you to read this.”

That’s my take on the state of IT reporting these days.  A lot of people who have no clue how, or why the industries they report on work, or the actual motivations or directions of the companies.  The “analysts” aren’t – they’re just people who spew words and make headlines.  This applies to some big name bloggers out there as well as wonks – and I really wish that wasn’t the case.  But from what I’ve seen of late -  it’s true.  And yeah, I’m pretty fired up over some of the inane and insipid attempts at “reporting” I’ve seen.  They include story bits – but just as you’re about to question the facts they provide they break in with these block quotes or a sensationalist statement or image – and so you don’t question, you just get fired up.

MOST of the IT predictions out there and the so called “analysts” are worthless -  or worse just do not understand the actual functions of their industry, the economics, business models, or operations of a industry that they’re supposed to be reporting on.  They are often -  I have found – people who’s credentials are  as “technically skilled” or knowledgeable of the industry – come from having worked in non-technical areas of IT.

Here’s a good example.  A few weeks ago a blogger - who shall remain nameless – went on a tirade about how Microsoft Xbox had no clue about MMO’s and how Microsoft needed to listen to the MMO creators out there if they ever wanted to make money and get their console business model remade so it would work with them.

Now, if you play MMO’s this makes sense.  Let’s face it we all know about World of Warcraft right?  We all know there’s some serious cash going on there.  And Microsoft Xbox has had 3 major MMO’s that just… died on the vine under them.   It’s like how in the heck… can this not make money for them – and they just – let this stuff slip through their fingers???  This blogger called Microsoft’s people basically inept morons who did not understand the market, dinosaurs who did not understand the money they were losing.

Yet – at the same time –- Microsoft’s Xbox Live was reported at making 1.2 Billion dollars.  So, is the blogging analyst right?  Is Microsoft giving up money hand over fist even though they made 1.2 billion??

Short answer… NO.  Not even close.  He’s just some guy who loves MMO’s and thinks that’s the best business model for every game.  That’s all he plays – and he says so in the article.  He’s got no knowledge of anything except maybe how to make a min/max Elf in Warcraft. Okay, so that’s an exaggeration.  He claims to have dozens of years experience in IT.  Which… questionably would make him older than most IT fields out there and probably having experience on Univac – But we’ll go with that anyway because his respected website posts it – So hey – it must be true right kids???

The blogger / analyst mentioned knew ONE part of the IT business.  Just one.  And that’s not enough to make a sweeping statement or provide analysis.  It is however, enough to write a blog apparently.

But it’s not enough to actually understand how IT and Games and Technology all fit together – and they certainly didn’t know what it takes to make any kind of software come into being, let alone something as complex as operating and maintaining a Massive Multiplayer Online game.    I’m not going to say I do but I do understand more of the issues here than they do, and I actually have written code and had to have it deployed globally, and actually have had to understand IT business models – unlike someone who’s big skill with it all is in knowing how to get the most DPS for your Druid.

So let me take a bash at explaining why this man (and sooo many others reporting) need to understand how to do more than write a headline.

First of all… MMO’s actually are one of the smaller gamer markets if you compare cost to make and maintain vs.  FPS or a more traditional gaming system  – compare the numbers you begin to see, as “big” as MMO’s are, there’s “big” and then there’s BIG.  MMO’s are not BIG when it comes to over all profit… they’re just ‘big’ … when it comes to profit.  Even though total income from MMO’s is around 1.5 billion world wide, the cost to keep them, maintain them, etc. is far more than a normal game.  As a result that 1.5 billion isn’t PROFIT – that’s just income.  If you’ve ever looked at your checkbook… you know the difference between income… and profit. 

MMO’s are not single guys with a great job a small apartment and a fancy car – they’re married to their investors, who are constantly asking for them to do more with less, and their 2.4 children (users) are constantly asking them for braces, lunch money, allowance (you can just call these ‘game updates’)… that fancy car (all the hardware that runs the game) they had when they were single… well it’s now in need to be traded in for a minivan because you have too many kids and it’s going to burn a gruntload more gas.

Bottom line… MMO’s cost money.  A lot of money to maintain.  So even though they make a lot of money – as any parent can tell you … it’s not enough.

Here’s the reality.  Bandwidth costs money, Updates to games cost money.  Xbox live could – yes handle that, I mean c’mon Microsoft Live is a monthly fee. 

But Microsoft didn’t create the MMO.  So if the price cut comes out of Microsoft’s pocket, not the game developer, it would have to eat that cost.  Not gonna happen because, let’s face it – the game now costs them more than they can make back on Xbox live.  Soooo… maybe the game developer just raises the price right? Hey that’s what happens anyway right?  I pay my $14.99 for my monthly game subscription, plus my $55 for the game… and yeah I’d need to pay my Xbox live fee. 

Funny thing… there’s a lot of surveys of people out there on that very system… and every survey done on this subject (and there’s been man of them)  show that most gamers would not go for that.   In fact it’s a pretty overwhelming majority.  Which… ironically gamers go out and do anyway.  It appears it’s when you actually ask them if they would they say “No way in hell” but they go ahead and do it for PC’s… just not… console systems.  Very strange.

Anyway, we haven’t even gotten to the issues of the special service updates, micro-transactions, why it’s necessary for a consistent development cycle for all parties working together, and other deal breakers or if the game will be “exclusive” and so on. 

And yes… before anyone emails to point this out – I’m well aware of Steam – and that they have 25 million users.  Now, ask how many of the actual current 2.5 million accounts of those 25 million accounts are providing income for Steam?
(*based on www.gameindustry.biz data – also be aware that Steam and Xbox Live are not the same business model, its’ confusing from a gamer view but actually take a look at what each does and you can see the difference – one is a game supplier, the other is a game provider – it’s a subtle but financially significant difference)

You can begin to see why Microsoft’s Xbox Live system works better for Microsoft, and they’re willing to walk away from an MMO deal they’re not 110% sure of – rather than take the risk associated with it. 

Why?  Because of the 10 million Xbox live accounts – the majority are paying Microsoft $50 a year or more.  Which explains why Xbox live made over 1.2 billion dollars last year… even though it’s not a game it basically is an MMO, and its almost as profitable as ALL of the MMO’s combined … for Microsoft.   Explain to me - Why exactly does it need to change it’s business model so that it can have an MMO again?

As you can see Microsoft unless they are complete morons – are not going to monkey around with with the Xbox live business model system.  Not just so they can have an MMO which may, or may not be profitable, and will most likely cost them – or a business partner a small fortune to maintain, and they will need to fight tooth an nail against established MMO’s costing more in advertising, more in – basically everything… just to say they have an MMO.  That would be insane.  Like… really insane. 

So… how about an analysis huh?  I’ve done the reading, done the research… what do I think?  Will Microsoft change it? 

My analysis… 

Here’s my surprising answer considering everything I’ve said so far… Yes.   I really think they will – and I will add,  in their time.  There is money in the MMO basket.  But that money isn’t there technologically for a little down the road. Once the money is there for them – yeah, I really think they want to be in this game all in.  It’s the market that’s holding them back.

As it becomes more profitable to open the business model up for them, and in time, it will.  But they won’t pull the trigger on that decision until the numbers are there to support it.  My guess is – they’re pretty close. 

For one thing – the more game system back ends get into a cloud, which Microsoft is becoming very strong in – the lower the price to maintain them becomes.  If handled properly – much of Xbox Live could become effectively a game provider cloud.  The technical logistics for this exist – it’s the legal and business logistics that would need to be worked out.  But from a technology view point – Microsoft is ready.

We’ve seen Microsoft test the waters with things like Monster Hunter, and they almost did it with Marvel Universe, and had a good test run with ShadowRun (yes the game I’;l give you was a miserable disappointment, more FPS than MMO – but the technology to support it was a success).  But the market is not there yet… and as I mentioned above… Microsoft historically does not get into a market unless they know they can not just make back the investment but make money off it. 

Now, if I – without being an ‘expert with dozens of years in the gaming industry’, and am just a plain old normal IT guy… can figure all of that that out with just a few minutes of searching on the internet… just imagine what a skilled blog reporter with ‘dozens of years in the gaming industry’ could do if they really set their mind to it.

Sunday, June 6, 2010

Getting Called On the Future…

Got a couple emails recently about some of the claims I’ve made about how soon technology is going to change.  Specifically on the way that just around the corner we’ll be seeing computers that can read minds and all kinds of science fictiony stuff and do I really buy that or am I just full of … well, lets not be polite here I believe the exact expression was … “full of crap”.

So – just for those doubting Thomas’ out there who don’t believe we’ll have a computer with a Direct Neural Interface any time soon… not only is it soon it’s NOW.  You can buy a somewhat primitive version of what I’ve been describing for the reasonably low price of about $150 or less. 

A company call OCZ makes a Neural Interface Actuator for video games – allows you to control much of your game just using your mind.  Well – actually your mind and the muscles in your head – using a lightweight headband that reads your neural activity and changes it into mouse/game movements.  And – I might add the products been out there now for … about 2-3 years.  It’s fairly well developed and far from a “proto-type”.  So this particular form of Brain Computer Interface already exists today, and its’ mass marketed already.

How good is it? 

Well for 75% of the people out there they’re going to find this to be beyond belief and the stuff of spooky science fiction.  The rest of us know it’s only really a first generation level device.  It doesn’t exactly connect you up to anything.  Yes, there is a directly neural interface and no – it doesn’t require a chip implant to make it work.  Just a headband. 

So … for those wondering how close the future of the next – the really truly “next” generation of computing is  - it’s here, just as I said, happening in small chunks here and there – until one day – you wake up and say, “I remember when ….”

Tuesday, March 16, 2010

Windows Mobile 7 Unexpected Reward

Alots getting said right now about what Win 7 mobile is and isn’t.. what it can and can’t or will or won’t be.  Enough that I’ll just let everyone read it themselves and make their own opinions on the subject.  Announcements that came out at Mix 2010 on the dev side of the things for Win 7 are to me a whole lot more interesting.

Most are going to just gloss over a small tid-bit that’s well worth looking into because of all the things in the new Win 7 swirling controversy of Zunes and HD video and support for existing devices and what devices can and can’t work with this… is a small package called the Expression Blend Developer Kit for Windows phone.

Now I’m not going to go all fanboy and squeal like a little girl about all the glories that this will unlock – but I will go so far as to say that there’s an unexpected consequence, or even reward that may come from this – which is that Microsoft’s increasing exposure to the Expression toolset and Silverlight.  Expression gives those with a designer skillset that happen to bedevelopers far greater powers and control than any other Microsoft product to date, which has been sorely lacking.

Microsoft’s history of creating anything for a designer – someone with a more visual eye and interface as opposed to the back end developer has been hit or miss at best.  No one argues their IDEs for Visual Studio aren’t great, but anyone who cared as much about the aesthetics and usability of the tools they developed as they did about the code was pretty much stuck in hell.

Its a long standing rule that developers are engineers – and engineers are great at a lot of things but looks, appearances and anything involving social experiences… they really tend to lag in those skill sets.  Designers on the ohter hand are very people and social conscience.  Unfortunately they’ll  build things if you let them that have no actual purpose other than aesthetics and drive performance and business logic right into the ground.  They live in two worlds and never the twain shall meet is the theory.

Expression Blend is a bridge for those two worlds which is surprisingly easy to use – and more surprisingly – allows a very high level of access to code usually reserved for more code development IDEs.  And it’s in providing a Expression Blend for the Windows Mobile 7 platform tool for free that Microsoft may unwittingly be reaping an unseen benefit.

The complete Mobile dev kit includes Expression Blend, XNA (the game development platform) and Visual Studio 2010 Express with all the Windows Mobile 7 Phone add-ins.  Now, far be it from me to point out that if you’re developing an app using this it can port directly over to a lot of platforms beyond the Mobile phone market.  And I’m in no way hinting that a smart developer wouldn’t care about the fact that the dev kits meant for the mobile market and use it for all of their rapid prototyping and development.  (Yeah, I’d never do that.)

Anyway … here’s the links … check it out…

  • Expression Blend 4 Beta
  • Windows Phone Developer Tools
  • Microsoft Expression Blend Add-in Preview for Windows Phone
  • Microsoft Expression Blend Software Development Kit Preview for Windows Phone
  • Tuesday, November 17, 2009

    So you think you do PunchOut?

    I’ve had – in the last week five emails from people asking for help with PunchOut eProcurement systems.  One or two isn’t uncommon but five or six becomes a trend.    So in an effort to reclaim my evening hours for watching House, Supernatural and helping my son with his homework (we’re doing Harper Lee’s “To Kill A Mockingbird” this week)… I thought I’d round up some of the more frequently asked questions I’ve seen.

    Q: What is OCI? 
    A: OCI is the Open Catalog Interface.  It’s largely used by SAP – and yes, believe it or not can be used with cXML.

    Q: What is EBD Format?
    A: EBD is the EPO Bibliographic Data Format… which is a mouthful and yes – there are companies, usually those dealing with legal documents such as patents and such that sell them online.   EBD in the case of SAP and Punchout however does not use this format… what you’re referring to is SAP Enterprise Buyer Data which isn’t a format it’s an application.  You use this if you want to create a process for direct and indirect shopping and the shopping cart ends with the entry of the invoice.

    Q: What is the difference between PunchOut, TapOut and Roundtrip?

    A: Contrary to an article and paper sent out by a service consultancy a while back… PunchOut, TapOut and RoundTrip – are all the same thing using different methods (IMHO – but then I’m Old School and picky about my definitions and not trying to sell something).  They’re eCommerce Shopping solutions that involve a shopping catalog “punchedout” and sent to a customer from a vendor.  Ariba’s name – which is the oldest is PunchOut, Commerce One and a few others call it  “RoundTrip” and Commerce One likes to use “TapOut”.  Bottom line … it’s all B2B – the only difference is the methods used to get there. 

     

    I’ll toss out more later on in the week – but figured this was a start for the week since I hadn’t posted in a while. 

    Friday, September 4, 2009

    Testing… Testing… Testing… is this thing on??

    Been far too long since I posted anything, and I feel like crud for that since I have been keeping up on emails and know how many people have been asking if I died or something … nope.  No deaths, alien abduction, undercover spy operations or world saving.  Just a ton of work and barely enough time left over to sleep let alone post anything on the blog.  Since at work they seem to be a bit behind the times (and our department below the budget) I’ve had to come up with inexpensive ways to design, develop and test stuff.  So in keeping with my on going mantra here on the blog of showing you how to do more with little or no cash I thought I’d share a few of the free testing and dev tools I’ve been playing with of late.

    image The first of which is a little beauty called the WaitN Test Recorder.  It’s an awesome tool for recording and playing back tests.   And it will set you back a cool bupkiss.  A big Nada.  Zero.  Zilch.  Zippo… totally free – which your boss will love. If you do any work on the web … this is your baby for testing.  Combine it with the rest of the WaitN line of toys and you’re good to go for most web based tests.

     

    Next “Thing You Gotta Have that’s Free…” in my toybox of free tools are … the Microsoft Visual Studio Express tools.  Now… I know, I know, I know these are “kiddie” versions are what you’re  image going to tell me.  Now – let me tell you… I’ve coded a ton of apps in these for work because, well, my department isn’t going to pay for a full blown MSDN Universal Subscription… heck, they probably wouldn’t pay for a copy of VS Pro… but these are FREE.  And that’s free as in FREE BEER free – you pay nothing for them.  All of the code that I’ve written in them is as good or better than the full blown Visual Studio.  No, you don’t have all the cool features – but you have enough of them that you’re using probably one of the slickest IDEs on the market even in it’s free version it’s still light years ahead of everything else out there.

    So… if you need to whip up an app quick and easy – or even a somewhat complicated application, or if you’re just starting out and want to learn a language or two… this is the way to go.  Now… for those who are saying “Yeah but why can’t I get the FULL Visual Studio IDE for free?” – got a surprise for you… you can.  In fact you can get that and your choice of RUBY or IronPython along with it … for free.

    So… for those who don’t do VB.NET, C#, etc., and you want to try the new stuff out there… you’re going to love this – RUBY with a Visual Studio IDE.  Yup… RUBY.  Say no more … and it’s also free.  SaphireSteel Software makes an awesome free version of it’s RUBY editor for Visual Studio, which, btw, just happens to include a copy of the Visual Studio IDE free if ya don’t happen to have one lying around, as well as RUBY, and MYSQL if you need a database.  So… how’s that?

    What’s that you say?  You want something … to handle subversioning?  (What’s subversioning you say?  hmmm… Do I need to take you to an ER to have you checked for head trauma???)  A subversion tool is a tool used to track versions, revisions to code, and provide a source control system for software development. 

    How many times have you written code… then had a brilliant Idea that was just so awesome that you didn’t back up your code… and accidentally wrote over your code?  C’mon… show of hands… fess up… everyone’s done it. 

    Wouldn’t it be cool if there was a magic fairy that would come down and allow you to see previous versions of the code you’d written – allow you to compare it or even revert back to a previsous version?  As if by magic? 

    Well there are several tools for this…  and once again… they’re FREE.  The first one I wanted to talk about is called TortiseSVN.  Now … straight off the box it says TortiseSVN is “A Subversion client, image implemented as a windows shell extension. TortoiseSVN is a really easy to use Revision control / version control / source control software for Windows. Since it's not an integration for a specific IDE you can use it with whatever development tools you like. TortoiseSVN is free to use. You don't need to get a loan or pay a full years salary to use it. “.

    There are a ton of free development tools out there that can really help your projects and give you the quality and degree of professionalism you’re looking for – that are free and that can free up your cash for other things.  Which if you’re a small shop or a struggling but scrappy start up shop trying to create the next Google – you’re not forced with the choice of doing things half-way or the wrong way because it would cost you an arm and a leg.

      So what’s that mean to you?  It means you can imagenow track your changes to the code.  You can now auto-revert to a previous version.  It means that when you screw up… and we all do… you can fix the problem faster and more efficiently – like a professional.   You reduce your costs, increase your efficiency – and you provide yourself with a safety net.   Good times.  :D

    But… but… but… what about better support for all those cool MS Visual Studio Express tools and the free Visual Studio IDE that came with your spanking new RUBY editor from SaphireSteel?  You go into VS Express editions and you don’t have subversion?  Well actually you do – but it’s not integrated nicely into things like you’d like.  Truth is – there are some featurFor that… you want AnkhSVN. image

    image

      AnkhSVN integrates directly with the Visual Studio 2008 IDE.  You get the familiar looking blue / green / red check marks on the files you’re working on in the Solution Explorer.  You get the very nice docking panel which provides details on imagefiles.  And best of all – it’s all built in.  No need to kill yourself trying to jump back and forth and open up new windows to work in.

     

     

    Now… those are just a few of the toys you need to make a yourself into a professional operation for free.  But … what other goodies do I have for free???   Well there is this cool tool you probably never considered… the Microsoft AdCenter Demographic Analysis tool…  really.  If you really need to understand why this is handy you should imageprobably not be reading this.  Demographics for a website are a key to selling it.  For example – this site is meant for a very wide demographic, and this handy little gizmo gives me some proof of that.  It shows that the site is very evenly distributed amongst the various demographic types it’s meant for namely the 25-35 age group.  You’ll find several very use tools over at the AdCenter for web sites so be sure to check it out.

    I’ve got tons more… but this should get you started for this week and keep people from asking me if I died or was kidnapped by aliens. 

    Friday, July 10, 2009

    Doing a lot for very little…

    Just when you thought it was safe… I drag you back into cXML validation! Hey – put down the torture devices…. it’s not what you think!  Remember a few posts back – we built a quicky validation tool?

    imageWell had someone ask if I actually use that, and the truth is – no I don’t.  The actual tool that I use is the one shown here.  But all of this began as something very similar to the code you saw here.  There’s a lot more exception handling – and slew of features added into it since we / I use this for all kinds of cool eCommerce tests around work.  

    As you can see the initial purpose of the tool remains the same, which is to validate cXML documents.  With this I can load the documents into the tool – and using any of the pre-populated addresses – it is capable of process an actual file, which is to imagesay round tripping where we begin with the PunchOut set up request and go all the way through the Purchase Order (OrderRequest) and even the POOM (PunchOutOrderMessage).

    It was built completely on the free VB Express system from Microsoft so it cost literally nothing to build.  Were I to sell this – I’d probably charge around $500 to $1200 depending on the added features I’ve put in there and people would I have no doubt pay that for it.  (I know because I’ve been offered that much for it).  So there’s no reason that with a bit of ingenuity someone looking to really add to their portfolio or even just make a few dollars can’t do this. Which is kind of the point to the exercises that I put up here. 

    With the economy currently in shambles for the tech industry there’s a lot of things you can do for very little cash that can reap some good rewards.   You don’t have to spend $$$ or have a lot of start up cash, software or hardware.  What you need is to sit down and say, “What tools need to be imagebuilt?”, “What do I need to do my job better?”. 

    There is always a better mousetrap out there – and even if your budget is nil – all it takes is some very basic coding skills to make something that you, your department, your boss really needs.

    Thats the root of it really using your skills to their best advantage.  If you happen to make a really great whatever so much the better.  And you’ll note I don’t use some exotic code – I use the very basic, very simple Visual Studio Express and a bit of code here and there to really  create a tool I need for my job.  This one was built because we didn’t have any test tools like this where I work.  Once again – you see a need – you build a tool.  The more you build the more indispensable you become.  Don’t wait for your job to out pace you  … out pace the job.  Create things.  Get messy.  Have fun.  It’s when we do this that we stand out form the crowd and get noticed.

    Just some food for thought… take care until next week.

    Wednesday, June 24, 2009

    PM Work: Some Required Assembly…

    Haven’t had much to say about Program Management in a while so decided to talk some stuff I ran into at a recent  ScrumMaster seminar.

    Now I love scrum as much as anyone.  You got your Chickens and you got your Pigs, and who isn’t going to love a PM method that’s got roles based around an old vaudeville sketch about farm animals right?  Okay… so I love scrum as a method of project management for other reasons than that – but lets face it that is pretty bizarre. 

    Now, it’s all really cool to have this great method to reduce time to product, reduce costs and increase quality.  And it’s all great to use agile methods.  But the fact is that Scrum and Agile aren’t for every project and they’re not for every team. 

    They are not a one-size-fits all method of development but they’ve become very much a defacto standard for everything and used without really a lot of good reasons other than the teams involved have used them before they worked.  Which is a good reason to try, but that doesn’t mean that because it worked once it’s going to work again.

    My daughter has a car.  It’s a great little Berretta and it’s very old.  Now, I used to have a really great Turbo Capri from about the same year as her Berretta and when it gave me fits, I replaced the starter and it worked well.  Unfortunately, my Daughters Berretta has a problem with it’s ECM and replacing the starter isn’t going to help it.  It needs a new ECM and it won’t matter whats worked for me in the past.

     raj_gather So before I go into a project and decide that Scrumming it up is a good idea I need to talk to a few people. 

    I need to talk to the people who are going to work on it.  I need to talk to the people who are going to pay for it.  I need to talk to the people who are going to use it.  I also need to talk about if it’s even remotely possible.

    Basically before I can even decide on if I want to be in the project - I need… Project Requirements. 

    Which is something I’d like to toss out there as a PM and a process I’d like to talk about.  When people approach you with a project you need to really understand all the requirements of the project itself. 

    Now, not everyone who’s a PM is in a position to pick and choose their projects.  But even if you didn’t get to pick your project(s) you should do this every time you have a project dropped on you.  If you’re going to drive a project then you need to know everything you can about it. 

    When I start a project I personally go through this.  I sit down and I write up, for my own understanding in a very rough outline form, the project General Requirements. 

    My general requirements list is everything that are currently defined requirements that are known.  This is the starting point and from there I can determine the questions I need for my other lists.

    I’ll create a short Systems Analysis, and in this I’m going to include all the things I can find out about what are the specific systems requirements I can think of and find out.  If the General Requirements have a preference  for a particular kind of programming language or a technology – I’ll hit the internet and write up the known specifications needed for that technology so when I sit down and have meetings for the real Systems Requirements I not only can understand what I’m being told but can actually participate in the discussion.  Here I’ll include anything I don’t know –all the questions that I can’t find answers for -  which are just as important as what I can find out, what I can know. 

    Next I’ll move on the Functional Analysis and then the Design Analysis.  I’ll break it down something like this: 

    • System Analytics are about the physical properties needed to make the project happen.
      • What technologies?
      • What physical products will be needed?
    • Functional Analytics are about what it will actually take to make the project happen.
      • Do we need a lot of people to create this? 
        • What kind of people?  Experts?  Developers?  Designers?  Manager?
          • How many Pigs?  How many Chickens? 
          • Will we need Silverbacks or just Codemonkeys?
    • Design Analytics are about we really are trying to create.
      • Is it about quality and style?
      • Is it about ease of use?
      • Is it about cost?
      • Is it about doing something no one else has?
      • Who’s the market?  Who’s going to use this?  Why?

     

    And most importantly for the Project – I’m going to play the Bosses Advocate and I’m going to ask all these questions again from the business perspective.  I’m going to look at the following – the Corporate Mission and Goals, The Department/Divsion Mission and Goals, and then the Teams Mission and Goals and I’m going to map all of these subjects to them.  So I know as many of them as possible so that when I need to go for funds I already have the answers the boss is going to ask me.

    Now – that’s what I call a PM Project Requirements Analysis.  Now I won’t say every PM should do this but I can tell you that if you do you will find that as you go through these same steps again for the real thing, you will find that it will make you a better PM.  Its basically gathering all the things you need for a project before hand or at least as many as you possibly can before you need them so that when you need them you’re not just ready you already have the answers.

    Take the time to write this up on a simple two-three page document for every project you have.  Take and use this as a blue print to feed into your Communications Plan, you need to use it to build as many of your docs as possible.  Then as time goes by you need to go back to the doc and update it.  Whenever possible a personal document like this should be considered a living document that you update over and over. 

    Like I said, I can’t say if you do this your life will be puppies and kitties and rainbows.  But.I can say that if you do this – it will make your life easier and your projects easier. 

    Just my 2 cents. 

    a good POSR to validate against…. final thoughts on cXML PunchOut validation…

    … and another email came in asking if I had a copy of a “good” cXML example I could share.

    Actually, the best cXML examples are off of www.cxml.org which has a lovely link you can download imagethe files you need from.  If you always download their latest and greatest help, examples and docs at this link: http://xml.cxml.org/current/cXML.zip

    Which will get you a very cool zip file that has samples for almost any kind of cXML operation you’re looking to pull off. 

    image

    Inside the zip is the examples directory – which is just piled all full of cXML goodies.  And in a blog or two ago I mentioned that humorously enough if you tried to validate any of those examples against the cxml.org dtd file… it would fail. 

    And someone mentioned I never said why they fail other than they’re meant for very generic situations.  Which is … not entirely true.

     

    It really depends on your outlook.  And if you want to see any of these files actually “validate” then you need to do one thing… change the DTD version in the DOCTYPE tag.  That’s the second line in the document and it would look like…

    <!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.020/cXML.dtd">
     

    So in order to make any of these work… set it back to an earlier version which we know is compliant.  If for example you take the current PunchOutSetUpRequest and attempt to validate it against the DTD there’s a lot of fields which need to be implemented, and yes – you actually do have to add the appropriate Elements and Attributes under the tag to make it conform to 1.2.020 standard.  This sample to be honest is actually a 1.2.008 compliant DTD file – and to verify this simply change the validation dtd url to that version. 


    <!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.0008/cXML.dtd">


    And you’ll get these results…






    cXML Validated
    Against the 1.2.008 DTD
    Valid 1.2.008
    cXML Validation Failed
    Against the  1.2.020 DTD
    Invalid 1.2.020 DTD

      


    So the DTD really is the lord and master and it really does matter when it comes to validation.  It determines the rules by which the document is considered ‘good’, it covers how to handle whitespaces and escaped characters and all manner of things.  And with each DTD you have a slightly different set of rules that are applied. 


    A file which validates fine against an earlier version can fail when validated against a newer set of standards.  So if you fail validation with DTD errors – try validating it against an earlier version. 

    … and it comes in blue…

    Got an email from Kedra A.– a developer/admin in Austin who wanted to know … if the cXML validator I put up this weekend could be done… using WPF.  Why Kedra wanted this in WPF I have no clue – but apparently all of their apps are now being done in… you got it – WPF.  Kedra tried building the project by just grabbing the various functions and subs and copying them into a WPF app and she couldn’t get it to work

    I told her I’d take a look at it and see why.

    So here it is.  Mission accomplished.  All done.

    image Okay – I won’t be cruel .. because there are some code differences between any WPF and a normal .NET application. 

    Basically there are very very few things in this app that won’t work in WPF.  But there are a few which, for various reasons need to be modified.

    Primarilly this is the Richtextbox control and the OpenFileDialog/Showdialog, and these I found out after a bit of digging on the web … can be tricky.

    So Kedra – don’t feel bad.  This is intermediate level to upper level stuff and it involves a very very new (for most people) technology. 

    Lets take a look at the OpenFileDialog code in the original application and the wpf version here.

    image image

    If you notice the OpenFileDialog in the new code needs to instantiate the OFDialog as a System.Windows.Forms OpenFileDialog instead of the default that comes with WPF.  Why’d I do that?

    'Set up the OpenFileDialog to get the name of the file for loading.
    Dim OFDialog As New System.Windows.Forms.OpenFileDialog
    With OFDialog
    .FileName = vbNull 'Clear out previous filename
    .FileName = "*.xml"



    Simple … the OFDialog that comes with System.Windows.Forms.OpenFileDialog  is an easier to use – and has some richer features than the one that’s baked into WPF which is Microsoft.Win32.OpenFileDialog and has all the functionality of a sockpuppet.  Okay it’s not that bad… at least not until you try to use the ShowDialog to go with it. 



    So that’s why… you can see I did this:



    If OFDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
    If
    .FileNames.GetUpperBound(iCount) < 1 Then
    'File selected so put it in the ComboBox



    In setting the OFDialog box to the Windows.Forms.OpenFileDialog in the top snippet – I can now use imagethe System.Windows.Forms.DialogResult and it’s various fun toys.  I also wind up with a much nicer OpenFileDialogbox.



    I do need to use Import System.Windows.Forms; and yes… this does mean I’m refactoring but it’s a small price on code like this which is a quicky.



    But … what other differences are there that you need to be aware of? 



    Microsoft.Win32 RichTextboxes differ greatly from their Windows.Forms brothers.  As a rule most of the WPF controls are very similar – and at the same time very different from their cousins.  System.Windows.Controls.Richtextbox and System.Windows.Forms.RichTextBox are close – but no cigar.  If I want to change the text in a RichTextbox in WPF it’s a much different process than it’s Forms cousin. Check out the links above – and compare the code in the link below the the code in the previous post (it’s the same code – just updated for the WPF, and I removed a couple of annoyances I discussed last time).  



     WPF Validator Download Link












    Side Note



    - Kedra also wanted to thank me for doing my samples in VB.NET since its apparently hard to find code samples in VB.NET.  I agree with her for some reason there’s a hundred samples out there and the conversion I also agree is pretty simple… but the fact is there are still a lot of new programmers out there who need some time with the code before their confidence is strong enough to jump into those waters.  (They will get there – we all do – they just need to see shore for a bit longer while they work on their swimming.)  I will continue to do as many samples as i can in VB, but will also try to put them out in C# as well


    Sunday, June 21, 2009

    validating PunchOut cXML - pt 2.

    Okay… so we covered a bit about POSRs in the last update.  And we kinda covered how it fit into an eCommerce Scenario… but let’s go into that more.

    image

    PunchOutSetupRequests are issued, and as we said last time the POSR (PunchOutSetupRequest) is sent from the Buyer to the Seller.  And they authenticate by sending an Identity and SharedSecret and a URL for the Seller to send a response back to.

    So once the Buyer sends this authenticated message to the server, the Supplier (Seller) reads this message, authenticates the Buyrer and then sends back a URL which is the catalog of items which are for sale. 

    This message that is sent back is called a PunchOutSetupResponse.  The Response message is usually nothing more than a “200” or “OK” message and the URL for the catalog.  If the message is anything other than a “200” – that means an error occurred.  “400” series errors generally mean a problem with redirections or locating urls, “500” series errors are server errors – which include the ever popular (and usually the most common) error message “500 Authentication Error”. 

    A series 500 error can also mean that for whatever reason the cXML you sent didn’t process.  So it’s important that you have a valid cXML document to send and that’s where validation comes into things.

    On the POSR, validation isn’t so difficult.  It’s basically just a From, a To, a Sender with Credentials, a BrowserFormPost URL – indicating where you want the Seller to respond to … and if you want to get fancy some Extrinsic values.  (We’ll talk about Extrinsics some other time since they’re a ton you can do with them – and they’re almost a discussion all their own.)

    Where Validation is really important – is on the OrderRequest, also called a PunchOutOrderRequest (POOR) document.  You see in the flow of things you authenticate to the Seller and then then Seller sends you are response message, which has a URL to the catalog you’re going to be shopping at.

    You do your shopping – all of this is recorded – and you send this information (your order – or PO) back to the Seller in the form of a PunchOutOrderRequest (POOR).  This has all the information needed to process the order. 

    They look like this – which is an image of an actual order request : (Warning - a lot of Scrolling Involved here if you want to see … So Be Warned)

    image

    <?xml version="1.0" encoding="UTF-8"?>
    <!
    DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.019/cXML.dtd">
    <
    cXML payloadID="3223232@ariba.acme.com"
    timestamp="1999-03-12T18:39:09-08:00" xml:lang="en-US">
     
    Below is the Header – and this isn’t really going to be much different from the POSR we created, it goes FROM the customer shown below as “Admin@acme.com”.  You’ll notice (and someone did email me about this) that the “domain” listed below is “AribaNetworkUserId” and yes, you can change this. It says “AribaNetworkUserId” because this is one of the actual examples from www.cxml.org.   

    Anyway – you’ll also note that there’s more than one Credential Identities
    in the From field. Yup – you can do that too. When I have more time I’ll go into why this is a cool trick to use if your a Seller, but it’s one of those weird things that we don’t have time for today.So – moving on to the TO field, and the Sender fields – these are the same as the POSR.

       
    <Header>
    <
    From>
    <
    Credential domain="AribaNetworkUserId">
    <
    Identity>admin@acme.com</Identity>
    </
    Credential>
    <
    Credential domain="AribaNetworkUserId" type="marketplace">
    <
    Identity>bigadmin@marketplace.org</Identity>
    </
    Credential>
    </
    From>
    <
    To>
    <
    Credential domain="DUNS">
    <
    Identity>942888711</Identity>
    </
    Credential>
    </
    To>
    <
    Sender>
    <
    Credential domain="AribaNetworkUserId">
    <
    Identity>admin@acme.com</Identity>
    <
    SharedSecret>abracadabra</SharedSecret>
    </
    Credential>
    <
    UserAgent>Ariba.com Network V1.0</UserAgent>
    </
    Sender>
    </
    Header>

    We then move to the Request tag, which says “Hey this is a Request – it’s going to have tons of info in it. From there we get down to the OrderRequestHeader. Notice the “orderID”?

    Thats generally the actual P.O. ID from many of your Buyer software ERP systems (most of them
    actually) and right next to it – is the orderDate, also known in some software as the “createdDate”.

    Next is the “type” – and it can be “new” or “edit” or even “delete”. And really that’s just the begining you see you have the ShipTo and the BillTo and the Contacts and we haven’t even begun to talk about ItemDetails – which are the actual items. A lot of these have rules to them, and there are some fields which are “optional but required”. Which means that, for example the Zip Code field is not required for a lot of software that processes the cXML… unless of course it’s got a isoCountryCode for the USA. Then it becomes required. Go ahead and take a look at this example and you can get some idea of how OrderRequests look.

    This, btw, is a pretty short
    OrderRequest. A real one may be many many many lines of text.

    <
    Request deploymentMode="test">
    <
    OrderRequest>
    <
    OrderRequestHeader orderID="DO1234" orderDate="1999-03-12" type="new">
    <
    Total>
    <
    Money currency="USD">2.68</Money>
    </
    Total>
    <
    ShipTo>
    <
    Address>
    <
    Name xml:lang="en">Acme</Name>
    <
    PostalAddress name="default">
    <
    DeliverTo>Joe Smith</DeliverTo>
    <
    DeliverTo>Mailstop M-543</DeliverTo>
    <
    Street>123 Anystreet</Street>
    <
    City>Sunnyvale</City>
    <
    State>CA</State>
    <
    PostalCode>90489</PostalCode>
    <
    Country isoCountryCode="US">United States</Country>
    </
    PostalAddress>
    </
    Address>
    </
    ShipTo>
    <
    BillTo>
    <
    Address>
    <
    Name xml:lang="en">Acme</Name>
    <
    PostalAddress name="default">
    <
    Street>123 Anystreet</Street>
    <
    City>Sunnyvale</City>
    <
    State>CA</State>
    <
    PostalCode>90489</PostalCode>
    <
    Country isoCountryCode="US">United States</Country>
    </
    PostalAddress>
    </
    Address>
    </
    BillTo>
    <
    Tax>
    <
    Money currency="USD">0.19</Money>
    <
    Description xml:lang="en">CA Sales Tax</Description>
    </
    Tax>
    <
    Payment>
    <
    PCard number="1234567890123456" expiration="1999-03-12"/>
    </
    Payment>
    <
    Comments xml:lang="en-US">Anything well formed in XML can go here.</Comments>
    </
    OrderRequestHeader>
    <
    ItemOut quantity="2" requestedDeliveryDate="1999-03-12">
    <
    ItemID>
    <
    SupplierPartID>1233244</SupplierPartID>
    </
    ItemID>
    <
    ItemDetail>
    <
    UnitPrice>
    <
    Money currency="USD">1.34</Money>
    </
    UnitPrice>
    <
    Description xml:lang="en">hello</Description>
    <
    UnitOfMeasure>EA</UnitOfMeasure>
    <
    Classification domain="SPSC">12345</Classification>
    <
    ManufacturerPartID>234</ManufacturerPartID>
    <
    ManufacturerName>foobar</ManufacturerName>
    <
    URL>www.foo.com</URL>
    </
    ItemDetail>
    <
    Shipping trackingDomain="FedEx" trackingId="1234567890">
    <
    Money currency="USD">2.5</Money>
    <
    Description xml:lang="en-us">FedEx 2-day</Description>
    </
    Shipping>
    <
    Distribution>
    <
    Accounting name="DistributionCharge">
    <
    Segment type="G/L Account" id="23456" description="Entertainment"/>
    <
    Segment type="Cost Center" id="2323" description="Western Region Sales"/>
    </
    Accounting>
    <
    Charge>
    <
    Money currency="USD">.34</Money>
    </
    Charge>
    </
    Distribution>
    <
    Distribution>
    <
    Accounting name="DistributionCharge">
    <
    Segment type="G/L Account" id="456" description="Travel"/>
    <
    Segment type="Cost Center" id="23" description="Europe Implementation"/>
    </
    Accounting>
    <
    Charge>
    <
    Money currency="USD">1</Money>
    </
    Charge>
    </
    Distribution>
    <
    Comments xml:lang="en-US">Anything well formed in XML can go here.</Comments>
    </
    ItemOut>
    </
    OrderRequest>
    </
    Request>
    </
    cXML>

    Sorry for the scrolling – but if you’re interested in learning about cXML you have to get your eyeballs dirty.  There’s no easy way to learn cXML Order Requests – other than looking at them.  The Order Request is the actual order – the items which are being purchased.  If you have to pick a place that you really need to make sure the cXML is valid this is one of the places you’re going to put at the top of the list. 


    So how do we know all these values and what they mean and what the options are?  Well it’s actually pretty simple.  Remember that 2nd line of the OrderRequest?  The one identifying it as cXML? The one that if you were writing a parser for this in XML it kept failing on and you probably just deleted that line because you couldn’t get it to work right?  (Yeah … I know who you are. ;-))


    <!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.019/cXML.dtd">


    Well –that is probably the single most important document in your cXML.  It’s the one that tells computers where to get a copy of the DTD that you can validate the file against. It is the line that identifies the cXML as cXML and if you have deleted this line because your XML parser threw a hissy fit when it read it … you’ve just got well formed XML and it’s worthless to send to anyone as cXML.


    I’m going to go on record right now and tell you that whatever your consultant that you paid a ton of money for tells you – you have to have this line.  Regardless of what your Supplier Network says or any other documentation you have says… if you are not including this line in your parse then you are not sending anyone cXML and there’s a good chance that you’re going to have errors when you connect to anyone who is cXML compliant and that’s almost everyone who adheres to this standard.


    So … that is why I’m spending so much time on this subject and what a POSR is and what a POOR is and later on… what a POOM (PunchOutOrderMessage) is.


    It’s also why I coded up a very short and very quick and dirty validator in the last blog update.  So if you don’t have it – go back and get that and see if you can get it running.


    I included the source code so you can download a copy of Visual Studio VB Express (which is free from Microsoft at this link) and take a look at how this works.


    Inside this little toy you’ll see a function I’ve borrowed from Microsoft’s MSDN samples on validation with a DTD.  I’ve named it cXML_validate – so it’s pretty easy to find.  Let’s look at it below:

    Private Function cXML_validate(ByVal value As String) As Boolean
    ' Set the validation settings.
    Dim settings As XmlReaderSettings = New XmlReaderSettings()
    settings.ProhibitDtd = False
    settings.ValidationType = ValidationType.DTD
    AddHandler settings.ValidationEventHandler, AddressOf ValidationCallBack
    cb_Success = True
    ' Create the XmlReader object.
    Try
    Dim
    reader As XmlReader = XmlReader.Create(value, settings)
    ' Parse the file.
    While reader.Read()
    End While
    Catch
    ex As Exception
    MsgBox(ex.Message)
    End Try

    Return
    cb_Success

    End Function

    Pretty straightforward right?  It creates a XMLReader, it sets the settings for the reader and it has a handler that handles the ValidationCallBack for when the validation fails, and the rest is just a very simple get the file, read through the file, and if there’s an error (aside from the validationcallback) toss it. 


    Now, what throws a lot of people (especially with .NET code) is that when Microsoft created the XML reader system, they assumed that it would be used for XML (silly Microsoft – what’s next?  They’re going what – create an operating system that’s used for … what it’s intended.)


    Anyway… the reason why this is important is that XML and cXML are NOT the same and that very lonely line we discussed earlier uses a DTD file.  Now that DTD file has all the cool things in there you’ll need to validate the file.  Unfortunately eons ago there was a bunch of discussions on standards.  Now, some people thought that you should use a DTD file to validate a schema on an XML file and some people thought you should use a XSD file. 


    I’ll cut to the chase here and simplify this for you – the end result is the people that felt DTD files should be used lost.  So Microsoft being part of the group that felt that XSD files should be used kind of created that as the process around which their XML parsers should be used.  They did consider the use of DTD files, and because of this DTD files can be used to validate a document but you need to know how to turn that on or you’re going to get an error similar to this:


    image


    So I’ll explain to you how you turn this feature on in the code.  If you look at the function above, there are two lines


    settings.ProhibitDtd = False settings.


    ValidationType = ValidationType.DTD


    Now the first one – settings.ProhibitDtd=False, sets the fact that a DTD will be used in the reader and it’s okay and don’t give us that silly looking error.  The second one of course sets the validation type to DTD file. 


    But there’s more because in order to do this, we need to set this property – which we do at the top of the Class, with the following property settings:

    Public Property ProhibitDtd() As Boolean
    Get
    Return False
    End Get
    Set
    (ByVal ProhibitDtd As Boolean)
    ProhibitDtd = False
    End Set
    End Property

     


    Yup … it’s that simple.  Just create the property so that it can be returned in the code and you’re good to go.  This believe it or not is something that completely throws a lot of devs who try to use the XMLReader to read a cXML and validate it, and it’s that simple to do.  It would I might add, help if they explained that it’s necessary to do this, but apparently that slipped someones mind I guess.


    Getting back to validation… we need to do something else that you’ll find in the code, which is set the value of the callback handler to TRUE, so it will return a FALSE if the validation call back handler is triggered.  We do this because the only time it’s triggered is if there’s a validation error. 


    Since we’ll be needing to pass this between the Function and the Callback – we want to add the following to the Public Properties area so the value is accessible.  We’ll call the value cb_Success and make it boolean, so it’s either a TRUE or FALSE, success or Failure.

    Private cb_Success As Boolean

    So we want the callback handler to hit, display the error, write that out for us, set itself to False and keep going.  Here’s the code for the validationcallback handler:

    Private Sub ValidationCallBack(ByVal sender As Object, _
    ByVal args As ValidationEventArgs)
    'Display the validation error. This is only called on error
    cb_Success = False
    If
    (args.Severity = XmlSeverityType.Warning) Then
    RichTextBox1.AppendText("No schema found to enforce validation.")
    ElseIf (args.Severity = XmlSeverityType.Error) Then
    RichTextBox1.AppendText("Validation error: ")
    End If

    If Not
    (args.Exception Is Nothing) Then ' schema validation error
    RichTextBox1.AppendText("DTD Schema error (File: " + args.Exception.SourceUri + ")" + vbCrLf)
    RichTextBox1.AppendText(vbCrLf)
    RichTextBox1.AppendText(String.Format(vbLf & "Validation event ({0}, {1}):" & vbLf & "{2}",_
    args.Exception.LineNumber, args.Exception.LinePosition, args.Message) + vbCrLf)
    RichTextBox1.AppendText(args.Message.ToString + vbCrLf)
    Label1.Text = "Warning"
    End If
    End Sub


    Once again – it’s really straightforward – we first set the cb_Success value to False since we set it to TRUE before we started.  Next we want it to check for the severity level of the validation error.  If it’s a warning it generally that there’s no schema (dtd) found to enforce the validation. If this is a full blown error – well – we want the message to be of use. 


    So – we then tell us where we can find the DTD file, because when an error occurs reading cXML it loads up the DTD file, which means there is a good chance that we’ll see line numbers waaaaay past anything in our cXML file.  If we are – then the error kicked back will be something that we can find in the DTD, which has been loaded already.  (To debug these errors you’ll want to download the DTD and look for the line numbers and position from this DTD … which is why we have it pull the URI for the DTD.)


    Next thing we need to do is see if we can’t pull the validation error line number and position of the error within the file (remember = some errors will report within the DTD) and finally we want it to display the error message so we have that too.


    Here’s a few screen shots of actual errors you’ll see:


    image
    (Indicates that you have a malformed or incomplete DOCTYPE header tag – most likely someone removed the DTD or the entire DOCTYPE tag.)


    image 
    This is kind of a confusing error message, but the gist of it is you have a Attribute or Element that is not conforming properly.  You can look up a specific tag in the DTD from the line numbers provided and see how it’s expected to be set up.


     


    The best reason I’ve found for why the error messages from the validators aren’t more clear – is because of the flexibility of XML and of the actual specifications.  Microsoft often takes a bit of a bashing for error messages and code errors related to them but in fact – this is actually how the spec is designed.  Humorously enough, while researching for examples for this error I ran across this in a forum posting:


    Here’s a discussion with a response from Microsoft on why you see the above error:







     Hello Michael,
    This is not a bug in XmlValidatingReader nor it is a bug in IE6 or Firefox. The XML spec gives the parser a choice to error. See section 3.2.1 of the XML spec in Validity constraint: Proper Group/PE Nesting (http://www.w3.org/TR/REC-xml/#sec-element-content): "For interoperability, if a parameter-entity reference appears in a choice, seq, or Mixed construct, its replacement text SHOULD contain at least one non-blank character, and neither the first nor last non-blank character of the replacement text SHOULD be a connector (| or ,)."
    Thanks,

    -Helena Kupkova, Microsoft


    And the reply:

    Thank you for the reply.
    As far as I can tell, the XML spec doesn't specify that it's an error to violate a constraint indicated by the keyword SHOULD, SHOULD NOT, RECOMMENDED, MAY, or OPTIONAL. Thus, isn't XmlValidatingReader nonconforming when it reports that test.xml is in error?

    -Michael

     


    As you can see – the original assumption was the error was from the XMLValidatingReader code, when in fact it’s reporting exactly what it’s supposed to – and in the spec it tells us exactly what should go there for this error, namely


    "For interoperability, if a parameter-entity reference appears in a choice, seq, or Mixed construct, its replacement text SHOULD contain at least one non-blank character, and neither the first nor last non-blank character of the replacement text SHOULD be a connector (| or ,)."

    And as you can see from Michaels reply … a lot of confusion gets generated by who should conform to what and the use of words like “should” and “optional” … and this is why Specs should be clear.  Because everyone has the right to their own opinion – and if given the chance they’ll use their opinion and do something silly with it just because they “think” it should be a certain way.


    So – in this case Michael has an issue with the word “should” and Michael “should” realize that when the XML committee says you “should” do something it means yes… in this case you have to – even if it’s inconvenient and makes you write more code.   Lesson:  Don’t shoot the messenger – or better yet – read the specs. 


    These are just a few error messages that will be generated.  Because we’re now working with the DTD instead of just treating this like some well formed XML with no rules or structure for processing behind it.  The downside to this is we now have to actually adhere to those rules (which we have to anyway when the files got processed) and not be blind and pretend they didn’t exist.


    The upside to this is – our files are far more likely to process without error, they are going to process with far more efficiency since they’re valid and don’t have to be scrubbed or massaged to get the data out of them, and they are far less likely to kick back an error and not get processed at all.


    But a caveats or two about what you read here and the code provided:


       - First of all – this is very simplified.  You can write validators that are capable of some amazing things.  Secondly it has errors in the code.  Well, let’s not say errors – let’s say this is the code I had to write because the code I wrote was too close to the code I wrote for someone else… and it was late when I did it.  So – some oddities in it that you can clean up – just above the Label1.test=”Warning:” in the validationcallback handler?  We don’t need that line that writes the args.message to the Richtextbox1.  It’s already done in the line above it.


    Like I said – it was late when I wrote that and it’s hardly my best work.  But it does work – so feel free to edit it change it and play with it. 


    This is just to get you started and I want to stress that. 


    - Second of all – Not the expert on this I wish I was.  I’m good with the cXML, but I’m not with cXML.org or any official representative of it.  I have no authority beyond being someone who works with it every day and sees a lot of problems caused by invalid cXML.  In fact, almost 80% of my workload is due to cXML which will not pass validation.  And these files come from some of the biggest names in the IT industry so – don’t feel bad if you don’t “get cXML” – apparently most people don’t.  I know I certainly don’t and I repair their files for them. 


    You can study the subject of eCommerce for years and still never know it all. It’s not meant to be the final word on the subject by any means.  It is literally just the beginnings of this for and should not be used to quote, refer to or otherwise say, “In this column they said…”. 


    Everything here is backed by the actual cXML.org documentation or the W3, or XML.org.  Quoting me is silly when you have the big guns like those you can use. 


    - Final Caveat:  One strange thing you will note…


    You mayget a chuckle out of the fact that the cXML examples on cXML.org will not pass a validation using their own DTD.  There are a couple of reasons why – but the basics are that they’re written for very generalized and genericized examples and not meant to pass validation.


    Well I’m about ready to turn into a pumpkin… so I’m going to leave this off for now and we’ll cover more validation errors in a later post. 


    Until then… take care.