Showing posts with label Work. Show all posts
Showing posts with label Work. Show all posts

Monday, April 13, 2009

The joys of being a POSR

Nope… not a mis-spelling – that’s POSR, as in Punch Out Setup Request.  As part of this current set of postings on cXML and the magic that is eCommerce that’s the subject dujuor.  The totally awesome and completely cool … POSR.

Now, a POSR is probably the single most important part of the eCommerce step by step.  It’s what authenticates and allows and online catalog to be sent to you. 

Here’s what one looks like  courtesy of www.cxml.org

The first section of a POSR handles the Doctype and how to handle the document…

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.020/cXML.dtd">
<cXML payloadID=1233444@ariba.com   timestamp="2000-03-12T18:39:09-08:00">

Now the grey line up there has the doctype and you can put all kinds of good things in there but what I’m showing here is the most important part – the DTD.  With this badboy you can write an app that will allow you to validate all your cXML and make sure it works, using some very simple XML routines and a few free tools available on the web. 

TIP:
You can – also find xml validators that can read the DTD – but many will choke on this line.  XML Notepad for example is designed for pretty much XML only and not cXML, and will choke.  The same thing goes for some browser based viewers.  If that’s all you’ve got to view xml – remove this line and you’ll find it’ll load the file fine.

Anyway, you can use the DTD to learn a lot about what’s wrong with any cXML that you’re given (or that you create) by validating it against the DTD.  So if you’re not – do so.  It’ll save you weeks of headaches.  This is especially true if you’re dealing with SAP or some of the Oracle solutions out there that like to write their own versions of cXML, or worse let you output in any fashion you want without telling you there are rules to how cXML is processed. 

<cXML DTD and  Consultant Rant Begins Here>
I would say 80% of the work I’m currently doing is on telling people how to validate their cXML, and fighting with people who tell me, “But we work successfully with dozens of vendors doing it this way…”.  That may be the case – but cXML has rules, and it doesn’t matter how anyone else works – if you’re outputting to cXML you follow it’s rules or you pay.

