|
|
May 2007 Entries
Amanda is really excited about the book being released. Also, she's going to be at Tech Ed next week, so if you are going then track her down and get her to sign your copy! You can read more about it on her blog. Now, if you'll excuse me, I'm off to Amazon to order my copy ;-)
"The Writer team has been working hard on a new release and we're excited that it is now available for download!" Source: Writer Zone Get it whilst it's hot :-)
 Waaaay, I've got my invite to the Popfly Alpha, so expect some posts on that soon :-) In the meantime, you can read more on Popfly here and here. Technorati tags: Popfly, Microsoft
Fellow Charterite Barry Dorrans pointed out that the registration for Developer Day #5 has now opened. It looks as if the site was found by some eagle-eyed net surfer and they may have jumped the gun on the Developer Day organizers, as the agenda hasn't even been published yet! :-) UPDATE: The agenda is now available at the Developer Day site. Technorati tags: Developer Day, DDD
As you may be aware, the XMLValidatingReader has been depricated in version 2.0 of the .Net framework, so how do you validate XML now? Well, given the following XML <?xml version="1.0" encoding="utf-8" ?>
<books>
<book>
<author>
<firstName>Gary</firstName>
<surname>Short</surname>
</author>
<title>My Book</title>
</book>
</books>
and the following XSD schema <?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Books"
elementFormDefault="qualified"
xmlns="http://tempuri.org/Books.xsd"
xmlns:mstns="http://tempuri.org/Books.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="books">
<xs:complexType>
<xs:sequence>
<xs:element
name="book"
minOccurs="1"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element
name="author"
minOccurs="1"
maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element
name="fistName"
minOccurs="1"
maxOccurs="1" />
<xs:element
name="surname"
minOccurs="1"
maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="title"
type="xs:string"
minOccurs="1"
maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
you can validate the XML against the schema like so /// <summary>
/// Read and validate xml from a file path
/// </summary>
/// <param name="path2XMLFile">Path to the xml</param>
/// <param name="path2XSDFile">
/// Path to the schema file defining the xml
/// </param>
public void ReadAndValidateFromFilePath(string path2XMLFile,
string path2XSDFile)
{
using (FileStream fs =
File.Open(path2XMLFile, FileMode.Open, FileAccess.Read))
{
//GS - Create an xml document to hold our xml
XmlDocument xdoc = new XmlDocument();
//GS - Create a reader settings, add the schema, set for
//schema validation and add a validation event handler
XmlReaderSettings settings = new XmlReaderSettings();
settings.Schemas.Add(null, path2XSDFile);
settings.ValidationType = ValidationType.Schema;
settings.ValidationEventHandler +=
new ValidationEventHandler(settings_ValidationEventHandler);
//GS - Load and validate the xml
XmlReader reader = XmlReader.Create(fs, settings);
xdoc.Load(reader);
//GS - Close the file stream when we're done
fs.Close();
_XML = xdoc.OuterXml;
}
}
/// <summary>
/// GS - Handle any validation events raised
/// </summary>
/// <param name="sender">Object</param>
/// <param name="e">ValidationEventArgs</param>
void settings_ValidationEventHandler(object sender, ValidationEventArgs e)
{
_SchemaValidationErrors += e.Message;
}
"We are currently in the process of rescheduling this fall’s Professional Developer Conference. As the PDC is the definitive developer event focused on the future of the Microsoft platform, we try to align it to be in front of major platform milestones. By this fall, however, upcoming platform technologies including Windows Server 2008, SQL Server codenamed “Katmai,” Visual Studio codenamed “Orcas” and Silverlight will already be in developers’ hands and approaching launch" Ah well, it's not the fact that there's no PDC this year that's a blow (I mean, I wasn't going anyway) it's the fact that no PDC means Microsoft have nothing new to show developers. Now that is a pity, I thought Microsoft might have made a big push for developers this year, given the great leaps Google et al are making with their dev. platforms.
"Rumors about Google acquiring RSS management company Feedburner from last week, started by ex-TechCrunch UK editor Sam Sethi, are accurate and are now confirmed" Source: TechCrunch Not a bad pay day for a fairly simple business idea. Makes me wonder what I could do if I could attract some VC funding ;)
"Chip-maker Intel "should be ashamed of itself" for efforts to undermine the $100 laptop initiative, according to its founder Nicholas Negroponte." Hmm, when big business does things like this (no matter what their motives) it always smacks of heavy handedness, don't you think? Source: BBC Technorati tags: OLPC, Intel, BBC
"Scientists have said there is no evidence to suggest a link between the use of wi-fi and damage to health." So no then. This has caused a bit of chatter in the Blogsphere today as a BBC Panorama program (aired tonight) found that radiation levels from wi-fi in one school was up to three times the level of mobile phone mast radiation. But to my mind, this just shows how silly the debate around mobile phone mast is, as the readings were 600 times below the government's safety limits. That still doesn't convince you? Okay, try this. Wi-Fi radiation is 100,000 times less than that of a domestic microwave. Are you scared of your microwave? Do you shield your kitchen or avoid going into it? No, I didn't think so. I wouldn't worry about Wi-Fi either then if I were you.
The recent Wordpress update to version 2.2 broke my previous theme, so I'll be using this one for the time being, hope you all like it :) Technorati tags: Wordpress, Themes
...but not a developer? Then check out this great new mashup creation tool :) Technorati tags: Microsoft, Mashup, Popfly
Well if you are Yahoo! you may define it as someone complaining when they get ripped off! Yes, that's right, you heard me, if you get ripped off and then complain about it on a Yahoo! site, then Yahoo! may claim you are harassing the rip-off merchant and actually remove your post! Unbelievable but true. Rebekka Guðleifsdóttira (a talented photo artist from Iceland) found out that the rip-off merchants at only-dreemin were stealing her photographs. According to Thomas Hawk, she then wrote about it on her Flickr photostream, that post received much support from the community, but not from yahoo!, who claimed she was harassing only-dreemin and deleted her post! Wow, way to support a community guys! [Update 1: The BBC ran the story] [Update 2: Flickr apologise]
The trouble with large enterprises is that... well, they're large, and that means that they are made up of smaller departments, and these departments may have a different "view" of the same business entity. For example, the billing department's view of a Customer is going to be different from the sales department's view. So, what happens if you are in the sales department and you have to use a Customer object built by the billing department? I mean, you can't change the interface of the class, otherwise you will break it for the billing department, and you don't want to create another version of a Customer, otherwise where would it end, you could have dozens of Customer classes in the enterprise. No, what you want to do is to implement the Adaptor Pattern. The Adaptor Pattern uses an intermediary class to transform the implementation of one interface into an implementation of another interface. The UML diagram for this pattern looks like this And the implementation looks something like this using System; using System.Collections.Generic; using System.Text;
namespace garyshort.org.patterns.adaptor { //Define a Customer interface public interface ICustomerOld { string GetName(); string GetAddress(); string GetEmail(); DateTime GetLastOrderedDate(); string GetCreditRating(); } //Define a Customer to implement the interface public class Customer : ICustomerOld { private string _Name; private string _Address; private string _Email; private DateTime _LastOrderedDate; private string _CreditRating;
public Customer(string name, string address, string email, DateTime lastOrderedDate, string creditRating) { _Name = name; _Address = address; _Email = email; _LastOrderedDate = lastOrderedDate; _CreditRating = creditRating; }
public string GetName() { return _Name; }
public string GetAddress() { return _Address; }
public string GetEmail() { return _Email; }
public DateTime GetLastOrderedDate() { return _LastOrderedDate; }
public string GetCreditRating() { return _CreditRating; } }
//Define an new interface that the customer //must now support public interface ICustomerNew { string CustomerName(); string CustomerEmailAddress(); bool HasGoodCreditRating(); }
//Define a class to adapt the old interface //to the new one public class AdaptedCustomer : ICustomerNew { private Customer _Customer;
public AdaptedCustomer(Customer c) { _Customer = c; } public string CustomerName() { return _Customer.GetName(); }
public string CustomerEmailAddress() { return _Customer.GetEmail(); }
public bool HasGoodCreditRating() { return _Customer.GetCreditRating() == "GOOD"; } } class Program { static void Main(string[] args) { //Let's test the pattern!
//Create a customer object Customer c = new Customer("Gary Short", "My house in Scotland", "me@myhouse.com", DateTime.Now, "GOOD");
//Show it implements the ICustomerOld interface StringBuilder sb = new StringBuilder(); sb.AppendLine(c.GetName()); sb.AppendLine(c.GetAddress()); sb.AppendLine(c.GetEmail()); sb.AppendLine(c.GetLastOrderedDate() .ToLongDateString()); sb.AppendLine(c.GetCreditRating()); Console.Write(sb.ToString());
//Wrap the customer in the adaptor AdaptedCustomer ac = new AdaptedCustomer(c);
//Show the adapted customer //implements ICustomerNew sb.Remove(0, sb.Length - 1); sb.AppendLine(ac.CustomerName()); sb.AppendLine(ac.CustomerEmailAddress()); sb.AppendLine(ac.HasGoodCreditRating() .ToString()); Console.Write(sb.ToString()); //Wait for the user to press a key before closing the //command window Console.WriteLine(Environment.NewLine + "Press any key to continue..."); Console.Read(); } } }
Madeleine McCann missing in Portugal. Have you seen her? Please contact: +351 289 884 500, + 351 282 405 400, +351 218 641 000 Madeleine McCann desapareceu em Portugal. Tem informações sobre o seu paradeiro? Por favor contacte: 289 884 500, 282 405 400, 218 641 000, 112
My daughter Gemma, along with hundreds of other students in Scotland, start their Higher examinations today. Good luck to you all, especially you Gemma ;) Technorati tags: Scotland, Highers, Exams
As fellow Charerite Alistair Laing points out, Charteris have started a scheme to help suitably qualified staff join the British Computer Society. My welcome pack came the other day, along with my shiny new membership card (coloured gold no less). So now, like Alistair, I can use the letters MBCS after my name, which is handy as I too do not have a degree. The letters BSc. after my name stand for Bronze Swimming Certificate. :-)
Today the BBC reports on a survey that states that some Coeliac sufferers have had to wait 13 years for diagnosis. Well my experience with diagnosis is even worse than that. Now I don't suffer from the condition myself, but I know someone who does. This person first sought medical help 19 years ago. During this time, the condition has be mis-diagnosed as IBS, complications arising from ME and a food allergy. All treatment failed to alleviate the pain and suffering of this condition. Around 18 months ago, this person fell into conversation with a Coeliac sufferer quite by accident. After hearing the symptoms this sufferer had and comparing them with their own, this person self diagnosed themselves as having the disease. Immediately they put themselves on a gluten free diet and almost at once they felt better. Over the next 18 months the damage was reversed until now they are practically symptom free. Now you may think the story ends there, but no, the medical profession had not finished messing up this person just yet. You see gluten free food is expensive and as well as that, the condition brings other risks such as osteoporosis and bowel cancer. Because of this, it is important to get a confirmed diagnosis and have your local NHS Trust be aware of your condition to enable them to monitor you for those associated risks. So this person makes an appointment to see their GP and explains to him their symptoms, how long they have had them, the conversation with the Coeliac sufferer and how much better they are feeling now that they have been on the gluten free diet for 18 months. The GP agrees that this person most likely has Coeliac and gives them a prescription for gluten free food. All seems well, however, the local NHS Trust is not happy. Oh no! You see it turns out that you can't do it that way. You cannot form an hypothesis about a condition, experiment to check your hypothesis and then, when the experiment proves your hypothesis, treat the hypothesized condition. Oh no, you have to have the actual test. So the NHS Trust wrote to this person's GP and instructed him to stop all prescriptions immediately until they had taken the test and it had returned a positive result. Now that seems pretty straightforward doesn't it, take a simple test, get a positive diagnosis and then get monitored for nasty things that go along with Coeliac disease? Only it's not that simple. Nope, you see the test the NHS Trust are talking about is a biopsy. You see if you suffer from Coeliac disease then gluten causes the body to attack the small bowel and this damage causes the symptoms. The test is to take a biopsy and examine it for this damage. However, since this person has been on a gluten free diet for 18 months (and has been practically symptom free) the the body will have repaired the damage and there will be nothing to see! Therefore the fact that a gluten free diet has made a huge difference to this person's life, is the best way (for this person) to be diagnosed. The NHS Trust's response? Totally unacceptable. Under no circumstances can a diagnosis be made this way (treating Coeliac must be expensive). Their solution is for this person to go come off of the gluten free diet, to have the condition damage the small bowel again and then when the symptoms return, to have the biopsy and examine the damage done! Yes that's right, even though it's taken the best part of 18 months for the damage to be repaired in the first instance, and despite every doctor taking the Hippocratic Oath (part of which states that a doctor should "never do harm to anyone"); the NHS wants this person to damage their small bowel, go through all that pain and suffering just so that they can have another go at diagnosing something that they have mis-diagnosed for 19 years!! So that's where we are at the moment. This person is off the gluten free diet and is feeling totally miserable, whilst they wait for an appointment to arrive to have a test, to prove what that person (and their GP) already know. Man, you've got to love the NHS eh?! Technorati tags: Coeliac, NHS, BBC
"Two separate challenges to the results of the Scottish Parliament are being considered, it has emerged." Source: BBC NEWS | Scotland | Holyrood vote may face challenges
"The full announcement, plans and capabilities around the Silverlight platform were announced today at the opening keynote at MIX07. A subset of those details focused on the cross-browser/cross-platform media capabilities of the browser plugin were first unveiled at NAB, also in Las Vegas, a few days back. Ray Ozzie introduced the Silverlight platform as a combination of a cross-platform media delivery platform, an RIA platform as a new choice to build sophisticated Web apps, and a services platform (such as the new Silverlight streaming service). This will of course be making waves in the blogs starting today, or should I say "Lighting up the Web?" Check it out, it has some really cool media capabilities, not to mention a great .net/managed programming model.
|
|