Thoughts on Programming Tools for Non-Programmers
AJAX and PHP
This is intended to make websites far more dynamic.
In case anyone is wondering why I am using PHP it is because I bought a domain and hosting for £30 for two years. The site advertised Pythin support that I only found out was disabled after I had the domain. The remaining options were Perl or PHP. I found the PHP to not be too painful to use. The site is strictly of local area interest so does not get quite the load that would cause trouble.
Spring Framework
This is a port of a java container framework.
It provides Object Factory support.
What a Web Service contract requires
COM used to have immutable contracts – although these were occasionly broken ( OLE-DB has a great feature that breaks the IUnknown contract – the behaviour of IUnknown on a provider varies depending upon whether the connection is connected).
This would require some extensions to the basic infrastructure but would save a lot of trouble in the future. This would prevent a system being built with a dependance upon somrthing that is just due to expire.
Cognotive Distance
Kate’s argument was that C# was too close to C++ to make freely jumping between them difficult and error prone this made VB.NET a more natural choice. I have had similar experiences. Currently I am working in Delphi, SQL and C#.
I find that keeping the SQL in strict upper case allows me the seperation so that I don’t find myself adding “then” to the end of my if statements. This allows me to keep a Cognative Distance between the two languages. Since Delphi and C# have a suitable distance between them (begin end vs {} ) I generally don’t have a problem switching..
The major gotcha that I have between Delphi and C# is the calling of a method with an empty parameter list. In Delphi you can call foo; where C# requires foo();
C# reserves foo for referencing the method itself.
The other niggle that I have with C# is the casting syntax.
In Delphi if I wanted to cast a class to a specific descendant and then use a method exclusive to that type I would use:
TChild(aParent).ChildMethod;
C# would require:
((TChild)aParent).ChildMethod();
which has slighly too many brackets for my taste.
I know this was implemented for the C and Java developers but since one of the aims of C# was to correct the mistakes of the C and C++ world this could have been improved.
Linux Remote Desktop
How to make money from open source
Greasemonkey documentation
The documentation can be found here.
The general idea is that if you find a site that does not work how you want it to you can rescript it to avoid annoyances. I will be experimenting with this and will record my progress.
MSMQ Samples
The example in .NET Framework essentials does not seem to work.
This is still a simpliefied version, not actually handling timeouts very cleanly.
//This is Enque:
// Enque.cs
using System;
using System.Messaging;
namespace EnqueSample
{
[Serializable]public struct Customer
{
public string Last;
public string First;
}
class EnqueSample
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
try
{
string path = “.\\PRIVATE$\\NFE_queue”;
if (!MessageQueue.Exists(path))
{
MessageQueue.Create(path);
}
MessageQueue q = new MessageQueue(path);
Customer c = new Customer();
c.Last = “Eyre”;
c.First = “Chris”;
q.Send(c);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}
}
// Deque
// Deque.cs
using System;
using System.Messaging;
namespace Dequeue
{
[Serializable]public struct Customer
{
public string Last;
public string First;
}
class Dequeue
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
try
{
string strQueuePath = “.\\PRIVATE$\\NFE_queue”;
if (!MessageQueue.Exists(strQueuePath))
{
throw new Exception(strQueuePath + ” does’nt exist”);
}
MessageQueue q = new MessageQueue(strQueuePath);
Type[] t = {typeof(Customer)};
((XmlMessageFormatter)q.Formatter).TargetTypes = t;
Message m = q.Receive(new TimeSpan(0,0,5));
Customer c = (Customer) m.Body;
Console.WriteLine(“Customer: {0} {1}”, c.First, c.Last);
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
System.Console.ReadLine();
}
}
}