Sunday, 21 October 2007

Debugging C# Rhino 4 plug-ins



Last week a colleague sent me a Rhino 4 plug-in, asking for help to debug it. Rhino-4 is a 3D graphics package which has become popular in universities. It has similar functionality to Alias Maya, 3DS Max etcetera, etcetera.

The easiest way to debug these rhino plug-ins, is to set the VS.net environment up so that starts Rhino (see graphic).

Then you can set break points, and if errors get raised you can step into them.

The error I found in the code was a consequence of C# array items not be instantiated. C# does not support dynamic arrays in the way for example that VBA and VB.net does.

The way the arrays were being declared was creating an array of whatever size, but was not populating that array with any actual objects.

Consequently I added a function that achieves the same thing to the end of the class, which I call to populate the array.

private whateverS[] GetArrayOfwhateverS(int num_whatever)
{
System.Collections.ArrayList al = new ArrayList();
whateverS whatever;
for(int i = 0; i < num_whatever + 1; i++) {
boid = new whateverS();
al.Add(whatever);
}
return (whateverS[])al.ToArray(typeof(whateverS));
}

There were 2 different functions referring to what ought to be the same array. So I made it a private class level variable to support that. I made the array a private class level variable so that it could be accessed throughout the class.

Tuesday, 18 September 2007

More Argos - Mikomi grief

Here is the rather predictable reply I got when I emailed Argos at the only email address I could find on their web site:




Dear London Software,

Thank you for your e-mail regarding 8gig Mikomi USB Flash Drive.

I am sorry I cannot help you on this occasion as the item was purchased in one of our stores. Please take the item back to any Argos store, along with your receipt, and our staff will be happy discuss the purchase with you.

[... (NOTE HOW THEY COMPLETELY IGNORE MY HAVING DONE THIS ALREADY AND HAVING SAID SO IN MY EMAIL TO THEM)....]

Alternatively the Argos store customer service team may also be contacted by phone on 0870 600 3030 option 4 for assistance.

[.... Incidentally, the equivalent landline number I just looked up on saynoto0870.com is 01908 690333 ....]

Should you require any further assistance please do not hesitate to contact us at order.enquiries@argos.co.uk or call us on 0870 600 2020.

Regards,

Argos Direct E-Commerce Customer Service Team.

Monday, 17 September 2007

Hey, if you think I'm just being praranoid... read this...

Hey, if you think I'm just being praranoid... (see below)... then have a read of this...

"I just bought your old hard drive"

Letter to Argos Mikomi

Here is the email I have just sent off to Argos / Mikomi (info@argos.co.uk) ... (we shall see what response I get). You need to read the previous post for the background to this.




I purchased an 8gig Mikomi USB Flah "Pen" Drive as a business purchase using my company business card from my local Argos on 12th September 2007, and was using it carry around important files with me that relate to my business including confidential information.

It became defective after 5 days of use. All the data files appear scrambled, and the drive has become locked so that nothing can be changed either adding or subtracting.

I am a computer professional with 20 years of experience and have several other similar devices from other manufacturers - none of these other devices has ever misfunctioned in this way for me.

I paid £50 for this 8 gig drive code: USBFD8GB - a "USB 2.0 Flash Drive 8GB".

When I try to reformat the drive it responds with "read only" - so I can't take the garbage off. It may be possible to recover confidential information from this garbage - and I certainly can't take the risk of handing over the drive to be returned to a factory where this confidential data is out of my control.

I took the drive back into the store, today (17th September 2007) and spoke to customer services staff there. As a reference for the conversation they gave me the name of the person in charge and the Manager's name.

They said they would only give me a refund if I hand over the drive. But it has confidential data on it which someone with the right equipment may be able to access - so I can't do that.

Bottom line is, I have bought a pen drive from Argos-Mikomi which breaks down within 5 days and I have NO RECOURSE. They won't give me either a refund or a replacement.

I suggested that we could take a hammer to it so I could be confident no-one could access my company data on the unit, but they wouldn't do that either. They said if they did that then argos HQ would expect that particular branch to foot the bill for the item.

You can verify that all this is true by speaking to the staff at the store.

My request is that you give me Argos vouchers to the value of the defective item (£50) so that I can purchase a replacement of a different brand. I won't be making the mistake of buying "Mikomi" products again.

Mikomi (Argos!) USB Pen drive HELL

Speaking purely from my own experience, I certainly have no statistics to show how many Mikomi USB Flah "Pen" Drives are defective, but I bought one as a business purchase using my company business card from a local Argos on 12th September 2007, and was using it carry around important files with me that relate to my business.

This morning (17th September 2007 - 5 days later) when I go on to it, the data looks like this:



