My New Programming Project

I’ve recently embarked on a new personal programming project and I though I might document my progress here on this blog. The project is a GTD App (see here to read about GTD if you don’t know what it it), I realise there are lots of these types of apps already out there, but none of the ones I’ve used have ticked all the boxes for me. I’m looking to write something that suits me, I don’t know if I will ever release it, this is more an exercise for honeing my skills, learning some new tchnologies and programming techniques. In my professional life I don’t often have the opportunity to write programs the way I want to, with this project I can. When I complete the project, if I decide to release it, I may make it open source, but there’s a long way to go yet before I need to start thinking about that.

I’m going to be writing my app in C# using Visual Studio 2010 and using NHibernate as my ORM and Persistance library, NUnit for Unit Testing, NAnt as my Build tool and SQL Server 2008 for the Backend Database. The plan is to make the app usable on multiple database platforms, such as Oracle, MySQL and SQL Server CE. I haven’t decided what I’m going to write the GUI in yet, I think I want to have a desktop version and a web version. For the desktop version I’m not sure whether to use standard Windows Forms or WPF or for the Web version, ASP.NET or Silverlight. I’m going to concentrate on the backend first and decide on the front end later.

I’ll post some more information as the project progresses.

SVN Checksum Problem

In all my software projects now I use SVN for my source control and although very good most of the time, does have a tendancy to break sometimes.

One of the issues I get sometimes is while updating my working copy from the repository, I get the following errors:

“svn: Checksum mismatch for ‘aaa’; expected: ‘xxxxx’, actual: ‘yyy'”

You can ofcourse just delete your working copy and do another checkout, but this is not always an option for me as some of my code is heavily embedded in my development environment. So I needed another solution.

After searching the internet for sometime I came across this blog post with the following solution:

  1. checkout a clean copy to a temporary location
  2. for new and your problem checkouts, go to the folder where your svn mismatch error is thrown
  3. in that folder, go to .svn folder
  4. copy the entries file over from the clean copy
  5. svn cleanup on the problem folder
  6. svn update

Problem solved!

Visio and Tiff to PDF

I’m currently working on a project that requires the automatic rendering of files to PDF, MS Office files work ok but there’s a problem with Visio and Tiff files  so I wrote this simple console app in VB.NET.

Module Module1

Sub Main(ByVal args As String())
OpenFileWithAcrobat(args(0), args(1))
End Sub

Private Sub OpenFileWithAcrobat(ByVal InputFile As String, ByVal OutPutFile As String)
Dim AcroAVDoc As Object
Dim AcroPDDoc As Object
Dim b As Boolean

AcroAVDoc = CreateObject("AcroExch.AVDoc")
b = AcroAVDoc.Open(InputFile, "Temp")

If AcroAVDoc.IsValid Then
AcroPDDoc = AcroAVDoc.GetPDDoc()
AcroPDDoc.SetInfo("Title", "")

If AcroPDDoc.Save(1 Or 4 Or 32, OutPutFile) <> True Then
Debug.Print("Error")
End If

AcroPDDoc.Close()
End If

AcroAVDoc.Close(0)
AcroPDDoc = Nothing
AcroAVDoc = Nothing

End Sub

End Module

The app uses Acrobat Professional 9 and takes as its parameters the path of the file to be rendered to PDF format and the path of where the file should be saved to.  eg. renderer.exe “c:\temp\file.tif” “c:\temp\file.pdf”

It works really well as it maintains page sizes and orientation.  It will needs some error handling adding before it goes into production, but for now it works ok.