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

<channel>
	<title>nicomputer&#039;s blog</title>
	<atom:link href="http://blog.nicomputer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nicomputer.com</link>
	<description>I am (not?) a Robot!</description>
	<lastBuildDate>Tue, 08 Dec 2009 13:53:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Regex Time, Part 3</title>
		<link>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-3/</link>
		<comments>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-3/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 13:53:04 +0000</pubDate>
		<dc:creator>--Nico</dc:creator>
				<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://blog.nicomputer.com/?p=238</guid>
		<description><![CDATA[How to retrieve a six (6) or ten (10) fixed-length digits string?

Test Cases
This kind of string should match our pattern:

a string of six (6) and only six (6) digits
a string of ten (10) and only ten (10) digits

All other strings should not match our pattern.
The Regular Expression Pattern
^\d{6}(?:\d{4})?$
The explanation

^: matches the beginning of the string
\d{6} [...]]]></description>
			<content:encoded><![CDATA[<p>How to retrieve a six (6) or ten (10) fixed-length digits string?</p>
<p><span id="more-238"></span></p>
<h2>Test Cases</h2>
<p>This kind of string should match our pattern:</p>
<ul>
<li>a string of six (6) and only six (6) digits</li>
<li>a string of ten (10) and only ten (10) digits</li>
</ul>
<p>All other strings should not match our pattern.</p>
<h2>The Regular Expression Pattern</h2>
<p><code>^\d{6}(?:\d{4})?$</code></p>
<h2>The explanation</h2>
<ol>
<li><code><strong>^</strong></code>: matches the beginning of the string</li>
<li><code><strong>\d{6}</strong></code> matches exactly six digits.</li>
<li><code><strong>(?:\d{4})?</strong></code> this non-capturing (non-capturing because of <strong>?:</strong>) group matches exactly four digits. This group is optional.</li>
<li><code><strong>$</strong></code>: matches the end of the string</li>
</ol>
<p>So, this regular expression could be read as:<br />
Match a string of exactly six (6) digits which could be optionally followed by a string of exactly four (4) digits.<br />
In conclusion, this regex will match a six (6) digits string or a ten (10) digits string (6 required digits + 4 optional digits).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint, Execution Context &amp; Security</title>
		<link>http://blog.nicomputer.com/programming/net/sharepoint-execution-context-security/</link>
		<comments>http://blog.nicomputer.com/programming/net/sharepoint-execution-context-security/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 12:07:13 +0000</pubDate>
		<dc:creator>--Nico</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.nicomputer.com/?p=181</guid>
		<description><![CDATA[<em>(I have originally published this article on the <a href="">Orckestra's Dot Net For Thougts Blog</a>)</em>

At least once in his career, a SharePoint developer is going to be faced with a security problem.

When a user executes an action in SharePoint, i.e. modifies an item in a list, the request on the server executes using the security context of the user. So, if the user does not have the right privileges to accomplish specific actions, the request could fail with a security exception.

A way to overcome this behaviour is to use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx">RunWithElevatedPrivileges method from the SPUtility class</a>.]]></description>
			<content:encoded><![CDATA[<p><em>(I have originally published this article on the <a href="http://www.dotnetforthoughts.com/post/2009/11/17/SharePoint-Execution-Context-Security.aspx">Orckestra&#8217;s Dot Net For Thougts Blog</a>)</em></p>
<p>At least once in his career, a SharePoint developer is going to be faced with a security problem.</p>
<p>When a user executes an action in SharePoint, i.e. modifies an item in a list, the request on the server executes using the security context of the user. So, if the user does not have the right privileges to accomplish specific actions, the request could fail with a security exception.</p>
<p>A way to overcome this behaviour is to use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx">RunWithElevatedPrivileges method from the SPUtility class</a>.</p>
<p><span id="more-181"></span></p>
<p>An important thing to keep in mind when using this method is the initial context of the object on which you will execute specific actions.</p>
<p>In the example below, even if you use the RunWithElevatedPrivileges method, the security context of the SPWeb object (<em>web</em> variable) is inherited from the user permissions.<br />
This behaviour is normal because the SPSite <em>site</em> variable is a reference to the <em>properties</em> variable which was created with the user’s security context.</p>
<pre class="brush: csharp;">
public override void ItemUpdated(SPItemEventProperties properties)
{
	SPSecurity.RunWithElevatedPrivileges(delegate(){
		using (SPSite site = properties.ListItem.Web.Site)
		{
			using (SPWeb web = site.RootWeb)
			{
				web.AllowUnsafeUpdates = true;
                                // Do some actions
			}
		}
	});
}
</pre>
<p>To run in a context with full control, all objects <strong>should be instantiated</strong> inside the RunWithElevatedPrivileges delegate method.<br />
By doing this, objects will inherit their permission from the RunWithElevatedPrivileges context which is full control:</p>
<pre class="brush: csharp;">
public override void ItemUpdated(SPItemEventProperties properties)
{
	SPSecurity.RunWithElevatedPrivileges(delegate(){
		using (SPSite site = new SPSite(properties.ListItem.Web.Site.ID))
		{
			using (SPWeb web = site.RootWeb)
			{
				web.AllowUnsafeUpdates = true;
                                // Do some actions
			}
		}
	});
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicomputer.com/programming/net/sharepoint-execution-context-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jaws and &lt;abbr&gt; HTML tag</title>
		<link>http://blog.nicomputer.com/web-integration/accessibility/jaws-and-abbr-html-tag/</link>
		<comments>http://blog.nicomputer.com/web-integration/accessibility/jaws-and-abbr-html-tag/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 15:05:44 +0000</pubDate>
		<dc:creator>--Nico</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jaws]]></category>

		<guid isPermaLink="false">http://blog.nicomputer.com/?p=102</guid>
		<description><![CDATA[Why Jaws does not read the title of an HTML abbreviation instead to only read the abbreviation itself?
This good question finds his answer in the default configuration of Jaws...]]></description>
			<content:encoded><![CDATA[<p>Why Jaws does not read the title of an HTML abbreviation instead of only reading the abbreviation itself?<br />
This good question finds its answer in the default configuration of Jaws&#8230;</p>
<p><span id="more-102"></span></p>
<h2>The semantic of the &lt;abbr&gt; <abbr title="Hypertext Markup language">HTML</abbr> tag</h2>
<p><a href="http://www.w3.org/TR/html401/struct/text.html#h-9.2.1"><acronym>W3C</acronym> HTML specification</a> defines ABBR tag as</p>
<blockquote><p>
ABBR:<br />
Indicates an abbreviated form (e.g., WWW, HTTP, URI, Mass., etc.).
</p></blockquote>
<p>Example:</p>
<pre class="brush: xml;">
1.5 &lt;abbr title=&quot;Liter&quot;&gt;l.&lt;/abbr&gt;
</pre>
<p>This example will render (move your mouse over the string <strong>l.</strong>) as: 1.5 <abbr title="Liter">l.</abbr></p>
<h2>How Jaws can correctly read &lt;abbr&gt; title?</h2>
<p>By default, Jaws does not read the title of the abbr tag but only the abbreviation itself. I think it is a nonsense because this option should be turned on by default.</p>
<p>Activating this option is quite simple. Just follow the steps below:</p>
<ol>
<li>Open Jaws</li>
<li>Open the <strong>Configuration Manager</strong> in the <strong>Utilities menu</strong></li>
<li>Choose <strong>HTML Options</strong> in the <strong>Set Options menu</strong></li>
<li>Check the Expand Abbreviations box</li>
<li>Et voilà!</li>
</ol>
<p><img src="http://blog.nicomputer.com/images/jaws-turn-on-abbr-reading-by-default.jpg" alt="Turn on abbr title reading in Jaws" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicomputer.com/web-integration/accessibility/jaws-and-abbr-html-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InfoPath Web based form and Windows SharePoint Services SP1 error</title>
		<link>http://blog.nicomputer.com/microsoft/infopath/infopath-web-based-form-and-windows-sharepoint-services-sp1-error/</link>
		<comments>http://blog.nicomputer.com/microsoft/infopath/infopath-web-based-form-and-windows-sharepoint-services-sp1-error/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 01:42:56 +0000</pubDate>
		<dc:creator>--Nico</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.nicomputer.com/?p=164</guid>
		<description><![CDATA[Today, I ran into a strange error when I was developping a custom InfoPath enabling some cascading dropdown menus (this subject interests you? Take a look at the Cascading Dropdowns in Browser Forms article from the InfoPath Team Blog).
Here is the exception I encountered:
Unexpected end of file while parsing Name has occurred. Line 1, position [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I ran into a strange error when I was developping a custom InfoPath enabling some cascading dropdown menus (this subject interests you? Take a look at the <a href="http://blogs.msdn.com/infopath/archive/2006/10/12/cascading-dropdowns-in-browser-forms.aspx">Cascading Dropdowns in Browser Forms</a> article from the <a href="http://blogs.msdn.com/infopath/">InfoPath Team Blog</a>).</p>
<p>Here is the exception I encountered:</p>
<blockquote><p><code>Unexpected end of file while parsing Name has occurred. Line 1, position 708. System.Xml.XmlException: Unexpected end of file while parsing Name has occurred. Line 1, position 708.[...]</code></p></blockquote>
<p>After a lot of searches on the Internet, I&#8217;d found a very helpful post on the <a title="Unexpected end of file while parsing Name has occurred." href="http://www.infopathdev.com/forums/t/8662.aspx">InfoPathDev forums</a>.</p>
<p>To summarise, <strong>if the server on which you&#8217;re developing is running with Windows SharePoint Services SP1 (Service Pack 1), your InfoPath form must not have a useless secondary Data Connection</strong> (declared but not used at all on your form).</p>
<p>Very simple&#8230; if you know it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicomputer.com/microsoft/infopath/infopath-web-based-form-and-windows-sharepoint-services-sp1-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regex Time, part 2</title>
		<link>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-2/</link>
		<comments>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-2/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 17:37:59 +0000</pubDate>
		<dc:creator>--Nico</dc:creator>
				<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://blog.nicomputer.com/?p=135</guid>
		<description><![CDATA[Today, one of my co-worker asked me to write a Regex. I love Regex, so it was a pleasure for me to answer him.
So, my co-worker wanted to know how to retrieve all digits (and only digits: 0 to 9) following a non-digit character and preceding a pipe &#8220;&#124;&#8221; character ?

Test Cases
This kind of string [...]]]></description>
			<content:encoded><![CDATA[<p>Today, one of my co-worker asked me to write a Regex. I love Regex, so it was a pleasure for me to answer him.</p>
<p>So, my co-worker wanted to know how to retrieve all digits (and only digits: 0 to 9) following a non-digit character and preceding a pipe &#8220;|&#8221; character ?</p>
<p><span id="more-135"></span></p>
<h2>Test Cases</h2>
<p>This kind of string should match our pattern:</p>
<ul>
<li>test123|another456|more789| <em>(should match three strings: &#8220;123&#8243;, &#8220;456&#8243; and &#8220;789&#8243;)</em></li>
<li>justone1|</li>
</ul>
<p>All other strings should not match our pattern.</p>
<h2>The Regular Expression Pattern</h2>
<p><code>(?&lt;!\d)(\d+)(?=\|)</code></p>
<h2>The explanation</h2>
<ol>
<li><code><strong>(?&lt;!\d)</strong></code>: <a href="http://www.regular-expressions.info/lookaround.html">negative lookbehind</a> expression tells to the regex engine that the character preceding our matching pattern must not be a digit. Because I&#8217;m using a lookaround which is a &#8220;zero-width assertion&#8221;, this first expression will not be a part of the matching string</li>
<li><code><strong>(\d+)</strong></code> matches one or more digit character. This group is the only capturing group (our matching string) of the regex.</li>
<li><code><strong>(?=|)</strong></code>: <a href="http://www.regular-expressions.info/lookaround.html">positive lookahead</a> expression tells to the regex engine that the character following our matching pattern must not be a pipe &#8220;|&#8221;. Because I&#8217;m using a lookaround which is a &#8220;zero-width assertion&#8221;, this third expression will not be  a part of the matching string</li>
</ol>
<p>So, this regular expression could be read as:<br />
Match a string of one or more digit character which is preceded by any character except a digit and which is followed by a pipe &#8220;|&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regex Time, part 1</title>
		<link>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-1/</link>
		<comments>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-1/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 14:59:38 +0000</pubDate>
		<dc:creator>--Nico</dc:creator>
				<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://blog.nicomputer.com/?p=113</guid>
		<description><![CDATA[How to retrieve any string (of at least one character) except the one character string «slash» "/" with a regular expression?]]></description>
			<content:encoded><![CDATA[<p>How to retrieve any string (of at least one character) except the one character string &#8220;/&#8221; (slash) with a regular expression?</p>
<p><span id="more-113"></span></p>
<h2>Test Cases </h2>
<p>These strings should not match our pattern:</p>
<ul>
<li>/</li>
<li><em>an empty string</em></li>
</ul>
<p>All other strings should match our pattern.</p>
<h2>The Regular Expression Pattern</h2>
<p><code>^/.+|[^/].+$</code></p>
<h2>The explanation</h2>
<ol>
<li><code><strong>^</strong></code> matches the beginning of the string</li>
<li><code><strong>/.+</strong></code> matches a string beginning by a &#8220;/&#8221; and following by at least one character</li>
<li><code><strong>|</strong></code> OR operator
<li><code><strong>[^/].+</strong></code> matches a string beginning by any character except &#8220;/&#8221; and following by at least one character</li>
<li><code><strong>$</strong></code> matches the end of the string</li>
</ol>
<p>So, this regular expression could be read as:<br />
Match a string beginning by a &#8220;/&#8221; and following by at least one character or match a string beginning by any character except &#8220;/&#8221; and following by at least one character.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicomputer.com/programming/regular-expression/regex-time-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to give the focus with jQuery?</title>
		<link>http://blog.nicomputer.com/web-integration/accessibility/how-to-give-the-focus-with-jquery/</link>
		<comments>http://blog.nicomputer.com/web-integration/accessibility/how-to-give-the-focus-with-jquery/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 14:31:18 +0000</pubDate>
		<dc:creator>--Nico</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[accessibility jQuery]]></category>

		<guid isPermaLink="false">http://blog.nicomputer.com/?p=14</guid>
		<description><![CDATA[For the past two years, I have been interesting and working on accessibility issues in all my web development projects. Not because my employer or my clients understand the real importance of offering accessible websites (do they?) but because I believe in an accessible world (and an accessible Internet) for <strong>EVERYBODY</strong>.

There are lots of articles and resources on the Internet which talk about the theory of the accessibility matter. However, there are not many technical articles which explain how the standards are really implemented or how a web developer has to implement them.

This first article focuses on how to give the... focus on a non-focusable <acronym title="Hypertext Markup Language">HTML</acronym> element with <a href="http://www.jquery.com/">jQuery</a>.

It extends (and I hope, completes) the <a href="http://donaldevans.com/guide/bestpractices/movefocus2.html">original article</a> written by C. Blouch and published on the <a href="http://donaldevans.com/guide/bestpractices/">Donald F. Evans's website</a>.]]></description>
			<content:encoded><![CDATA[<p>For the past two years, I have been interesting and working on accessibility issues in all my web development projects. Not because my employer or my clients understand the real importance of offering accessible websites <span class="wcag">(do they?)</span> but because I believe in an accessible world (and an accessible Internet) for <strong>EVERYBODY</strong>.</p>
<p>There are lots of articles and resources on the Internet which talk about the theory of the accessibility matter. However, there are not many technical articles which explain how the standards are really implemented or how a web developer has to implement them.</p>
<p>This first article focuses on how to give the&#8230; focus on a non-focusable <acronym title="Hypertext Markup Language">HTML</acronym> element with <a href="http://www.jquery.com/">jQuery</a>.</p>
<p>It extends (and I hope, completes) the <a href="http://donaldevans.com/guide/bestpractices/movefocus2.html">original article</a> written by C. Blouch and published on the <a href="http://donaldevans.com/guide/bestpractices/">Donald F. Evans&#8217;s website</a>.</p>
<p><span id="more-14"></span></p>
<h2>The theory</h2>
<p>Giving the focus to a non-focusable <acronym title="Hypertext Markup Language">HTML</acronym> element seems to be quite simple. Many articles on the Web were written about it.</p>
<p>To summarize them, you only have to :</p>
<ol>
<li>Set the <code>tabindex</code> attribute of the selected element to <code>-1</code></li>
<li>Give the focus to the <acronym title="Document Object Model">DOM</acronym> node with the JavaScript method <code>.focus()</code></li>
</ol>
<p>Quite simple, isn&#8217;t it?</p>
<p>In fact, after doing few tests with Jaws, it demonstrates that it does not really work that way&#8230;</p>
<h2>The reality</h2>
<p>By default, only a few <acronym title="Hypertext Markup Language">HTML</acronym> elements are focusable like anchors or form inputs.<br />
So, in order to give the focus to a non-focusable <acronym title="Hypertext Markup Language">HTML</acronym> element correctly, don&#8217;t forget to add an important third step:</p>
<ol>
<li>Set the <code>tabindex</code> attribute of the selected element to <code>-1</code></li>
<li>Give the focus to the <acronym title="Document Object Model">DOM</acronym> node with the JavaScript method <code>focus()</code></li>
<li><strong>Use the <code>setTimeout</code> JavaScript function to delay the execution of the <code>focus()</code> function</strong></li>
</ol>
<p>Without the use of the <code>setTimeout</code> function, Jaws will simply ignore the focus and will not redirect the user to the element where you want to give the focus.</p>
<h2>The JavaScript code</h2>
<pre class="brush: jscript;">
$(document).ready(function () {

	$(&amp;quot;#addNMoveFocus&amp;quot;).click(function(e){

		AddNMoveFocus(&amp;quot;ul#nl&amp;quot;, &amp;quot;&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;A simple b tag inside a li tag&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&amp;quot;, &amp;quot;ul li:last b&amp;quot;);
		e.preventDefault();

	});

});

function AddNMoveFocus (o1, content, o2){
	AddContent(o1, content);
	MoveFocus(o2);
}

function AddContent(o, content) {
	$(o).append(content);
}

var f; // must be declared as global
function MoveFocus(o){
	$(o).attr(&amp;quot;tabindex&amp;quot;, &amp;quot;-1&amp;quot;);
	f = $(o).get(0);
	setTimeout(&amp;quot;f.focus();&amp;quot;, 0);
}
</pre>
<h2>The examples</h2>
<p>Examples listed below were tested with IE7, Jaws 7.10, Jaws 8, Jaws 9 and Jaws 10</p>
<ul>
<li><a href="http://demo.nicomputer.com/accessibility/focus/">View the working example (with the use of <code>setTimeout</code> function).</a></li>
<li><a href="http://demo.nicomputer.com/accessibility/focus/index-1.html">View the not working example (without the use of <code>setTimeout</code> function).</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicomputer.com/web-integration/accessibility/how-to-give-the-focus-with-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
