. Topicala Page Index Token

A Journal about the experiences I have developing little applications in C#, Perl, Html and Javascript and talking about things new things that I use. Always Geeky; Always Nerdy; Always poor Grammer!

I am a Software Analyst Developer working in Southport, England but living in Liverpool. I develop mainly in C# and ASP.Net. I have been developing comercial software for several years now. I maintain this site (hosted at SwitchMedia UK) as a way of exploring new technologies (such as AJAX) and just generally talking about techie geek issues. This site is developed through a host of Perl scripts and a liberal use of Javascript. I enjoy experimenting with new technologies and anything that I make I host here.

Quick Search

Web www.kinlan.co.uk

Sunday, April 30, 2006

Error Codes vs. Exceptions

An Enteraining read about Exceptions vs Error Codes in applications programming, some bad language, plenty of analogies [don't know if that if the correct spelling :)] but a good read!
"Very little software really gets error handling right. Even many critical, backend server systems tend to break under heavy loads. And the vast majority of end-user applications handle errors gracefully only for the most well understood, commonly encountered conditions, but very poorly for most other conditions."


Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , ,

My Related Documents
, , , , , , , ,

Related Amazon Books
Fluid Concepts and Creative Analogies: Computer Models of the Fundamental Mechanisms of Thought: / Fluid Concepts and Creative Analogies: Computer Models of Mental Fluidity and Creativity: / Fluid Concepts and Creative Analogies: / Error-Correcting Coding Theory (The McGraw-Hill Computer Communications Series): / Error-control Coding for Computer Systems (Prentice Hall Series in Computer Engineering): / Bug Proofing Visual Basic: A Guide to Error Handling and Prevention: / Advances in Exception Handling Techniques (Lecture Notes in Computer Science): / Ajax in Action: / Head First Servlets and JSP: / Professional JavaScript for Web Developers: / Head First Java: / Hibernate in Action: Practical Object/Relational Mapping: / Pro C# 2005 & the .NET 2.0 Platform: / CLR Via C#: Applied .NET Framework 2.0 Programming: / Beginning ASP.NET 2.0: /

Related Images From Flickr


read more | digg story

Thursday, April 27, 2006

All Visual Studio Express Editions are now Permanently Free!

I know this is old old old news, but I thought I might as well post a blog entry about it.
"Dear Visual Studio Express community, we are incredibly excited to announce that effective April 19th, 2006, all Visual Studio 2005 Express Editions including Visual Basic, Visual C#, Visual J#, Visual C++, and Visual Web Developer Express will be free permanently!"

Also check out the cool new tools.


It is pretty cool when you think about it, I think that it will introduce a whole set of new developers to Windows and ASP.Net. I know of one of my friends who has taken an Express version and loved it. He was pretty gutted though when he found out some of the limitations (like only one project per solution). But that is by the by when you think about all the stuff it gives budding developers.

Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , ,

My Related Documents
, , , , ,

Related Amazon Books
Pro ASP.NET 2.0 in C#: / Beginning Visual Basic 2005: / Beginning ASP.NET 2.0: / Programming ASP.NET 2.0 Core Reference: / ASP.NET 2 for Dummies (For Dummies S.): / The ZEN of CSS Design: Visual Enlightenment for the Web: / Beginning Visual C# 2005: / Expert C# 2005 Business Objects: / How Stuff Works: /

Related Images From Flickr


read more | digg story

C# Trackback, Part 2

The second article on how to implement trackback in C# - source code included and free to copy.

Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , ,

My Related Documents
, , , ,

Related Amazon Books
Blogosphere: Best of Blogs: / Refactoring: Improving the Design of Existing Code (Object Technology S.): / Code Complete: A Practical Handbook of Software Construction: / HTTP Pocket Reference: / HTTP: The Definitive Guide: / C#: / Professional ASP.NET 2.0: / Pro C# 2005 & the .NET 2.0 Platform: / Beginning ASP.NET 2.0: / Programming ASP.NET 2.0 Core Reference: /

Related Images From Flickr


read more | digg story

C# Trackback, Part 1

I saw the article on http://www.janoserdelyi.com/permalink/article/19.aspx, it is part 1 of a basic implementation of a Trackback pinger.
this is part one of a C# implementation of the trackback speicification used by blogs.

part one involves the Trackback Ping with a full code explanation.

I am yet to be convinced by Trackbacks, however the article is full of code and is pretty interesting to read.

Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , ,

My Related Documents
, , , ,

Related Amazon Books
Blogosphere: Best of Blogs: / Refactoring: Improving the Design of Existing Code (Object Technology S.): / Code Complete: A Practical Handbook of Software Construction: / HTTP Pocket Reference: / HTTP: The Definitive Guide: / C#: / Professional ASP.NET 2.0: / Pro C# 2005 & the .NET 2.0 Platform: / Beginning ASP.NET 2.0: / Programming ASP.NET 2.0 Core Reference: /

Related Images From Flickr


read more | digg story

Saturday, April 22, 2006

Integrating Google calendar in your website

This article shows how to integrate Google Calendar to your website with a simple PHP/ Javascript


I would like to integrate blogger into my calander and viceaversa. I think that would be pretty cool.

read more | digg story

Microsoft to upgrade Xbox 360 CPU

Microsoft will upgrade the CPU used in its Xbox 360 games console early next year, the CPU's manufacturer announced today. The new CPU will be built using technology that can reduce heat and power consumption, as well as potentially increasing speed.


I have seen a lot of comment on this, and people are reacting saying "I AM GONNA TAKE MINE BACK", how ridiculous is that. Microsoft are cutting the cost of making their machine, so that they get better yeilds and also save more money and it is really unlikely that they will speed it up, rather they will make it run cooler and quiter!

Each of the console manufacturers has a long history of this type of modification, god knows sony did it all the time and for good reason.

I bought a PS2 when it came out, and it was the biggest piece of junk ever, the DVD playback was terrible and the sound was delayed for about 2 seconds. It wasn't until later versions that it got better I heard. (by that time I had sold my PS2)

read more | digg story

DS outselling PSP 6 to 1 (almost 7 to 1)

This week's sales figures show the PSP continuing to wither away.

All I can say is Good. I have no idea what it is, but I really dislike sony and their products. I don't think I have a reason too, I just do.

read more | digg story

ASP.NET 2.0 Is NOT a Silver Bullet

I was just reading Karl Seguins Blog and I came across this:
Before the first concrete information about 2.0 came out, promises about massive code reduction were being made. "I can't say too much at this point...one of our aggressive goals is to reduce the number of lines of code between v1 and v2 by 70%"... Fast forward to today, you'll quickly realize there is no silver bullet.


I couldn't agree more. There are alot of things about ASP.Net 2.0 that I don't like, personalisation for one! But Karls blog makes some good reading. He mentions that more than 1/2 his time is doing DAL and BLL stuff and ASP.Net 2.0 doesn't help there. However, I do tend disagree. ASP.Net 2.0 is supposed to help even at that level, and the increased number of server controls helps reduce code too.

Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , , , , ,

My Related Documents
, , , , , ,

Related Amazon Books
Professional ASP.NET 2.0: / ASP.NET 2 for Dummies (For Dummies S.): / Beginning ASP.NET 2.0: / Programming ASP.NET 2.0 Core Reference: / Pro ASP.NET 2.0 in C#: / Programming Microsoft ASP.NET 2.0 Applications: Advanced Topics: / Wrox's ASP.NET 2.0 Visual Web Developer 2005: Express Edition Starter Kit: / ASP.NET 2.0 Cookbook: /

Related Images From Flickr


read more | digg story

Will Blogger Integrate with GData

If you read the introduction to GData, Googles new Data Protocol you will see the following paragraph:
For example, a blogging application might provide a feed for each blog, and a comment feed for each blog entry. A calendar application might allow you to send full-text search queries using the GData protocol, and return results in the GData syndication format.

I know that Blogger already supports Atom and its associated protocol, but does this comment indicate that they are planning on integrating Blogger futher into Google? Or is it that because Blogger is based on Atom that it will easily support GData with little modification?

I don't know, I think Blogger are behind the times with everything that they do. And I can't see them changing in the near future.

Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , , , , , ,

My Related Documents
, , , , , , , , , , ,

Related Amazon Books
Developing Feeds with RSS and Atom: / Beginning RSS and Atom Programming: / RSS and Atom: Understanding and Implementing Content Feeds and Syndication: / RSS and Atom Hacks: /

Related Images From Flickr

Friday, April 21, 2006

Build a C# Named Pipes Interprocess, inter-machine Cache Service

Extensible implementation of a Cache Windows service using Named Pipes.

I think this would be quite interesting for syncing web servers up that rely on the same data but are not sharing the same state, cache or session information.

read more | digg story

Related Tags
[feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , ,

My Related Documents
, , , , ,

Related Amazon Books
Object-oriented Application Development Using the Cache Postrelational Database: / Cache and Memory Hierarchy Design: A Performance Directed Approach: / Web Caching and Its Applications (International Series in Engineering and Computer Science): / Object-oriented Application Development Using the Cache Post-relational Database: / Web Content Caching and Distribution (IFIP International Federation for Information Processing S.): / The Cache Memory Handbook: / Professional ASP.NET 2.0: /

Related Images From Flickr

Microsoft porting C# programming to the Mac

Mike Harsh of Microsoft writes that the support of WPF/E on the Macintosh platform will not be limited to a JavaScript engine: "WPF/E supports programmability through JavaScript for tight browser integration. The WPF/E package also contains a small, cross platform subset of the CLR and .NET Framework that can run C# or VB.NET code.


read more | digg story

Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Amazon Books
C# & VB.NET Conversion Pocket Reference: / CLR Via C#: Applied .NET Framework 2.0 Programming: / VB.NET Language Pocket Reference: / Professional VB.NET 2003: / Pro ASP.NET 2.0 in VB 2005: / MCSD Self Paced Training Kit: Developing Web Applications with VB.NET and Visual C#: / Beginning VB.Net Databases: / MCAD/MCSD Self Paced Training Kit: Developing Windows Applications with VB.NET and C#.NET: /

Related Images From Flickr

High Performance Site Coding

Ever wondered what has been done to optimize sites like Digg and Zooomr so they do not crumble under the load of many simultaneous users? This article explains some of the things you can do to gain as much from your site as you can.

read more | digg story

5 Truths About Code Optimization

"See if you can speed this code up." It's usually code I've never seen. It's probably important, otherwise they wouldn't be worried about how it is performing. And speed it up to what? Still, there are some basics you can fall back on when someone asks you to optimize some code.


A pretty good article that I saw. It talks about some Java Experiences, but makes at least one good, strong point. Always check with a profiler where the code is going slow.

read more | digg story

Thursday, April 20, 2006

Associative Array C# .Net

A visitor to my site from google was looking for: associative array c# .net.

The only thing I can say about this really is that an associative array in C# is just a hash table.

The hash table associates a key of type object with an associated object.
For Example:

Hashtable ht = new Hashtable();
ht.Add("testKey", "AssociatedData");
MessageBox.Show(ht["testKey"]);

Related Tags
[feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , ,

My Related Documents
, , , , ,

Related Amazon Books
C#: / CLR Via C#: Applied .NET Framework 2.0 Programming: / Programming ASP.NET 2.0 Core Reference: / Programming C#: / Programming Microsoft Visual C# 2005: The Language: /

Related Images From Flickr

c# personal attribute to an html tag

A Visitor to my site came from google looking for "c# personal attribute to an html tag". If I understand this query correctly then the person is trying to add an attribute to an already created HTML object. However, this might not be the case, so I will include in this entry a few different ways of adding attibutes to HTML elements via C#.

Firstly, I am presuming that they are using IE to view the HTML. IE is pretty cool about attributes being added to HTML elements. They treat these attributes on HTML like expando objects (you can add them dynamically in Javascript too). So an element <b id="testB"> can have an attribute kinlaniscool simply by using the following Javascript: document.all.testB.kinlaniscool="false"; It could have been defined in the HTML as <b id="testB" kinlaniscool="false"> and you would get the same results.

To do this from C#, if you are rendering out a serverside control you could simply have the following:

HtmlGenericControl b = new HtmlGenericControl("b");
b.ID="test";
...
...
b.Attributes.Add("kinlaniscool", false);
this.Page.Controls.Add(b);

The above code might add a control to the page which is a "b" tag and that will look like: <b id="testB" kinlaniscool="false">

If you wanted to do something similar in a custom server control, I might do the following:

protected override void Render(HtmlTextWriter output)
{
output.AddAttribute("kinlaniscool", "false");
output.AddAttribute("ID", "test");
output.RenderBeginTag(HtmlTextWriterTag.B);
output.Write("Yo!");
output.RenderEndTag();
}

Basically all we are doing in the above code is overriding how the control renders its data. It will render a B tag with all the correct attributes.

And that is about it.

Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , , ,

My Related Documents
, , , ,

Related Amazon Books
Applied .Net Attributes: / Head First Design Patterns: / Head Rush Ajax: / JavaScript: The Definitive Guide: / Programming ASP.NET 2.0 Core Reference: / Programming C#: / ASP.NET 2 for Dummies (For Dummies S.): / C#: /

Related Images From Flickr

AJAX Tagger

This application will help you build up a better blog entry. It will find related articles, related topical tags, related encylopedia definitions and related images. It also has the ability to link into your associate schems so that you can start to populate your entries with products related to your topics.

read more | digg story

Wednesday, April 19, 2006

Thanks Digger

Who ever was the first person to Digg my Ajax Tagger, thank you very much. (Zoodle I think)

Everyone: let me know what you think of it! I appreciate the comments good or bad. :)

Related Tags
[feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
,

My Related Documents
, , , , , , , ,

Related Amazon Books
Ajax in Action: / Professional AJAX: / Head Rush Ajax: / Foundations of AJAX: / Ajax Hacks: / Pragmatic Ajax: A Web 2.0 Primer: / AJAX/REST Patterns and Best Practices: / Building Responsive Web Applications with AJAX and PHP: / Ajax for Dummies (For Dummies S.): /

Related Images From Flickr

Ajax Tagger is Updated

I have updated the . I have fixed a number of bugs and changed some things around. What follows is a summary of changes.

Updates:
  • Related Tags now go to my own Tag Directory and not Technorati's
  • OPML output now output Yahoo search results as RSS now.

Fixes:

  • Menu Items Classes now don't keep appending "," to the class name of the element
  • OPML now escapes apostrophes
  • Images that are selected for output maintain their selection if new images are added.

Todo:

  • Blogger Interface
  • Kelkoo Intergration
  • Fix Security Warning about cross domain CGI request; my subdomain problem
  • Del.icio.us OPML Integration


Related Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , , ,

My Related Documents
, , , , , ,

Related Amazon Books
Ajax in Action: / Professional AJAX: / Head Rush Ajax: / Foundations of AJAX: / Pragmatic Ajax: A Web 2.0 Primer: / AJAX/REST Patterns and Best Practices: / Building Responsive Web Applications with AJAX and PHP: / Syndicating Web Sites with RSS Feeds for Dummies (For Dummies S.): / Developing Feeds with RSS and Atom: / Beginning RSS and Atom Programming: / Hacking RSS: /

Related Images From Flickr

Ajax Tagger

I am going to try and do a little more work on the Ajax Tagger. I really need to do some bug fixes.

Technorati Tags
[feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents
, , , , ,

Related Amazon Books
Ajax in Action: / Professional AJAX: / Head Rush Ajax: / Foundations of AJAX: / Ajax Hacks: / Pragmatic Ajax: A Web 2.0 Primer: / AJAX/REST Patterns and Best Practices: / Building Responsive Web Applications with AJAX and PHP: / Ajax for Dummies (For Dummies S.): /

Related Images From Flickr

Monday, April 17, 2006

My Tag Directory Doesn't output the correct links for Del.icio.us [Fixed]

Now its fixed :)

try it out: Tag, perl, Del.icio.us

Sunday, April 16, 2006

My Tag Directory Doesn't output the correct links for Del.icio.us

My Tag Directory Doesn't output the correct links for Del.icio.us.

I will try and fix it tomorrow.

Sorry about that.

Saturday, April 15, 2006

Feedburner Are Quick

No more than 10 minutes or so after I posted about not having full text in my feed burner feed I got this response:
Hi Paul,We currently have a limit to the size of source feeds we process of
256k. Perhaps going full text might have put your feed over the limit.You can
reduce the number of posts in your feed or the text for each post to get back
within the limit. This will ensure we and other consumers of your feed process
it correctly. Hope this helps but feel free to post on our forums or email
anytime.Thanks,Jessie ChavezFeedburner Team

Talk about monitoring public feedback.

Great work guys!

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , ,

My Related Documents
, ,

Related Amazon Books
Analytic Feedback System Design: An Interpolation Approach: / Syndicating Web Sites with RSS Feeds for Dummies (For Dummies S.): / Developing Feeds with RSS and Atom: / Beginning RSS and Atom Programming: / Hacking RSS: / RSS and Atom: Understanding and Implementing Content Feeds and Syndication: / RSS and Atom Hacks: / Secrets of RSS: /

Related Images From Flickr

Friday, April 14, 2006

Feedburner update

Reduced the number of posts on my front page and that seemed to sort it out

I think I might move my blog away from Feedburner

I am having problems with it not outputting the Full Text feed at the moment, and I can't work out what the problem is.

How to develop a CDR generator

My Final Year project covered Telecoms fraud. It included a call detail record generator.

I have had a fair few queries about this, mostly around how to develop a CDR tool.

Whilst I have only ever seen one CDR file. I did do a fair amount of research around the subject and I found out quite a bit.

Firstly, I choose to store the least amount of data that I could get away with. The data that I chose was:

  • Caller (source)

  • Callee (destination)

  • Call Type (local, national etc)

  • Start Time

  • Duration



With those 5 parameters you can work out the cost of the call and you can also work out a lot of other statistics.

To generate a CDR I had to configure a lot of models, high user, low users, business users etc. Each of these models had different parameters. The parameters were attributes such as:

  • The average cost and STDEV of a local call

  • The average number and STDEV of local calls

  • The average cost and STDEV of a PRS call

  • The average number and STDEV of PRS calls

  • The average cost and STDEV of a national call

  • The average number and STDEV of National calls

  • The times most likely to make a call: 8am -5 pm for a business as an example



When you have all these parameters you can get a random number generate to randomly pick values that fall within the bounds set by the model.

When the model generator is finished you should have a spread of customers that fit the model described.

Using this data you can then simulate your network in whatever manner you need.

How you determine the parameters of the model, is upto you because you know the data that you are trying to model.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents
, , , , ,

Related Amazon Books
Financial Modeling Using Excel and VBA: / Analytic Methods in the Analysis and Design of Number Theoretic Algorithms: / Image Analysis, Random Fields and Markov Chain Monte Carlo Methods: A Mathematical Introduction (Stochastic Modeling and Applied Probability S.): / Random Generation of Trees: Random Generators in Computer Science: / Uniform Random Numbers: Theory and Practice (Kluwer International Series in Engineering & Computer Science): /

Related Images From Flickr

Tuesday, April 11, 2006

Are you an UK Amazon Marketplace Seller?

I have created a place where any Amazon Marketplace seller can link to a list of all their products.

Currently it is only for the UK, but making it US based will not be hard at all.

If you know you market place seller ID: mine is A30C94ZTNLBKQM, then you can link to http://www.kinlan.co.uk/amazon/uk/Selled ID and get a page that can be indexed by search engines easily.


For example: http://www.kinlan.co.uk/amazon/uk/A30C94ZTNLBKQM will take you to a list of my products.

More information will be going in soon, so that it will display products better. But for now it is an easy way to see up to 20 of your products on any one page.

Have a play.

RelatedTags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , ,

My Related Documents
, , , ,

Related Amazon Books
Selling Used Books Online: The Complete Guide to Bookselling at Amazon's Marketplace and Other Online Sites: / Web Services and Service-oriented Architecture: The Savvy Manager's Guide: / Web Service Security: Scenarios, Patterns, and Implementation Guidance for Web Services Enhancements 3.0: / How to Sell Anything on Amazon... and Make a Fortune: / Amazon.com for Dummies: /

Related Images From Flickr

Monday, April 10, 2006

My Tag Directory Now has Amazon Integration

I have updated my tag directory, it now includes Amazon product data. It pulls data from the Amazon AWS (Books currently) that are related to the tag in the tag directory. I am thinking of putting images in, but currently it just adds links.

It is another Web 2.0 API to add to this Mashup. Now it include:

  • Amazon AWS

  • Del.icio.us

  • Yahoo Search API

  • Google Blog Search RSS Results


Check it out some examples and and

Related Tags
[feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , ,

My Related Documents
, , , , , , ,

Related Amazon Books
Theory of Modeling and Simulation: / Developing Feeds with RSS and Atom: / Hacking RSS: / Beginning RSS and Atom Programming: / RSS and Atom: Understanding and Implementing Content Feeds and Syndication: / Practical RDF: / Creating the Semantic Web with RDF: / Rdf Specifications: Containing Resource Description Framework Rdf Schema and Resource Description Framework Rdf Model and Syntax Specification: / Hacking Del.Icio.Us (ExtremeTech): /

Related Images From Flickr

Saturday, April 08, 2006

My Tag Directory Now has Del.icio.us Integration

I have updated my tag directory, it now includes Del.icio.us data. It pulls RDF data from del.icio.us for the most popular items for a tag.

Check it out some examples RDF and RSS

Related Tags
[feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , ,

My Related Documents
, , , , , , ,

Related Amazon Books
Theory of Modeling and Simulation: / Developing Feeds with RSS and Atom: / Hacking RSS: / Beginning RSS and Atom Programming: / RSS and Atom: Understanding and Implementing Content Feeds and Syndication: / Practical RDF: / Creating the Semantic Web with RDF: / Rdf Specifications: Containing Resource Description Framework Rdf Schema and Resource Description Framework Rdf Model and Syntax Specification: / Hacking Del.Icio.Us (ExtremeTech): /

Related Images From Flickr

Tuesday, April 04, 2006

Serializing OPML via an OPML Object Model

As I promised in a previous post I have uploaded the OPML source code.

The code is a basic Main() which instantiates the OPML object, serializes it and then deserializes it (to kind of prove that it works).

The Object model isn't very clean, infact it is pretty hackey! But anyway it is here now :)

using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using OPML.OPML;

namespace OPML
{
///
/// Summary description for Class1.
///

internal class Class1
{
///
/// The main entry point for the application.
///

[STAThread]
private static void Main(string[] args)
{
Opml o = new Opml();
o.body = new OpmlBody();
o.body.outline = new OpmlOutline[1];
o.body.outline[0] = new OpmlOutline("Yo Yo");
o.body.outline[0].title = "Test";
o.body.outline[0].Url = "uasd";
o.body.outline[0].Type = "link";
o.body.outline[0].htmlUrl = "www.kinlan.co.uk";

XmlSerializer xs = new XmlSerializer(typeof (Opml));
StringBuilder sb = new StringBuilder();

TextWriter sr = new StringWriter(sb);

xs.Serialize(sr, o);

sr.Close();

Console.Write(sb.ToString());
Console.Read();

TextReader tr = new StringReader(sb.ToString());

Opml o2 = (Opml) xs.Deserialize(tr);

}
}

namespace OPML
{
[XmlRoot("opml")]
public class Opml
{
public OpmlHead head;
public OpmlBody body;

///
/// Initializes a new instance of the class.
///

public Opml()
{
body = new OpmlBody();
head = new OpmlHead();
}
}

[XmlRoot("body")]
public class OpmlBody
{
[XmlElement("outline")] public OpmlOutline[] outline;
}

[XmlRoot("head")]
public class OpmlHead
{
[XmlAttribute] public string title;
[XmlAttribute] public string dateCreated;
[XmlAttribute] public string dateModified;
[XmlAttribute] public string ownerName;
[XmlAttribute] public string ownerEmail;
[XmlAttribute] public string ownerId;
[XmlAttribute] public string docs;
[XmlAttribute] public string expansionState;
[XmlAttribute] public string vertScrollState;
[XmlAttribute] public string windowTop;
[XmlAttribute] public string windowLeft;
[XmlAttribute] public string windowBottom;
[XmlAttribute] public string windowRight;
}

[XmlRoot("outline")]
public class OpmlOutline
{
private string _text;
[XmlAttribute] public string title;
private string _type;
private string _url; // when type == link, this must not be null
[XmlAttribute] public string description;
[XmlAttribute] public string xmlUrl;
[XmlAttribute] public string htmlUrl;
[XmlAttribute] public string language;
[XmlElement("outline")] public OpmlOutline[] outline;

///
/// Initializes a new instance of the class.
///

public OpmlOutline()
{
//Text = inText; //Use the property so that it can check the values.
}

///
/// Initializes a new instance of the class.
///

/// The in text.
public OpmlOutline(string inText)
{
Text = inText; //Use the property so that it can check the values.
}

///
/// Gets or sets the text.
///

/// The text.
[XmlAttribute("text")]
public String Text
{
get { return _text; }
set
{
if(value == null)
{
throw new ArgumentNullException("Outline Text must not be null");
}

if(value.Length == 0)
{
throw new ArgumentException("Outline Text must not be blank");
}

_text = value;
}
}

[XmlAttribute("type")]
public String Type
{
get { return _type; }
set
{
if(value == null)
{
throw new ArgumentNullException("Type must not be null");
}

if(value.Length == 0)
{
throw new ArgumentException("Type must not be blank");
}

if(value.ToUpper() == "LINK")
{
if(Url == null)
{
throw new ArgumentException("Url must not be Null when Type=Link");
}
else if (Url.Length == 0)
{
throw new ArgumentException("Url must not be blank when Type=Link");
}
}
_type = value;
}
}

[XmlAttribute]
public string Url
{
get { return _url; }
set
{
if(_type != null)
{
if(_type.ToUpper() == "LINK" && value == null)
{
throw new ArgumentException("Url must not be Null when Type=Link");
}
else if (value.Length == 0)
{
throw new ArgumentException("Url must not be blank when Type=Link");
}
else
{
_url = value;
}
}
else
{
_url = value;
}
}
}
}
}
}

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , ,

My Related Documents
, , , , , , ,

Related Amazon Books
Service-oriented Architecture: A Field Guide to Integrating XML and Web Services: / Eric Meyer on CSS: / Professional ASP.NET 2.0: / CLR Via C#: Applied .NET Framework 2.0 Programming: / Programming C#: / The Object Primer: Agile Model-Driven Development with UML 2.0: / Model Driven Architecture: Applying MDA to Enterprise Computing: / Executable UML: A Foundation for Model Driven Architecture: / Object-oriented System Analysis: A Model Driven Approach: /

Related Images From Flickr

Sunday, April 02, 2006

Rank 0?

If technorati reports this "Rank: 0 (236 links from 22 sites)" about my blog, does that make it the best blog ever? I hope so ;)

Technorati Tags
[feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , ,

My Related Documents
, , , , ,

Related Amazon Books
Blog Design Solutions: / Blog Marketing: / I Blog, Therefore I Am: /

Related Images From Flickr

Saturday, April 01, 2006

OPML .Net Object Model

[This is the second time I typed this because IE7 suddenly closed down whilst I was typing the original post.]

I have been playing around with the .Net XML Serialization over the past couple of days. I thought it would be a good idea to create an object based roughly around the OPML 2.0 DRAFT spec. With the intent of being able to serialize and deserialize OPML files with ease.

I had some successes with Serializing the OPML Object. I had developed the OPML Object model with constraints in which are defined in the spec, so the OPML file was correctly formed when it was serialized.

I had problems with the de-serializing. I could not get the XML Deserializer to enforce some of the constraints that I had placed on public propertties, so it was infact possible to load an incorrectly constructed OPML file.

I will post the code later. But I will keep playing with the code.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , ,

My Related Documents
, , , , , , ,

Related Amazon Books
Professional AJAX: / Service-Oriented Architecture: Concepts, Technology, and Design: / XML in a Nutshell: / Model Driven Architecture: Applying MDA to Enterprise Computing: / Model Driven Architecture with Executable UML: / Visual Basic.NET Serialization Handbook: / Professional ASP.NET 2.0: / CLR Via C#: Applied .NET Framework 2.0 Programming: /

Related Images From Flickr

Google Search: Directory explorer c#

A visitor to my site was looking for "directory explorer c#". I know they wouldn't have found what they wanted, they would have found my tag directory instead. Hopefully this post might rectify this in the future.

The first thing I think when I saw this query was, does this person mean ASP.Net Internet Directory browsing or do they mean a Win32 application for browsing directories in the System.IO namespace.

I am presuming the latter, because the former can be configure in IIS without any c#.

In .Net there is a whole bevy of File and Directory functionality. Mostly all the functions are static Methods so you can do things such as:
File.Exist("c:\\test.txt");
which will return a boolean if test.txt exists on the c:\ drive.

You can get a list of directories by calling Directory.GetDirectories("C:\\"); which will return a string array of directories directly underneath the C: drive.

I hope this quick blog helps anyone popping by my site.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , , , , ,

My Related Documents
, , , ,

Related Amazon Books
IIS 6.0 Administrator's Pocket Consultant: / IIS 6 Administration: / Win32 Programming (Advanced Windows S.): / Win32 API Programming with Visual Basic: / Pro C# 2005 & the .NET 2.0 Platform: / CLR Via C#: Applied .NET Framework 2.0 Programming: /

Related Images From Flickr