The reward for following the rules is that if you do have a valid document – cXML is as stable as a rock, and your cXML will process like cannonball from a cannon.  So it is worth the effort to do it right, even if your “consultant” tells you it’s not necessary.  (Clue – if your “expert” tells you it’s not necessary to follow a standard… slap them.  They either don’t know how to follow the standard, have been told by a software application advertisement it’s not necessary, or something but the bottom line is – they don’t know.  I’ve seen a rash of “consultants” who claim this standard or that standard isn’t needed.  It usually is – and the only reason why they don’t or they won’t use the recommended DTD standard is that they assume what they’ve been told by articles or others who are not familiar with them, that a DTD is basically the same thing as an XSD schema.  

They hold many things in common, and often have a degree of interchangeability – but there is a reason why a DTD and an XSD exist and we don’t just use one or the other.  The subtle nuances in how they work allow them to perform different degrees of use for different types of uses.  For cXML the DTD is the model you need to be using, and one of the reasons is that certain required fields within the cXML DTD file enforce rules needed to make cXML work efficiently and correctly.  When consultants try to slip around these rules, or try to get loose with the rules – it may work fine on their local system, but when they try to connect to anyone else, it becomes costly and time consuming.
</End Rant>

Before move on, it’s important to point out one thing in the DTD.  DTDs are versioned.  Each version has it’s own requirements and rules.  If you find that you’re not validating – check the version which you’re validating against – it does make often a very big difference.  You can read more about each of the versions, and get copies of them at www.cxml.org.

So… let’s get back to the POSR.  What this does is it handles the hand shaking between the customer who is “Punching Out” to the vendor who has the catalog of goods that they will punch out to us.  Now the concept of the “PunchOut” is very simple.  A customer may have a massive catalog of items, but we don’t want all of them, or we may have rules regarding certain items in the catalog.  (Joe the Janitor probably isn’t allowed to buy the same things that Victor the V.P. does at a company.)   This can be controlled by the catalog that is “punched out” to the customer.  And all of this – begins with the POSR, where we authenticate not just the company but often the employee at the company who is requesting access to the catalog. 

This is done at the header of the POSR.  Here’s what a header looks like:

<Header>
        <From>
            <!-- Supplier's identity -->
            <Credential domain="NetworkID">
              <Identity lastchangedTimestamp="2000-03-12T18:39:09-08:00">AN01333333333</Identity>
            </Credential>
        </From>
        <To>
            <!-- BCE's identity -->
            <Credential domain="NetworkID">
                <Identity>AN01222222222</Identity>
            </Credential>
        </To>
        <Sender>
            <Credential domain="AribaNetworkUserId">
                <Identity>admin@ariba.com</Identity>
                <SharedSecret>bce's shared secret with AN</SharedSecret>

            </Credential>
            <UserAgent>Ariba Network v20</UserAgent>
        </Sender>
    </Header>

The area you need to pay closest attention to is the one that reads “AribaNetworkUserId”, which I’m going to break from things here and point out that cXML is a standard developed by Ariba, and so – you’re going to see a lot of cheerleading for them in it.  But you will probably have to change this for some eCommerce companies who… ahem… have competing products.  But what you should never deviate from – is the use of a ID and SharedSecret.  These will generally be supplied to you – from the vendor doing the punchout.  These are the most important part of the punchout.  Without them… you won’t authenticate, you won’t get a catalog and you will most definitely not pass go and collect $200.

Now if you’re familiar with earlier versions of cXML you’ll note that up in the Suppliers Identity – there’s a lastChangedTimestamp and you may not have seen that before.  The truth is cXML (even with all those DTD rules) is very flexible.  And you can actually put in your own Identities in this section so if your internal cXML processor needs other names to identify it – go to it.  I’ve actually seen cXML where there were up to 15 Identities here.  So long as the Identity that you and your vendor have agreed upon is in here amongst the others you can get pretty creative and this is a good place for you as an organization to make use of multiple identities.

The next part of a good punchout setup request is … the request itself.   It contains a cookie, and if you have to do debugging something really handy… the BrowserFormPost.  If you can locate this you can discover exactly here it originated from – and often this can help with network an connectivity issue resolution.  So – keep track of that. 

<Request>
    <ProviderSetupRequest>
        <OriginatorCookie>c546794949</OriginatorCookie>
        <BrowserFormPost>
             <URL>
http://service.ariba.com/returntome</URL>
        </BrowserFormPost>

        <Followup>
             <URL>http://service.ariba.com/laterUpdates</URL>
        </Followup>
        <SelectedService>BCE.Edi</SelectedService>
        <Extrinsic name="user">
           <Identity>user234</Identity>
        </Extrinsic>
        <Extrinsic name="url">
           <URL>
http://service.ariba.com/anotherurl</URL>
        </Extrinsic>

    </ProviderSetupRequest>
</Request>

Also up in there… are the extrinsics.  Now I’ll let you in on a secret.  Most of the stuff you see up there?  Look up in the DTD – you’ll find a lot of it is not required.  Remember that rant on DTDs I had up above?  The DTD – will tell you exactly what fields are required and which fields are optional for cXML.  Now, some vendors may have rules over and above those – but the DTD is core.  It speaks – the world listens.  So – check to see what you need and what you don’t need. A good rule of thumb for efficient processing is that if you don’t need to be sending  it – don’t.  All that does is make the systems on the vendor’s end have to read through it and figure out if it’s needed or not.

Put into a cXML document only those things you absolutely need for the best performance. 

And that leaves us to the last part about the POSR… the closing tag. 

</cXML>

I won’t go into a rant over tags here – but I will say that a well formed document with complete tags is essential.  Don’t get sloppy.  cXML is not forgiving when it comes to tags.  It’s not chopped HTML where an unclosed tag will let it slide through.  It may work on your system – but validate, validate, validate. 

Get a tool which handles DTD validations, or roll your own.  Either way – validate your stuff.  If you use a tool like SAP or Oracle, find out how to get your output – even if you have to get it from the server logs and validate that.  Make sure the application you’re using actually does churn out valid cXML if you’re sending it to a vendor.  The time you save on that one chore – may save you weeks of arguing back and forth which of you has the problem.  Don’t just assume your cXML output is good – KNOW it’s good because with the flexibility in some tools that I’ve mentioned it will actually let you create very bad cXML that no one can run no matter how forgiving their system is.

Well this is a larger post than I meant – but I’ve been behind on my postings… so seemed I should make up for it here.  Next we’ll look at the PunchOutSetupResponse (the return to the POSR) – the OrderRequest and the POOM.  (Yeah, yeah… I can tell you’re all shaking with anticipation.)

See you next week.

Friday, April 3, 2009

what’s been keeping me up at night…

Been a bit busy… so I figured I’d give everyone a taste of the somewhat promised cXML eCommerce toy I’m working on.  So here are a few screen shots.  As you can see – it’s designed to load cXML or XML and perform validations.  It also allows the tester to actually POST the cXML PunchOut and OrderRequests directly to the server.  This retrieves complete header information.  The tester can auto-generate OCI HTML web forms that can be sent to customers for their own testing.  

You can also verify Authentication Tokens, Session IDs, and perform HostName / IP Address checks. 

The cXML validation allows the user to validate against any of a number of DTD files, from cXML to those used by OSN or even 3rd party or local files.  Anyway… that’s what has been keeping me from Posting.   In the next week or so – I’ll get some code up and discuss how eCommerce procurement systems work a little more directly. 

Until then… you’re just going to have use these shots and wonder.  (And for the record … yes I have removed any sensitive info from these screen shots.  The cXML displayed is a generic OrderRequest form. 

 image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

image

 

image  image

image

Monday, February 16, 2009

Grumblings from the field…

In a bit of a hurry this morning so this’ll just be a cap up of what’s going on.

The Job Market in the Pac Norwest for software development and IT has definitely taken a blow – but there’s still a lot of work out there.  I still receive about 4 or 5 job requests per week (my resume is unusual as I have job skills that are uncommon).  But most of these for the last three weeks are not ones I’d really look into unless the economy is bad.  The practice of sending out contact emails for positions with unrealistically low or unrealistic job requirements (usually both) for the purposes of being able to say, “We couldn’t find anyone here in the USA qualified” is still pretty rampant.  I’ve seen about 6 of those in the last month.  (When was the last time you saw an honest request for a Program Manager with a background as a Sr. Developer with 10 years experience for $25/hr??  Yeah – they seriously want to fill that position.)

It’s insulting and disgusting that companies will go to that length to justify hiring outside the US, and it’s more annoying that the offers come from respected legal and recruiting firms.  I won’t say who I’ve seen use this the most – however you might be surprised their one of the longest and major supporters of Open Source software and similar initiatives.  I’ve said it before that one of my core dislikes of the OSS community is it’s naiveté regarding the fact that their largest supporters exist because they’re too cheap to pay for software and have always felt software had no value.  It becomes pretty obvious when a companies true motivations for greed and being cheap are so thinly veiled behind the cloak of “We’re one of the good guys!”. 

Let’s face it – if you’re not making your money off the development of the software that people use, then you have to be making it off the process of selling it or supporting it.  In a model such as that the guy on the low end of the totem pole will always be the guy who created it in the first place.  They are the ones who’s efforts are not perceived as having value because it’s their efforts they place as having little or no cost associated to them.  (If you’re not charging anyone for the hours it took to develop  product – which is where that model places the cost recoup at – then the developers and creators are effectively valued at ‘zero cost”.)

So where do these companies place value?  They place it on the management end of things and the sales end of things.  The sales of the software, and over a long term the sale of the software support, or the sales of the software as a service.  Bottom line – the jobs they really care about are managers and sales people.  For the people who come up with the software, who spend the hundreds and thousands of man hours to code it to test it and to bring it to life?  Well, they’re a necessary evil – one which if they can find anyone to do it cheaper – they will.  Which is why yes… they do send out emails to people here in the USA looking for jobs, people they’ve often

laid off or let go, giving unrealistically low, or unrealistic job requirements, or in some cases just bizarre job requirements, all so they can be turned down.  They can then go before the US Congress and Senate and say, “We looked for people here in the USA for these jobs – but there aren’t any who meet the qualifications!  Can we go overseas and get them without losing our tax breaks???”. 

The HR departments of these companies can sign up for (and line up for) classes to learn how to do this.  And this doesn’t burn you up – the fact is this is not the “American Job” vs “Overseas Job” issue that drives this, and those probably hardest hit are – as incredible as this may seem – overseas wokers.  Overseas, in places like Hyderabad, Beijing and the former Soviet Republics you’ll find the amount of fraud based job services there is a full blown industry not all that different than Coyote hustlers that tell immigrants they can sneak them through the American border but take their money and leave them, often with no hope of survival.   Now, if you say, “Hey we’re cracking down on these bastards”, I’d like to point out – they busted 11 people and companies.  11 of them is not even a band aid on this gaping wound.  11 busts isn’t even lip service to the literally billions being spent on this.  The fact is that as long as it’s profitable for these companies to treat the people who create products you use like dirt (and for many of us – that person is us) they will continue to do so. 

So – hey – support the open source movement - make software free to everyone.  It is after all, just someone's idea – it’s not like has value right?  Anyone can do it, and with the right sales model we can recoup the loss by selling maintenance, and services.  While you’re at – you may want to head down to Walmart and buy a nice coat made by children overseas to keep warm in on that unemployment line.  Just some food for thought. 

Tuesday, January 27, 2009

money for nothin…

Got up this morning and saw a very disturbing story about people scamming people through Monster.com.  They covered one scam – which admittedly is a pretty lame scam. but people are falling for it. 

You get contacted by a firm they “hire” you but… OH NOES!  You need the latest Laptop, or a company cell phone or other medium to large purchase.   Don’t worry, they’ll send you a check for the expenses to get you working right away… what’s your bank account number?  They need to do a wire transfer. 

All of this seems somewhat reasonable.  And when you’re out of work it sounds like a dream come true.  Problem is that like many things that are too good to be true it is.  You give them your bank account info – and they give you an empty bank account.

Now, here’s another scam they can do… in order to get you your supplies their company ONLY banks through bank _________ and you need to set up an account there.  (In the example on TV the bank was Wells Fargo – but I’ve seen this scam with others.)  Once you set up an account there they send a check through.  You go buy the laptop and send them the receipt.   Sounds pretty legit right?  They  did send you money all they wanted was the receipt – you got a laptop out of the deal right?

Three days later your new bank account informs you it’s waaaay overdrawn and that banking fraud is illegal.  Seems that transfer got refused.  You now owe the bank for the money – and the credit card company you bought the laptop through – and you btw – find out the laptop that you sent that receipt for?  It’s already been returned somewhere else.

Here’s how this works – it relies on a scam that knows how banks work.  So when someone gives you a wire transfer… you sit on that check until it actually clears.  When dealing with someone new that asks unusual requests like these… call the bank and verify the funds.  They can do this without alerting anyone, and it’s actually accepted banking behavior. 

So… be careful.  Watch out for Monster, HotJobs and especially Craigs List jobs … if you’re  professional – verify the company with a professional web site, or make some calls.  Check with better business bueau – do a bit of research. 

Earlier this year I had a very legit firm that contacted me.  I went through 3 rounds of interviews over the phone and got flown out to meet for a face to face interview.  A great group of people.  But something didn’t feel right so I did some googling and checking for sales numbers, checking for who the company was and what they’d done vs. what their PR said they wanted to do.  Turned out their eyes were bigger than their pocketbooks and I was actually called by them the week before I was to start (after months of contact and planning) and they informed me they were unable to hire me.

Had I not been expecting this – financially it would have been a disaster. 

So – lessons learned for everyone – Check All Future Employers out!  They run a background check on you – you should be running one on them.    Google., www.Zabbasearch.com , www.yahoo.com, there are dozens of ways to look up a company – look them up.  Do a search on future bosses.  Know who it is that is making that offer – know as much about their business as the do.  It can’t hurt … and your impressive knowledge of their company may actually help you land a job. 

Wednesday, January 21, 2009

Project Status Template deux

Got a ping from someone asking if the Project Status Email Template could do …. MS Project inserts.

image

Indeed you can – but it is a bit tricky.  As you can see from the screen shot – the end result in an email looks pretty well… cool.  image

Some caveats – first of all – you gotta have MS Project on the machine to insert an MS Project Object into the template.  So that’s a bigge – because you’re actually inserting an MS Project Object into the email. 

The other users – will not need to have MS Project installed – because the areas you have showing will become images.  The same is true for excel spreadsheets and other embedded inserts.

So … how do we do this? 

Real simple… first we’re going to create our template – just like in the last blog posting.  But where you want to Insert the MS Project (place the cursor where you want it in the file – it’s easier than moving this later) … then click on the “Insert” tab and select “Object”.

image

 

 

 

Now – this will bring up the Object menu.  Scroll down the list to Microsoft Office Project Document and Click “OK”.  This will embed the object into your email template.

image

Once embedded – you’ll need to adjust the various values to your liking.  But… what’s that you say?  “Oh NOES!!!  I DON’T WANT TO PUT IN ALL THAT DATA AGAIN!!”.  Then don’t.

You simply open your Project Plan.. copy the rows… and then open the email template – and copy them in there.  It really is that simple. You will need to adjust the viewing area displayed – the Height and Width to reflect the email but – updating it is pretty simple.  And the results make you look great as you can see.

So … save yourself a ton of time, a ton of effort – and template. 

image

You can find this file here:

http://cid-e46e5f5a0e3b5854.skydrive.live.com/self.aspx/Public/Office%20Templates/Project%20Status%20Advanced.zip

Saturday, January 17, 2009

Outlook Template power ACTIVATE! Form of… a Status report!

I’ve been doing a lot of documentation lately, which is brain numbing at best, and time consuming at the same time.  So when a boss asked if I’d need more time for a status report I naturally said, “No I should be good…”. 

Now I can do that (and look really good) because of a little trade secret that almost no one I’ve met uses… the power of the outlook template.  I’ll go one further and say, almost no one uses templates except those of us that seem to be in some hidden fraternity of Program Managers who share these little secrets… like templates.

I keep a template around that does all kinds of fun Project Summary things – and I’m including it here.  Here’s a list of things that are built in:

  1. Has all the people who need to be on the report – already in the "CC” line for me.
  2. Has a current spreadsheet of the issue items (my more advanced version actually pulls the values from a Issue Tracker – which you can look into doing sometime but this has the drop downs and auto-formating for status.
  3. Drop downs (see Sheet2 when you double click on the table – you can edit the values there)

So all I have to do – is basically load it, click on the fields I want to update and hit send.  Major time saver and everyone thinks you’re like… the coolest most on top of things guy ever.

Let’s cover how this magic happens – first you need to know how to make a template from Outlook.  Which… is surprisingly really easy.

image

All you do – is literally create an email just the way you want it In this case, I’ve put in all the elements that I want in the email I want to send out.  I’ve done a couple other things as well so that it will make it easier to customize things later – like special headings. 

When I need to swap my status from Green to Yellow and so on all I need to do is select the text and click on the “Format Text” tab and select the style I want.

image

I also want to have my CC and To fields preset with the names of everyone who will need to receive my status report.  The thing to keep in mind is that this is not a “one time” message.  It’s going to have certain things in it that I’ll need to do over and over.   So I can create all my headings, any graphics that I’ll want to reuse, and any tables that will need to be updated.  Now – if I’m going to just update some fields then I’ll probably use the Table feature of imageOutlook and embed a table.

If the table is going to have a lot of data that I’ll be typing in often (like names or email) then I’ll use the table feature to embed an excel spreadsheet, and on the Sheet2 page I’ll create a series of terms and names.  Here I’ve put in terms for my Status types, I’ve created a range of values for percentages of completion, email addresses of those who I’ll use in my report.  These ranges – I’ll use by going back to the Main Sheet – the one I want to display and use them as Drop Down Lists.   The drop down list is a little used feature, but very handy for tricks like this one. 

imageYou create it by first creating a range of values somewhere either in the workbook or on the same sheet.  You then select imagewhere you want to create the drop down box, and then on the Data tab (which you’ll note that you now have one in Outlook once you are in the Spreadsheet, just like you do in Excel).  imageClicking on this will open the Data Validation Dialog Box.  Once you have this you’ll want to select “List” from the drop down list.  This will bring up the options for drop down lists from the dialog box.  

 

In the Source section – you’ll want to put in the range you created over on Sheet2.  You can do this either by having named the range, or by putting in the actual range “=Sheet2!$B$3:$B$7” in the imageSource.  Either will work, although using a named range is somewhat easier, especially if you have a lot of ranges to deal with.    The end result will create a cell that has a drop down list on it.  You can copy this cell as you would any other and that makes automation a bit easer.

Another thing you can do with this cell is… use Conditional Formatting Options so that if the values are within a range or if the cell contains certain text – we want it to appear a certain way (background color red – text white) or even contain specific icons or color bars.  Really it’s pretty amazing how in-depth you can get with reporting features doing this.  And with all of it – you just click on a value, and spreadsheet updates it on the fly.  Which leaves you more time for whatever details or other information you need to add and still look like a rock star. image

Now – when you’ve finished creating your email artwork of status reporting – or whatever it is you need to template out… you just… click Save As.   The Save As dialog box will appear and you save it as an Outlook Template by selecting that option off the Save As Type drop down.

Now, it will save this by default in your profile.  So if you want to save it for sending it for someone else to use, use Save As and select another location that’s easier to find.

If you’ve done all of this properly – you’ll now have a spiffy template all ready to use over and over again, and not have to fill in all those fields and do all that work all over.   All you’ll need to do is load the template and use it.

 

Step Step Two – Load the Template….

To load the template – just click on “New” in Outlook and scroll down to “Choose Form…” which, imageironically enough will allow you to load a form.  Now there are all kinds of forms that you can pick from – and if you’ve never played imagewith this do so – you can get really creative with forms. 

But for today, we just want the form we’ve created – which is in the “User Templates in File System”.  And you locat that by clicking on the drop down box at the top of the dialog, and then picking the “User Templates in File System” category, which if you’ve done imagethis right… will bring up all the files you have saved that are templates.  If you do it wrong…. it will cause an error and ninja assassins will be dispatched to your home from their secret lair beneath the Google headquarters.  (Okay – I made that up… their lair is actually just south of Portland near a winery that they use as a cover.)

 

Anyway… you want to pick out the form you’ve created.  If you’re using the one I have up as a sample imagehere the name will be “Project Status and Summary”.  So – if that’s what you’re using – click on it so it can load and you can begin being a genius. 

Now when the template loads – you’ll want to fill in all the categories and in one of the screen shots above I’ve given you some clues – but you should modify this to your own liking and add the kinds of things YOU need.

  The one I’m providing is just a starting point for you – in the words of the beloved Ms. Frizzle, “Get Messy!  Make Mistakes!  Learn!”.  And one of the cool things you can learn how to do – is use embedded excel spreadsheets.

 

The table on the form – looks like a table until you click on it … so click on it.  Because it’s really an excel spreadsheet with fun stuff you can update on the fly.  So click away.   But you should know that when when you click on it – it’s going to say something like this:image

so ignore that and click “Yes” because what’s the point of doing all this… if we just click “No” and end it all now?  We know the item that we’re loading and we also know it’s got an excel spreadsheet built into it so we know why they gave us that warning.  We WANT to be able to do cool things with it, so there’s no security issue.    Which should, give you some idea of the real power of a good template – since you can actually do stuff with them that requires an occasional security warning.  image

Now – if you play with this you’re going to note that there are drop down boxes – and there is conditional formatting on those drop down boxes.  So when you enter a task name – and click on the boxes to the right of it…. you can change the values without having to type them in every time.  Just grab one and click it, move on to the next… wash, rinse, repeat until done. 

Here are some examples… of the stuff in them… the first set of drop downs allow you to select from various project status types – imageCompleted, In-Progress and so on … and IF you pick one of them – it will automatically reformat it to the color scheme that corresponds to that type of status.  The next is the degree of completion – which goes from 0%-100% and you get these very cool traffic light colors when you pick those. 

imageBasically, this allows you to focus on filling in the information instead of filling in all kinds of cool formatting, setting up things every time.  As time savers go – this one is definitely a keeper for anyone who has to do reports, news letters or any process that requires you fill in a lot of repeated information, terms, titles and so on.

There’s tons more you can do – this is just the tip of the iceberg, like most of the stuff I do here it’s a starting point for you.  You can find out more about – and lay your hands on literally hundreds of great templates you can customize and make your own at Microsoft Office’s Template Library.  Free templates for almost every Office Product are available here.

You can … of course also snag the template I used as an example from my Skydrive here:


Direct Link:
http://cid-e46e5f5a0e3b5854.skydrive.live.com/self.aspx/Public/Office%20Templates/Project%20Status%20and%20Summary.zip

Until later… have fun… be productive… and someone find out when the next new Venture Brothers Episode is for me? 

Monday, January 12, 2009

Word document programming… simplified…

Fixing things for people around the office is often time consuming and frankly problematic.  Sometimes you don’t have administrative privileges on everyone's machine and you also don’t have time to personally go around and fix things. You write a script … but unfortunately the company email system has an apoplectic fit and refuses to send around your script. 

So… you put the script on a share – or your rename it to a zip or some other file name and force everyone to rename it and then run it. 

 

Open your Microsoft Word (I’m using 2007 for this) and let’s get to your Developer tab.  Don’t have a Developer tab??  Here’s how you get one… first  Open Word and click on the Office Button and select imageimageWord Options. Which will open up the Options menu screen – and off the Popular menu you can click on the check box for “Show Developer”  like it shows here.  

Now the cool thing is that if my directions are not that good  - you can find them off the Microsoft web site here… http://office.microsoft.com/en-us/excel/HA101730521033.aspx – so feel free to use them.  But the goal is to get a developers tab – so you can … well … develop.  Now this is a quickie tip so we won’t get too involved but using the Developer tab you’re able to put into a document any VBA command you can think of so you’re not limited.  There is very little you can’t do from programmatically changing things on the document to changing the registry settings. 

Let’s start by typing a short description of what it is the document does, and letting the user know that it is not a standard word document – and even telling the user that they’re going to need to turn on the scripts and macros for the document to make it run. 

It’s important that if you do any scripting on a word, excel or other document you inform the user they are using a document that has macros or scripted capabilities in it.  Sure – you could just have it trigger an event and not warn the user but to do so is very unprofessional and it imposes a level of credibility imagewith the user’s sense of safety and privacy.    So type a short paragraph and tell them what you’re about to do before you do it. 

Buttons or other mechanisms that the user can click on – that provide a kind of tactile feel let the user know this is not a standard document and that by clicking on the button something will happen.

So select a button from the legacy tool tools list – my prefered one is the standard ActiveX control Command Button that we see all the time.  You can find it off the Legacy tools menu imageshown under the ActiveX commands.  Once you’ve set your commandbutton up right – double click on it to reveal the vba code blocks.

I know… I know… this is VBA and VBA supposedly has a reduced instructions and it’s not as good as real code… and blah-blah-blah. 

Yes, a lot of that is very true.  VBA is not as robust as VB.net (although it’s pretty close) and it’s certainly not up to C# and nothing like the degree of power you get from unmanaged code.  But the point of VBA is that the average person can – with a bit of trial and error create pretty much anything they need and for the most part there is very little that you would want to try with a document that you need the power of unmanaged code or even the power of full blown Visual Basic or C#.  But if you wanted to – you very definitely can.  It really all depends on what you need to do, but for this quickie we’re just going to show something simple.

imageSo here’s a button … we’ve double clicked on it to reveal the visual basic editor – which looks like this… and I’ve dropped a little code in there which will open (silently) two command windows run the command “ipconfig /release” and “ipconfig /renew”. 

Now – I’ll do one more thing here, which is to disable the button the user clicks to make sure they only click it once.  Ordinarily I’d drop in some error code to check to see if the code completely properly and so on – you get the idea. 

The code to turn off the button looks like this:

ThisDocument.CommandButton1.Enabled = False

And you want to do that because if you don’t disable the button – then people will keep clicking it because your code may not display any visual indicator that the code was actually executed.  There are literally dozens of ways to provide feed back to the user to give them status and I really recommend you do.  The number of things you can do with a document are amazing.

You can add in there code, functions, anything you really need and now it’s all self contained in a document file that should allow you to send it to people and the only thing they have to do – is enable macros for the document and click on the button. 

 

To enable macros – if someone hasn’t gotten the standard warning asking them to enable them it imagelooks like the one shown here – so you may want to warn people they’re going to see this and to turn it on in any emails you include the document with.  Once again it’s all about trust – and if people start mistrusting your emails then you’ve got a problem.  Make people know that if you do send them something with a macro or code in it … it’s okay by telling them why they got the message. 

You can… of course download the code for this … here… it is of course a “docm” format – meaning that it’s clearly a word document with scripted or programmed (macros even) capabilities.  But I can save this in my groups SharePoint – and even most email programs will allow it to pass to someone since it’’s very openly a macro or scripted object.   Hopefully your company is one of those whose email systems do allow this since it requires the user to manually turn on the document’s macro capabilities.  If yours is one this is a great time saver you can send out to a group to fix issues.

Just my 2 cents and a quickie for the week….

http://cid-e46e5f5a0e3b5854.skydrive.live.com/self.aspx/Public/VBA%20Word%20Document%20Demo/NOTE.docm

 

HEY… Special note… congrats to Tommy Z out there on the birth of his son Zachary Z – many many blessings to you and mom.  He’s a cutie. 

Thursday, January 1, 2009

Drag and Drop richtextbox update…

I almost forgot to mention a little couple details for the previous post…

First off – got an email from Jason who asked about why the code doesn’t work for him.  I took a look at his code implementation and what he’s missing is something I drop in my form load area.  By setting RichTextBox1.AllowDrop to TRUE (in the form load) when the form is loaded and the richtext box control is created, it allows drag and drop operations.  Now I know – I know – by default the richtextbox control is supposed to have the drag and drop automatically set to allow it. 

Now, oddly enough – in my research I’ve found that not all properties dialogs out there (VS2005) for the richtextbox control have the property to set for this in the properties dialog.  I have confirmed – that you can set this in the code as showen below in 2005.  I’m still trying to find out if this is with all richtextbox controls – or if a 3rd party addon or control is what is causing the issue. 

In any case – you can set it programmatically which is what I’ve always done which is why I’m at a bit of a loss as to what the cause of this problem is.  Jason’s confirmed that setting this programmatically worked for him.

Public Class Form1
    Private Sub Form1_Load(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
        'This call is required by the Windows Form Designer.
      
RichTextBox1.AllowDrop =True
    End Sub

In my rush to send that out this morning I probably should have discussed – or commented the code a bit better.  By default

Wednesday, December 31, 2008

drag’n drop files into richtext boxes (so it’s actually useful)

There’s a ton of howto’s out there showing people how to do the drag and drop into a richtext box.  But recently I had a job that required me not to drag the contents from one part of the form to the other but to actually drag a file (or files) into a RichTextbox control – and process them.

Which… if you’ve never tried this before drops the file as an icon you can click on and open.  Not really imageuseful if you’re trying to process files.  It’s kind of annoying that even after a bit of Googling you’ll get a lot of links that let you drag the text or images or all kinds of stuff from one part of the form – to another part of the form. 

Which is fine if that’s what you need.  But what I needed was to be able to grab several files – of either text or xml – and then process them and display the output. 

Since I can’t share my work code – here’s the training wheels version of the code for you. image As you can see we process the XML and display it.  It also does text so … this is fairly close to the final version – which hopefully I’ll take some time and cleanse it from any confidential use info that may be in it and share.  In the mean time – here’s the actual guts of the code that makes it work.

 

Since I’m reallllly running behind – that’s all I can get out this week  - but hopefully it’ll be of use to someone out there.  As you can see – I’m calling the richtextbox dragenter event and customizing it.  The first thing I do is hunt for the dataformats.filedrop type off the event handleer – this allows me to grab the filename and – load it appropriately into the richtextbox.

Anyway… to all out there – here’s the code – have an AWESOME New Year… and I’ll be back on line to annoy all as soon as I can.

 

Imports System
Imports System.Drawing
Imports System.Data
Imports System.IO
Imports System.Collections
Imports System.Windows.Forms
Imports System.Xml
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'This call is required by the Windows Form Designer.
RichTextBox1.AllowDrop = True
End Sub

Private Sub
richTextBox1_DragEnter(ByVal sender As Object, ByVal e As DragEventArgs) Handles RichTextBox1.DragEnter

Try
If
e.Data.GetDataPresent(DataFormats.FileDrop) Then
' Put all file names into a string array
'in case the user grabbed more than one file.
Dim files As String() = CType(e.Data.GetData(DataFormats.FileDrop), String())
Try
'Now we break it down - we only want text files, xml or xsd files
'so we trap for that if it's not one of those - we ignore it.
If files(0).Contains(".txt") Then
Dim
f_stream As IO.StreamReader = FileIO.FileSystem.OpenTextFileReader(files(0))
RichTextBox1.Text = f_stream.ReadToEnd()
'Just for fun we show the name of the file and link it
llblFileName.Text = files(0).ToString

f_stream.Close()
ElseIf files(0).Contains(".xml") Then
Dim
filename As String = files(0)
Dim reader As New XmlTextReader(files(0))
llblFileName.Text = files(0).ToString
reader.MoveToContent()
'Loop through the XML and display it in the richtextbox
Do While reader.Read
RichTextBox1.AppendText(reader.ReadContentAsString)
Loop
reader.Close()
End If
Catch
ex As Exception
MessageBox.Show(ex.Message)
Return
End Try
End If
Catch
ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub
llblFileName_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles llblFileName.LinkClicked
System.Diagnostics.Process.Start(llblFileName.Text)
End Sub
End Class

Wednesday, December 10, 2008

We’re not dead yet…

Been a week or two since I updated so this is going to be quick before I lumber off to work.  The recession isn’t as bad as it might appear.  It’s bad – almost every IT company out there decided to put the breaks on a lot of hiring and dropped the expected wages they’re paying.  But the jobs are still there.  Nationally I just got a ping for over 35 IT Jobs that opened since December 10th – most are east coast related (NY, NH, NJ, FL) although there’s a surprising number from TX and IL that I really didn’t see coming.  Most of these are Dev and Engineering – but there’s a smattering of UI designer and PM type roles.

In the NW USA we’re still seeing a remarkable amount of stuff going on – although most is at MS still around 36 jobs posted through Dice and Careerbuilder since Dec 5th.  Once again – MS leads with Test positions and Dev positions, but has a nice nearly equal compliment of PM jobs.

Had someone ask me how to tell if companies are gearing up for work or completing projects based on job postings… here’s the tip:  If they need more PMs than they do Developers – they’re gearing up and there’s more work coming.  If they’ve got more Developer positions than PM and Test it generally means they aren’t planning they’re completing what they have on their plates.  This is often cyclical so don’t read a whole lot into it.

If you want a good idea of how to predict work in an economy – check comic books.  They’re a luxury item but they’re one that kids save up for – so if the kiddies have money for comics then mom & dad we can guesstimate if times are really tight.  If kids buy a lot of comics – then the allowance is healthy if they buy fewer – then the allowance is down.  As a result the comics industry has always been a good way to tell how hard hit families are in a financial crunch.  They’re one of those trail indicators you don’t think about but watching their wake tells you the size of the destructive forces applied to children.  Hate to be so cold blooded – but economics suck.

Warren Ellis sent off a ping saying the comics industry’s finally feeling the pinch – and his info seems to match up with mine.  It’s not that financially the industry’s gone south yet – tons of work being done and things are being bought – but the fear of the slow down is causing less work.  His recipe for digging out of holes in the comics industry is the same as mine – raise your game up a level or two. 

What every business from Film & Entertainment (Web especially) to  GM & FORD to Marvel Comics and Microsoft has had for the last decade has been an assumed captive market.  Raise your game and create better products or you’re going to get your corporate clocks cleaned by people willing to raise their game and give customers what they want. 

This isn’t the time to get conservative – this is the time to get creative.  To dig deep take some risks (not financially but creatively) and come up with great product.  Warren’s DOKTOR SLEEPLESS is a good example of a comic built and crafted for fans that’s selling in a market where others are slipping back.

Dr. Horrible (from Joss Whedon) is another example – built for fans it was what fans wanted.  It sold beyond well (waaay past expectations)  for no advertising, no budget, and not a lot of time.  But the quality was there and they created a product they knew their target audience would want.

These are the kinds of products that save companies and that’s the strategy needed to pull it out and win. 

That’s all for this week… back to slaving away…

Oh… and for those who haven’t seen it yet – did a new experiment with Vanishing Point in Photoshop and After Effects… it’s up on the web.  A 20 minute wonder here… but always fun to play.   The original here was a still photo of an alley – near canal street as I recall – a bit of adjustment, and wallah… 3D from flat using Vanishing Point in Photoshop to extract the planes for AE.

To belabor the theme of this week’s blog here … if you haven’t picked up a new skill this week you’re not raising your personal game up a notch.  Find something you haven’t done before – and go do it!  If you don’t someone else will.  If you do – you get to choose what it is you want to learn – what it is you want to do – and you’re a lot closer to doing what you want to do in life.  Remember … you can be a passenger or the guy driving the bus in your life.  Do you want to be the guy who gets to tell everyone where they’re going and when they can get off or do you want to be told?  The choice is up to you.

Tuesday, November 18, 2008

Reuse and recycling work

I just did a short bit on color correction in video in the previous blog, I demo’d a couple of different things you can do with the same clip to get different color corrections and other basic work with some filters that you can do quickly to get some cool effects with one very badly shot grainy clip.

Probably what I should have mentioned is … never delete your clips when you’re done.  Catalog them and save them.  Even the bad stuff can be often reused on other projects.

A good example is that grainy bad clip.   Since I had the time this morning while waiting on a phone call – I came up with a couple new effects for that same clip.  I saved them because I thought they might be useful.  Each time I do that I save myself some time.  I may not necessarilly use the clip again, but by adding tags to it in my catalog – the next time some one asks me if I can do a cosmic face effect – I can pull that up. 

Here’s the clip….

Tuesday, November 4, 2008

Consulting Tips – more notes from the field…

In keeping with posts for those who want to start a consultancy – I asked consultants on several forums what they considered were “Must Haves” to be consultants.

Mind you, most of these people travel (a lot) so there’s a section here for just travel needs. 

On the professional side of the house – your professional needs – you had the more common items.  Business Licenses – which many states have not just a requirement that Consultants be licensed, but also they have additional State and in some cases local taxes for that profession.  Some also require that you have Professional Liability Insurance as well – so check your state to make sure you have that covered.

They also reminded me of the need to actually have contracts on hand – something that when a client is ready to sign on the dotted line, you can have them sign on the dotted line.  Some pointed out they need not be physical contracts – you can always print one up a at a Kinko’s.  But talk to an attorney about getting a good basic contract for services that you can fill in the blanks for (generic standard form) and if you offer a specific service which requires additional language often enough, have them draft up one of those as well.  No one specifically mentioned an attorney but you get the impassion it’s not a bad idea to swing by one and get their take on your business as well.

One thing they all do seem to agree on and I second – is that you find yourself an accountant, or at the very least really good accounting software and learn how to use it so you can hand that over to an accountant for taxes.

Next came another lesson I found interesting – get several bank accounts and use them for their purposes.  A Business account for day-to-day business activities.  A Savings fund for “rainy day” and “misc” unexpected expenses that come up.  A second savings fund for taxes (you may as well earn interest on it if you have to pay it to IRS).  A personal account for you – and place 10% from every check in there.  That’s yours, once its in there – pretend like it doesn’t exist.  Don’t touch it – don’t think about touching it – once every so often, you should take that and roll it into a 401k or other plan for your retirement.

  • Professional Needs
    • Business and Professional Licensees 
    • Contracts (Standard form and Specific Clause)
    • Personal Insurance
      • Health
      • Life
    • Professional (Consultant) Liability Insurance
    • Accountant (or Good Accounting Software)
      • Way of calculating and handling taxes
    • Bank Accounts:
      • Business Account
      • Business Savings Fund 1 (Misc)
      • Business Savings Fund 2 (Taxes)
      • Personal Account Savings (Bonus/Benefits

Next, we ran into suggestions for Business Needs – specifically equipment.  A good laptop and a desktop – and make sure you set aside a small budget to buy yourself a new one every 18 months was a really great tip. 

Cell Phones were next.  Some said Blackberries others iPhones, Win Mobile… bottom line – any good cell phone that can keep you in touch with your mail.  But a very very wise consultant also tossed this one out as a great tip.  For about $30 you can also get a pre-paid phone and for about $5 a month he keeps just enough minutes on it to keep it always ready.  Get one – keep it and it’s charger in your luggage.  If you lose or damage your regular cell – you’re never without one.

Home offices everyone had suggestions – but the most common is to have at least a quiet room you can work from and take calls.

Presence was another area people had opinions on, some said a blog was all they needed, others said they had a fully professional website.  Still others just a page, a blog, and so on. 

Here’s my take.  For $15-45 a month you can get yourself a nice website and have your own domain and your own email address to that domain.  (Office Live can even get you started for free – and move everything over to a paid site. The free site comes along with project and document repositories you can share with customers and coworkers and clients even).  I personally pay about $39 a month for mine and I never use half of it’s features. 

One feature I do use – and I use a lot is the Online Shared Folders.  I often back up my most recent work there.  Anyone who’s ever lost a laptop – had something crash and burn – knows that losing what you’re working on is harsh.  Do that 1,000 miles from your back ups and at a customer site is devastating. 

Skydrive is free and you get 5 gb.  There are dozens of other locations out there.  Windows Live Mesh is a personal savior to me.  Between that and Skydrive and my Office Live folders I’ve got a good 30 gb stored in the cloud that can never be destroyed and I can access from anywhere – even an Airport Kiosk. 

Your presence is who you are as a company.  Put the money out and do this right. 

Next… here’s a blast from the past.  Business cards.  Put your name, put your email, your phone and your web address on it.  Nothing else.  No titles.  Keep it professional and simple.  People do keep them – and people DO remember you when you hand them out.  Simple cards like I mention here you can get from Overnight Prints or other Web printers for 250 for $10-12. 

Next part of your presence is your online identity.  Google yourself.  If you don’t like what you see – then get rid of it.  If you have a myspace page that you wouldn’t share with a customer – get rid of it.  I don’t care if it is your “personal” space.  Clients and customers may see it and they won’t care if the reason you were stripped to your underwear singing LaVida Loco was at a college party 10 years ago. 

Scrub your own google records.  Or accept that someone else will.  Some people have the opposite problem you google them and there’s nothing.  SO – get that website up.  And while you’re at it hit the rest of the social network sites and build up a presence that speaks well of you.

We’re talking LinkedIn, Facebook, and some other professional sites.  I would avoid MySpace and similar sites like the plague as in my experience they’re hard to maintain.  By “maintain” – I mean this – if you go out to blogger or wordpress and create a blog (seperate from your web site) you can then use the RSS feed from that blog to actually feed your blog postings to many social websites at once.

This particular blog entry will feed Facebook, LinkedIn and 3 other sites I’m on.  I post once… and I’m updating 3+ web presences.  Kind of like being your own personal syndication system. 

And since we’re mentinoning LinkedIn, there are now an abundance of “professional” boards out there.  Xing, Ning, Ling, Ting, Ping, Pong, you name it the list goes on and on.   Pick the ones you actually want to participate in and do so.  Spreading yourself too thin is a mistake. 

One thing you may want to do – is open a PayPal account to do on line transactions. 

Many online freelancer sites work with PayPal so if you’re going to doing any work from them – I’d suggest you have one.  You may want to look into some of these as they’re not bad places I’m told to get bits of side work. 

I found LimeExchange, TechRepublic and Guru.com to be fairly good places.  Nothing I’d survive off of – but there is work there. GetAFreelancer.com seems to be over run with competition that is questionable at best … and always willing to bid at minimum wage or lower.  Just my experience – your actual mileage may vary.

  • Business Needs
    • Equipment & Supplies
      • Computer
      • Cell Phone
      • Cards
    • Office (at least a quiet room)
    • Presence
      • Website
      • Email
      • Blog(s)
      • Shared Folders
      • Cards
      • PayPal
      • Accounts with OnLine Providers
        • LimeExchange
        • TechRepublic
        • Guru
        • Others (GetAFreeLancer)
      • Social Networks
        • LinkedIn
        • FaceBook
        • (Xing,Ling,Ning,TheLadders…)

Lastly we come to Travel needs for a consultant.  Every good consultant needs a passport. It’s an official 2nd form of ID, it’s needed for travel and in general it’s handy to have and kinda cool.

You may not be traveling to Brussels – but instead to the suburbs so make sure that you have a travel budget.  Set aside enough cash as you build your business so that you at least have enough cash to pay for regular car maintenance for your vehicle and 1 tickets air fare to somewhere.  (Use it for a vacation at the end of the year was a great tip someone mentioned.)

Get an emergency credit card – basically a card that has a very very low balance on it (paypal was suggested by one person).  If you don’t like that – it was suggested that you always keep $300 cash in your suitcase.  Basically the idea is always have that ready in case of an emergency.

The same goes with a spare change of professional clothes (most said they just kept them in the wrapping believe it or not).  And with the rest of the back ups they also said to make sure you have spare chargers for any devices you depend on a lot.

  • Travel Needs
      • Passport
      • Travel Budget account (1 trips worth)
      • Car Service (Regular Maintenance)
      • Decent Luggage
      • Emergency Credit Card(s) ($300 limit)
      • 1 Set of Spare Clothes (Unopened)
      • Backup Power / Cables for any equipment (Laptop, Cell, etc.)
      • Throw Away Cell Phone