Sunday, 15 March 2009

Was at a course last week and found a tip that I didn't know about before.

So I thought I should share it.

Before SQL Server 2005 the only way to compare Profiler logs and System Resource Logs (Performance Logs) was to put them side by side and then manually try to match up events. This was frustrating and annoying.

Now with SQL Server 2005 a new feature exists in Profiler 2005 that allows you to import performance logs into profiler. You can import logs by going to File -> Import Performance Data.

When the log is imported you can navigate the log by either clicking on entries in the SQL Profiler Trace or by clicking on points on the performance log graph. Both ways will synchronise the logs so that they show the system event when a sql event happened or the sql event happening at a system event.

Please note that you may have to restart Profiler if Import Performance Data is greyed out

Thursday, 5 March 2009

Recently I had to develop a delphi method that would allow users to select one or more rows in a DBGrid and create duplicates of the selected rows in the same grid.

The factors that made this non trivial were the facts that you had to add the rows to the same grid as the source rows, there was a auto incrementing field in the grid and some of the field had to be left blank in the duplicate rows.

Things that I had to think about

I tried to get all the values into an array. This was fine but when I tried to use the array as the parameter for Dataset.AppendRecord, I got a compile error which stated that it was looking for an Array but was given a dynamic array. So I had to change the way I did it and had to add another forloop to insert all the values from the source row to the duplicate row.

I had to move the Auto Incrementing field to the end of the the clientdataset so that I didn't have to specify a value for it. If I tried to specify a value for it or tried to assign 'null' to it, then the code didn't compile. This is the reason for -2 in the for loop.

for I := 0 to DbgResults.SelectedRows.Count -1 do begin SetLength(ArRec,CdsResults.FieldCount); // set length of array to number of fields in client dataset CdsResults.GotoBookmark(Pointer(DbgResults.SelectedRows.Items[i])); // For loop with -2 as need to ignore 'AutoInc' field // Double forloop one to get cell values and one to insert cell values for J := 0 to CdsResults.Fields.Count -2 do begin ArRec[J] := CdsResults.Fields[J].Value; end; // second for loop CdsResults.Append; for J := 0 to CdsResults.Fields.Count -2 do begin CdsResults.Fields[J].Value := ArRec[J]; end;

// Remove information that will be different in new record CdsResultsResultNum.Clear; CdsResultsResultString.Clear; CdsResultsValidReport.Clear; CdsResultsPartNo.Clear;

// End insert CdsResults.Post;

// Remeber to release resources ArRec := nil; end;end;

This may not be the best way to do it but it worked for me. If you have any comment s then let me know

Wednesday, 4 March 2009

This is the final part of a two part article. In Part 1 I talked about the hardware and operation system that I chose for my media centre and the reasons for the choices.

In this part of the arcticle I will be talking about the media centre software that can be used to control your media.

The options that I looked at were.

Vista Media Center

Media Portal

Sesam

Vista Media CenterI was optimistic in trying Vista Media Center on my media center (Laptop with 1.6 AMD Processor, 512Mb RAM, 20Gb Hard Drive). It really was too slow a machine to cope with Vista. Even so I was impressed with what I saw of the software. It seemed very slick. I don't know who copied who but it looks similar to the PS3 interface with items on two axises. I have had a play with Win XP Media Center 2005 and it is a big improvement on the older version.

Media PortalI had to go back to Win XP from Vista so I looked around for some free media centre software. The first one that came up from my searching was Media Portal. I remember looking at this before but at that stage it was very buggy and didn't work correctly. The current version of Media Portal is 1.0.0.0 so I was optomistic that it would be more stable. It started off promisingly, the interface was slick very useable. On startup it came up with an error stating that the VRM 9 version was outdated. Eventually I found out that it was due to not having Win XP SP3. After installing Win XP SP 3 the error disappeared. When using Media Portal it came up with some other strange errors. When I looked on their forum it stated that installing .Net Framework 2.0 and 3.0 may fix the problem. I reluctanctly installed both frameworks. Unfortunately Media Portal continued to be unstable. Maybe it was the hardware I was trying it on but there was something intrinsinctly buggy and unstable about Media Portal which made it unusable for me. This is a pity because Media Portal did seem to have most if not all the features that I required.

SesamThis is an old media server that I have also looked at before. It looks a bit old fashioned but worked really well. The interface is very slick and it is the only media centre that I have seen that can be controlled exclusively using four arrow keys and the ok button on a remote. This may seem like a small issue but when your using a remote and have to use the mouse for certain functionality then it quickly becomes frustrating.

Conclusion

My system maybe a special case as it is quite a low specification but my conclusion is that media centre software should be stable and very easy to use. It shouldn't be compared to other computer software as it's usage is completely different. It should be compared to other home entertainment equipment like DVD players or Hi-Fi systems. So would you be happy if you had to use a mouse to get to certain functionality of your DVD player or would you be happy if you had to restart your DVD player because it was constantly crashing. In my opinion media centre software is a tool to get to your media. It doesn't need super fancy graphics, it just needs to be designed to get to your media quickly and efficiently. If you are like me then I would recommend Sesam. The only issue with Sesam is the fact that it is not being developed anymore so useful features like plugin's for YouTube will probably never happen.

Tuesday, 3 March 2009

JHoveis a java utility that can be used to identify document types. It is used extensively in the digital preservation field.

The problem

At work I was set the task of getting JHove to batch process all files in a folder. It does individual documents correctly using the GUI however there were no examples of it being used through the command line on a batch of files. After looking at it for a while it seemed that we would have to build a separate application in order to call JHove for each file in a folder.

Finally we worked out how to do batch processing by using JHove alone.