Friday, November 30, 2007

The world vs Microsoft (maybe)

I was reading a very interesting article on coding horror the other day ( about browser wars.
This got me thinking about how much Microsoft must be worrying about how the enhancements in browsers and related technology will effect there business model.

When you think about it, most there money comes from selling operating systems and Office products. Now, browsers are becoming more and more the platform of choice to write applications on. it makes sense really.

The app will run on any device with a net connection (including phones, pda's etc), you can almost guarantee it will work, there is no need for the user to install software, updates are easy to roll out, ease of distribution, the list go's on and on.

While as it stands there aren't to many office based application that can challenge the MS office in the features category, there are certainly very capable alternatives out there, the main one being Googles offering, Google docs ( All the documents are saved online, so you can give other people access to them and wherever you are in the World you will always have access to your data.

One of the only downfalls of online applications is when you lose your net connection. We'll Google have even come up with a way of getting round that. It's called gears (

I dont personally know all that much about it, its a framework that will allow you to build web based applications that will also work of line. At the moment the only apps I have seen that use it are Google ones, but i'm sure more will be popping up.

So, are the mighty Microsoft doing anything of there own like this. Well, a bit. They have bought a stake in the social networking site Facebook (

One of the cool features of Facebook is the fact that you can create applications using there framework, and post them to the community. As the Facebook community is absolutely massive (according to 14 million used applications in Facebook in August) your application will get a lot of exposure.

On the back of this Microsoft has added support via a developer kit into its Visual web Developer product ( The thing I find funny about this is when you look at the Facebook developer documentation it's language of choice is PHP. Will this be changing to dotnet now Microsoft have got there claws into it?

So, are Microsoft trying to embrace the internet as its development platform of the future, or sticking to there so far successful business model of traditional desktop software. I'm sure we'll find out over the next few years.

And just out of interest, while we are talking about browsers, this is a breakdown of what browsers people visiting this site have been using over the last month:
While using this site as a test bed may not be the fairest judge of what people are using (most visitors will be more aware of what browser they run than normal users) , it does still indicate that no matter how much the other company's push there alternatives, the Browser of choice is Internet Explorer.

Thursday, November 22, 2007

Firefox 3 beta 1

Firefox 3 is now at its beta stage, so i've decided to start using it. you can get more details at

As well as a new rendering engine (gecko) there are various new features, such as the places options that let you easily bookmark and tag you favorites, and have fast access to them. As its a beta its probably not a good idea to use it on any production machines.

On another note i am in the process of creating a new blogg based on the wordpress platform. I've not fallen out with blogger or anything like that, its just that wordpress gives me more flexibility over what I can do. You can check it out at

Its a work in progress so some things might not be perfect yet

Thursday, November 15, 2007

Going Green - Creating a PC Shutdown Script

There's been a lot of talk throughout the IT industry recently about being more 'Green'. Well, being all for that and also sick of users who leave there pc's turned on all night for no good reason I have come up with a script to turn of pc's.

The script looks into Active Directory for computer objects in a specific OU, loops through all of the computers and creates a batch file that calls the windows script Shutdown.vbs. This is a script that comes bundled with XP, and allows an administrator to shutdown a remote machine from the command line.

You can download the script from

Rename the file to a .vbs file, change the 3 variables at the top of the script to match your environment and it should create your file. A couple of things to note before using this script:

BE CAREFUL! You could end up shutting down servers or client machines that are being used. I would make sure first the pc's are ok to shutdown, and only run the script after you know the users aren't likely to be using them.

This script will not forcefully close open applications, so not to lose any users work. If you really want to force the machine down (even if the user has un-saved open work) you can add a '-f' switch to the script on the line where it writes the computer name out to the file.

You will need to be a Domain admin or similar to shutdown the remote machines, or you'll just get an access denied errors.

As I mentioned before this could be dangerous so make sure the pc's are ok to shut down before running the script.

Wednesday, November 14, 2007

More on Spiceworks 2 Beta

I Got an email this morning that contained a link to a page with some more info on the upcoming version 2 of Spiceworks, read more about it here -

The website looks very snazzy, but there doesn't seem to be all that much in the way of new features. They are putting a lot of emphasis on it being 'Faster'. Hopefully the web interface will preform a little better as sometimes I found it a bit laggy, but I thought the actual scanning of the devices was quite fast, considering how much it was doing.

There is something in there now that looks like it will collect event logs from you devices, that is a nice touch but not all that much use to me personally as we us a syslog daemon from Kiwi and Snare agents on the servers to send the logs out. The Kiwi syslog good for setting up alerts based on events you specify, hopefully you will be able to do something like this in Spiceworks

The rest of the updates look like they are purely cosmetic. Graphs and things look nice but they dont really bring much to the app, I would have liked to have seen the ability to extend it with user submitted plugins, now that would have been a real step forward

Monday, November 12, 2007

Spiceworks and Firefox Beta Time

I noticed on a couple of days ago there was an story about Firefox3 not being in beta, but is is out soon its worth mentioning it. You can see all the happening at, but these are a list of upcoming features:

Improved bookmarking system called 'places'
Improved support for add ons
New version of the rendering engine Gecko 1.9

See the above link for more details. You can download the current Alpha (9) but as the beta's out soon unless you are a developer are very curious then probably best to wait for that.

I also received an email from Spiceworks, about a beta version of spiceworks 2 beta. You can sign up for it at At the minute they seam to be keeping quite about the features, but there is a thread at that has a bit of information

Thursday, November 08, 2007

API Wrapper Classes

The past couple of days I have been on a short course run by one of our vendors about using the API from one of there products.

Now I have to firstly applaud them for making there product open enough for us to call it using its api, there are some bits of business logic missing, but for the most part it is very good and very well documented.

The only problem with it is the amount of parameters you can pass to some of the methods, and the amount of information you get back. In some case's there are over 30 inputs to a method, but only 2 are mandatory. So Calling the API could look something like this:

result = AppInteraction.API("APICustSearch", pi_pointer, pi_source, type.missing, type.missing, type.missing) etc etc

This kind of code while functional can get very messy and hard to read. What we could do with is a class to wrap the functionality of the API calls in.

First thing to do is create a couple of classes for the input and outputs of the method. This example is using the method called APICustSearch, it will have 5 possible inputs and 3 outputs.

Public Class CustSearch _input
Public Spointer As String

Public Source As String

Public date As String

Public Active As String
Public MinSpend As String

End Class

Public Class CustSearch _results
Public Result As Integer

Public Resulttext As String

Public Custname As String

End Class

The above classes just deal with the inputs/outputs of the api, next we need to code the actual api call into a class:

Public Class AppWrapper
' Defintion for API APICustSearch
Public Function CustSearch(ByVal oInput As CustSearch_input) As CustSearch_results

Dim oApp As New AppAPI.Interaction
Dim oResults As New AppAPI.colGeneric
Dim oReturn As New Suborderrestart_results

oResults = oApp.API("APICustSearch", oInput.Spointer , oInput.Source,, oInput.Active, oInput.MinSpend )

While System.Runtime.InteropServices.Marshal.ReleaseComObject(oApp) > 0
End While
While System.Runtime.InteropServices.Marshal.ReleaseComObject(oResults) > 0
End While

oResults = Nothing
oApp = Nothing

Return oReturn
End Function

End Class

So now we have our class to call the functionality of the API method we are interested in, we can easily call it from our application like so:

Dim App As New AppWrapper
Dim CustSearchParam As New CustSearch_input
Dim search_result As CustSearch_results

With CustSearchParam
.Spointer = "12345"
.Source = "API"
.date = "08/11/2007"
.Active = "Y"
.MinSpend = "0"
End With

search_result = App.CustSearch(CustSearchParam)

'this is some checking specific to the API i was working with. If the search_result.Result was not 0
'an error had happened and the details were in search_result.Resulttext
If (search_result.Result <> 0) Then
MessageBox.Show(search_result.Resulttext, "Search error")
End If

If (search_result.Result = 0) Then
MessageBox.Show(search_result.Resulttext, "SubOrderRestart Suceeded" & vbnewline & search_result.Custname )
End If

You will obviously have to tailor the classes based on the api you are using, but you can just add all the methods you use the the AppWrapper class, and create new input and output classes based on the spec.

Apologies for any errors in the example code, I have re-written sections of mine to make it more generic, but hopefully you should get the idea