ActiveCollab Windows Server 2003 IIS6

We are trying out ActiveCollab @ Karova instead of Basecamp. There was quite a few problems to get it working though. Mainly as it was PHP on IIS methinks. The first error was that none of the class files were not being loaded by autoloader as it didn’t know where to look so I had to tell it ->

[code lang=”php”]
private $parse_directories = array(‘%ABSOLUTEPATHTOWEBSITEDIRECTORY%’);
[/code]

in environment\classes\AutoLoader.class.php Line 36

The second error was that emails were not being sent. I reckon this was either our SMTP or PHP on windows not liking the format of the email addresses (“Philip Roche”<phil @philroche.net>)
[code lang=”php”]
function toString() {
if(trim($this->getName()) == ”) {
return trim($this->getEmail());
} else {
//return trim($this->getName()) . ‘ < ' . trim($this->getEmail()) . ‘>’;
return trim($this->getEmail());
} // if
} // toString
[/code]

in environment\library\simplemail\MailAddress.class.php Line 49

and finally, I could not upload public files as the isPrivate method was returning blank instead of 0.
[code lang=”php”]
static function setIsPrivateForObject(ProjectDataObject $object) {
$isPrivateVar = $object->isPrivate();
if($isPrivateVar!=1)
{
$isPrivateVar = 0;
}
return DB::execute(‘UPDATE ‘ . ApplicationLogs::instance()->getTableName(true) .
‘ SET `is_private` = ? WHERE `object_id` = ? AND `object_manager_class` = ?’,
$isPrivateVar, $object->getObjectId(), get_class($object->manager())
); // execute
} // setIsPrivateForObject
[/code]

in application\models\application_logs\ApplicationLogs.class.php line 61

It’s all sorted now and running and actually I am finding it alot nicer than basecamp and as it’s on our own server – a hell of a lot quicker.

local.live.com Snowdon Mashup

I don’t like the term “mashup” but I wrote a quick “mashup” to show the route I took up Snowdon on sunday (I didn’t go all the way). Try it out. The javascript needs some cleaning but it works for now. Note: I haven’t tested in in IE.

To tie this in with a handheld GPS (which I plan to get for christmas) would be really cool. You could download the Longitudes and Latitudes that you have walked and add them to the Javascript config and presto you can see an aerial view of your trip.

Snowdon Mashup

Update: It does seem to work in IE6 but as Andy pointed out below – I haven’t tested in Safari but I havn’t done any Javascript naughtiness so it should be fine.

Another update: It doesn’t work in Safari – Not because of anything I have done – Local.live.com doesn’t work in Safari – phew

Yet another update: I’ve updated the Javascript, it’s much neater and half the size. It works in IE (the menu is out of position though), Firefox and Opera.

Aggreg8.net sold

None of you will have noticed that Aggreg8.net and Aggreg8.com are now actually hosting Microcosm which is a Microsoft portal of some sorts.

I was approached about a month ago to see if I would sell Aggreg8.com. Hell yes. I suggested $3000 as I could not be bothered getting into a to and fro debate on the price. I also offered Aggreg8.net for $2000. Both suggested prices were accepted and the domain transfer proceeded using Network Solutions certified offer service. I am yet to receive the checks but I am well chuffed and after £2000 in the last 2 months on car repairs – it is definitely needed.

I have since purchased Aggreg8.co.uk and Aggreg8.org so my Aggreg8 RSS reader will be moving there once I get a chance.

C# XML encoding woes

I have a simple XML document fragment with a euro symbol in it:
[code lang=”xml”]

Lorem ipsˆum dolor sit amet,

[/code]

which I want to load into an XML document.

[code lang=”cpp”]
System.Xml.XmlDocument doc=new System.Xml.XmlDocument();
doc.LoadXml(xml);
[/code]

I then output the XML of that doc to see that all is well – alas it is not, It has decided to re-enocde my beautiful numeric entities.
[code lang=”xml”]

Lorem ips€um dolor sit amet,

[/code]

I cannot find a way around this. It still works well, but god damnit . I want my bloody entity references back you bastards. Can anyone please help me. I have tried XMLTextReader and XML streams and all sorts of other google groups induced madness.

Update:

I managed to figure out a way to re-encode the data after it has been loaded into xml (after it has been xslt transformed or just as a string)-
[code lang=”cpp”]
System.Xml.XmlDocument docOut=new System.Xml.XmlDocument();
docOut.LoadXml(xml);
string text = docOut.OuterXml.ToString();

System.Text.StringBuilder sb = new System.Text.StringBuilder(text.Length);
foreach (char c in text)
{
if (c > 0x0080)
{
sb.Append(“&#”);
sb.Append((int)c);
sb.Append(‘;’);
}
else
{
sb.Append(c);
}
}
Log.logError(” sb.ToString(); = “+sb.ToString()+”\n”);

System.IO.StreamWriter sw = System.IO.File.CreateText(outXMLFile);
sw.Write(sb.ToString());
sw.Flush();
sw.Close();

//docOut.Save(outXMLFile);
[/code]

I’m not too sure but there might be a way to override the OuterXML property of the XMLDocument class. I hope so. For now it works and I am chuffed -now to get back to what weekends are really for, laundry and cleaning drinking 🙂

Dev crazy

In an attempt to vary the type of programming I am doing, out of office I have been working on quite a few cool projects. Outlined a few below – unfortunately none are for download yet as they are still in progress.

KarovaDev Firefox extension
As Karova‘s main product is a hosted e-commerce solution, we naturally have to integrate with quite a few payment service providers. It can be a chore to test our stores with these payment service providers, having to enter dummy or real credit card details everytime. I hate monkey work so I wrote a firefox extension for the Karova developers to help in the testing of Karova stores. It’s pretty sweet, You can edit all the default data passed for each payment service providers, specify the domains or virtual directories (if installed on localhost) to test against. The final test page scans all the user’s cookies and chooses the ones that match the supplied domains etc. You can then choose your site and test to your heart’s content- saving hours of monkey work.
Screenshot of KarovaDev firefox extension
It was nice to work on a beefy extension again. It re-affirmed to me how good the Gecko/ XUL platform is.
Philroche Blog Tool
Most of the C# work I do in wrk is web applications running on IIS. I do some command line apps that run as scheduled tasks but I don’t have cause to develop any GUI apps. Microsoft released Visual Studio 2005 express so I downloaded it and gave WinForms a shot… easy peasy to get a nice GUI designed and built. I decided to write a simple RSS aggregator to see how easy it would be.
Philroche Blog tool view feed
I haven’t written the RSS parser yet but I have the tree view and the Mozilla ActiveX control working well. I could have used the built in webbrowser (IE) component but then why would I want to do that.
Philroche Blog tool make post
I wanted to see if I could integrate with the wordpress API too to make blog posts so I turned to Xstandard (the lite version). Xstandard also have a .NET component that you can use. It is really neat and you can bet your house on the markup being valid.

Visual studio 2005 express is excellent and free too (as in beer). Also checkout SQL server 2005 express which I have used on a very beefy project already and it is ace – also free (as in beer).

Mod_Python
Since having a fairly new Dell machine donated to me by my Dad I have been feverishly using Ubuntu. I have Apache and mod_python running and have a nice little app running. Mod_python as a development platform is sweet as it is not as contstrained as TurboGears or Ruby on Rails. It is very hard to debug though.

So all in all I am getting some nice variety in my dev work, I find it can sometimes get stale if you’re doing the same thing day-in day-out, especially if it involves legacy asp sites. Is there anything you guys would recommend trying out as an antidote to work work while still being dev work (if you know what I mean). I do want to look at mono and PyGTK.