<?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>rousso.eu &#187; Computing</title>
	<atom:link href="http://rousso.eu/?feed=rss2&#038;cat=24" rel="self" type="application/rss+xml" />
	<link>http://rousso.eu</link>
	<description>a Greek guy, writing from Sweden, his blog in the States.</description>
	<lastBuildDate>Tue, 22 Jun 2010 16:51:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>ECDIS software</title>
		<link>http://rousso.eu/?p=6</link>
		<comments>http://rousso.eu/?p=6#comments</comments>
		<pubDate>Mon, 17 Mar 2008 10:20:42 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[.NET Development]]></category>
		<category><![CDATA[ECDIS]]></category>
		<category><![CDATA[Past Projects]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=40</guid>
		<description><![CDATA[I am working on two ECDIS projects in parallel. Both have to do with monitoring sea traffic. As some details of the projects are confidential, I am not currently able to release any details on the projects themselves. But I can talk about my work in those two projects. Project A: The goal is to [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>I am working on <strong>two </strong><a href="http://en.wikipedia.org/wiki/Electronic_Chart_Display_and_Information_System" target="_blank"><strong>ECDIS</strong></a><strong> projects</strong> in parallel. Both have to do with monitoring sea traffic.</p>
<p>As some details of the projects are confidential, I am not currently able to release any details on the projects themselves. But I can talk about my work in those two projects.</p>
<h3>Project A:</h3>
<p>The goal is to create a system that will help <strong>track ships</strong> that are involved in, or responsible for different types of events that can happen in the seas. For instance: <strong>an oil spill</strong> is located and reported somewhere. Authorities need to <strong>identify the <strong>vessels,</strong> suspect </strong>for causing the environmental damage.</p>
<p>The project approaches the problem by creating a system that will allow for sea traffic monitoring and then, correlating that information with earth observation (<a href="http://en.wikipedia.org/wiki/Earth_observation" target="_blank">EO</a>) data to produce a list of suspect vessels. Vessels are <strong>ranked</strong> by certain qualitative, quantitative and spatial criteria to help the user make the final decisions and identify the offending vessel using the hints provided by the system along with his/her experience and best knowledge.</p>
<p>What I am building for this project is <strong>a custom ECDIS system</strong> that implements all the functionality required for this application.</p>
<p>Sea traffic is monitored using a network of <strong><a href="http://en.wikipedia.org/wiki/Automatic_Identification_System" target="_blank">AIS</a></strong> receivers. AIS messages are temporarily recorded in local databases and transmitted in real time to a central database through <strong>web services</strong> over a VPN.</p>
<p>The ECDIS software I am building is using AIS signals to mark the positions of different vessels at specific points in time. It also provides a mechanism for importing and recoding vector data that come form EO sources (<strong>processed satellite imagery</strong>). EO data are used to identify event locations and possibly other detected targets in the area of the event during data capture.</p>
<p>The <strong>concept</strong> of the software developed is described below. I will post some screen-shots or a screen-cast when possible to support the description below:</p>
<p>The application window is divided vertically into two panes. The main pane (on the left) is the <strong>map pane</strong> where the <strong>ENC</strong> is displayed. The second narrower pane on the right is used for <strong>context sensitive</strong> information display. Both panes are tabbed for better information and functionality grouping. Application commands are available through main and context menus and toolbars.</p>
<p>Below the ENC pane there is a set of <strong>playback controls</strong> much similar to those you see in video players: a Play/Pause button, a timeline you can scroll, a playback speed selector etc.</p>
<p>All data recorded in the system (be them AIS messages, EO data or Events) are <strong>tied to a specific point in time and space</strong>.</p>
<p>The concept is that while the system&#8217;s database maintains historical sea traffic data for long periods of time, the user only needs to <strong>focus</strong> on a specific subset of those data related to a particular event. To enable this approach the application allows the user to select one of the recorded events to focus on. Focusing on an event implicitly means <strong>filtering AIS and EO data</strong> to a specific point in time and space. More accurately: around a specific point in time and space. This way the system loads <strong>only relevant data</strong> from the database which makes processing faster and consumes less system resources. Selection of the timeframe and area is made either implicitly and explicitly by the user during the selection of the event under investigation.</p>
<p>So keep in mind two concepts here:</p>
<ul>
<li>the <strong>&#8220;investigated time-frame&#8221;</strong> which is essentially a period determined by a staring date/time and a length (duration)</li>
<li>and the <strong>&#8220;investigated area&#8221;</strong> determined by the central location of the event and a range in nautical miles around it.</li>
</ul>
<p>All data that fall into the selected time and space are loaded into in memory data sets. But not all those data are concurrently displayed in the ENC pane. The AIS and EO data displayed in the ENC pane at any given time is a <strong>subset</strong> of the loaded data and is determined by:</p>
<ul>
<li>the <strong>&#8220;focus time&#8221;</strong></li>
<li>the length of the <strong>&#8220;visible time-frame&#8221;</strong></li>
<li>and the <strong>view-port</strong> (which is identified by its center coordinates and range)</li>
</ul>
<p>The &#8220;focus time&#8221; is equivalent to the playback position in a video player. As the user scrolls the timeline control to the left or right, the focus time changes.</p>
<p>The length of the &#8220;visible time-frame&#8221; refers to the time span before focus time during which all recorded signals should be visualized. For instance if the visible time-frame is set to 1 hour then the track behind a vessel&#8217;s &#8220;current&#8221; position will be displayed for the last hour (&#8220;current&#8221; being determined by &#8220;focus-time&#8221;).</p>
<p>The &#8220;view-port&#8221; is nothing more that the visible area of the ENC and is defined by means of panning and zooming the map.</p>
<p>Probably you are already getting the &#8220;<strong>big picture</strong>&#8220;: A system that will playback what happened around an event (i.e. an oil spill) and allow you to watch it like you would watch a video. What you see is what you would see if you were flying with a plane over the event at the selected time, only mapped in ENC, loaded with useful information and of course: interactive.</p>
<p>During playback, you can move around the map by zooming and panning, change the playback speed and generally interact fully with the application (all functionality remains available).</p>
<p>By pointing your mouse to a vessel&#8217;s latest signal or track you can see relevant information on the right pane of the application. Information available for each vessel includes all category 5 AIS message fields (ship static and voyage information), all fields of categories 1, 2 &amp; 3 of AIS messages (position reports) and derived information based on algorithms and ranking databases, that help classify the ship and rank the probability of it being the offending vessel.</p>
<p>At the time of writing this project is in its final stages. It has been demonstrated to the customer and given their satisfaction it is pending some further development and optimizations before it is officially presented and delivered.</p>
<h3>Project B:</h3>
<p>Project B is an entirely independent project from Project A. Nevertheless, it is so <strong>relevant in context</strong>, that it is being developed in parallel. Actually so far I did not see a need to even branch the first project. Minor behavioral differences are handled very effectively through configuration files.</p>
<p>The goal of this project is to use AIS, <a href="http://en.wikipedia.org/wiki/Vessel_Traffic_Service" target="_blank">VTS</a> radar and EO data to <strong>identify certain types of vessels</strong> in the context of naval security.</p>
<p>AIS, VTS and EO data are <strong>correlated</strong> with data fusion algorithms and the results are again ranked by risk level.</p>
<p>My work in this project involves the creation of the <strong>visualization console</strong>. Data acquisition and fusion is handled by other project parties and the results of their work is just input data for my application.</p>
<p>The main difference from Project A is that this time, the software must be used mainly for near real-time monitoring. Playback is just a useful feature.</p>
<p>This project uses <strong>more sophisticated data</strong> sets and also includes estimated data. There are also considerable differences in data formats. All these had being handled properly during the design phase of the software and provisions where made so that it can read a wider variety of different data sources.</p>
<p>This project is also approaching its demonstration phase.</p>
<p><strong>Technologies</strong> used in <strong>both projects</strong> include:</p>
<ul>
<li><a href="http://www.microsoft.com/sql/2005/" target="_blank">Microsoft SQL 2005 Server</a></li>
<li><a href="http://www.postgresql.org/" target="_blank">PostgreSQL</a> (only in Project B)</li>
<li><a href="http://www.microsoft.com/net/" target="_blank">Microsoft .NET Framework 2.0</a></li>
<li><a href="http://www.sevencs.com/index.php?page=205〈=" target="_blank">SevenCs EC2007 ECDIS SDK</a></li>
</ul>
<p>Apart from the above technologies these projects <strong>required extensive understanding of</strong> <a href="http://en.wikipedia.org/wiki/Electronic_Chart_Display_and_Information_System" target="_blank">ECDIS</a>, <a href="http://en.wikipedia.org/wiki/Electronic_navigational_chart" target="_blank">ENCs</a>, <a href="http://en.wikipedia.org/wiki/Automatic_Identification_System" target="_blank">AIS</a>, <a href="http://en.wikipedia.org/wiki/Vessel_Traffic_Service" target="_blank">VTS</a> and <a href="http://en.wikipedia.org/wiki/Earth_observation" target="_blank">EO</a> related literature and of course engineering know-how in both software and earth sciences.</p>
<p>Both systems are being <strong>developed using</strong> <a href="http://msdn2.microsoft.com/en-us/vstudio/" target="_blank">Microsoft Visual Studio 2005</a> and C#.</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=6</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t change access modifiers when inheriting from Generic Types.</title>
		<link>http://rousso.eu/?p=35</link>
		<comments>http://rousso.eu/?p=35#comments</comments>
		<pubDate>Thu, 21 Feb 2008 15:26:32 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[.NET Development]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=37</guid>
		<description><![CDATA[Well I might be silly, but I had not run-up to this one yet. Until just now: You cannot change the accessibility level of a class member by means of hiding when inheriting from a generic type. Consider this example. A simple console application using two classes: MyList inherits from List and My2ndList inherits from [...]]]></description>
			<content:encoded><![CDATA[<div class="ExternalClass116804C8FA344016B5563A28BA960D76">
<p>Well I might be silly, but I had not run-up to this one yet. Until just now:</p>
<blockquote><p>You cannot change the accessibility level of a class member by means of hiding when inheriting from a generic type.</p>
</blockquote>
<p>Consider this example. A simple console application using two classes: <strong>MyList</strong> inherits from <strong>List<int></strong> and <strong>My2ndList</strong> inherits from <strong>MyList</strong>. Generic type <strong>List<t></strong> has a public method named <strong>Add</strong> that is not declared as virtual.</p>
<p>My intention was to <strong>completely hide</strong> the base implementation of the Add method in my derived class. In other words, let&#8217;s assume that I want MyList class to <strong>not</strong> expose an <strong>Add</strong> method. What one would normally do in this case, would be to hide the method by using the <strong>new modifier</strong> and changing its access modifier <strong>from public to private</strong> like I tried to do in line <strong>32</strong> of the code snippet that follows.</p>
<p>Well. Guess what. <strong>This does not work</strong> if you are inheriting from a Generic Type. Try the code bellow then try to play around with the access modifiers in lines <strong>32</strong> and <strong>47</strong>. Although I would normally assume that the code bellow would not even compile, <strong>it does</strong>!</p>
<pre class="brush: csharp;">using System;
using System.Collections.Generic;
using System.Text;

namespace TestGenerics
{
    class Program
    {
        static void Main(string[] args)
        {
            MyList myList = new MyList();
            myList.Add(1);
            myList.Add(2);
            myList.Add(3);

            myList.Print();

            Console.WriteLine(&quot;Now the 2nd List&quot;);

            My2ndList my2ndList = new My2ndList();
            my2ndList.Add(1);
            my2ndList.Add(2);
            my2ndList.Add(3);

            my2ndList.Print();
        }

    }

    public class MyList : List&lt;int&gt;
    {
        new private void Add(int item)
        {
            item *= 10;
            base.Add(item);
        }

        public void Print()
        {
            foreach (int item in this)
                Console.WriteLine(item.ToString());
        }
    }

    public class My2ndList : MyList
    {
        new private void Add(int item)
        {
            item *= 100;
            base.Add(item);
        }
    }
}</pre>
<p>So why am I posting about this?</p>
<p>Well&#8230; I didn&#8217;t come across any comments on the subject on the Internet for the little I looked around and I thought it was an interesting thing to talk about.</p>
<p>If you know of any links discussing the subject and explaining the internals of the compiler or generics implementation in C#, then by all means <strong>please do leave a comment</strong> to this post.</p>
<p><em>If you&#8217;d like to copy paste the code above then </em><a href="http://rafb.net/p/qpqQZ986.html" target="_blank"><em>go get it here</em></a><em>.</em></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=35</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Information aesthetics</title>
		<link>http://rousso.eu/?p=12</link>
		<comments>http://rousso.eu/?p=12#comments</comments>
		<pubDate>Thu, 19 Jul 2007 08:57:46 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[Notable Sites and Services]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=31</guid>
		<description><![CDATA[Only today I discovered this site on data visualization and visual design, which I found extremely interesting: information aesthetics (http://infosthetics.com/) I subscribed to its RSS feed and I might also add it somewhere here in my site too.]]></description>
			<content:encoded><![CDATA[<div class=ExternalClass560E7EC53ACA4803BDBC57FFE2FA3BE0>
<p>Only today I discovered this site on data visualization and visual design, which I found extremely interesting: </p>
<ul>
<li><a href="http://infosthetics.com/">information aesthetics</a> (<a href="http://infosthetics.com/">http://infosthetics.com/</a>) </li>
</ul>
<p>I subscribed to its RSS feed and I might also add it somewhere here in my site too.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=12</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About Twitter</title>
		<link>http://rousso.eu/?p=11</link>
		<comments>http://rousso.eu/?p=11#comments</comments>
		<pubDate>Fri, 22 Jun 2007 10:09:51 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[Notable Sites and Services]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=30</guid>
		<description><![CDATA[I found out about Twitter on a friend&#8217;s blog a couple of months ago. Today I was looking for an alternative and I bumped on lots of posts debating Twitter, its value and its alternatives. So I am posting some links to them along with my personal opinion on the matter. Here are the links: [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>I found out about Twitter on a friend&#8217;s blog a couple of months ago. Today I was looking for an alternative and I bumped on lots of posts debating Twitter, its value and its alternatives. So I am posting some links to them along with my personal opinion on the matter.</p>
<p>Here are the links:</p>
<ul>
<li><a href="http://leoville.vox.com/library/post/goodbye-twitter-hello-jaiku.html">Goodbye Twitter</a> by Leo Laporte</li>
<li><a href="http://www.webware.com/8301-1_109-9706570-2.html">Twitter vs. Jaiku Battle</a> by Rafe Needleman</li>
<li><a href="http://web1979.wordpress.com/2007/03/14/rip-twitter-2007-2007/">RIP Twitter</a> by Mat Balez (with lots of nice comments)</li>
<li><a href="http://jaiku.com/">Jaiku.com</a> (a Twitter alternative)</li>
</ul>
<p>My personal opinion is this: Twitter is just another effort to something new. I can&#8217;t really go on predictions, because things change on the web and they do change fast. So I am in, but wait and see…</p>
<p>I was looking for an alternative to Twitter today, because, though I do not use it that much, 9 out of 10 times I have tried to use Twitter, some, if not all of its features, are down for maintenance… IM does not really work most of the times. I am using AIM because neither Windows Live Messenger is supported, nor can I setup my own-domain-GTalk (as I need to add DNS SRV records which my DNS provider does not support). Even the web interface which should be mostly available was down again today. Posting by SMS is a nice alternative but still silly to use while I am sitting in front of my computer. So, am I going to switch to Jaiku? Well… I created a Jaiku account today but I am not sure yet… First I &#8216;ll try it, then I will decide… But in any case, posting through IM is preferred method of sending updates, so Jaiku, won&#8217;t win me over before they support IM unless Twitter looses me first…</p>
<p>If you do not know what Twitter is then <a href="http://en.wikipedia.org/wiki/Twitter"></a><a href="http://en.wikipedia.org/wiki/Twitter">look it up here.</p>
<p></a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple calls to RegisterOnSubmitStatement and Client-Side Validation</title>
		<link>http://rousso.eu/?p=13</link>
		<comments>http://rousso.eu/?p=13#comments</comments>
		<pubDate>Sat, 02 Dec 2006 08:54:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=3</guid>
		<description><![CDATA[Ok! Here is a new thing I discovered yet again the hard way&#8230; In short: Do not call Page.ClientScript.RegisterOnSubmitStatement after the Page Load event. (What?!) Well yes! It&#8217;s not under all circumstances that you can notice the difference but it&#8217;s there and it&#8217;s major! I do not really wan to describe this, so I &#8216;ll [...]]]></description>
			<content:encoded><![CDATA[<div class="ExternalClass03F95B4ADC804EE39AAD32C3FF903CC5">
<div>
<p>Ok! Here is a new thing I discovered yet again the hard way&#8230;</p>
<p><strong>In short:</strong> Do not call Page.ClientScript.RegisterOnSubmitStatement after the Page Load event.</p>
<p>(What?!)</p>
<p>Well yes! It&#8217;s not under all circumstances that you can notice the difference but it&#8217;s there and it&#8217;s major!</p>
<p>I do not really wan to describe this, so I &#8216;ll take you though it with <strong>an example</strong>:</p>
<p>Let&#8217;s say you have an aspx page. The page has two controls in it. For simplicity lets make those controls UserControls. The controls are pretty simple: just a TextBox and a RequiredFieldValidator in each of them.</p>
<p>So there you have it:</p>
<p><strong>Control A</strong> (let&#8217;s call it OnSubmitControlA):</p>
<pre class="brush: xml;">&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;OnSubmitControlA.ascx.cs&quot; Inherits=&quot;OnSubmitControlA&quot; %&gt;
&lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot; /&gt;
&lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;TextBox1&quot; ErrorMessage=&quot;RequiredFieldValidator&quot; /&gt;</pre>
<p>and the code file:</p>
<pre class="brush: csharp;">public partial class OnSubmitControlA : System.Web.UI.UserControl
{
   protected override void OnPreRender(EventArgs e)
   {
      Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomething&quot;, &quot;alert('This alert is registered by OnSubmitControlA');&quot;);
      base.OnPreRender(e);
   }
}</pre>
</p></div>
<div>
<p><strong>Control B</strong> (let&#8217;s call it OnSubmitControlB):</p>
<pre class="brush: xml;">&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;OnSubmitControlB.ascx.cs&quot; Inherits=&quot;OnSubmitControlB&quot; %&gt;
&lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot; /&gt;
&lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;TextBox1&quot; ErrorMessage=&quot;RequiredFieldValidator&quot; /&gt;</pre>
<p>and the code file:</p>
<pre class="brush: csharp;">public partial class OnSubmitControlB : System.Web.UI.UserControl
{
   protected override void OnPreRender(EventArgs e)
   {
      Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomethingElse&quot;, &quot;alert('This alert is registered by OnSubmitControlB');&quot;);
      base.OnPreRender(e);
   }
}</pre>
<p>And finally <strong>the page</strong> itself:</p>
<pre class="brush: xml;">&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;OnSubmitTest.aspx.cs&quot; Inherits=&quot;OnSubmitTest&quot; %&gt;
&lt;%@ Register Src=&quot;OnSubmitControlA.ascx&quot; TagName=&quot;OnSubmitControlA&quot; TagPrefix=&quot;uc1&quot; %&gt;
&lt;%@ Register Src=&quot;OnSubmitControlB.ascx&quot; TagName=&quot;OnSubmitControlB&quot; TagPrefix=&quot;uc2&quot; %&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
   &lt;head runat=&quot;server&quot;&gt;
      &lt;title&gt;Test Page&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
         &lt;uc1:OnSubmitControlA ID=&quot;OnSubmitControlA1&quot; runat=&quot;server&quot; /&gt;
         &lt;uc2:OnSubmitControlB ID=&quot;OnSubmitControlB1&quot; runat=&quot;server&quot; /&gt;
         &lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Button&quot; /&gt;
      &lt;/form&gt;
   &lt;/body&gt;
&lt;/html&gt;</pre>
<p>(the codefile has nothing special in it&#8230;)</p>
<p>The page has of course a submit button so that we can submit and test it&#8230;</p>
<p>So! What we have here!?</p>
<ul>
<li>A Page, </li>
<li>two controls that wan to access client-side code just before the page submits (for no particular reason) </li>
<li>and at least a Validator Control that will fail validation at some point. (If we did not have a validator then I would not have a case here!) </li>
</ul>
<p>Now go render the page an <strong>see the result</strong>. If you leave either TextBox empty and click on the submit button, you will notice that only the alert from the first control pop&#8217;s up. The other registered script is never called&#8230;.</p>
<p>Now go back and make a slight change. <strong>Move in both</strong> contols&#8217; codefile the call to Page.ClientScript.RegisterOnSubmitStatement from OnPreRender to OnLoad, like this:</p>
<pre class="brush: csharp;">public partial class OnSubmitControlA : System.Web.UI.UserControl
{
   protected override void OnLoad(EventArgs e)
   {
      base.OnLoad(e);
      Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomething&quot;, &quot;alert('This alert is registered by OnSubmitControlA');&quot;);
   }
   protected override void OnPreRender(EventArgs e)
   {
      // Let's comment this out
      // Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomething&quot;, &quot;alert('This alert is registered by OnSubmitControlA');&quot;);
      base.OnPreRender(e);
   }
}</pre>
<p>do the same on the other control:</p>
<pre class="brush: csharp;">public partial class OnSubmitControlB : System.Web.UI.UserControl
{
   protected override void OnLoad(EventArgs e)
   {
      base.OnLoad(e);
      Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomethingElse&quot;, &quot;alert('This alert is registered by OnSubmitControlB');&quot;);
   }
   protected override void OnPreRender(EventArgs e)
   {
      // Let's comment this out also
      // Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomethingElse&quot;, &quot;alert('This alert is registered by OnSubmitControlB');&quot;);
      base.OnPreRender(e);
   }
}</pre>
<p>Done! Go back and render the page! Leave either TextBox empty and click submit&#8230; See??? <strong>Now both alerts pop up!!!</strong></p>
<p>Why is that???</p>
<p>Well <strong>look at the source</strong> of the rendered page <strong>before and after the change</strong> to see what&#8217; going on:</p>
<p>Here is the script rendered when the call to RegisterOnSubmitStatement is placed in the <strong>OnPreRender</strong> event:</p>
<pre class="brush: js;">&lt;script type=&quot;text/javascript&quot;&gt;
   &lt;!--
      function WebForm_OnSubmit() {
         alert('This is registered by OnSubmitControlA');
         if (typeof(ValidatorOnSubmit) == &quot;function&quot; &amp;&amp; ValidatorOnSubmit() == false)
            return false;
         alert('This is registered by OnSubmitControlB');
         return true;
      }
   // --&gt;
&lt;/script&gt;</pre>
<p>And here is the script rendered when the call to RegisterOnSubmitStatement is placed in the <strong>OnLoad</strong> event:</p>
<pre class="brush: js;">&lt;script type=&quot;text/javascript&quot;&gt;
    &lt;!--
    function WebForm_OnSubmit() {
        alert('This is registered by OnSubmitControlA');
        alert('This is registered by OnSubmitControlB');
        if (typeof(ValidatorOnSubmit) == &quot;function&quot; &amp;&amp; ValidatorOnSubmit() == false)
            return false;
        return true;
       }
   // --&gt;
&lt;/script&gt;</pre>
<p>Got it?</p>
<p>If RegisterOnSubmitStatement is called after OnLoad, then the first time it&#8217;s called the framework appends the statement that calls ValidatorOnSubmit() and returns false if it fails; (effectively blocking the rest of the script from executing). Subsequent calls of RegisterOnSubmitStatement (after OnLoad) are appended to the script generated by the first call (and get blocked by the effect I just described).</p>
<p>Instead, if all your calls to RegisterOnSubmitStatement come before the end of the OnLoad phase, then all registered scripts are appended to previously generated scripts before the eventual injection of the call to ValidatorOnSubmit().</p>
<p>Hoping for comments on this&#8230;</p>
</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=13</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xsl:include, xsl:import &amp; msxml:script blocked on WSS 3 XML WebParts</title>
		<link>http://rousso.eu/?p=14</link>
		<comments>http://rousso.eu/?p=14#comments</comments>
		<pubDate>Wed, 29 Nov 2006 08:57:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=4</guid>
		<description><![CDATA[I discovered today (the hard way), that we can no longer use xsl:include and xsl:import elements in XSL Transformations for Windows SharePoint Services 3.0 XML WebParts. Along with those msxml:script is also blocked. I am going to investigate this further and see if there is an administrative way to bypass this security restriction. XSLT code reuse [...]]]></description>
			<content:encoded><![CDATA[<div>
<div class=ExternalClassFD9214EBD4594E70B4C56273B782C50D>
<div>
<p>I discovered today (the hard way), that we can no longer use <strong>xsl:include</strong> and <strong>xsl:import</strong> elements in XSL Transformations for Windows SharePoint Services 3.0 XML WebParts.</p>
<p>Along with those <strong>msxml:script</strong> is also blocked.</p>
<p>I am going to investigate this further and see if there is an administrative way to bypass this security restriction. XSLT code reuse is a useful thing and I want to keep it as an option in some environments.</p>
<p>Anyhow&#8230;</p>
<p>I am including two relevant links I found on the web:</p>
<ul>
<li><a href="http://weblogs.asp.net/soever/archive/2005/03/08/389371.aspx">SharePoint DVWP: xslt limitations&#8230;</a> in Serge van den Oever&#8217;s Blog
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_SP2003_ta/html/OfficeSharePointDDWRT.asp">SharePoint Data View Web Part Extension Functions in the ddwrt Namespace</a> in MSDN</li>
</ul>
<p>I would appreciate comments from people who know more on the subject.</p>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving to WSS 3</title>
		<link>http://rousso.eu/?p=15</link>
		<comments>http://rousso.eu/?p=15#comments</comments>
		<pubDate>Sat, 25 Nov 2006 18:45:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=2</guid>
		<description><![CDATA[I am in the process of replacing my old personal site with a new version based on Windows SharePoint Services 3.0. My previous site is based on Windows SharePoint Services 2.0, and is currently located at http://rousso.gr/. Though I could just gradually upgrade the old site to the new version of WSS I opted not [...]]]></description>
			<content:encoded><![CDATA[<div class=ExternalClass6BAB22F36E1F45C9A0D4E0394981478C>
<p>I am in the process of replacing my old personal site with a new version based on Windows SharePoint Services 3.0. </p>
<p>My previous site is based on Windows SharePoint Services 2.0, and is currently located at <a href="http://rousso.gr/">http://rousso.gr/</a>. </p>
<p>Though I could just gradually upgrade the old site to the new version of WSS I opted not to do so because the last few months I have been considering of restructuring my sites completely. I am not currently getting into any more details on this, but the bottom line is that I came to have far too many personal sites which rendered my main site almost useless. On the other hand I need I WSS based site in order to enjoy the goodies of WSS like custom lists and document sharing with my family, friends and colleagues. </p>
<p>So what you can expect to see here is either a private site or a public site replacing the current versions of <a href="http://www.rousso.gr/">http://www.rousso.gr</a> and <a href="http://blog.rousso.gr/">http://blog.rousso.gr</a>. </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=15</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CS:Editor ViewState</title>
		<link>http://rousso.eu/?p=16</link>
		<comments>http://rousso.eu/?p=16#comments</comments>
		<pubDate>Tue, 19 Sep 2006 07:58:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[Community Server]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=5</guid>
		<description><![CDATA[Quick Tip: CommunityServer 2.1 uses TinyMCE as a rich text editor. They use what appears to be a wrapper to TinyMCE: CommunityServer.Controls.Editor. As I am developing an application on top of CS 2.1 I am using the same rich text editor and encountered the following problem: I was setting declaratively the Height Property of the [...]]]></description>
			<content:encoded><![CDATA[<div class="ExternalClass4096C33E55EC4ED5A2769FF5CB88A56C">
<div>
<p><span><strong>Quick Tip:</strong></span></p>
<p><span>CommunityServer 2.1 uses TinyMCE as a rich text editor. They use what appears to be a wrapper to TinyMCE: CommunityServer.Controls.Editor. As I am developing an application on top of CS 2.1 I am using the same rich text editor and encountered the following problem:</span></p>
<p><span>I was setting declaratively the Height Property of the Editor control, but it could not retain it&#8217;s value after postbacks. </span></p>
<p><span>Look at the ASPX part:</span></p>
<pre class="brush: xml;">&lt;%@ Register Assembly=&quot;CommunityServer.Controls&quot; Namespace=&quot;CommunityServer.Controls&quot; TagPrefix=&quot;CS&quot; %&gt;
&lt;CS:Editor ID=&quot;edtNotes&quot; runat=&quot;server&quot; Height=&quot;160px&quot; /&gt;</pre>
<p><span>So far so good but, after a postback the Editor control returned to its default height (messing-up my layout). </span></p>
<p><span>To make a long story short, it figured that something is wrong either with timing or with implementation. I mean that either the wrapper, or the wrapped control do not assign the value of Height before ViewState is saved, or they assign it to either a Property that is not saved in view state, or during an Event that fires before LoadViewState.</span></p>
<p><span>So what I did to work-around the issue was just disable ViewState in the Editor control.</span></p>
<pre class="brush: xml;">&lt;CS:Editor ID=&quot;edtNotes&quot; runat=&quot;server&quot; Height=&quot;160px&quot; EnableViewState=&quot;false&quot; /&gt;</pre>
<p><span>The problem has gone away and that means that LoadViewState was overwriting my value.</span></p>
<p><span>I did not devote any time in looking further into this matter so I&#8217;m just posting this work-around, but if I do, I &#8216;ll let you know the details.</span></p>
</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UseSubmitBehavior &amp; GetPostBackEventReference</title>
		<link>http://rousso.eu/?p=17</link>
		<comments>http://rousso.eu/?p=17#comments</comments>
		<pubDate>Mon, 29 May 2006 08:00:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=6</guid>
		<description><![CDATA[funny thing… I needed a button (in an ASP.NET 2.0 page) to post-back and raise an event for another control. That means that I click a button but the post-back event is not handled by the button clicked but instead by another control on the same page. The easy way was to add a System.Web.UI.WebControls.Hyperlink [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>funny thing…</p>
<p>I needed a button (in an ASP.NET 2.0 page) to <strong>post-back and raise an event for another control</strong>. That means that I click a button but the post-back event is not handled by the button clicked but instead by another control on the same page.</p>
<p>The easy way was to add a System.Web.UI.<strong>WebControls.Hyperlink</strong> and set its <strong>NavigateUrl</strong> property to Page.ClientScript.<strong>GetPostBackClientHyperlink</strong>(myOtherControl, &quot;Arguments&quot;)</p>
<p>But I wanted it to look like a Button so instead I added a System.Web.UI.<strong>HTMLControls.HTMLButton</strong> Control and did the same thing to its <strong>OnClientClick</strong> property.</p>
<p>All worked fine.</p>
<p>The funny thing happened when I decided that I like most to use a System.Web.UI.<strong>WebControls.Button </strong>instead.</p>
<p>ASP.NET Buttons are rendered as &lt;input type<strong>=&quot;submit&quot;</strong> /&gt; controls. and by default their client-side onClick event is wired to the <strong>__doPostBack </strong>javascript method by ASP.NET.</p>
<p>To change that behavior in ASP.NET 2.0 we are supposed to use the <strong>UseSubmitBehavior</strong> Property which when set to false causes the Button to be rendered as &lt;input type=<strong>&quot;button&quot; </strong>/&gt; and allows you to set the client-side onClick event programmatically (or declaratively) by setting the <strong>OnClientClick</strong> server-side Property.</p>
<p>That&#8217;s what I did, only to discover that to whatever I was assigning to the OnClientClick Property, <strong>the original __doPostBack call was automatically appended</strong> by the framework.</p>
<p>I did not spend all the time in the world to figure this out and as I failed to find a reasonable way out of the problem, what I did, was to <strong>trick</strong> the client-side out of it by appending a JavaScript “<strong>return;</strong>” statement to the script I was assigning to OnClicntClick.</p>
<p>To make all these more obvious here is the hands on:</p>
<p>in the <strong>aspx/ascx</strong> file:</p>
<pre class="brush: xml;">&lt;asp:detailsview id=&quot;DetailsView1&quot; runat=&quot;server&quot;&gt;
 ...
&lt;/asp:detailsview&gt;

&lt;asp:HyperLink ID=&quot;HyperLink1&quot; runat=&quot;server&quot; Text=&quot;HyperLink&quot; /&gt;
&lt;input id=&quot;Button1&quot; type=&quot;button&quot; value=&quot;button1&quot; runat=&quot;server&quot;/&gt;
&lt;asp:Button ID=&quot;Button2&quot; runat=&quot;server&quot; Text=&quot;Button2&quot; /&gt;</pre>
<p>Notice that lines 5 and 6 above define the Hyperlink and HTMLButton that worked fine and line 7 defines the WebControls.Button that did not behave. Lines 1 to 3 define a <strong>DetailsView</strong> just because that is the control I wanted to handle the post-back event.</p>
<p>Now in the <strong>code file</strong>:</p>
<pre class="brush: csharp;">HyperLink1.NavigateUrl = Page.ClientScript.GetPostBackClientHyperlink(DetailsView1, &quot;New$0&quot;, true);
Button1.Attributes.Add(&quot;onClick&quot;, Page.ClientScript.GetPostBackClientHyperlink(DetailsView1, &quot;New$0&quot;, true));
Button2.UseSubmitBehavior = false;
Button2.OnClientClick = Page.ClientScript.GetPostBackEventReference(DetailsView1, &quot;New$0&quot;);</pre>
<p>These get <strong>rendered as follows</strong> at run-time (if you look at the source in the browser):</p>
<pre class="brush: csharp;">&lt;a id=&quot;HyperLink1&quot; href=&quot;javascript:__doPostBack('DetailsView1','New$0')&quot;&gt;HyperLink&lt;/a&gt;
&lt;input name=&quot;Button1&quot; type=&quot;button&quot; id=&quot;Button1&quot; value=&quot;button&quot; onclick=&quot;javascript:__doPostBack('DetailsView1','New$0')&quot; /&gt;
&lt;input type=&quot;button&quot; name=&quot;Button2&quot; value=&quot;Button&quot; id=&quot;Button2&quot; onclick=&quot;__doPostBack('DetailsView1','New$0'); __doPostBack('Button2','')&quot; /&gt;</pre>
<p>This works just fine if you click on the Hyperlink1 or Button1 controls, but not at all if you clicked at Button2. That is because Button2 makes the <strong>call to __doPostBack twice</strong>. Once because I asked it to do so (by assigning its OnClientClick Property as you see in line 4 of the code-file above) and once because the framework automatically inserted the default post-back event reference for the button (Button2) itself.</p>
<p>To overcome this behavior (as I could not find another way around it) I just changed the last line in the code-file (line 4 in the snippet) by appending a <strong>javascript return statement</strong> as follows:</p>
<pre class="brush: csharp; first-line: 4;">Button2.OnClientClick = Page.ClientScript.GetPostBackEventReference(DetailsView1, &quot;New$0&quot;) + &quot;; return;&quot;;</pre>
<p>This caused Button2 to render as follows:</p>
<pre class="brush: xml; first-line: 3;">&lt;input type=&quot;button&quot; name=&quot;Button2&quot; value=&quot;Button&quot; id=&quot;Button2&quot; onclick=&quot;__doPostBack('DetailsView1','New$0'); return;__doPostBack('Button2','')&quot; /&gt;</pre>
<p>Notice the return statement (in bold) rendered between the two calls to __doPostBack. Although this does not prevent the second __doPostBack call from beeing inserted by the framework, it does prevent it from executing….</p>
<p>If you know a proper way out of this little puzzle&#160; please let me know….</p>
<p>P.S:</p>
<ol>
<li>
<p>As you obviously noticed I needed the button to create an <strong>Insert</strong> button that would enable a <strong>DetailsView</strong> to go to Insert Mode even if the view has <strong>no items</strong> to display. The button (when clicked) causes the DetailsView to receive an Insert Command.</p>
</li>
<li>
<p>Of course <strong>you fortunately do not need to do all this</strong> to make a details view to enter Insert Mode. It would be enough to just and any button with a server-side Click event handler changing the mode to Insert by just calling DetailsView1.<strong>ChangeMode(DetailsViewModes.Insert)</strong>;</p>
</li>
</ol>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiding a Report Parameter in SQL Server 2000 Reporting Services</title>
		<link>http://rousso.eu/?p=18</link>
		<comments>http://rousso.eu/?p=18#comments</comments>
		<pubDate>Fri, 05 May 2006 08:02:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=7</guid>
		<description><![CDATA[Situation: You use SQL 2000 Reporting Services, to create a report (probably same applies for SQL 2005, but I have not tried it yet). You report expects various parameters but the user does not need to specify all of them through the user interface. For example the value of a parameter (say ParamB) can be [...]]]></description>
			<content:encoded><![CDATA[<div>
<p><strong><u>Situation:</u></strong></p>
<p>You use SQL 2000 Reporting Services, to create a report (probably same applies for SQL 2005, but I have not tried it yet).</p>
<p>You report expects various parameters but the user does not need to specify all of them through the user interface. For example the value of a parameter (say ParamB) can be calculated based on the value of another parameter (say ParamA) that the user selects.</p>
<p>So, you want to hide ParamB from the user.</p>
<p><u><strong>Solution:</strong></u></p>
<p>In the Report Parameters Collection Editor select the parameter that you want to hide and clear its “Prompt” field. Then add a Default Value to it (either by using an expression or by using a query).</p>
<p><u><strong>Quick Tip:</strong></u></p>
<p> Notice that when you use a query to get the default value of the hidden parameter ParamB you can always pass to it the Value that the user selected for ParamA (or another parameter).</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=18</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
