<?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"
	>

<channel>
	<title>novolocus.com &#187; 2006 &#187; July</title>
	<atom:link href="http://www.novolocus.com/2006/07/feed" rel="self" type="application/rss+xml" />
	<link>http://www.novolocus.com</link>
	<description>Whatever Andy Burns is working on...</description>
	<pubDate>Mon, 05 Jan 2009 16:14:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Mastering Regular Expressions</title>
		<link>http://www.novolocus.com/2006/07/21/mastering-regular-expressions/</link>
		<comments>http://www.novolocus.com/2006/07/21/mastering-regular-expressions/#comments</comments>
		<pubDate>Fri, 21 Jul 2006 10:07:48 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
		
		<category><![CDATA[Books]]></category>

		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.novolocus.com/?p=170</guid>
		<description><![CDATA[by Jeffrey Friedl
Regular expressions are the most useful tool in string manipulation going - but learning about them is a real pain. Essentially, they&#8217;re confusing for most folks because of an apparently opaque syntax, and because there are so many different &#8216;flavours&#8217; of them.This book does more than anything else I&#8217;ve read to make all [...]]]></description>
			<content:encoded><![CDATA[<p>by Jeffrey Friedl</p>
<p>Regular expressions are the most useful tool in string manipulation going - but learning about them is a real pain. Essentially, they&#8217;re confusing for most folks because of an apparently opaque syntax, and because there are so many different &#8216;flavours&#8217; of them.This book does more than anything else I&#8217;ve read to make all this clearer.</p>
<p>It&#8217;s a very &#8216;first principles&#8217; book, looking at how regular expressions are processed, down to how they work through a string, character by character. This is useful, as it makes you realise how they work.</p>
<p>Later, it goes through more advanced features (lookaheads, etc.), and then it examines some of the most commonly used regular expression syntaxes - Java, .NET and Perl. It&#8217;s also got a lot of examples and good ideas on writing efficient expressions for the sort of stuff you do day to day - matching email, parsing arguments from the command line, that sort of thing.</p>
<p>At work, I&#8217;m our &#8216;regular expressions&#8217; guy now, &#8216;cos I read this book, and I use it as a reference on a frequent basis. I also use regular expressions LOTS in my programming - and by God is it faster than writing code to process strings.</p>
<p>My only complaint - well, I wouldn&#8217;t mind a few wee examples in other languages - Javascript being the obvious one, and PHP and Ruby. They&#8217;re all VERY similar to Perl, so it wouldn&#8217;t take long to highlight any differences and explain how to use them.</p>
<p>However, it is a great book for the subject - just look at it on <a href="http://www.amazon.co.uk/gp/product/0596002890/202-4060955-8860667?v=glance&amp;n=266239">Amazon</a>. My opnion? Every coder should read this book (or one just like it). Programming without Regexes is just crazy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.novolocus.com/2006/07/21/mastering-regular-expressions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>XML Data Islands</title>
		<link>http://www.novolocus.com/2006/07/21/xml-data-islands/</link>
		<comments>http://www.novolocus.com/2006/07/21/xml-data-islands/#comments</comments>
		<pubDate>Fri, 21 Jul 2006 08:07:32 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
		
		<category><![CDATA[HTML &amp; Web]]></category>

		<guid isPermaLink="false">http://www.novolocus.com/?p=171</guid>
		<description><![CDATA[I never knew you could do this - although quite when it&#8217;d be useful escapes me - XML and HTML being merged on the browser
]]></description>
			<content:encoded><![CDATA[<p>I never knew you could do this - although quite when it&#8217;d be useful escapes me - <a href="http://www.devarticles.com/c/a/XML/The-Why-and-How-of-XML-Data-Islands/">XML and HTML being merged on the browser</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.novolocus.com/2006/07/21/xml-data-islands/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Error Starting Workflow when a new Sharepoint Item is created</title>
		<link>http://www.novolocus.com/2006/07/21/error-starting-workflow-when-a-new-sharepoint-item-is-created/</link>
		<comments>http://www.novolocus.com/2006/07/21/error-starting-workflow-when-a-new-sharepoint-item-is-created/#comments</comments>
		<pubDate>Fri, 21 Jul 2006 07:07:37 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.novolocus.com/?p=172</guid>
		<description><![CDATA[So, as I mentioned in an earlier post, I was having some problems creating a workflow which I wanted to initiate when a new item was added to a forms list. Well, I think I solved it.
I could do this fine with the workflows that come with Sharepoint, but when I tried to run my [...]]]></description>
			<content:encoded><![CDATA[<p>So, as I mentioned in an earlier post, I was having some problems creating a workflow which I wanted to initiate when a new item was added to a forms list. Well, I think I solved it.<span id="more-172"></span></p>
<p>I could do this fine with the workflows that come with Sharepoint, but when I tried to run my own, it never worked. Whenever I added a new item, I&#8217;d get the message &#8216;Error Occurred&#8217;, and looking in the logs I found:</p>
<p><code>06/20/2006 12:00:28.75  OWSTIMER.EXE (0x064C)                       0x0D08  Windows SharePoint Services<br />
Workflow                        72et    Exception<br />
System.ArgumentNullException: Value cannot be null.<br />
at Microsoft.SharePoint.Workflow.SPWorkflow.GetReservedItemId( SPList list, Guid taskId, Boolean createNew)<br />
at     Microsoft.SharePoint.Workflow.SPWinOEItemEventReceiver.CreateListItemSubscription( Guid subscriptionId,<br />
SPWorkflow workflow, SPList list, Guid channelTypeId, Guid staticCorrelationId, Guid dynamicCorrelationId,<br />
Guid subEventType, SPEventReceiverType rt, String assemblyName, String className, String eventName,<br />
Int32 itemId, Boolean fReserveId)<br />
at     Microsoft.SharePoint.Workflow.SPWinOETaskService.CreateSubscription(MessageEventSubscription sub)<br />
at     Microsoft.SharePoint.Workflow.SPWinOESubscriptionService.CreateSubscription(MessageEventSubscription sub)</code></p>
<p>I&#8217;m still not clear what was causing this - I couldn&#8217;t find more detail - but I did get rid of it for my troublesome workflows.</p>
<p>I found a thing suggesting that I&#8217;d have to have event handlers for all the events on the task that I create in this workflow - that is <em>onTaskCreated</em> and <em>onTaskDeleted</em>, as well as <em>onTaskChanged</em>.</p>
<p>I also found a comment suggesting that I&#8217;d have to have the line:</p>
<p><code>workflowId = workflowProperties.workflowId</code></p>
<p>in onWorkflowActivated.</p>
<p>Finally, I found a mistake in one of the settings for the correlation token on the onTaskChanged event.</p>
<p>I fixed all of these things, and the workflow worked on a new item being added. I removed the line of code from onWorkflowActivated. The workflow still worked. I removed the unnecessary event handlers - onTaskCreated and onTaskDeleted. The workflow still worked.</p>
<p>I can only conclude that the problem lay with the correlation token that I fixed. My working example can be <a href="http://www.novolocus.com/files/wwf_beta2_startonnewitem.zip">downloaded here</a>.</p>
<p>What I did then was go back and check the correlation tokens being used throughout the workflows I was having problems with. I&#8217;m still not sure how these work (though I do get what they&#8217;re for). For one of my workflows, I&#8217;d set this to the same variable name as the <em>workflowId</em> and <em>taskId</em>. This was wrong. I set them just to <em>workflowToken</em> and <em>taskToken</em>, and the workflow, well, worked. I checked out another workflow that was failing - and there, for the task, I was using a correllation token called <em>workflowToken</em>. I changed this to <em>taskToken</em> for things associated with the task. (I didn&#8217;t create a correlation token anywhere - it seemed to do that itself.) Now it seemed to work too.</p>
<p>I should point out, I don&#8217;t see where these correlation tokens are being used, and I really don&#8217;t get how they work. Yet.</p>
<p>Anyway, this seemed to fix the error I was getting above for all of my problematic workflows, although I got a new error for one - where I was trying to parse initiationData, but there isn&#8217;t any for a workflow started automatically like that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.novolocus.com/2006/07/21/error-starting-workflow-when-a-new-sharepoint-item-is-created/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More about frozen panes&#8230;</title>
		<link>http://www.novolocus.com/2006/07/14/more-about-frozen-panes/</link>
		<comments>http://www.novolocus.com/2006/07/14/more-about-frozen-panes/#comments</comments>
		<pubDate>Fri, 14 Jul 2006 10:07:58 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
		
		<category><![CDATA[HTML &amp; Web]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.novolocus.com/?p=173</guid>
		<description><![CDATA[So, I&#8217;ve been working with &#8216;Frozen&#8217; panes in tables in HTML. The problem is, some of these tables are, well, a little big. Like maybe 100 cells square. I found that the technique mentioned earlier in my blog didn&#8217;t work very well, as the scrolling on the DIV tag became slow and jerky.
This makes sense [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve been working with &#8216;Frozen&#8217; panes in tables in HTML. The problem is, some of these tables are, well, a little big. Like maybe 100 cells square. I found that the technique mentioned earlier in my blog didn&#8217;t work very well, as the scrolling on the DIV tag became slow and jerky.</p>
<p>This makes sense really - each cell is having it&#8217;s CSS rerun each time. Then it struck me - the styles were defined as:</p>
<p><code>td.frozen {<br />
padding: 3px;<br />
position:relative;<br />
top: expression(document.getElementById('pane').scrollTop-2); /*IE5+ only*/<br />
z-index: 5;<br />
}</code></p>
<p>This mean that &#8216;getElementById&#8217; was being run repeatedly. However, the style&#8217;s JavaScript was being run before &#8216;onload&#8217;. I just couldn&#8217;t run the &#8216;getElementById&#8217; to populate a global variable after the element had been created, but before the style expressions were run. Instead, in a moment of clarity, I changed the style to:</p>
<p><code>td.frozen {<br />
padding: 3px;<br />
position:relative;<br />
top: expression(getPane().scrollTop-2); /*IE5+ only*/<br />
z-index: 5;<br />
}</code></p>
<p>And added a script:</p>
<p><code>var pane;</code></p>
<p>function getPane() {<br />
if( pane == null ) {<br />
pane = document.getElementById(&#8221;pane&#8221;);<br />
}<br />
return pane;<br />
}</p>
<p>Thus, we only run getElementByID once - the first time a CSS style&#8217;s javascript expression is run. This worked - the DIV tag now scrolls much more quickly, certainly not so as users will notice any lag.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.novolocus.com/2006/07/14/more-about-frozen-panes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#34;malformed header from script&#34;</title>
		<link>http://www.novolocus.com/2006/07/10/malformed-header-from-script/</link>
		<comments>http://www.novolocus.com/2006/07/10/malformed-header-from-script/#comments</comments>
		<pubDate>Mon, 10 Jul 2006 21:07:04 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
		
		<category><![CDATA[Ruby &amp; Rails]]></category>

		<guid isPermaLink="false">http://www.novolocus.com/?p=175</guid>
		<description><![CDATA[So, in testing simplyXiangqi, I found I was getting error pages when I tried certain actions. The actions seemed to happen okay, but I got the standard Rail &#8216;Application Error&#8217;.
Looking in the logs, I was getting an error &#8216;malformed header from script&#8217;. &#8216;Curious&#8217;, I thought. The full error was of the form:
malformed header from script. [...]]]></description>
			<content:encoded><![CDATA[<p>So, in testing <a href="http://www.simplyxiangqi.com/">simplyXiangqi</a>, I found I was getting error pages when I tried certain actions. The actions seemed to happen okay, but I got the standard Rail &#8216;Application Error&#8217;.</p>
<p>Looking in the logs, I was getting an error &#8216;malformed header from script&#8217;. &#8216;Curious&#8217;, I thought. The full error was of the form:<br />
<code>malformed header from script. Bad header=isRed = 1:<br />
                /home/simplyxi/public_html/dispatch.cgi</code><br />
It seemed to me that part of my code was appearing as a header when the page was returned.</p>
<p>Eventually, I figured it out. My code still had &#8216;puts()&#8217; calls in it. I&#8217;d added these for debugging during development on WebBrick. In WebBrick, the strings output by &#8216;puts()&#8217; were written to the command window WebBrick was running under. On my Apache installation, though, this was output as a header. Consequently, I got errors.</p>
<p>I removed the &#8216;puts&#8217; calls, and it all worked fine.</p>
<p class="oldCommentOuter">Comments from my old blog:</p>
<p class="oldCommentInner">
<p class="oldComment">Thanks, buddy. Saved my sorry ass. <img src='http://www.novolocus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p class="oldCommentFooter">By Magnus Bergmark at 18:07:07 Saturday 29th September 2007</p>
]]></content:encoded>
			<wfw:commentRss>http://www.novolocus.com/2006/07/10/malformed-header-from-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lock a column or &#8216;freeze panes&#8217; in scrollable tables</title>
		<link>http://www.novolocus.com/2006/07/05/lock-a-column-or-freeze-panes-in-scrollable-tables/</link>
		<comments>http://www.novolocus.com/2006/07/05/lock-a-column-or-freeze-panes-in-scrollable-tables/#comments</comments>
		<pubDate>Wed, 05 Jul 2006 15:07:13 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[HTML &amp; Web]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.novolocus.com/?p=176</guid>
		<description><![CDATA[This is quite clever - locking or freeze panes in HTML tables. This is something I&#8217;ve been asked to do a couple of times, and it&#8217;s hard. Fundamentally, web pages are not Excel.
Well, that solution works, although I guess it&#8217;s only useful in an intranet environment - it only works on IE. And it mystifies [...]]]></description>
			<content:encoded><![CDATA[<p>This is quite clever - <a href="http://web.tampabay.rr.com/bmerkey/examples/locked-column-csv.html">locking or freeze panes in HTML tables</a>. This is something I&#8217;ve been asked to do a couple of times, and it&#8217;s <em>hard</em>. Fundamentally, web pages are not Excel.</p>
<p>Well, that solution works, although I guess it&#8217;s only useful in an intranet environment - it only works on IE. And it mystifies me why someone would want to or be allowed to run javascript from inside a CSS declaration. Still, we&#8217;ve checked it - works on IE 5.5 to 7.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.novolocus.com/2006/07/05/lock-a-column-or-freeze-panes-in-scrollable-tables/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dispatch.cgi and End of File Characters</title>
		<link>http://www.novolocus.com/2006/07/03/dispatchcgi-and-end-of-file-characters/</link>
		<comments>http://www.novolocus.com/2006/07/03/dispatchcgi-and-end-of-file-characters/#comments</comments>
		<pubDate>Mon, 03 Jul 2006 07:07:27 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
		
		<category><![CDATA[Ruby &amp; Rails]]></category>

		<guid isPermaLink="false">http://www.novolocus.com/?p=177</guid>
		<description><![CDATA[So, I was setting up my Chinese Chess site (domain name might not have propagated yet), and I had some problems. I kept getting the error &#8216;Application error: Rails application failed to start properly&#8217;. Looking in the logs the error was &#8220;Premature end of script headers: dispatch.cgi&#8221;. Tracked this down to the Dispatch.cgi file through [...]]]></description>
			<content:encoded><![CDATA[<p>So, I was setting up my <a href="http://www.simplyxiangqi.com/">Chinese Chess site</a> (domain name might not have propagated yet), and I had some problems. I kept getting the error &#8216;Application error: Rails application failed to start properly&#8217;. Looking in the logs the error was &#8220;Premature end of script headers: dispatch.cgi&#8221;. Tracked this down to the Dispatch.cgi file through Google, where other folks seem to have had problems with the EOF character.</p>
<p>I couldn&#8217;t figure out how to delete these characters - why is it that &#8216;vi&#8217; is so popular? - so what I did in the end was create a new rails app and copy the cgi files across into my app. The files, although they appeared to have the same text, had very different file sizes.</p>
<p>Anyway, that seemed to do the trick.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.novolocus.com/2006/07/03/dispatchcgi-and-end-of-file-characters/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