Mikomi I did not realise is a brand name for Argos own electronic products. I paid £50 (about $100) for this 8 gig drive code: USBFD8GB - a "USB 2.0 Flash Drive 8GB".

The drive now says it is "read only" - so I can't take the garbage off. I ran it through the data recovery program "Active Undelete". That has worked miracles for me in the passed but could do nothing with this.

Did a quick search and found some one who bought a similar item (4 gig) and it completely trashed her system - so I suppose I should count my blessings that didn't happen to me.

I took the drive back into my local store who said they would only give me a refund if I hand over the drive. But possibly is has confidential data on it which someone with the right equipment will be able to access so I can't do that.

Bottom line is, I buy a drive from Argos which breaks down within 5 days and I have NO RECOURSE. They won't give me either a refund or a replacement. I suggested that we could take a hammer to it so I could be confident no-one could access my company data on the unit, but they wouldn't do that either.

Perhaps one lesson is this:

Always try out a new pen drive for at least 2 week with data that is not at all confidental or sensitive, prior to putting anything on it that is confidential. That way if it dies you can get a replacement from the likes of Argos / Mikomi.

I am writing a letter to their head office about this, so may yet still get my refund... I'll keep you posted.

In the meantime if you know any cool tools for data recovery from pen drives please do let me know in the comments.



Keywords: Mikomi Argos USB Flash Pen Drive Failed Crashed Died data corruption defective 1 gig 2 gig 4 gig 8 gig 1gb 2gb 4gb 8gb

Tuesday, 15 May 2007

Bad documentation

What is it that makes documentation "bad"?

(1) When documentation has been written only for people who already know about the subject of the documentation, and provides no reference path for where to go prior to it.

(2) When documentation has been written with an audience in mind who are different than the audience that the documentation is provided to.

Wednesday, 21 February 2007

Cyclic Development, Microsoft Solutions Framework

How does the principal of "cyclic" or iterative development apply to modern software projects.

The concept of cyclic development, as espoused by Microsoft's solution framework, references and a modern approach to software project development, where in, a project is developed and delivered to a client as a series of iterations... a series of releases that move the software forwards as much as is achievable with the available budget and resources, and which deliver features and benefits which have been prioritised according to their business benefit.

The philosophy behind this approach is that it gives clients the soonest possible benefit of development work done, by getting the results of that work out to the client and put into production, rather than waiting for a longer period of time, in the hope of a system that solves every problem, and deals with every business rule.

Given the pace of change of modern business where requirements can easily change in the few short months between specification and delivery, this kind of iterative approach to development and delivery into production has come to be seen as a way to maximise the return on investment in business software systems, and software systems that provide the foundation for inteligent infrastructures and profit generating business processes.

Monday, 5 February 2007

"Known State" in software development projects

Today a potential client, another UK software company, asked "If you were me, would you hire you?"
Understandably, perhaps, I answered "Yes", and then he asked me to say why I would ... and this is what I said....

The reason why I'm a great person to have build a software project for you is because I do what I call "complete work".
To use the gutteral, I don't do things in a half-arsed way.
I don't provide people with "half a hair cut".
With me you either get a whole haircut, or no haircut at all.

This does not mean that I always finish every project by every deadline.
Nor does it mean that I only ever produce products that spectacularly exceed client's expectations. I aim for this obviously and sometimes achieve it.
But sometimes of course the limitations on resources or time are more important to a client (or one of my own endeavours) than the delivery of a basic set of functionality for a given purpose. I don't claim to be proud of every web page I produce or database product I deliver.

Rather it means that I operate on the basis of "known state".
Every time I work on a project I move it on to a state that is relatively easy to communicate to another developer or a client.
Consequently I can give you a really straight-forward report on progress at each step along the way.

As I work, I don't leave half done modifications in my wake, or to whatever extent that may be necessary, I document any such situations so that anyone who is picking up from where I left off (that person is often me), has a really clear statement of how the pieces currently lie.

There are numerous beneficial consequences of operating in this way.

The first one is it makes my development working very productive. I tend to turn out solutions to software problems at a fraction of the speed that it takes many other software developers. As I trained myself to operate in this way, I noticed a three or four times increase in my productivity.

A second benefit, equally important, possibly more so from the point of view of the client, is that it makes it really easy to accurately answer the question "How is the project progressing?" , and the related question "When are we going to be able to deploy this?"

Its not that my delivery dates are 100% accurate, 3 months ahead of time, it is that they are continuously updated in a realistic way based on the achievement of these mini-milestones - discreet units of complete work. Because I am able to be completely honest about the progress being made on a project, my customers know, as accurately as it is possible to know, when they can expect to be using the next version. Very often the accuracy of this information has as much to do with the success of a project, as does the software itself.

Wednesday, 24 January 2007

London Software Consultant

London Software Consultant