J2Solutions are the creators of Scribbl ( http://scribbl.net/ ) and Taggl ( http://taggl.net/ ).

vldtr is up and running

JK | Wed, 2009/08/12 - 23:55

tags:

vldtr validates your html pages, css files and rss or atom feeds against W3C standards. And you can save your lists to easily revalidate them later. See http://vldtr.com/?key=vldtr for an example.

jQuery 1.3.2 Bugs

JK | Sat, 2009/05/16 - 22:43

tags:

After moving a project from jQuery 1.2.6 to 1.3.2 - because I needed UI/Sortable, which is part of UI 1.7, which depends on jQuery 1.3 - I found several parts of of the jQuery-related functionality broken.

Since I had a set of testcases anyway, I made a page out of it to check the status of the bugs. You can see the result here: http://kruisit.nl/jquerybugs/
Interesting to note: the Sibling selector bug does not occur in WebKit.

Asp.Net url rewriting and postbacks

JK | Mon, 2009/03/09 - 22:47

tags:

When you use url rewriting in combination with asp.net, postbacks tend not to go to the rewritten url but to the real url, which is then shown in the browser. .NET 3.5 SP1 includes new functionality on the Form-object which makes it easy to change that behaviour.

Given a normal serverside form:

    <form runat="server" id="form1"></form>

all you have to do is add a single line of code to the Page_Load event handler:

    form1.Action = Request.RawUrl;

Request.RawUrl contains the rewritten url. Setting the Action property on the form to that value makes the form post back to the rewritten url.

Speeding up debugging with Firefox and VS2008

JK | Thu, 2009/02/19 - 12:25

I can't imagine doing web development without Firefox and Firebug. Unfortunately, debugging a VS2008 project with Firefox is much, much slower than debugging with IE or any other browser if you use the built-in webserver.

Luckily, a fix is available. All I needed to do was go to about:config in Firefox and set network.dns.disableIPv6 to true. A full load for a rather large and complex page went from 30 to 3 seconds!

from: http://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slownes...

Merging collections

JK | Thu, 2008/12/04 - 14:44

tags:

ICollection does not offer a method for merging two collections. As merging collections was exactly what I needed, I wrote a bit of code for it. An extension method seemed to offer the most elegant solution:

public static ICollection<T> Add<T>(this IList<T> self, IList<T> input)
{
	foreach (T item in input)
	{
		self.Add(item);
	}
	return self;
}

Because I've overloaded the Add method, this will now work:

IList<string> list1 = new IList<string>();
IList<string> list2 = new IList<string>();
string name = 'J2';

list1.Add(list2);
list1.Add(name);

For the license to this code, see http://creativecommons.org/licenses/by/3.0/

Fixing HN: Explicitly ending the comments page

JK | Sat, 2008/11/08 - 01:10

The Hacker News site design is simple and unintrusive. Sometimes, it is a bit too subtle and I don't notice the end of the comments page. I hit the down arrow, try to put the focus back on the document, act confused and then notice that I have reached the bottom of the page.

This is easily fixed with a site-specific user stylesheet in FireFox:

  1. Go to your FireFox profile directory. (see finding the FireFox profile folder )
  2. Copy this user stylesheet into the chrome directory. If that file already exists, copy the content of the user stylesheet and add it to your file.
  3. Restart FireFox.

The end of the page now has a small orange line that clearly signals the end of page.

XmlDocument improved

JK | Fri, 2008/08/29 - 22:10

tags:

On a nice summerday I set out to write a command line tool that would change values in xml documents. You would pass it a document name, an xpath query, and a value, and it would update the element found in the document through the query, and set its content to the new value.

So I created this tool, and all was fine. That is, until I encountered a document that contained namespaces. I created a namespace manager, figured out how to dynamically get the namespace information from the xml document, and now I could use the namespaces in the xpath expression.

Not an impressive feat, but it left me wondering why System.Xml.XmlDocument doesn't do the "heavy" lifting for us. I decided it should, and you'll find my fix after the break.

using System;
namespace J2.Xml
{
	/*		created by http://j2solutions.nl - 20080824
	 *		XmlDocument that automatically loads all namespaces.
	 *		The default namespace, if present, gets the prefix 'default'.
	 *		license:	http://creativecommons.org/licenses/by/3.0/
	 */
	public class XmlDocument : System.Xml.XmlDocument
	{
		private const string DEFAULT_DEFAULT_NS_PREFIX = "default";
		System.Xml.XmlNamespaceManager nsmgr = null;
		public string DefaultNsPrefix { get; set; }
		public XmlDocument()
		{
			DefaultNsPrefix = DEFAULT_DEFAULT_NS_PREFIX;
		}
		#region Load
		public new void Load(string filename)
		{
			base.Load(filename);
			nsmgr = CreateNamespaceMgr(DefaultNsPrefix);
		}
		public new void Load(System.IO.Stream inStream)
		{
			base.Load(inStream);
			nsmgr = CreateNamespaceMgr(DefaultNsPrefix);
		}
		public new void Load(System.IO.TextReader txtReader)
		{
			base.Load(txtReader);
			nsmgr = CreateNamespaceMgr(DefaultNsPrefix);
		}
		public new void Load(System.Xml.XmlReader reader)
		{
			base.Load(reader);
			nsmgr = CreateNamespaceMgr(DefaultNsPrefix);
		}
		#endregion
		#region LoadXml
		public new void LoadXml(string xml)
		{
			base.LoadXml(xml);
			nsmgr = CreateNamespaceMgr(DefaultNsPrefix);
		}
		#endregion
		#region SelectSingleNode
		public new System.Xml.XmlNode SelectSingleNode(string xpath)
		{
			return (null != nsmgr) ? base.SelectSingleNode(xpath, nsmgr) : base.SelectSingleNode(xpath);
		}
		private new System.Xml.XmlNode SelectSingleNode(string xpath, System.Xml.XmlNamespaceManager nsmgr)
		{
			throw new NotSupportedException();
		}
		#endregion
		#region SelectNodes
		public new System.Xml.XmlNodeList SelectNodes(string xpath)
		{
			return (null != nsmgr) ? base.SelectNodes(xpath, nsmgr) : base.SelectNodes(xpath);
		}
		private new System.Xml.XmlNodeList SelectNodes(string xpath, System.Xml.XmlNamespaceManager nsmgr)
		{
			throw new NotSupportedException();
		}
		#endregion
		private System.Xml.XmlNamespaceManager CreateNamespaceMgr(string prefixForDefaultNS)
		{
			System.Collections.Specialized.NameValueCollection namespaces = GetNamespaces(base.DocumentElement, prefixForDefaultNS);
			System.Xml.XmlNamespaceManager namespaceMgr = null;	
			if (0 != namespaces.Count)
			{
				namespaceMgr = new System.Xml.XmlNamespaceManager(base.NameTable);
				for (int i = 0; i < namespaces.Count; i++)
				{
					namespaceMgr.AddNamespace(namespaces.Keys[i], namespaces[i]);
				}
			}
			return namespaceMgr;
		}
		private System.Collections.Specialized.NameValueCollection GetNamespaces(System.Xml.XmlElement doc, string prefixForDefaultNS)
		{
			System.Collections.Specialized.NameValueCollection ret = new System.Collections.Specialized.NameValueCollection();
			foreach (System.Xml.XmlAttribute attr in doc.Attributes)
			{
				if (-1 < attr.Name.IndexOf("xmlns"))
				{
					// xmlns=<uri> is the default namespace, xmlns:<name>=<uri> is a named namespace
					string key = (-1 < attr.Name.IndexOf("xmlns:")) ? attr.Name.Replace("xmlns:", "") : prefixForDefaultNS;
					ret.Add(key, attr.Value);
				}
			}
			return ret;
		}
	}
}

For the license to this code, see http://creativecommons.org/licenses/by/3.0/

More applications

JK | Sat, 2008/04/26 - 01:24

tags:

It has only been a week since Taggl has gone live, and already we have added support for Blogger (blogs), MetaCafe (the second largest video site after YouTube) and del.icio.us (social bookmarking).
There is more on our list, so keep an eye on Taggl.

Taggl is online!

JK | Fri, 2008/04/18 - 22:41

tags:

Almost four months after the idea was born Taggl has gone live. We are happy.

Just one more week

JK | Sat, 2008/04/12 - 23:05

tags:

In just 7 days Taggl will go online.

Taggl is almost done

JK | Mon, 2008/03/31 - 23:59

tags:

After three months of development, we're nearing the point where we want to show the world what we have created. We expect to have our first version online within the next two weeks.

A New Design

JK | Wed, 2008/02/20 - 23:21

tags:

As Taggl is nearing completion, some parts of the design have influenced this new design for j2solutions.nl. The new design is simpler to maintain, but primarily clearer and prettier. We hope you like it as much as we do.

Syndicate content