<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Knut Kristian Johansen’s blog</title>
	<atom:link href="http://knutkj.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://knutkj.wordpress.com</link>
	<description>Bits and pieces from my professional life…</description>
	<lastBuildDate>Sun, 22 Jan 2012 23:48:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='knutkj.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/7b37801d2c40f9749e6624688436ff88?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Knut Kristian Johansen’s blog</title>
		<link>http://knutkj.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://knutkj.wordpress.com/osd.xml" title="Knut Kristian Johansen’s blog" />
	<atom:link rel='hub' href='http://knutkj.wordpress.com/?pushpress=hub'/>
		<item>
		<title>jQuery Mobile and client generated pages</title>
		<link>http://knutkj.wordpress.com/2012/01/23/jquery-mobile-and-client-generated-pages/</link>
		<comments>http://knutkj.wordpress.com/2012/01/23/jquery-mobile-and-client-generated-pages/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 23:48:35 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery Mobile]]></category>

		<guid isPermaLink="false">http://knutkj.wordpress.com/?p=312</guid>
		<description><![CDATA[Normally you would use jQuery Mobile for server generated pages. But you can also create the pages dynamically with JavaScript in the browser. To make this work we need to do a little jQuery Mobile configuration and call some utility methods our self. In this sample todo list web app we will have this data in local storage: var todos [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=312&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Normally you would use <a title="jQuery Mobile website." href="http://jquerymobile.com/" target="_blank">jQuery Mobile</a> for server generated pages. But you can also create the pages dynamically with JavaScript in the browser. To make this work we need to do a little jQuery Mobile <a title="jQuery Mobile: Configuring defaults." href="http://jquerymobile.com/demos/1.0/docs/api/globalconfig.html" target="_blank">configuration</a> and call some <a title="jQuery Mobile: Methods &amp; Utilities." href="http://jquerymobile.com/demos/1.0/docs/api/methods.html" target="_blank">utility methods</a> our self.</p>
<p>In this sample todo list web app we will have this data in local storage:</p>
<pre>var todos = [
    { title: "Buy milk", desc: "Remember to buy milk tomorrow." },
    { title: "Call Will", desc: "Will expects a call at 8." },
    { title: "Pay the bill", desc: "Pay the electric bill today." }
];
localStorage.setItem("todos", JSON.stringify(todos));</pre>
<p>We will have this <a title="HTML5." href="http://en.wikipedia.org/wiki/Html5" target="_blank">HTML5</a> page to start with:</p>
<pre>&lt;!doctype html&gt;
&lt;html&gt;&lt;head&gt;&lt;meta charset="utf-8" /&gt;
    &lt;title&gt;Todo list app&lt;/title&gt;
    &lt;link
        rel="stylesheet"
        href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /&gt;
    &lt;script src="http://code.jquery.com/jquery-1.6.4.min.js"&gt;
    &lt;/script&gt;
    &lt;script type="text/javascript"&gt;

        // jQuery Mobile initialization …

    &lt;/script&gt;
    &lt;script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.js"&gt;
    &lt;/script&gt;
    &lt;script type="text/javascript"&gt;

        // Page generation …

    &lt;/script&gt;
&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;</pre>
<p>Note that we do not have any content at all. The body is completely empty.</p>
<p>jQuery Mobile will do a lot of stuff for us when loaded. This is how the document looks like when done:</p>
<pre>&lt;!doctype html&gt;
&lt;html class="ui-mobile"&gt;&lt;head&gt;
    &lt;base href="http://host/"&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Todo list app&lt;/title&gt;
    &lt;link
        rel="stylesheet"
        href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css"&gt;
    &lt;script src="http://code.jquery.com/jquery-1.6.4.min.js"&gt;
    &lt;/script&gt;
    &lt;script type="text/javascript"&gt;

        // jQuery Mobile initialization …

    &lt;/script&gt;
    &lt;script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.js"&gt;
    &lt;/script&gt;
    &lt;script type="text/javascript"&gt;

        // Page generation …

    &lt;/script&gt;
&lt;/head&gt;
&lt;body class="ui-mobile-viewport"&gt;
    &lt;div
        data-role="page"
        data-url="/pages.html"
        tabindex="0"
        class="ui-page ui-body-c ui-page-active"
        style="min-height: 1071px; "&gt;
    &lt;/div&gt;
    &lt;div class="ui-loader ui-body-a ui-corner-all" style="top: 535.5px; "&gt;
        &lt;span class="ui-icon ui-icon-loading spin"&gt;&lt;/span&gt;
        &lt;h1&gt;loading&lt;/h1&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Most importantly a <a title="jQuery Mobile: Anatomy of a page." href="http://jquerymobile.com/demos/1.0/docs/pages/page-anatomy.html" target="_blank">page</a> has been created. When jQuery Mobile loads a document without a page, a page will be created. We can also see that this has been made the active page by the <code>ui-page-active</code> CSS class. We need to stop jqm from doing this. We want to create our own page, and make this generated page the active one. The <code>autoInitializePage</code> option has to be set to <code>false</code> on the <code>mobileinit</code> <a title="jQuery Mobile: Events." href="http://jquerymobile.com/demos/1.0/docs/api/events.html" target="_blank">event</a>:</p>
<pre>        // jQuery Mobile initialization …
        $(document).bind("mobileinit", function () {
            $.mobile.autoInitializePage = false;
        });</pre>
<p>Now the only thing that happens is that the <code>head</code> <code>base</code> elements gets added like in the previous case. Now we need to create our first dynamic page, which is going to be the page with the list of todos, and make it current:</p>
<pre>        // Page generation …
        function createPage (title, content) {
            return $([
                '&lt;section data-role="page"&gt;',
                    '&lt;header data-role="header"&gt;',
                        "&lt;h1&gt;", title, "&lt;/h1&gt;",
                    "&lt;/header&gt;",
                    '&lt;div data-role="content"&gt;',
                        content,
                    "&lt;/div&gt;",
                "&lt;/section&gt;"
            ].join("")).appendTo("body");
        }

        var items = JSON.parse(localStorage.getItem("todos")) || [];
        function createList () {
            var list = [ '&lt;ul data-role="listview"&gt;' ];
            $.each(items, function (i) {
                list.push(
                    "&lt;li&gt;",
                        '&lt;a href="#todos/', i, '"&gt;', this.title, "&lt;/a&gt;",
                    "&lt;/li&gt;"
                );
            });
            list.push("&lt;/ul&gt;");
            return list.join("");
        }

        $(function () {
            createPage("Todos", createList()).attr("id", "list");
            $.mobile.initializePage();
        });</pre>
<p>Here we create our first page with an id of <code>list</code> that we append to the <code>body</code> element. The page contains a <a title="jQuery Mobile: List markup conventions." href="http://jquerymobile.com/demos/1.0/docs/lists/docs-lists.html" target="_blank">list view</a> with all the todo items. Each item has a URL with a hash. We will use this hash to figure out what dynamic page to generate. The hash looks like <code>#todos/{itemId}</code>. The last thing we do is to initalize the page. The page looks like this:</p>
<p><a href="http://knutkj.files.wordpress.com/2012/01/todos1.png"><img class="alignnone size-full wp-image-321" title="todos" src="http://knutkj.files.wordpress.com/2012/01/todos1.png?w=594" alt=""   /></a></p>
<p>When we click a todo we get this error message:</p>
<p><a href="http://knutkj.files.wordpress.com/2012/01/todos-error1.png"><img class="alignnone size-full wp-image-322" title="todos-error" src="http://knutkj.files.wordpress.com/2012/01/todos-error1.png?w=594" alt=""   /></a></p>
<p>jQuery Mobile is trying to load our page from <code>http://host/todos/0</code>. This is clearly not our intention. We want to generate the details pages for our items dynamically, not fetch them using AJAX. We also want to use a hash, but jQuery Mobile has changed our hash into pointing to a real document on the server side. Lets take some control of page changing by subscribing to the <code>pagebeforechange</code> event:</p>
<p><a href="http://knutkj.files.wordpress.com/2012/01/first-page-debug1.png"><img class="alignnone size-full wp-image-330" title="first-page-debug" src="http://knutkj.files.wordpress.com/2012/01/first-page-debug1.png?w=594" alt=""   /></a></p>
<p>If <code>$.mobile.activePage</code> is <code>undefined</code> we know that it is the first page we are going to change to. We let jQuery Mobile do its thing in this case. Lets click an item in the todos list:</p>
<p><a href="http://knutkj.files.wordpress.com/2012/01/next-page-debug.png"><img class="alignnone size-full wp-image-331" title="next-page-debug" src="http://knutkj.files.wordpress.com/2012/01/next-page-debug.png?w=594" alt=""   /></a></p>
<p>Here we can see that this is not the first page. We also look for the flag <code>byUs</code> that we will use later to indicate that the page has been changed by us. If none of these are present we stop jQuery Mobile from doing anything. Now our first page works as expected, but nothing happens if we click a todo item in the todo list.</p>
<p>We want full control of page changing and use hash changes to figure out what to do. jQuery Mobile includes <a title="Ben Alman: jQuery hashchange event." href="http://benalman.com/projects/jquery-hashchange-plugin/" target="_blank">Ben Alman&#8217;s hashchange special event plugin</a>. First lets do some jqm configuration:</p>
<pre>        // jQuery Mobile initialization …
        $(document)
            .bind("mobileinit", function () {
                $.extend($.mobile, {
                    autoInitializePage: false,
                    linkBindingEnabled: false,
                    pushStateEnabled: false,
                    hashListeningEnabled: false
                });
            })
            .bind("pagebeforechange", function (e, data) {
                var firstPage = !$.mobile.activePage,
                    changedByUs = !!data.options.byUs,
                    firstPageOrChangedByUs = firstPage || changedByUs;
                if (!firstPageOrChangedByUs) {
                    e.preventDefault();
                }
            });</pre>
<p>Here we make sure to stop jQuery Mobile from:</p>
<ul>
<li>Auto initialize our page</li>
<li>Add custom behaviour to our list items</li>
<li>Rewrite our hashes into real server documents</li>
<li>Listen to hash changes</li>
</ul>
<p>Next thing to do is to subscribe to the <code>hashchange</code> event and change to dynamically generated pages:</p>
<pre>        // Page generation …
        function createPage (title, content) { … }

        var items = JSON.parse(localStorage.getItem("todos")) || [];
        function createList () { … }

        $(function () {
            createPage("Todos", createList()).attr("id", "list");
            $.mobile.initializePage();
            $(window).bind("hashchange", function () {
                var url = window.location.href,
                    hash = $.mobile.path.parseUrl(url).hash;
                route(hash);
            });
        });

        var pattern = /\/(\d+)/;
        function route (route) {
            var match = pattern.exec(route);
            var showList = match === null;
            if (showList) {
                changePage($("#list"));
            } else {
                var itemId = match[1];
                changePage(getItemPage(itemId));
            }
        }

        function changePage (page) {
            $.mobile.changePage(page, {
                byUs: true,
                transition: "none",
                changeHash: false
            });
            $.mobile.urlHistory.stack = [];
        }

        function getItemPage (id) {
            var existingItemPage = $("#item" + id);
            if (existingItemPage.size() === 1) {
                return existingItemPage;
            }
            var item = items[id];
            return createPage(item.title, item.desc)
                .attr("id", "item" + id);
        }</pre>
<p>Here we:</p>
<ul>
<li>Search for an todo list item id in the hash</li>
<li>If we do not find an item we show the todo list page</li>
<li>If we find an item id we create an item page</li>
<li>Make sure not to recreate the list page and item pages by searching for pages with specific ids</li>
<li>Use jQuery Mobile&#8217;s <code>$.mobile.changePage</code> method to change to the found page</li>
</ul>
<p>When we change the page we make sure to:</p>
<ul>
<li>Set the <code>byUs</code> flag to <code>true</code> so that we know not to prevent default in the <code>pagebeforechange</code> event</li>
<li>Prevent transitions because the URL history of jQuery Mobile does not match our custom routing</li>
<li>Make sure that jQuery Mobile does not change our hash</li>
</ul>
<p>Our first item page looks like this:</p>
<p><a href="http://knutkj.files.wordpress.com/2012/01/todos-item1.png"><img class="alignnone size-full wp-image-338" title="todos-item" src="http://knutkj.files.wordpress.com/2012/01/todos-item1.png?w=594" alt="Todo item page."   /></a></p>
<p>Note the URL with the hash. There is still an issue to take care of. If we refresh the web app with this URL it will be staying. The problem is that we render the list page as the first page without checking the URL. Lets fix this last problem and then we are done:</p>
<pre>        // jQuery Mobile initialization …
        $(document)
            .bind("mobileinit", function () { … })
            .bind("pagebeforechange", function (e, data) {
                var changedByUs = !!data.options.byUs;
                if (!changedByUs) {
                    e.preventDefault();
                }
            });</pre>
<p>Here we make sure to never change any page if not changed by us. But this also prevents us from changing into our first page. Fix:</p>
<pre>        // Page generation …
        function createPage (title, content) { … }

        var items = JSON.parse(localStorage.getItem("todos")) || [];
        function createList () { … }

        $(function () {
            createPage("Todos", createList()).attr("id", "list");
            $.mobile.initializePage();
            $(window)
                .bind("hashchange", function () {
                    var url = window.location.href,
                        hash = $.mobile.path.parseUrl(url).hash;
                    route(hash);
                })
                <strong>.trigger("hashchange")</strong>;
        });

        var pattern = /\/(\d+)/;
        function route (route) { … }

        function changePage (page) { … }

        function getItemPage (id) { … }</pre>
<p>To solve this last problem we just trigger a hash change when our web app gets loaded.</p>
<p>You can try the complete todo list HTML5 web app here:</p>
<p><a title="Live Todo List HTML5 Web App." href="http://www.kkj.no/apps/todo-list/index.htm" target="_blank">http://www.kkj.no/apps/todo-list/index.htm</a>.</p>
<p>The source for the demo can be found here:</p>
<p><a title="Todo List HTML5 Web App source code." href="https://github.com/knutkj/kkj/blob/master/src/apps/todo-list/index.htm" target="_blank">https://github.com/knutkj/kkj/blob/master/src/apps/todo-list/index.htm</a>.</p>
<br /> Tagged: <a href='http://knutkj.wordpress.com/tag/javascript/'>JavaScript</a>, <a href='http://knutkj.wordpress.com/tag/jquery-mobile/'>jQuery Mobile</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/312/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=312&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2012/01/23/jquery-mobile-and-client-generated-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>

		<media:content url="http://knutkj.files.wordpress.com/2012/01/todos1.png" medium="image">
			<media:title type="html">todos</media:title>
		</media:content>

		<media:content url="http://knutkj.files.wordpress.com/2012/01/todos-error1.png" medium="image">
			<media:title type="html">todos-error</media:title>
		</media:content>

		<media:content url="http://knutkj.files.wordpress.com/2012/01/first-page-debug1.png" medium="image">
			<media:title type="html">first-page-debug</media:title>
		</media:content>

		<media:content url="http://knutkj.files.wordpress.com/2012/01/next-page-debug.png" medium="image">
			<media:title type="html">next-page-debug</media:title>
		</media:content>

		<media:content url="http://knutkj.files.wordpress.com/2012/01/todos-item1.png" medium="image">
			<media:title type="html">todos-item</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Phone SVG Icon Generator</title>
		<link>http://knutkj.wordpress.com/2011/11/07/windows-phone-svg-icon-generator/</link>
		<comments>http://knutkj.wordpress.com/2011/11/07/windows-phone-svg-icon-generator/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 11:16:12 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[SMIL]]></category>
		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">https://knutkj.wordpress.com/?p=294</guid>
		<description><![CDATA[When you submit a Windows Phone app you need to specify the app’s icon in different resolutions: Application Icon (62 x 62) Application Tile Image (173 x 173) Device application icon for Windows Phone Marketplace catalog (99 x 99) Device application icon for Windows Phone Marketplace catalog (173 x 173) Desktop application icon for Windows [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=294&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When you submit a Windows Phone app you need to specify the app’s icon in different resolutions:</p>
<ul>
<li>Application Icon (62 x 62) </li>
<li>Application Tile Image (173 x 173) </li>
<li>Device application icon for Windows Phone Marketplace catalog (99 x 99) </li>
<li>Device application icon for Windows Phone Marketplace catalog (173 x 173) </li>
<li>Desktop application icon for Windows Phone Marketplace catalog (200 x 200) </li>
</ul>
<p>It&#8217;s great to create icons using a vector format so that it is easy to scale it later on. Windows Phone apps usually have simple icons, and that makes vector graphics to be an even better choice.</p>
<p><a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics">Scalable Vector Graphics (SVG)</a> is the vector markup language for the web. In <a href="http://en.wikipedia.org/wiki/Html5">HTML5</a> you can have inline SVG. That means you can create web apps with SVG functionality. I have created a <a href="http://www.kkj.no/apps/windows-phone-svg-icon-generator.htm">Windows Phone SVG Icon Generator</a> that makes it easy to create the icons required by the Windows Phone Marketplace. Take a look at the video demo below.</p>
<span style="text-align:center; display: block;"><a href="http://knutkj.wordpress.com/2011/11/07/windows-phone-svg-icon-generator/"><img src="http://img.youtube.com/vi/qq3K3etMAug/2.jpg" alt="" /></a></span>
<p>The generator is currently supported in:</p>
<ul>
<li>Latest Firefox </li>
<li>Latest Google Chrome </li>
<li>Internet Explorer 9+ </li>
<li>Opera 12+ (<a href="http://www.opera.com/browser/next/">Opera 12 is currently in alpha</a>) </li>
<li>Latest Safari </li>
</ul>
<p>When you hit the “generate icons” button the SVG markup gets saved into <a href="http://en.wikipedia.org/wiki/Web_Storage">HTML5 storage</a>.</p>
<p>In the generator app there is a <code>textarea</code> where you add the SVG markup. When you hit the “generate icons” button this markup gets wrapped into the following SVG template:</p>
<pre>&lt;svg&gt;
    &lt;defs&gt;
        &lt;g id=&quot;icon&quot;&gt;
            &lt;!-- SVG from textarea goes here --&gt;
        &lt;/g&gt;
    &lt;/defs&gt;
&lt;/svg&gt;</pre>
<p>Then it gets added to a zero size SVG element. There are five other SVG elements on the page. They look like this:</p>
<pre>…

&lt;svg&gt;
    &lt;g transform=&quot;scale(1.73)&quot;&gt;
        &lt;use xlink:href=&quot;#icon&quot; /&gt;
    &lt;/g&gt;
&lt;/svg&gt;

…

&lt;svg&gt;
    &lt;g transform=&quot;scale(.62)&quot;&gt;
        &lt;use xlink:href=&quot;#icon&quot; /&gt;
    &lt;/g&gt;
&lt;/svg&gt;

…

&lt;svg&gt;
    &lt;g transform=&quot;scale(2)&quot;&gt;
        &lt;use xlink:href=&quot;#icon&quot; /&gt;
    &lt;/g&gt;
&lt;/svg&gt;

…

&lt;svg&gt;
    &lt;g transform=&quot;scale(1.73)&quot;&gt;
        &lt;use xlink:href=&quot;#icon&quot; /&gt;
    &lt;/g&gt;
&lt;/svg&gt;

…

&lt;svg&gt;
    &lt;g transform=&quot;scale(.99)&quot;&gt;
        &lt;use xlink:href=&quot;#icon&quot; /&gt;
    &lt;/g&gt;
&lt;/svg&gt;

…</pre>
<p>So I just use the SVG <code>use</code> element to reference the defined icon. I also scale all the icons so that they match the Windows Phone Marketplace requirements. Just remember to use a 100 by 100 coordinate system that has the origin point 0,0.</p>
<p>The animation of the initial Windows Phone lookalike loading screen is created using <a href="http://en.wikipedia.org/wiki/Synchronized_Multimedia_Integration_Language">Synchronized Multimedia Integration Language (SMIL)</a>. Here is the markup:</p>
<pre>&lt;rect width=&quot;100&quot; height=&quot;100&quot; fill=&quot;white&quot; /&gt;
&lt;line x1=&quot;-100&quot; y1=&quot;1&quot; x2=&quot;0&quot; y2=&quot;1&quot;
    stroke=&quot;#e51400&quot; stroke-dasharray=&quot;2 18&quot; stroke-width=&quot;2&quot;&gt;
    &lt;animate dur=&quot;4s&quot; repeatCount=&quot;indefinite&quot; attributeName=&quot;x1&quot;
        keyTimes=&quot;0;.25;.75;1&quot; values=&quot;-100; 20; 54; 100&quot; /&gt;
    &lt;animate dur=&quot;4s&quot; repeatCount=&quot;indefinite&quot; attributeName=&quot;x2&quot;
        keyTimes=&quot;0;.25;.75;1&quot; values=&quot;0; 46; 80; 200&quot; /&gt;
    &lt;animate dur=&quot;4s&quot; repeatCount=&quot;indefinite&quot; attributeName=&quot;stroke-dasharray&quot;
        keyTimes=&quot;0;.25;.75;1&quot; values=&quot;2 18; 2 4; 2 4; 2 18&quot; /&gt;
&lt;/line&gt;
&lt;text x=&quot;50&quot; y=&quot;50&quot; text-anchor=&quot;middle&quot; fill=&quot;#e51400&quot; font-size=&quot;8&quot;&gt;
    generate icons...
&lt;/text&gt;</pre>
<p>Hope you like the Windows Phone SVG Icon Generator!</p>
<br /> Tagged: <a href='http://knutkj.wordpress.com/tag/html/'>HTML</a>, <a href='http://knutkj.wordpress.com/tag/html5/'>HTML5</a>, <a href='http://knutkj.wordpress.com/tag/smil/'>SMIL</a>, <a href='http://knutkj.wordpress.com/tag/svg/'>SVG</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/294/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=294&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2011/11/07/windows-phone-svg-icon-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
		<item>
		<title>The HTML class attribute: for styling purposes only?</title>
		<link>http://knutkj.wordpress.com/2011/08/02/the-html-class-attribute-for-styling-purposes-only/</link>
		<comments>http://knutkj.wordpress.com/2011/08/02/the-html-class-attribute-for-styling-purposes-only/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 20:17:22 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://knutkj.wordpress.com/?p=222</guid>
		<description><![CDATA[Introduction Early specifications The www-style mailing list Later specifications Pulling it all together Conclusion Side note Introduction Cascading Style Sheets (CSS) has the HyperText Markup Language (HTML) language specific class selector. The CSS rule below applies to an HTML element which has a class attribute with the value name: *.name { color: gray; } Without [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=222&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#early-specs">Early specifications</a></li>
<li><a href="#mailing-list">The www-style mailing list</a></li>
<li><a href="#later-specs">Later specifications</a></li>
<li><a href="#pulling">Pulling it all together</a></li>
<li><a href="#conclusion">Conclusion</a></li>
<li><a href="#sidenote" style="color:gray;">Side note</a></li>
</ul>
<h2 id="intro">Introduction</h2>
<p>Cascading Style Sheets (CSS) has the HyperText Markup Language (HTML) language specific <em><a title="Class as selector…" href="http://www.w3.org/TR/REC-CSS1-961217#class-as-selector" target="_blank">class selector</a></em>. The <em><a title="Cascading Style Sheets, level 1: Basic concepts…" href="http://www.w3.org/TR/REC-CSS1-961217#basic-concepts" target="_blank">CSS rule</a></em> below applies to an HTML element which has a <em><a title="Element identifiers: the id and class attributes…" href="http://www.w3.org/TR/html401/struct/global.html#h-7.5.2" target="_blank">class attribute</a></em> with the value <code>name</code>:</p>
<pre>*.name { color: gray; }</pre>
<p>Without the class selector you would have to use the <em><a title="Attribute selectors…" href="http://www.w3.org/TR/CSS2/selector.html#attribute-selectors" target="_blank"> attribute selector</a></em>. The rule below is equivalent to the rule in the previous example:</p>
<pre>*[style~=name] { color: gray; }</pre>
<p>Then a question arises. Was the HTML class attribute added to <em><a title="HTML 4.0 Working Draft Release…" href="http://www.w3.org/TR/WD-html40-970708/" target="_blank">HTML 4.0</a></em> in 1997 just to make it more convenient to write CSS files? To answer this question we have to dig into <em><a title="The World Wide Web Consortium (W3C)…" href="http://http://www.w3.org/" target="_blank">World Wide Web Consortium (W3C)</a></em> specifications and mailing lists.</p>
<p>If you don&#8217;t want the details you can <a href="#conclusion"><em>skip</em> right to my conclusion</a>.</p>
<h2 id="early-specs">Early specifications</h2>
<p>This quote from the W3C Working Draft <a href="http://www.w3.org/TR/WD-style-970324" target="_blank"><em>HTML and Style Sheets: W3C Working Draft 24-Mar-97</em></a>, which doesn&#8217;t tie HTML to any particular style sheet language, states that the two elements <code>div</code> and <code>span</code> was added to HTML 4.0 to make it easier to style an HTML document:</p>
<blockquote><p>To make it easier to apply a style to parts of a document, two new elements for use in the body of an HTML document are defined: DIV and SPAN. The first is to enclose a division (chapter, section, etc.) of a document, making it possible to give a whole section a distinctive style. The latter is used within paragraphs, similarly to EM, but in cases where none of the other HTML elements (EM, STRONG, VAR, CODE, etc.) apply.</p>
</blockquote>
<p>These two quotes from the same document states that the HTML class attribute was added to support effective use of style sheets with HTML documents:</p>
<blockquote><p>To support effective use of style sheets with HTML documents a number of common attributes are proposed. These can be used with most HTML elements. In general, all attribute names and values in this specification are case insensitive, except where noted otherwise.</p>
</blockquote>
<blockquote><p>A space separated list of class names. CLASS names specify that the element belongs to the corresponding named classes. These may be used by style sheets to provide class dependent renderings. Note that white space characters are permitted within class names, and that one or more contiguous white space characters should be treated as the same as a single space character (decimal 32).</p>
</blockquote>
<p>In this quote from <a href="http://www.w3.org/TR/REC-CSS1-961217" target="_blank">Cascading Style Sheets, level 1: W3C Recommendation 17 Dec 1996</a> we can read that the class attribute was added to HTML to increase the control of elements:</p>
<blockquote><p>To increase the granularity of control over elements, a new attribute has been added to HTML [2]: &#8216;CLASS&#8217;. All elements inside the &#8216;BODY&#8217; element can be classed, and the class can be addressed in the style sheet</p>
</blockquote>
<p>It is also interesting to read in the same document that:</p>
<blockquote><p>CSS gives so much power to the CLASS attribute, that in many cases it doesn&#8217;t even matter what HTML element the class is set on &#8212; you can make any element emulate almost any other. Relying on this power is not recommended, since it removes the level of structure that has a universal meaning (HTML elements). A structure based on CLASS is only useful within a restricted domain, where the meaning of a class has been mutually agreed upon.</p>
</blockquote>
<p>These two documents are the result of work from several people. The W3C mailing lists gives us a unique opportunity to find information from discussions that led into adding the class attribute. You will find lot&#8217;s of quotes from the <em><a title="www-style@w3.org Mail Archives…" href="http://lists.w3.org/Archives/Public/www-style/" target="_blank">www-style</a></em> mailing list from the year <em>1995</em> below:</p>
<h2 id="mailing-list">The www-style mailing list</h2>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995May/0012.html">http://lists.w3.org/Archives/Public/www-style/1995May/0012.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… One example of such an (unwanted, IMHO) dependency is the fact that
Hakon's style language currently presupposes the existence of an
attribute CLASS, because that's what the notation `H1.punk' means. To
fix this, I proposed a global declaration `@archform CLASS', to be
inserted at the start of the style sheet, so that applications would
now what the dot stands for. (Btw. a `.' is maybe not a good choice,
since the dot is often used a name character in SGML; that's why I
used `@' instead.) …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Jul/0016.html">http://lists.w3.org/Archives/Public/www-style/1995Jul/0016.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… Of these, CLASS is the one that is important, since it allows people
to create new elements at will, without it having any effect on
applications that don't know the new element. For example, I can add
tags for CITY, PERSON, DATE, INSTRUCTION, EVENT, NUMBER, etc., simply
by using &lt;TEXT CLASS=CITY&gt;, &lt;TEXT CLASS=PERSON&gt;, etc. Some
applications would do special things with this information, others
would simply recognize it as legal HTML but subsequently ignore it. …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Jul/0017.html">http://lists.w3.org/Archives/Public/www-style/1995Jul/0017.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… It only makes sense to define extra styles if they are attached to new
pseudo-elements.  Attaching arbitaray styles to a single element is a
regression to Word for Windows style formatting, e.g. &lt;C CLASS="UNDERLINE"&gt;
&lt;C CLASS="LARGE"&gt;, &lt;C CLASS="EXTRA LARGE"&gt;.  This is just Netscape
extensions with a more verbose syntax.

I also oppose &lt;TEXT&gt;, however.  Any new element should be based on an old
one.

Think of it this way: what would be the easiest way to turn a Word for Windows
document into a "correct" HTML 3.0 document:

&lt;STYLE&gt;
massive amounts of style sheet declarations here to precisely emulate the
Word for Windows environment
&lt;/STYLE&gt;
&lt;TEXT class="s23dfe2as"&gt;Text&lt;TEXT class="s2ecfe232"&gt; text&lt;/TEXT&gt;&lt;/TEXT&gt;

We must not allow this.  If we force them to use real HTML elements then
we can show users the output and explain to them why it is wrong:
"look it used an emphasis tag when you didn't really want emphasis.  Look
it used an address tag to enclose something that is not an address."

If we create a tag with no semantics it can be used anywehere without
ever being wrong.  We must force authors to properly tag the semantics
of their document.  We must force editor vendors to make that choice
explicit in their interfaces.</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Jul/0019.html">http://lists.w3.org/Archives/Public/www-style/1995Jul/0019.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… With generic character-level elements, the source for the database could
be written *in HTML* with key fields (i.e. Department) inside generic
elements subclassed appropriately:
 .... Proffessor X teaches the following courses in the
&lt;STRING CLASS=Department&gt;Mathematics&lt;/STRING&gt; department: ...
Unless a specific stylesheet hint for STRING[CLASS=Department] existed,
this would render as normal text, which is probably the desired effect.
The database search engine, however, can now search for all professors
from a given department by looking at the HTML. This allows the source
files for the database to be in a relatively human-readable form, and
allows hand-editing without special software. …

… secondary purpose of the generic text entity is to allow special
rendering hints for certain semantic elements. For example, the
names of individual products in a searchable catalog could be rendered in
a different font …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Jul/0025.html">http://lists.w3.org/Archives/Public/www-style/1995Jul/0025.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>I'm also getting a handle on how the classes are done in the style sheet.
This is really useful, not only to hint at the presentation, but also for
showing more precisely what a tag means.

address.street: font.color = #FFF;
address.street: back.color = #000;
address.email: font.color = #00C;

&lt;address class=street&gt;7125 Riverwood Dr, Columbia, MD&lt;/address&gt;
&lt;address class=email&gt;Mike Batchelor &lt;a href="mailto:mikebat@clark.net"
&amp;lt;mikebat@clark.net&amp;gt;&lt;/a&gt;&lt;/address&gt;

This very nicely highlights the difference between the two kinds of
addresses, in the tags, and in the browser.</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Jul/0087.html">http://lists.w3.org/Archives/Public/www-style/1995Jul/0087.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… I next want to consider just how we intend to use the class
attribute. I've not been on the www-html list for long, but as people
who read my earlier posts on the subject of alternative media
representations for table data (i.e, drawing charts instead of
tables!), I have argued (or at least inferred) in the past that there
are occassions when using the class attribute for some kind of purely
presentational descriptor is almost as bad as having added a
presentational tag to the spec. Better to use

&lt;ADDRESS class="internet.email"&gt;Chris.Tilbury@estate.warwick.ac.uk&lt;/ADDRESS&gt;
(to steal an oft quoted example of the use of the SGML name tokens)

than 

&lt;ADDRESS class="purplefontgreenbackground"&gt;Chris.Tilbury@estate.warwick.ac.uk&lt;/ADDRESS&gt;

if for no other reason than that HTML is such a massively generic
application of SGML that people wishing to more descriptively markup
their content (in this I include myself) will or may want to use the
class tag for content orientated purposes rather than purely
presentational ones. …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Jul/0095.html">http://lists.w3.org/Archives/Public/www-style/1995Jul/0095.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>                                      … if you believe that CLASS is
useless on non-stylesheet browsers, then you have misunderstood what CLASS
is for.  Style sheets are merely one application of the CLASS attribute.
They are useful for precisely the application you have in mind, which is
to further specify the kind of data enclosed within a tag.  That
stylesheets can take advantage of this is a happy consequence of a good
idea. …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Jul/0099.html">http://lists.w3.org/Archives/Public/www-style/1995Jul/0099.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… &gt;I realize that CLASS is not just for stylesheets, but are we going to
&gt;build a library of CLASS names with suggested meanings (and some suggested
&gt;renderings)? If so, then I would use CLASS, but this hasn't been done so
&gt;far as I know...

I think that it would be premature to standardize CLASSes until we see what
people want to do with them. …

… The CLASS and ID attributes should also be added to HTML as soon as possible
(HTML 2.1?).  A useful style sheet language can be developed which does not
depend on them, but can use them when they are present. …

…        encourage the usage of CLASS, which would contribute to its usage in
robots and other software.
        allow us to judge how people use CLASS so that we can think about
standardizing some usages.
        increase the awareness of platform portability issues.
        put the IETF and W3C back in the driver's seat with respect to the
direction of HTML and the Web. …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Jul/0103.html">http://lists.w3.org/Archives/Public/www-style/1995Jul/0103.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… I believe that CLASSes should *never* be standardized
in the sense that you describe, i.e., such that a browser
would give elements special treatment based on CLASS
attribute values without an explicit instruction from
the author.

Authors must be free to use whatever CLASS names they
come up with without fear that Somebody Else's Browser
might do something unexpected with their document.

Domain- or organization- specific "conventional standards"
would be quite useful, but these should not be hardwired into
browsers.

&gt; The CLASS and ID attributes should also be added to HTML as soon as possible
&gt; (HTML 2.1?).  A useful style sheet language can be developed which does not
&gt; depend on them, but can use them when they are present.  

Yes, definitely.  Also DIV. …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Dec/0048.html">http://lists.w3.org/Archives/Public/www-style/1995Dec/0048.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… CLASS is a way of semantically subclassing elements.  Applying a style is
just one reason you would want to subclass an element.  Creating CLASSes
with types of "big" or "blue" or "five_point" are just as bad as creating
elements named "&lt;BIG&gt;" or "&lt;FONT&gt;".  If you absolutely must put style
information directly in your HTML document, and that style information does
not correspond to a semantic subclass, then you should use some other
attribute, such as STYLE. …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Dec/0053.html">http://lists.w3.org/Archives/Public/www-style/1995Dec/0053.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… &gt;&gt; Why use STYLE as the name of the attribute instead of CLASS? Because it
&gt;&gt; matches the &lt;STYLE&gt; element in the HEAD. It makes no sense to use CLASS
&gt;&gt; instead, unless you have &lt;CLASS&gt; in the HEAD. In a word: Consistency.
&gt;
&gt;A good argument.  I think that the intention was to overload class to
&gt;give semantic meaning as well as formatting control.

There was no overload.  The intention was to provide a mechanism for
subdividing classes of elements according to your needs.  The ability to
apply a particular style to a particular class is a BENEFIT of being able to
define classes, not an "alternate usage".

&gt;However, as the consensus seemed to be away from any list of named
&gt;classes, and since a thesaurus-type system such as Murray-Rust is using
&gt;for CML is unlikely to be an option for all HTML documents, 

Maybe not for all, but perhaps for many.

&gt;it seems
&gt;that CLASS will only be used for semantic markup withing focussed
&gt;subject areas where application conventions can be agreed.  This means
&gt;that generic search engines, for example, are unlikely to offer
&gt;searching based on CLASS (which was I think the original point).

If CLASS becomes widely used in certain disciplines, then specialized search
engines oriented for that discipline will support it.  Why should we care
about "generic" search engines? …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Dec/0062.html">http://lists.w3.org/Archives/Public/www-style/1995Dec/0062.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… &gt;Example: I have a table presenting the results of a scientific study; I
&gt;want to call out three pairs of columns to talk about in the text, by
&gt;presenting them in three different background colors.  There is no
&gt;"meaning" to the colors.  The styling will not be used anywhere else in
&gt;the document.  With a STYLE attribute I can put "STYLE={color: xxx}" on
&gt;each of the three column groups and be done with it.  If all styles must
&gt;go through a stylesheet, I must include a STYLE element (possibly
&gt;otherwise unneeded) in the HEAD of the document, define three classes
&gt;in it (with the wonderfully significant class names "red," "green," and
&gt;"blue"), and then apply those classes to the colgroups.

Are they really just "red," "green," and "blue?"

Or are they CLASS="first_example", CLASS="second_example",
CLASS="third_example".  The latter is quite useful to someone reading your
paper through a speach synth.  The former is not.

You may have thought this through, and decided that "red," "green," and
"blue" are the most meaningful names you can come up with.  But what
percentage of the population is that knowledgable about device-independant
content presentation? Forcing them to go to the header may trigger some
thought about the issue.  "Carol, why does HTML force me to declare styles
like this?"  "Because you are supposed to use meaningful names for your
classes so that your documents will be useful to people using display
devices you have not thought about."

Similarly, HTML's limited formatting commands is a powerful pedagogic tool.
In online and offline fora all over the world the question "why can't I make
blue text" is answered every day. When it is explained, some respond: "I
don't care.  I just want to make blue text."  Some reply: "Interesting idea.
Where can I learn more about this structual markup."  Many of today's
proponents of structural markup started out this way.

When you are trying to move people to a new paradigm, you must make it
difficult to slip back into the old one.  I would guess that that is why
SmallTalk and Java don't have functions, and why ANSI C has strong type
checking.

The proposed STYLE attribute allows you to do your "red", "green", "blue"
thing and still serves this educational purpose.  It seems like a good
compromise to me. …</pre>
</blockquote>
<p><a href="http://lists.w3.org/Archives/Public/www-style/1995Dec/0074.html">http://lists.w3.org/Archives/Public/www-style/1995Dec/0074.html</a>:</p>
<blockquote style="width:auto;margin-right:0;margin-left:0;font-style:normal;">
<pre>… &gt; One could also argue that where the styling is used to
&gt;convey a specific typographic impression, giving the styling would be
&gt;more useful to the visually impaired reader than giving an arbitrary
&gt;name to the styling, since the reader could then visualize the
&gt;appearance of the material.

A blind person visualize?  I hope I'm not showing ignorance here, but if
you've been blind since birth, the difference between red and blue is
probably pretty meaningless.  The difference between "first example" and
"second example" is very explicit. …</pre>
</blockquote>
<h2 id="later-specs">Later specifications</h2>
<p>From the <a href="http://www.w3.org/TR/WD-html40-970708/struct/global.html#adef-class"><em>HTML 4.0 Specification: W3C Working Draft 8-July-1997</em></a> specification:</p>
<blockquote>
<p>… attribute assigns a class or set of classes to a specific instance of an element. Any number of elements may be assigned the same class name or names. They must be separated by white space characters.</p>
<p>The id and class attributes assign identifiers to an element instance. …</p>
<p>… A class name specified by class may be shared by several element instances. Class values should be chosen to distinguish the role of the element the class is associated with, e.g. note, example, warning. …</p>
<p>… Style sheets can use the class attribute to apply a style to a set of elements associated with this class, or to elements that occur as the children of such elements. …</p>
<p>… class can be used for further processing purposes, e.g. for identifying fields when extracting data from HTML pages into a database, translating HTML documents into other formats, etc.). …</p>
</blockquote>
<p>From the <a href="http://www.w3.org/TR/REC-html40-971218/struct/global.html#h-7.5.2"><em>HTML 4.0 Specification: W3C Recommendation 18-Dec-1997</em></a> and <a href="http://www.w3.org/TR/html4/struct/global.html#h-7.5.2"><em>HTML 4.01 Specification: W3C Recommendation 24 December 1999</em></a> specifications:</p>
<blockquote>
<p>… This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters. …</p>
<p>… class attribute, on the other hand, assigns one or more class names to an element; the element may be said to belong to these classes. A class name may be shared by several element instances. The class attribute has several  roles in HTML:</p>
<ul>
<li>As a style sheet selector (when an author wishes to assign style information to a set of elements).</li>
<li>For general purpose processing by user agents. …</li>
</ul>
</blockquote>
<p>From the <a href="http://www.w3.org/TR/html5/elements.html#classes"><em>HTML5: A vocabulary and associated APIs for HTML and XHTML: W3C Working Draft 25 May 2011</em></a> specification:</p>
<blockquote>
<p>Every HTML element may have a class attribute specified.</p>
<p>The attribute, if specified, must have a value that is a set of space-separated tokens representing the various classes that the element belongs to.</p>
<p>The classes that an HTML element has assigned to it consists of all the classes returned when the value of the class attribute is split on spaces. (Duplicates are ignored.)</p>
<p>There are no additional restrictions on the tokens authors can use in the class attribute, but authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content.</p>
</blockquote>
<p>Later HTML specifications ends up talking less and less about the class attribute. The style sheet selector role is listed before the role of being used for general purpose processing. Maybe this is some kind of lost in translation or maybe it just reflects how the class attribute has been used in practice?</p>
<h2 id="pulling">Pulling it all together</h2>
<p>The HyperText Markup language provides a means to create structured documents. The structure is created by marking up different parts of a document with <a href="http://en.wikipedia.org/wiki/Html#Elements" target="_blank"><em>HTML elements</em></a>. HTML provides elements such as headings, paragraphs, lists, links, quotes and other items. These elements belong to the <em>document domain</em>, which is the <em>main</em> domain of HTML documents, although its general design and adaptations over the years have enabled it to be used to describe a number of other types of documents. <a href="http://www.w3.org/TR/2010/WD-html5-20100624/introduction.html#background" target="_blank">New versions of HTML</a> is also addressing a vague subject referred to as Web Applications and other issues raised in the past few years.</p>
<p>You can use HTML to write about a person. Then person becomes a <em>subdomain</em> of your HTML document. HTML is lacking elements for marking up different properties of a person such as name, date of birth, job title, etc. … The class attribute allows authors to create new pseudo elements at will, without it having any effect on applications that don&#8217;t know the new element. You can markup the name of a person with classes like this:</p>
<pre>… &lt;span class="person"&gt;… &lt;span class="name"&gt;Knut K. Johansen&lt;/span&gt; …&lt;/span&gt; …</pre>
<p>If the the meaning of a class has been mutually agreed upon applications can do special things with this information. Properties can be indexed, searched for, saved or cross-referenced, so that information can be reused or combined. They where discussing standardizing classes back then in 1995. They meant it would be premature to standardize classes until they could see what people would do with them. Now there are standards for the use of classes like <a href="http://en.wikipedia.org/wiki/Microformats"><em>Microformats</em></a>. Despite these standards classes has ended up as being mainly a presentational descriptor. Google is the perfect proof. You can&#8217;t search for types of entities like persons, cities or cars. You can only use keywords and you as a human have to extract the semantics of the HTML documents. Maybe the history would have been different if some standards were developed back then.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Even though the later HTML specifications ends up talking very little about the class attribute we can see through earlier specifications and discussions that there is a deeper meaning to it. The fundamental idea behind the HTML class attribute is to semantically subclass HTML elements. These pseudo elements are useful for precisely the application you have in mind, which is to further specify the kind of data enclosed within a tag. That means to provide data about data. This data is called <a href="http://en.wikipedia.org/wiki/Metadata"><em>metadata</em></a>.</p>
<p>Style sheets are merely one application of the class attribute. That stylesheets can take advantage of this is just a happy consequence. The HTML class attribute is meant for semantics, not for styling purposes! We can only hope that we see more and more semantics added to HTML documents in the future!</p>
<h2 id="sidenote">Side note</h2>
<p>There are other ways to add semantics to HTML documents. One such way is <a href="http://en.wikipedia.org/wiki/RDFa" target="_blank"><em>RDFa</em></a>. Lately <a href="http://en.wikipedia.org/wiki/Microdata_(HTML5)"><em>HTML5 Microdata</em></a> has emerged. I have previously written <a title="HTML5 Microdata and CSS" href="http://knutkj.wordpress.com/2011/07/26/html5-microdata-and-css/" target="_blank">a blog post about how the use of HTML5 Microdata</a> can change the way we write CSS. <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=99170" target="_blank">Google supports</a> RDFa, Microformats and Microdata.</p>
<br /> Tagged: <a href='http://knutkj.wordpress.com/tag/css/'>CSS</a>, <a href='http://knutkj.wordpress.com/tag/html/'>HTML</a>, <a href='http://knutkj.wordpress.com/tag/semantics/'>semantics</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/222/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=222&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2011/08/02/the-html-class-attribute-for-styling-purposes-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
		<item>
		<title>HTML5 Microdata and CSS</title>
		<link>http://knutkj.wordpress.com/2011/07/26/html5-microdata-and-css/</link>
		<comments>http://knutkj.wordpress.com/2011/07/26/html5-microdata-and-css/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 20:35:38 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[microdata]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://knutkj.wordpress.com/?p=173</guid>
		<description><![CDATA[If you add both classes and microdata to your elements you may end up with duplicate metadata. To avoid this remove the classes and use the microdata in your CSS selectors.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=173&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Consider this piece of HTML:</p>
<pre>&lt;dl class="person"&gt;
    &lt;dt&gt;Name&lt;/dt&gt;
    &lt;dd class="name"&gt;Knut Kristian Johansen&lt;/dd&gt;
    &lt;dt&gt;Gender&lt;/dt&gt;
    &lt;dd class="gender"&gt;Male&lt;/dd&gt;
    &lt;dt&gt;Job title&lt;/dt&gt;
    &lt;dd class="jobTitle"&gt;senior system developer&lt;/dd&gt;
&lt;/dl&gt;</pre>
<p>and this CSS:</p>
<pre>dl.person &gt; dd.name
{
    font-size: 120%;
}
dl.person &gt; dd.gender
{
    color: gray;
}
dl.person &gt; dd.jobTitle
{
    font-weight: bold;
}</pre>
<p>Lets add some <a title="HTML5 Microdata." href="http://dev.w3.org/html5/md/" target="_blank">HTML5 Microdata</a> using the <a title="schema.org person schema." href="http://schema.org/Person" target="_blank">person schema</a>:</p>
<pre>&lt;dl class="person" itemscope itemtype="http://schema.org/Person"&gt;
    &lt;dt&gt;Name&lt;/dt&gt;
    &lt;dd class="name" itemprop="name"&gt;Knut Kristian Johansen&lt;/dd&gt;
    &lt;dt&gt;Gender&lt;/dt&gt;
    &lt;dd class="gender" itemprop="gender"&gt;Male&lt;/dd&gt;
    &lt;dt&gt;Job title&lt;/dt&gt;
    &lt;dd class="jobTitle" itemprop="jobTitle"&gt;senior system developer&lt;/dd&gt;
&lt;/dl&gt;</pre>
<p>We end up duplicating metadata. We now both say that the name <code>dd</code> is of class name and that it is a microdata name property. Duplication is something to avoid. Lets remove the classes:</p>
<pre>&lt;dl itemscope itemtype="http://schema.org/Person"&gt;
    &lt;dt&gt;Name&lt;/dt&gt;
    &lt;dd itemprop="name"&gt;Knut Kristian Johansen&lt;/dd&gt;
    &lt;dt&gt;Gender&lt;/dt&gt;
    &lt;dd itemprop="gender"&gt;Male&lt;/dd&gt;
    &lt;dt&gt;Job title&lt;/dt&gt;
    &lt;dd itemprop="jobTitle"&gt;senior system developer&lt;/dd&gt;
&lt;/dl&gt;</pre>
<p>But now we lost our styling! How can we get our styling back without duplicating metadata? Lets change our CSS so that we take advantage of the microdata:</p>
<pre>dl[itemtype="http://schema.org/Person"] &gt; dd[itemprop="name"]
{
    font-size: 120%;
}
dl[itemtype="http://schema.org/Person"] &gt; dd[itemprop="gender"]
{
    color: gray;
}
dl[itemtype="http://schema.org/Person"] &gt; dd[itemprop="jobTitle"]
{
    font-weight: bold;
}</pre>
<p><strong>Summary:</strong></p>
<p>If you add both classes and microdata to your elements you may end up with duplicate metadata. To avoid this remove the classes and use the microdata in your CSS selectors.</p>
<p>What do you think about this technique?</p>
<p><strong>References, recommended readings and tools:</strong></p>
<ul>
<li><a title="Microdata specification." href="http://dev.w3.org/html5/md/" target="_blank">Microdata specification</a></li>
<li><a title="Dive into HTML5." href="http://diveintohtml5.org/" target="_blank">Dive Into HTML5 by Mark Pilgrim</a></li>
<li><a title="HTML5 microdata model" href="http://diveintohtml5.org/extensibility.html#property-values" target="_blank">HTML5 microdata data model (Where Do Microdata Property Values Come From?)</a></li>
<li><a title="Rich Snippets Testing Tool" href="http://www.google.com/webmasters/tools/richsnippets" target="_blank">Rich Snippets Testing Tool</a></li>
<li><a title="Getting started with schema.org." href="http://schema.org/docs/gs.html" target="_blank">Getting started with schema.org</a></li>
<li><a title="RDFa and HTML5's Microdata." href="http://realtech.burningbird.net/semantic-web/rdf-and-rdfa/rdfa-and-html5s-maxwells-silver-hammer" target="_blank">Maxwell&#8217;s Silver Hammer: RDFa and HTML5&#8242;s Microdata (<em>microdata critique</em>)</a></li>
<li><a title="CSS 2.1 selectors." href="http://www.w3.org/TR/CSS2/selector.html#pattern-matching" target="_blank">CSS 2.1 selectors</a></li>
</ul>
<br /> Tagged: <a href='http://knutkj.wordpress.com/tag/css/'>CSS</a>, <a href='http://knutkj.wordpress.com/tag/html/'>HTML</a>, <a href='http://knutkj.wordpress.com/tag/html5/'>HTML5</a>, <a href='http://knutkj.wordpress.com/tag/microdata/'>microdata</a>, <a href='http://knutkj.wordpress.com/tag/semantics/'>semantics</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=173&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2011/07/26/html5-microdata-and-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting started with Windows Sharepoint Services 3.0 development with free tools</title>
		<link>http://knutkj.wordpress.com/2010/05/03/getting-started-with-wss3-development/</link>
		<comments>http://knutkj.wordpress.com/2010/05/03/getting-started-with-wss3-development/#comments</comments>
		<pubDate>Mon, 03 May 2010 20:56:14 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://knutkj.wordpress.com/?p=133</guid>
		<description><![CDATA[To get started with Windows Sharepoint Services 3.0 (WSS 3.0) development download: VMware Server A trial of Windows Server 2008 R2 Windows SharePoint Services 3.0 x64 with Service Pack 2 Microsoft Visual C# 2010 Express Then you need to: Install VMware Server on a computer with lots of memory Create a virtual machine for Windows [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=133&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To get started with <a href="http://en.wikipedia.org/wiki/Windows_SharePoint_Services">Windows Sharepoint Services 3.0</a> (WSS 3.0) development download:</p>
<ol>
<li><a href="http://www.vmware.com/products/server/">VMware Server</a></li>
<li>A trial of <a href="http://www.microsoft.com/windowsserver2008/en/us/trial-software.aspx">Windows  Server 2008 R2</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=9FB41E51-CB03-4B47-B89A-396786492CBA&amp;displaylang=en">Windows SharePoint Services 3.0 x64 with Service Pack 2</a></li>
<li><a href="http://www.microsoft.com/express/Downloads/#2010-Visual-CS">Microsoft Visual C# 2010 Express</a></li>
</ol>
<p>Then you need to:</p>
<ol>
<li>Install VMware Server on a computer with lots of memory</li>
<li>Create a virtual machine for Windows Server 2008 R2</li>
<li>Install Windows Server 2008 R2 on the virtual machine</li>
<li>Install WSS 3.0 on Windows Server 2008 R2</li>
<li>Install Microsoft Visual C# 2010 Express on Windows Server 2008 R2</li>
</ol>
<p>Now that all the software and tools are set up it&#8217;s time to create the familiar &#8220;Hello world!&#8221; application:</p>
<ol>
<li>Start Microsoft Visual C# 2010 Express</li>
<li>File → New Project… → Console Application → OK</li>
<li>File → Save All</li>
<li>File → Close Solution</li>
<li>Open the file <code>ConsoleApplication1.csproj</code> with notepad</li>
<li>Change the two occurences of <code>&lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;</code> to <code>&lt;PlatformTarget&gt;x64&lt;/PlatformTarget&gt;</code></li>
<li>Change <code>&lt;TargetFrameworkVersion&gt;v4.0&lt;/TargetFrameworkVersion&gt;</code> to <code>&lt;TargetFrameworkVersion&gt;v3.5&lt;/TargetFrameworkVersion&gt;</code></li>
<li>Open the project again</li>
<li>Project → Add Reference… → Browse → <code>C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll</code> → OK</li>
<li>Add the code below and hit F5</li>
</ol>
<pre style="color:#000000;background:#eee;padding:5px;"><span style="color:#800000;font-weight:bold;">using</span> System<span style="color:#800080;">;</span>
<span style="color:#800000;font-weight:bold;">using</span> Microsoft<span style="color:#808030;">.</span>SharePoint<span style="color:#800080;">;</span>

<span style="color:#800000;font-weight:bold;">namespace</span> ConsoleApplication1
<span style="color:#800080;">{</span>
    <span style="color:#800000;font-weight:bold;">class</span> Program
    <span style="color:#800080;">{</span>
        <span style="color:#800000;font-weight:bold;">static</span> <span style="color:#800000;font-weight:bold;">void</span> Main<span style="color:#808030;">(</span><span style="color:#800000;font-weight:bold;">string</span><span style="color:#808030;">[</span><span style="color:#808030;">]</span> args<span style="color:#808030;">)</span>
        <span style="color:#800080;">{</span>
            var url <span style="color:#808030;">=</span> <span style="color:#800000;font-weight:bold;">string</span><span style="color:#808030;">.</span>Format<span style="color:#808030;">(</span><span style="color:#800000;">"</span><span style="color:#0000e6;">http://{0}</span><span style="color:#800000;">"</span><span style="color:#808030;">,</span> Environment<span style="color:#808030;">.</span>MachineName<span style="color:#808030;">)</span><span style="color:#800080;">;</span>
            <span style="color:#800000;font-weight:bold;">using</span> <span style="color:#808030;">(</span>var site <span style="color:#808030;">=</span> <span style="color:#800000;font-weight:bold;">new</span> SPSite<span style="color:#808030;">(</span>url<span style="color:#808030;">)</span><span style="color:#808030;">)</span>
            <span style="color:#800080;">{</span>
                Console<span style="color:#808030;">.</span>WriteLine<span style="color:#808030;">(</span><span style="color:#800000;">"</span><span style="color:#0000e6;">Hello {0}!</span><span style="color:#800000;">"</span><span style="color:#808030;">,</span> site<span style="color:#808030;">.</span>OpenWeb<span style="color:#808030;">(</span><span style="color:#808030;">)</span><span style="color:#808030;">.</span>Title<span style="color:#808030;">)</span><span style="color:#800080;">;</span>
            <span style="color:#800080;">}</span>
        <span style="color:#800080;">}</span>
    <span style="color:#800080;">}</span>
<span style="color:#800080;">}</span></pre>
<p>Ignore the compiler warnings for now.</p>
<p>This will get you started. More details to come.</p>
<p>A final note. If you don&#8217;t set the platform target to <code>x64</code> you will get a <code>System.IO.FileNotFoundException</code> with the message:</p>
<blockquote><p>The Web application at http://hostname could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.</p></blockquote>
<br /> Tagged: <a href='http://knutkj.wordpress.com/tag/asp-net/'>ASP.NET</a>, <a href='http://knutkj.wordpress.com/tag/sharepoint/'>SharePoint</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=133&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2010/05/03/getting-started-with-wss3-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
		<item>
		<title>XPlanner installation</title>
		<link>http://knutkj.wordpress.com/2009/04/19/xplanner-installation/</link>
		<comments>http://knutkj.wordpress.com/2009/04/19/xplanner-installation/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 13:58:32 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kkj.no/blog/?p=84</guid>
		<description><![CDATA[XPlanner is a project planning and tracking tool for eXtreme Programming (XP) teams. This guide describes how to install XPlanner on a Windows XP system.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=108&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>XPlanner is a project planning and tracking tool for eXtreme Programming (XP) teams. This guide describes how to install XPlanner on a Windows XP system.</p>
<h4>Installation of required software</h4>
<ol>
<li>Download and install <a href="http://developers.sun.com/downloads/">JDK 6 Update 13</a></li>
<li>Copy the file <code>C:\Program Files\Java\jdk1.6.0_13\bin\msvcr71.dll</code> into <code>C:\WINDOWS\system\</code> (<a href="http://www.duckware.com/tech/java6msvcr71.html">details</a>)</li>
<li>Download and install <a href="http://tomcat.apache.org/download-60.cgi">Apache Tomcat 6.0.18</a></li>
<li>Download and unzip <a href="http://heanet.dl.sourceforge.net/sourceforge/xplanner/xplanner-0.7b7b-war.zip">XPlanner Version 0.7b7</a></li>
<li>Copy the extracted folder <code>xplanner-0.7b7-war\xplanner\</code> into <code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\</code></li>
</ol>
<h4>Configuration of XPlanner</h4>
<p>Specify the database credentials in the XPlanner database configuration file <code>xplanner-custom.properties</code> which is located inside the <code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\xplanner\WEB-INF\classes\</code> folder.</p>
<h4>Adjustment of XPlanner source code</h4>
<p>XPlanner does not officially support the versions of Java and Tomcat that we have installed, but only minor adjustments needs to be taken to get up and running.</p>
<p><code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\xplanner\WEB-INF\classes\spring-beans.xml</code>. Replace (<a href="http://jira.codehaus.org/browse/XPR-391">details</a>):<br />
<!--     Source code     --></p>
<pre style="color:#000000;background:#ffffff;">…
<span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">property</span> <span style="color:#274796;">name</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#0000e6;">repositories</span><span style="color:#0000e6;">"</span><span style="color:#a65700;">&gt;</span>
    <span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">map</span><span style="color:#a65700;">&gt;</span>...<span style="color:#a65700;">&lt;/</span><span style="color:#5f5035;">map</span><span style="color:#a65700;">&gt;</span>
<span style="color:#a65700;">&lt;/</span><span style="color:#5f5035;">property</span><span style="color:#a65700;">&gt;</span>
…</pre>
<p>with:<br />
<!--     Source code     --></p>
<pre style="color:#000000;background:#ffffff;">…
<span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">property</span> <span style="color:#274796;">name</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#0000e6;">repositories</span><span style="color:#0000e6;">"</span><span style="color:#a65700;">&gt;</span>
    <span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">bean</span> <span style="color:#274796;">class</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#0000e6;">java.util.HashMap</span><span style="color:#0000e6;">"</span><span style="color:#a65700;">&gt;</span>
        <span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">constructor-arg</span><span style="color:#a65700;">&gt;</span>
            <span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">map</span><span style="color:#a65700;">&gt;</span>...<span style="color:#a65700;">&lt;/</span><span style="color:#5f5035;">map</span><span style="color:#a65700;">&gt;</span>
        <span style="color:#a65700;">&lt;/</span><span style="color:#5f5035;">constructor-arg</span><span style="color:#a65700;">&gt;</span>
    <span style="color:#a65700;">&lt;/</span><span style="color:#5f5035;">bean</span><span style="color:#a65700;">&gt;</span>
<span style="color:#a65700;">&lt;/</span><span style="color:#5f5035;">property</span><span style="color:#a65700;">&gt;</span>
…</pre>
<p><code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\xplanner\WEB-INF\jsp\common\WEB-INF\jsp\common\footer.jsp</code> line 43. From:<br />
<!--     Source code     --></p>
<pre style="color:#000000;background:#ffffff;">…
    <span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">bean:message</span><span style="color:#274796;"> key</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"footer.message"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">        arg0</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#a65700;background:#ffffe8;">&lt;%</span><span style="color:#808030;background:#ffffe8;">=</span><span style="color:#000000;background:#ffffe8;">productionSupportEmail</span><span style="color:#a65700;background:#ffffe8;">%&gt;</span><span style="color:#0000e6;">"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">        arg1</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#a65700;background:#ffffe8;">&lt;%</span><span style="color:#808030;background:#ffffe8;">=</span><span style="color:#000000;background:#ffffe8;">issueLink</span><span style="color:#a65700;background:#ffffe8;">%&gt;</span><span style="color:#0000e6;">"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">        arg2</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#a65700;background:#ffffe8;">&lt;%</span><span style="color:#808030;background:#ffffe8;">=</span><span style="color:#000000;background:#ffffe8;">appUrl</span><span style="color:#808030;background:#ffffe8;">+</span><span style="color:#0000e6;background:#ffffe8;">"/do/systemInfo"</span><span style="color:#a65700;background:#ffffe8;">%&gt;</span><span style="color:#0000e6;">"</span><span style="color:#a65700;">/&gt;</span>
…</pre>
<p>to:<br />
<!--     Source code     --></p>
<pre style="color:#000000;background:#ffffff;">…
    <span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">bean:message</span><span style="color:#274796;"> key</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"footer.message"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">        arg0</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#a65700;background:#ffffe8;">&lt;%</span><span style="color:#808030;background:#ffffe8;">=</span><span style="color:#000000;background:#ffffe8;">productionSupportEmail</span><span style="color:#a65700;background:#ffffe8;">%&gt;</span><span style="color:#0000e6;">"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">        arg1</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#a65700;background:#ffffe8;">&lt;%</span><span style="color:#808030;background:#ffffe8;">=</span><span style="color:#000000;background:#ffffe8;">issueLink</span><span style="color:#a65700;background:#ffffe8;">%&gt;</span><span style="color:#0000e6;">"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">        arg2</span><span style="color:#808030;">=</span><span style="color:#0000e6;">'</span><span style="color:#a65700;background:#ffffe8;">&lt;%</span><span style="color:#808030;background:#ffffe8;">=</span><span style="color:#000000;background:#ffffe8;">appUrl</span><span style="color:#808030;background:#ffffe8;">+</span><span style="color:#0000e6;background:#ffffe8;">"/do/systemInfo"</span><span style="color:#a65700;background:#ffffe8;">%&gt;</span><span style="color:#0000e6;">'</span><span style="color:#a65700;">/&gt;</span>
…</pre>
<p><code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\xplanner\WEB-INF\jsp\view\notes.jsp</code> line 86. From:<br />
<!--     Source code     --></p>
<pre style="color:#000000;background:#ffffff;">…
<span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">xplanner:</span><span style="color:#800000;font-weight:bold;">link</span><span style="color:#274796;"> page</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"/do/delete/note"</span><span style="color:#274796;"> </span><span style="color:#074726;">onclick</span><span style="color:#808030;">=</span><span style="color:#0000e6;">'</span><span style="color:#a65700;background:#ffffe8;">&lt;%</span><span style="color:#808030;background:#ffffe8;">=</span><span style="color:#0000e6;background:#ffffe8;">"return confirm('Do you want to delete note </span><span style="color:#0f69ff;background:#ffffe8;">\\</span><span style="color:#0f69ff;background:#ffffe8;">\\</span><span style="color:#0000e6;background:#ffffe8;">'"</span><span style="color:#000000;background:#ffffe8;"> </span><span style="color:#808030;background:#ffffe8;">+</span><span style="color:#000000;background:#ffffe8;"> StringUtilities</span><span style="color:#808030;background:#ffffe8;">.</span><span style="color:#000000;background:#ffffe8;">replaceQuotationMarks</span><span style="color:#808030;background:#ffffe8;">(</span><span style="color:#000000;background:#ffffe8;">StringEscapeUtils</span><span style="color:#808030;background:#ffffe8;">.</span><span style="color:#000000;background:#ffffe8;">escapeJavaScript</span><span style="color:#808030;background:#ffffe8;">(</span><span style="color:#000000;background:#ffffe8;">note</span><span style="color:#808030;background:#ffffe8;">.</span><span style="color:#000000;background:#ffffe8;">getSubject</span><span style="color:#808030;background:#ffffe8;">(</span><span style="color:#808030;background:#ffffe8;">)</span><span style="color:#808030;background:#ffffe8;">)</span><span style="color:#808030;background:#ffffe8;">)</span><span style="color:#000000;background:#ffffe8;"> </span><span style="color:#808030;background:#ffffe8;">+</span><span style="color:#000000;background:#ffffe8;"> </span><span style="color:#0000e6;background:#ffffe8;">"</span><span style="color:#0f69ff;background:#ffffe8;">\\</span><span style="color:#0f69ff;background:#ffffe8;">\\</span><span style="color:#0000e6;background:#ffffe8;">'?')"</span><span style="color:#a65700;background:#ffffe8;">%&gt;</span><span style="color:#0000e6;">'</span><span style="color:#a65700;">&gt;</span>
    <span style="color:#a65700;">&lt;</span><span style="color:#800000;font-weight:bold;">html</span><span style="color:#5f5035;">:</span><span style="color:#800000;font-weight:bold;">img</span><span style="color:#274796;"> page</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"/images/delete.gif"</span><span style="color:#274796;"> </span><span style="color:#074726;">alt</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"delete"</span><span style="color:#274796;"> </span><span style="color:#074726;">border</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"0"</span><span style="color:#a65700;">/&gt;</span>
    <span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">xplanner:linkParam</span><span style="color:#274796;"> </span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"oid"</span><span style="color:#274796;"> </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"note"</span><span style="color:#274796;"> property</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"id"</span><span style="color:#a65700;">/&gt;</span>
<span style="color:#a65700;">&lt;/</span><span style="color:#5f5035;">xplanner:</span><span style="color:#800000;font-weight:bold;">link</span><span style="color:#a65700;">&gt;</span>
…</pre>
<p>to:<br />
<!--     Source code     --></p>
<pre style="color:#000000;background:#ffffff;">…
<span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">xplanner:</span><span style="color:#800000;font-weight:bold;">link</span><span style="color:#274796;"> page</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"/do/delete/note"</span><span style="color:#a65700;">&gt;</span>
    <span style="color:#a65700;">&lt;</span><span style="color:#800000;font-weight:bold;">html</span><span style="color:#5f5035;">:</span><span style="color:#800000;font-weight:bold;">img</span><span style="color:#274796;"> page</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"/images/delete.gif"</span><span style="color:#274796;"> </span><span style="color:#074726;">alt</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"delete"</span><span style="color:#274796;"> </span><span style="color:#074726;">border</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"0"</span><span style="color:#a65700;">/&gt;</span>
    <span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">xplanner:linkParam</span><span style="color:#274796;"> </span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"oid"</span><span style="color:#274796;"> </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"note"</span><span style="color:#274796;"> property</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"id"</span><span style="color:#a65700;">/&gt;</span>
<span style="color:#a65700;">&lt;/</span><span style="color:#5f5035;">xplanner:</span><span style="color:#800000;font-weight:bold;">link</span><span style="color:#a65700;">&gt;</span>
…</pre>
<p>Note that this removes the confirmation of deleting comments in XPlanner.</p>
<h4>Start XPlanner</h4>
<p>The last step is to start XPlanner from the Tomcat Web Application Manager.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=108&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2009/04/19/xplanner-installation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
		<item>
		<title>Tanker rundt implementasjon av ESXi i mitt LAN</title>
		<link>http://knutkj.wordpress.com/2008/08/15/tanker-rundt-implementasjon-av-esxi-i-mitt-lan/</link>
		<comments>http://knutkj.wordpress.com/2008/08/15/tanker-rundt-implementasjon-av-esxi-i-mitt-lan/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 21:09:37 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.kkj.no/blog2/?p=9</guid>
		<description><![CDATA[For ikke lenge siden lastet jeg ned VMware ESXi. En del spam fra VMware om viktige oppdateringer de siste dagene har minnet meg på at jeg er nødt til å se nærmere på ESXi. I dag slettet jeg den gamle ISO–en og lastet ned siste versjon. Disse to videoklippene gir en fin introduksjon til ESXi: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=9&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For ikke lenge siden lastet jeg ned <a href="http://www.vmware.com/products/esxi/">VMware ESXi</a>. En del spam fra VMware om viktige oppdateringer de siste dagene har minnet meg på at jeg er nødt til å se nærmere på ESXi. I dag slettet jeg den gamle ISO–en og lastet ned siste versjon.</p>
<p>Disse to videoklippene gir en fin introduksjon til ESXi:</p>
<ul>
<li><a href="http://www.youtube.com/watch?v=6aJEXaoq_B4">VMware Server Virtualization &#8211; ESXi Server now FREE!</a></li>
<li><a href="http://www.youtube.com/watch?v=GC-_MW8kuzQ">VMware ESXi Server Virtualization Walkthrough</a></li>
</ul>
<p>For øyeblikket kjører jeg <a href="http://www.vmware.com/products/server/">VMware Server</a> på serveren min som er en AMD Athlon 64 X2 4600+ med 4GB RAM og seks disker. Ved hjelp av <code><a href="http://en.wikipedia.org/wiki/Mdadm">mdadm</a></code> har jeg satt opp 3 av diskene i et <a href="http://en.wikipedia.org/wiki/RAID_5#RAID_5">RAID 5</a> array som gir 1TB redundant data. Host OS er <a href="http://www.ubuntu.com/products/WhatIsUbuntu/serveredition">Ubuntu Server Edition 6.10</a>.</p>
<p>Etter å ha diskutert litt på IRC–kanalen <a href="http://www.linuxguiden.no/index.php/Linuxhelp.no">#linuxhelp.no</a> og sett videoklippene på YouTube så er jeg blitt overbevist om at det lønner seg å bytte ut VMware Server med VMware ESXi. Det er imidlertid et problem. ESXi støtter ikke software RAID. Mine undersøkelser rotet meg borti tanker rundt:</p>
<ol>
<li><a href="#iscsi">Internet SCSI protocol (iSCSI)</a></li>
<li><a href="#openfiler">Openfiler</a></li>
<li><a href="#nbd">Network block device (NBD)</a></li>
<li><a href="#controller">RAID kontroller</a></li>
</ol>
<h4 id="iscsi">1. Internet SCSI protocol (iSCSI)</h4>
<p>iSCSI er en protokoll der SCSI kommandoer blir sendt over TCP. ESXi støtter denne protokollen. Jeg kunne derfor ha satt opp en ny server med Ubuntu Server Edition og RAID 5. Deretter kunne jeg gjort diskene tilgjengelig for ESXi–serveren ved hjelp av iSCSI, og på den måten hatt redundans på mine virtuelle maskiner. Det finnes også ferdige <a href="http://www.promise.com/marketing/Landing%20Pages/iSCSI%20Landing%20Page/iSCSI.asp">&#8220;iSCSI and IP SAN solutions&#8221;</a> der ute som dessverre ikke er et reelt alternativ for meg. Snufs. iSCSI virker lovende, men på grunn av at jeg trenger en ekstra fysisk server så er ikke dette løsningen for meg.</p>
<p>For mer informasjon se:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Iscsi">http://en.wikipedia.org/wiki/Iscsi</a></li>
</ul>
<h4 id="openfiler">2. Openfiler</h4>
<p>Openfiler er et operativsystem spesielt egnet for å dele data. Støttede protokoller er blant annet:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Network_file_system">Network file system (NFS)</a></li>
<li><a href="http://en.wikipedia.org/wiki/Server_Message_Block">Server Message Block (SMB)/Common Internet File System (CIFS)</a></li>
<li><a href="http://en.wikipedia.org/wiki/Http">Hypertext Transfer Protocol (HTTP)</a>/<a href="http://en.wikipedia.org/wiki/Webdav">Web-based Distributed Authoring and Versioning (WebDAV)</a></li>
<li><a href="http://en.wikipedia.org/wiki/Ftp">File Transfer Protocol (FTP)</a></li>
<li>Internet SCSI protocol</li>
</ul>
<p>Openfiler virker som et lovende operativsystem, og jeg er absolutt nødt til å teste det. En server med Openfiler og en med ESXi hadde vært en meget spennende løsning, men igjen siden jeg trenger en ekstra server så er ikke dette et alternativ for meg.</p>
<p>For mer informasjon om Openfiler se:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Openfiler">http://en.wikipedia.org/wiki/Openfiler</a></li>
<li><a href="http://www.openfiler.com/">http://www.openfiler.com/</a></li>
</ul>
<h4 id="nbd">3. Network block device</h4>
<p>Ved hjelp av NBD så kan man mounte devicer som ligger på andre maskiner. Dette alternativet fører også til at jeg måtte ha hatt en ekstra server.</p>
<p>For mer informasjon se:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Network_block_device">http://en.wikipedia.org/wiki/Network_block_device</a></li>
</ul>
<h4 id="controller">4. RAID kontroller</h4>
<p>Det billigste og mest miljøvennlige alternativet er uten tvil å kjøpe meg en RAID kontroller som <a href="http://www.vmware.com/pdf/vi35_io_guide.pdf">støttes av ESXi</a>. Det kan se ut som det kan bli <a href="http://prisguide.hardware.no/product.php?productId=68591">Adaptec RAID 3805</a>. Kortet koster en formue så det blir nok VMware server en stund til. Snufs.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/knutkj.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/knutkj.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=9&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2008/08/15/tanker-rundt-implementasjon-av-esxi-i-mitt-lan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
		<item>
		<title>Some floating issues</title>
		<link>http://knutkj.wordpress.com/2007/08/18/some-floating-issues/</link>
		<comments>http://knutkj.wordpress.com/2007/08/18/some-floating-issues/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 22:00:05 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.kkj.no/blog2/?p=42</guid>
		<description><![CDATA[I have written an article that shed light on some floating issues. Take a look if it interests you.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=42&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have written an article that shed light on some floating issues. <a href="http://www.kkj.no/files/floating.html" target="_blank">Take a look</a> if it interests you.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/knutkj.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/knutkj.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=42&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2007/08/18/some-floating-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
		<item>
		<title>Error reporting in PHP</title>
		<link>http://knutkj.wordpress.com/2007/03/21/error-reporting-in-php/</link>
		<comments>http://knutkj.wordpress.com/2007/03/21/error-reporting-in-php/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 00:00:00 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.kkj.no/blog2/?p=4</guid>
		<description><![CDATA[Some way down the road the default php.ini started to get shipped with settings that stopped the error printing. The default location of this file is /usr/local/lib/php.ini, and the most common settings that controls the error reporting behaviour is listed below: error_reporting = E_ALL &#124; E_ERROR &#124; ... &#124; E_USER_NOTICE display_errors = On &#124; Off [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=4&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some way down the road the default <code>php.ini</code> started to get shipped with settings that stopped the error printing. The default location of this file is <code>/usr/local/lib/php.ini</code>, and the most common settings that controls the error reporting behaviour is listed below:</p>
<pre>error_reporting = E_ALL | E_ERROR | ... | E_USER_NOTICE
display_errors = On | Off
log_errors = On | Off</pre>
<p>First of all error_reporting decides what type of errors or messages that will be taken care of in the first place. See <code>php.ini</code> for details. Then you have the options to:</p>
<ol>
<li>Print the error as part of the HTML by setting <code>display_errors</code> to <code>On</code></li>
<li>Log the error to Apaches <code>error_log</code> by setting <code>log_errors</code> to <code>On</code></li>
<li>Or both print and log the errors and messages</li>
</ol>
<p>There is a reason why they stopped to display errors as a default thing. This is because you are risking to leak sensitive information about your server configuration. A way to achive instant information about errors, and keep the rest of your web site safe, is to alter the settings for just the scripts you are working with at run time. It can be done like this:</p>
<pre>ini_set('display_errors','On');
error_reporting(E_ALL);</pre>
<h4>Suggested readings:</h4>
<ul>
<li>Comments in php.ini section about error reporting</li>
<li><a href="http://no.php.net/manual/en/function.error-reporting.php">PHP Manual: error_reporting</a></li>
<li><a href="http://no.php.net/manual/en/function.ini-set.php">PHP Manual: ini_set</a></li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/knutkj.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/knutkj.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=4&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2007/03/21/error-reporting-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
		<item>
		<title>Character encodings by example</title>
		<link>http://knutkj.wordpress.com/2007/03/20/character-encodings-by-example/</link>
		<comments>http://knutkj.wordpress.com/2007/03/20/character-encodings-by-example/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 22:00:28 +0000</pubDate>
		<dc:creator>knutkj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ANSI]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Latin-1]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[UTF-8]]></category>

		<guid isPermaLink="false">http://www.kkj.no/blog2/?p=53</guid>
		<description><![CDATA[In this text I asume you have a basic understanding of character sets. Take a look at the reference section if you need to take a look into that area. You can use the code charts at http://www.unicode.org/charts/ to see the code points of the characters we will use. I use Microsoft Calculator to convert [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=53&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this text I asume you have a basic understanding of <em>character sets</em>. Take a look at the reference section if you need to take a look into that area. You can use the code charts at <a href="http://www.unicode.org/charts/">http://www.unicode.org/charts/</a> to see the <em>code points</em> of the characters we will use. I use Microsoft Calculator to convert between hex, decimal and binary numbers.</p>
<p>In this example we will write a Java program that writes bytes to text files. The files will consist of characters <em>encoded</em> in ISO–8859–1 (Latin–1) and the UTF–8 encoding of the Unicode character set. We will use Microsoft Notepad, to view these files.</p>
<h4>The Java program</h4>
<p>The program below takes a file name and binary strings as arguments. Each binary string represents one byte in the text file, so make sure not to exceed a string length of 8 to get expected results. If you want to you can modify the main method to use decimal numbers instead.</p>
<pre>import java.io.*;

public class Bits {

    public static void main(String[] args) throws Exception {
	FileOutputStream out = new FileOutputStream(args[0]);
	for (int i = 1; i &lt; args.length; i++) {
	    int bits = Integer.parseInt(args[i],2);
	    System.out.print("Byte " + i + ": " + args[i] + " ");
	    System.out.print(bits + " ");
	    System.out.println(Integer.toHexString(bits));
	    out.write(bits);
	}
	out.close();
    }
}</pre>
<h4>Example 1</h4>
<p>Find the character A in the <a href="http://www.unicode.org/charts/PDF/U0000.pdf">Basic Latin code chart</a>. Notice it has the hexadecimal code point <code>0041</code> or if converted the binary code point <code>1000001</code>. Lets write a byte with this value to the text file <code>example1.txt</code>:</p>
<pre>java Bits example1.txt 1000001</pre>
<p>If you open the file with Microsoft Notepad you will see that it contains the letter A as expected. If you pick save as from the menu you can see that notepad suggests the <a href="http://en.wikipedia.org/wiki/Ansi">ANSI</a> encoding. ANSI is an <a href="http://en.wikipedia.org/wiki/Extended_ASCII">extended ASCII</a> encoding, as is Latin–1. ANSI and Latin–1 has differences, but we will use characters that are encoded the same way for both encodings. So just think of ANSI as Latin-1 throughout the text.</p>
<h4>Example 2</h4>
<p>Click the save as option in the notepad menu. Save <code>example1.txt</code> as <code>example2.txt</code> with the UTF–8 encoding. Take a look at the file properties of the newly created file. Notice that it has a size of 4 bytes, but if you open it again it still contains the lonely letter A. The 3 new bytes are located at the beginning of the file, and is the <a href="http://en.wikipedia.org/wiki/Byte_Order_Mark">Byte Order Mark (BOM)</a> for the UTF–8 encoding. The BOM is the only way for notepad to know that this is a text document encoded in UTF–8, and not Latin–1. This is because the character A is encoded the same way for both encodings. Let&#8217;s create <code>example2.txt</code> manually:</p>
<pre>java Bits example2.txt 11101111 10111011 10111111 1000001</pre>
<h4>Example 3</h4>
<p>Let&#8217;s try to encode a character that is encoded differently in the two encodings. Below we make three text files with the Norwegian letter Å. One encoded in Latin–1, the second in UTF–8 and the last one in UTF–8 too, but without the BOM. The <a href="http://www.unicode.org/charts/PDF/U0080.pdf">Latin-1 chart</a> tells us that Å has the hexadecimal code point <code>00C5</code>. If we convert it using Microsoft Calculator we get the binary string <code>11000101</code> or the decimal number <code>197</code>.</p>
<pre>java Bits example3-1.txt 11000101
java Bits example3-2.txt 11101111 10111011 10111111 11000011 10000101
java Bits example3-3.txt 11000011 10000101</pre>
<p>Notice that notepad recognizes the UTF–8 encoded Å in <code>example3-3.txt</code> even though we left out the BOM. Also notice that we need two bytes to encode Å in UTF–8. Some characters in UTF–8 is even encoded in four bytes. The combination of the two bytes <code>11000011</code> and <code>10000101</code> is decoded into the code point <code>197</code> when read. <code>197</code> references the letter Å for both the Unicode and the Latin–1 character set.</p>
<p>Now I hope you have a better understanding of how characters are encoded. If you want to know more you could take a look at the suggested readings. I personally recommend the XML in a Nutshell book. It&#8217;s almost everything you need.</p>
<h4>Suggested readings</h4>
<ul>
<li><a href="http://en.wikipedia.org/wiki/ASCII">ASCII</a></li>
<li><a href="http://en.wikipedia.org/wiki/Byte_Order_Mark">Byte Order Mark (BOM)</a></li>
<li><a href="http://en.wikipedia.org/wiki/Character_encoding">Character encoding</a></li>
<li><a href="http://www.unicode.org/charts/">Code Charts</a></li>
<li><a href="http://en.wikipedia.org/wiki/Extended_ASCII">Extended ASCII</a></li>
<li><a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a></li>
<li><a href="http://en.wikipedia.org/wiki/Unicode">Unicode</a></li>
<li><a href="http://en.wikipedia.org/wiki/Ansi">Windows code page</a></li>
<li><a href="http://www.amazon.com/gp/product/0596007647/sr=8-2/qid=1152198748/ref=pd_bbs_2/102-3970295-7713728?ie=UTF8">XML in a Nutshell, Third Edition (Paperback)</a></li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/knutkj.wordpress.com/53/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/knutkj.wordpress.com/53/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knutkj.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knutkj.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knutkj.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knutkj.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knutkj.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knutkj.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knutkj.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knutkj.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knutkj.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knutkj.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knutkj.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knutkj.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knutkj.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knutkj.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knutkj.wordpress.com&amp;blog=13420620&amp;post=53&amp;subd=knutkj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knutkj.wordpress.com/2007/03/20/character-encodings-by-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e10f0b2b66aba6a99d6f1cd8d53efcd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">knutkj</media:title>
		</media:content>
	</item>
	</channel>
</rss>
