<?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>Radu Poenaru &#187; 2009 &#8211; Fraunhofer FIT</title>
	<atom:link href="http://www.radupoenaru.com/category/my-work/fit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.radupoenaru.com</link>
	<description>Team leader and Software engineer</description>
	<lastBuildDate>Mon, 01 Aug 2011 20:47:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Adding events to LINQtoCSV library</title>
		<link>http://www.radupoenaru.com/adding-events-to-linqtocsv-library/</link>
		<comments>http://www.radupoenaru.com/adding-events-to-linqtocsv-library/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 11:40:36 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[My work]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[User experience]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=985</guid>
		<description><![CDATA[The User Experience that a library provides must be at least equal with is quality and speed. And frankly, CSVtoLINQ rocks on latest two, but lacks a little on the User Experience(in our case Developer Experience)  by not having some events of starting, progress and ending of the parsing.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/adding-events-to-linqtocsv-library/">Adding events to LINQtoCSV library</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadding-events-to-linqtocsv-library%2F' data-shr_title='Adding+events+to+LINQtoCSV+library'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadding-events-to-linqtocsv-library%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadding-events-to-linqtocsv-library%2F' data-shr_title='Adding+events+to+LINQtoCSV+library'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadding-events-to-linqtocsv-library%2F' data-shr_title='Adding+events+to+LINQtoCSV+library'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="How to improve Developer experience by adding custom events to libraries" border="0" alt="How to improve Developer experience by adding custom events to libraries" align="left" src="http://www.radupoenaru.com/wp-content/uploads/2010/02/CsvDelimited.png" width="100" height="100" />
<p>The User Experience that a library provides must be at least equal with is quality and speed. And frankly, CSVtoLINQ rocks on latest two, as I presented in previous articles <a href="http://www.radupoenaru.com/import-csv-file-and-query-it-with-linq/">Import CSV file and query it with LINQ</a> and continuing in <a href="http://www.radupoenaru.com/linq-wonder-world/">LINQ wonder world</a>, but lacks a little on the User Experience(in our case Developer Experience)&#160; by not having some events of starting, progress and ending of the parsing.</p>
<p>Especially important, while parsing huge files, is a confirmation for the user that something happens and (ideally) the point in which the processing is. That is why, thanks to <b><a href="http://www.codeproject.com/Members/Matt-Perdeck">Matt Perdeck</a></b> for sharing the entire source of the library, I was able to improve it by adding events.</p>
<p>So, let’s see some code!</p>
<h3>Modifications into LINQtoCSV library &#8211; CSVContext.cs</h3>
<p><strong>Important: All modifications will be made in the CsvContext class from LINQtoCSV namespace – the CSVContext.cs file.</strong></p>
<p>First we’ll add the ReadStarted event to the library – it will fire when the reading of the CSV file has started.</p>
<pre class="brush:csharp">// defining the delegate
public delegate void ReadStartedHandler(object sender, EventArgs e);
// here we define the event
public event ReadStartedHandler ReadStarted;

// the call of the event processing
protected virtual void OnReadStarted() {
  if (ReadStarted != null) {
    // we use empty eventargs because nothing is needed on readstarted event, just the confirmation of parsing started
    ReadStarted(this, EventArgs.Empty);
  }
}</pre>
<p><span id="more-985"></span>Similarly, we define the complete event: </p>
<pre class="brush:csharp">public delegate void ReadCompletedHandler(object sender, EventArgs e);
public event ReadCompletedHandler ReadCompleted;

protected virtual void OnReadCompleted() {
    if (ReadCompleted != null) {
        ReadCompleted(this, EventArgs.Empty);
    }
}</pre>
<p>For the progress we have to do a small addition by creating our own EventArgs type: </p>
<pre class="brush: csharp">public class ProgressArgs : EventArgs {
    private int _Progress;
    private int _Max;

    public int MaxValue {
        set {
            _Max= value;
        }
        get {
            return this._Max;
        }
    }

    public int Progress {
        set {
            _Progress = value;
        }
        get {
            return this._Progress;
        }
    }
}

public delegate void ReadProgressHandler(object sender, ProgressArgs p);
public event ReadProgressHandler ReadProgress;

protected virtual void OnReadProgress(ProgressArgs p) {
    if (ReadProgress != null) {
        ReadProgress(this, p);
    }
}</pre>
<p>As the events and event arguments were created, we have to insert their calls into the code, with specific line numbers (might differ a little at your implementation time, but that&#8217;s why I presented some of the surrounding code) from the CSVContext.cs:</p>
<pre class="brush: csharp;first-line:106">(...)
#region Get line counting for progress
int count = 0;
string line;
while ((line = stream.ReadLine()) != null) {
    count++;
}

ProgressArgs p = new ProgressArgs();
p.MaxValue = count;
#endregion
(...)</pre>
<pre class="brush: csharp;first-line:124;highlight:[129,133,134]">(...)
AggregatedException ae =
    new AggregatedException(typeof(T).ToString(), fileName, fileDescription.MaximumNbrExceptions);

try {
    ReadStarted(this, EventArgs.Empty);
    bool firstRow = true;

    while (cs.ReadRow(ref row)) {
        p.Progress++;
        ReadProgress(this, p);
(...)</pre>
<p>And of course, the ReadCompleted event: </p>
<pre class="brush: csharp;first-line:170;highlight:[176]">(...)
finally {
    if (readingFile) {
        stream.Close();
    }

    ReadCompleted(this, EventArgs.Empty);
(...)</pre>
<h3>Modifications in your application</h3>
<p>Now, in your application you have to register and create methods responding to the events: </p>
<pre class="brush: csharp;">CsvContext cc = new CsvContext();
// add event handlers
cc.ReadStarted += new CsvContext.ReadStartedHandler(cc_ReadStarted);
cc.ReadCompleted += new CsvContext.ReadCompletedHandler(cc_ReadCompleted);
cc.ReadProgress += new CsvContext.ReadProgressHandler(cc_ReadProgress);</pre>
<p>While the ReadStarted and ReadCompleted events are trivial, I feel that ReadProgress deserves to be presented as code( here <font color="#0000ff">tsProgressBar</font> is a <font color="#0000ff">System.Windows.Forms.ToolStripProgressBar</font>): </p>
<pre class="brush: csharp;">void cc_ReadProgress(object sender, ProgressArgs e) {
    if (tsProgressBar.Maximum != e.MaxValue)
        tsProgressBar.Maximum = e.MaxValue;
    tsProgressBar.Value = e.Progress;
    this.Cursor = Cursors.Default;
}</pre>
<p>That’s all folks – Enjoy the code!</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/adding-events-to-linqtocsv-library/">Adding events to LINQtoCSV library</a></p>
<div class="shr-publisher-985"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/adding-events-to-linqtocsv-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import CSV file and query it with LINQ</title>
		<link>http://www.radupoenaru.com/import-csv-file-and-query-it-with-linq/</link>
		<comments>http://www.radupoenaru.com/import-csv-file-and-query-it-with-linq/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 19:02:00 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CSV Parsing]]></category>
		<category><![CDATA[Import CSV]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=973</guid>
		<description><![CDATA[Assume that you have an plain text, old Comma Separated Values file filled with your precious export from a legacy system. How can you process it easily now? The first answer that is worth considering is parse it to LINQ, the language-integrated query, which is a collection of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/import-csv-file-and-query-it-with-linq/">Import CSV file and query it with LINQ</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fimport-csv-file-and-query-it-with-linq%2F' data-shr_title='Import+CSV+file+and+query+it+with+LINQ'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fimport-csv-file-and-query-it-with-linq%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fimport-csv-file-and-query-it-with-linq%2F' data-shr_title='Import+CSV+file+and+query+it+with+LINQ'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fimport-csv-file-and-query-it-with-linq%2F' data-shr_title='Import+CSV+file+and+query+it+with+LINQ'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="How to easily import CSV file and query it with LINQ" border="0" alt="How to easily import CSV file and query it with LINQ" align="left" src="http://www.radupoenaru.com/wp-content/uploads/2010/02/CsvDelimited.png" width="100" height="100" /> Assume that you have an plain text, old Comma Separated Values file filled with your precious export from a legacy system. How can you process it easily now? The first answer that comes to mind is to parse it and load it into a datatable and later process it by using DataTable.Select() method. But this approach has some limitations – like splitting data into several tables and then join them.</p>
<p>One would imagine that parsing CSV files is a straightforward and boring task, given that it is quite a while since CSV is around. Some of them are correct &#8211; in the sense that many implementations merely use some splitting method like <code>String.Split()</code>. Some don’t even offer the specification of the values splitting character – so your file wouldn’t be parsed correctly if instead of <strong>,</strong> you have <strong>; </strong>as separator – yet another thing to modify if you’re lucky enough to have the sources. Others will not handle properly field values with commas because the simple split method of the String class. But there are better implementations that take care about escaped quotes, trimming spaces before and after fields and other small and useful details, but very few that I found did it all as I liked it &#8211; and at least as importantly, in a <strong>fast</strong> and <strong>efficient</strong> manner.</p>
<p> <span id="more-973"></span>
</p>
<p>After trying several methods to parse the csv file, I endup using <b><a href="http://www.codeproject.com/Members/Matt-Perdeck">Matt Perdeck</a>’</b>s LINQ to CSV library presented in its article on <a href="http://www.codeproject.com/KB/linq/LINQtoCSV.aspx">The Code Project</a> website.</p>
<p>Among the feature that I used and liked very much I would mention (from the article):</p>
<ul>
<li>Follows the <a href="http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm">most common rules for CSV files</a>. Correctly handles data fields that contain commas and line breaks. </li>
<li>In addition to comma, most delimiting characters can be used, including tab for tab delimited fields. </li>
<li>Can be used with an <code>IEnumerable</code> of an anonymous class &#8211; which is often returned by a LINQ query. </li>
<li>Supports deferred reading. </li>
<li>Supports processing files with international date and number formats. </li>
<li>Supports different character encodings if you need them. </li>
<li>Recognizes a wide variety of date and number formats when reading files. </li>
<li>Provides fine control of date and number formats when writing files. </li>
<li>Robust error handling, allowing you to quickly find and fix problems in large input files. </li>
</ul>
<p>Using the library is straight-forward: after downloading the zip file from the <a href="http://www.codeproject.com/KB/linq/LINQtoCSV.aspx">The Code Project</a> (this required that you have an account there) you can start using it by including it as a referenced library in your project.</p>
<p>Next step is to define the layout of your csv file, in a manner that CSVtoLINQ to be able to map the data from file (which is pure text) to correct data types :</p>
<pre class="brush: csharp">using LINQtoCSV;
using System;

class Product
{
    [CsvColumn(Name = &quot;ProductName&quot;, FieldIndex = 1)]
    public string Name { get; set; }

    [CsvColumn(FieldIndex = 2, OutputFormat = &quot;dd MMM HH:mm:ss&quot;)]
    public DateTime LaunchDate { get; set; }

    [CsvColumn(FieldIndex = 3, CanBeNull = false, OutputFormat = &quot;C&quot;)]
    public decimal Price { get; set; }

    [CsvColumn(FieldIndex = 4)]
    public string Country { get; set; }

    [CsvColumn(FieldIndex = 5)]
    public string Description { get; set; }
}</pre>
<p>As you can see, there are lots of types that you can apply to your class.</p>
<p>Then you have to declare the using clause in your source file, where you want to use it:</p>
<pre>using LINQtoCSV;</pre>
<p>Then, all you need is to start using the library by adding this code</p>
<pre class="brush: csharp">private void btnLoad_Click(object sender, EventArgs e) {
  openFile.Filter = &quot;CSV Files|*.csv&quot;;
  openFile.Title = &quot;Open CSV File&quot;;

  if (openFile.ShowDialog() == DialogResult.OK) {
    textBox1.Text = openFile.FileName;

    CsvFileDescription inputFileDescription = new CsvFileDescription {
      // cool - I can specify my own separator!
      SeparatorChar = ';',
      FirstLineHasColumnNames = true
    };

    CsvContext cc = new CsvContext();

    bEvents =
      cc.Read<beventtype>(openFile.FileName, inputFileDescription);

    // elegantly parse the LINQ outputed by the parser
    var bALLEvents =
      from p in bEvents
      orderby p.EventID
      select new { p.EventID, p.EventName, p.SourceName, p.TargetName };

    // binding to DataGridView
    // Notice the conversion to a List of the bALLEvents collection
    dataGridView1.DataSource = bALLEvents.ToList();
  }
}</pre>
<p>That’s it, folks – Enjoy and share!</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/import-csv-file-and-query-it-with-linq/">Import CSV file and query it with LINQ</a></p>
<div class="shr-publisher-973"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/import-csv-file-and-query-it-with-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change screen orientation of a Microsoft Surface application</title>
		<link>http://www.radupoenaru.com/change-screen-orientation-of-a-microsoft-surface-application/</link>
		<comments>http://www.radupoenaru.com/change-screen-orientation-of-a-microsoft-surface-application/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 06:06:00 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[My work]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[User experience]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=948</guid>
		<description><![CDATA[In order to understand the need of changing the screen orientation on a Microsoft Surface, you might want to think aboutthe situation in which you have casual visitors, who sit in pairs working on one Surface, you might considering rotating the window such that the ’Down’ of the application would be the nearest edge to them.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/change-screen-orientation-of-a-microsoft-surface-application/">Change screen orientation of a Microsoft Surface application</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fchange-screen-orientation-of-a-microsoft-surface-application%2F' data-shr_title='Change+screen+orientation+of+a+Microsoft+Surface+application'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fchange-screen-orientation-of-a-microsoft-surface-application%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fchange-screen-orientation-of-a-microsoft-surface-application%2F' data-shr_title='Change+screen+orientation+of+a+Microsoft+Surface+application'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fchange-screen-orientation-of-a-microsoft-surface-application%2F' data-shr_title='Change+screen+orientation+of+a+Microsoft+Surface+application'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a class="cboxelement" title="Change screen orientation of a Microsoft Surface application with C# and using WCF / WPF and Silverlight" href="http://www.radupoenaru.com/wp-content/uploads/2009/08/ms_surfac.png"><img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Change screen orientation of a Microsoft Surface application - Programming with C# and using WCF / WPF and Silverlight" border="0" alt="Change screen orientation of a Microsoft Surface application - Programming with C# and using WCF / WPF and Silverlight" align="left" src="http://www.radupoenaru.com/wp-content/uploads/2009/08/ms_surfac_thumb.png" width="240" height="87" /></a>
<p>Microsoft Surface is designed to allow <a title="Microsoft Surface using MultiUser and MultiTouch features" href="http://www.radupoenaru.com/microsoft-surface-%e2%80%93-new-task-and-new-challenges/">MultiUser and MultiTouch</a> interaction.While MultiTouch is easy to acknowledge, the MultiUser and designing a smart changing of <a title="What&#39;s inside the Microsoft Surface" href="http://www.radupoenaru.com/microsoft-surface-whats-inside/">Surface’s screen orientation</a> is a little difficult coming from desktop computing, where the monitor’s down will be the same always.</p>
<p>In order to understand the need of changing the screen orientation on a Microsoft Surface, you might want to think about it’s normal usage: Collaboration and User experience. In the implementation for a group of 4-8 people, sitting around the Surface, their need for rotating the environment is almost zero or otherwise they will experience dizziness and losing their focus while rotating the environment for one of them. </p>
<p>While for the situation in which you have casual visitors(as in BMW implementation in their <a title="BMW Product Navigator" href="http://www.youtube.com/watch?v=gX6u1mTZHPQ">showrooms</a>), who sit in pairs working on one Surface, you might considering rotating the window such that the ’Down’ of the application would be the nearest edge to them.</p>
<p> <span id="more-948"></span>
<p>The <a href="http://www.microsoft.com/surface/">Microsoft Surface SDK</a> provides such ways that not only you know where the users are (by reading the direction from their fingers hit area) but also to rotate the application on screen.</p>
<p>One of the easiest checks that can be made are verifying the static property <strong>Microsoft.Surface.ApplicationLauncher.Orientation.</strong>In order to be automatically noticed, there is an event published by the framework: <strong>Microsoft.Surface.ApplicationLauncher.OrientationChanged. </strong>It fires when the user changes his side by touching on the access buttons at the corresponding side.</p>
<p>But let’s better dig into some code.</p>
<blockquote><p>The rotating of screen is done through a RotateTransform, transformation known very well from Computer Graphics. We’ll apply this transformation with a computed Angle according to the Orientation. In order to apply this to the main application window, we will set the RotateTransform in the root element of the SurfaceWindow.</p>
</blockquote>
<pre class="brush:csharp">&lt;s:SurfaceWindow x:Class=&quot;SurfaceApplication1.SurfaceWindow1&quot;
    xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
    xmlns:s=&quot;http://schemas.microsoft.com/surface/2008&quot;
    Title=&quot;SurfaceApplication1&quot;&gt;
  &lt;Grid Name=&quot;MenuGrid&quot;&gt;

    &lt;Grid.LayoutTransform&gt;
      &lt;RotateTransform x:Name=&quot;OrientationTransform&quot; Angle=&quot;0&quot;/&gt;
    &lt;/Grid.LayoutTransform&gt;

    &lt;TextBlock Name=&quot;OrientationTextBox&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
   &lt;/Grid&gt;
&lt;/s:SurfaceWindow&gt;</pre>
<p>Since for this small example we’re interested only to setup the orientation at the startup of the application, all we need is to subscribe to be notified by the event loop on the ApplicationLauncher.OrientationChanged event. Thus, we’ll set the Angle as per the ApplicationLauncher.Orientation property.</p>
<pre class="brush:csharp">private void AddActivationHandlers()
{
    // Subscribe to surface application activation events
    ApplicationLauncher.ApplicationActivated += OnApplicationActivated;
    ApplicationLauncher.ApplicationPreviewed += OnApplicationPreviewed;
    ApplicationLauncher.ApplicationDeactivated += OnApplicationDeactivated;
    //subscribing to the orientation changing event
    ApplicationLauncher.OrientationChanged += ApplicationLauncher_OrientationChanged;
}
void ApplicationLauncher_OrientationChanged(object sender, OrientationChangedEventArgs e)
{
    // for simplicity, we consider that the application can be rotated only with 180 deg increments
    // so you'll not need to consider the scaling or moving the elements if the bottom becomes the shorter edge
    OrientationTransform.Angle = ApplicationLauncher.Orientation == UserOrientation.Top ? 180 : 0;
    // applying the orientation to UI elements
    OrientationTextBox.Text = ApplicationLauncher.Orientation.ToString();
}</pre>
<p>That’s it folks – use and enjoy!</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/change-screen-orientation-of-a-microsoft-surface-application/">Change screen orientation of a Microsoft Surface application</a></p>
<div class="shr-publisher-948"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/change-screen-orientation-of-a-microsoft-surface-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to make a Print Screen on Microsoft Source using WPF</title>
		<link>http://www.radupoenaru.com/how-to-make-a-print-screen-on-microsoft-source-using-wpf/</link>
		<comments>http://www.radupoenaru.com/how-to-make-a-print-screen-on-microsoft-source-using-wpf/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 17:05:48 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=941</guid>
		<description><![CDATA[For sure at some point in your Microsoft Surface application you'll need to do programatically some screenshots. This article explains how to do it in two simple steps.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/how-to-make-a-print-screen-on-microsoft-source-using-wpf/">How to make a Print Screen on Microsoft Source using WPF</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-make-a-print-screen-on-microsoft-source-using-wpf%2F' data-shr_title='How+to+make+a+Print+Screen+on+Microsoft+Source+using+WPF'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-make-a-print-screen-on-microsoft-source-using-wpf%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-make-a-print-screen-on-microsoft-source-using-wpf%2F' data-shr_title='How+to+make+a+Print+Screen+on+Microsoft+Source+using+WPF'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-make-a-print-screen-on-microsoft-source-using-wpf%2F' data-shr_title='How+to+make+a+Print+Screen+on+Microsoft+Source+using+WPF'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a class="cboxelement" title="Microsoft Surface - Programming with C# and using WCF / WPF and Silverlight" href="http://www.radupoenaru.com/wp-content/uploads/2009/08/ms_surfac.png" rel="lightbox[729]"><img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Making a Printscreen with WPF on Microsoft Surface - Programming with C# and using WCF / WPF and Silverlight" border="0" alt="Making a Printscreen with WPF on Microsoft Surface - Programming with C# and using WCF / WPF and Silverlight" align="left" src="http://www.radupoenaru.com/wp-content/uploads/2009/08/ms_surfac_thumb.png" width="240" height="87" /></a>
<p>After we <a href="http://www.radupoenaru.com/microsoft-surface-whats-inside/">took a look inside of Microsoft Surface</a>, let’s see how to take a later look on the surface, by creating printscreens of the application.</p>
<p>In some WPF applications you’ll need to take a quick screenshot of the user’s screen, allowing him (or them, in case of Multi User Surface) for later reviewing. Now, on Surface there can be only one full screen and active application. So it use the entire screen of the device.</p>
<p>Here are the steps in order to accomplish that:</p>
<p>First, we need to add to Visual Studio project the references to the libraries that we’ll use:</p>
<pre class="brush: csharp">using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;</pre>
<p>Then, we will add create the method that will do the actual saving to a specific file, with the format PNG: </p>
<pre class="brush: csharp">public void MakeScreenshot(String fileName)
{
    Bitmap bmpScreenshot;
    Graphics gfxScreenshot;

    //first, we create&amp;set a bitmap object to the size of the screen
    bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);

    //Using the bitmap, we create a graphics object
    gfxScreenshot = Graphics.FromImage(bmpScreenshot);

    //Copy the rectangle (the screen in our case) - from the upper left corner to the right bottom corner
    gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);

    // Do the saving, outputing a file by supplying the name and format it as PNG
    bmpScreenshot.Save(fileName, ImageFormat.Png);
}</pre>
<p>That’s all, folks &#8211; Use and enjoy!</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/how-to-make-a-print-screen-on-microsoft-source-using-wpf/">How to make a Print Screen on Microsoft Source using WPF</a></p>
<div class="shr-publisher-941"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/how-to-make-a-print-screen-on-microsoft-source-using-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handle XML with namespaces</title>
		<link>http://www.radupoenaru.com/handle-xml-with-namespaces/</link>
		<comments>http://www.radupoenaru.com/handle-xml-with-namespaces/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 09:54:48 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Fraunhofer FIT]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/handle-xml-with-namespaces/</guid>
		<description><![CDATA[I faced an issue while working with an xml file in Flash. I was unable to parse the xml data using the normal E4X syntax such as xml.node1.node2. It would give an error. The only thing different about this particular xml is that it has a lot of namespaces declared in it. After going through the documentation I found out a way to handle this issue.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/handle-xml-with-namespaces/">Handle XML with namespaces</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhandle-xml-with-namespaces%2F' data-shr_title='Handle+XML+with+namespaces'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhandle-xml-with-namespaces%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhandle-xml-with-namespaces%2F' data-shr_title='Handle+XML+with+namespaces'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhandle-xml-with-namespaces%2F' data-shr_title='Handle+XML+with+namespaces'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I faced an issue while working with an xml file in Flash. I was unable to parse the xml data using the normal E4X syntax such as xml.node1.node2. It would give an error. The only thing different about this particular xml is that it has a lot of namespaces declared in it. After going through the documentation I found out a way to handle this issue. Let&#8217;s consider the following code:</p>
<pre class="brush: java">
var xml:XML = &lt;Workbook xmlns:c=&quot;urn:schemas-microsoft-com:office:component:spreadsheet&quot; xmlns:html=&quot;http://www.w3.org/TR/REC-html40&quot; xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot; xmlns:x2=&quot;http://schemas.microsoft.com/office/excel/2003/xml&quot; xmlns:ss=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot; xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;&gt;
  &lt;ss:Worksheet ss:Name=&quot;Sheet1&quot;&gt;
  &lt;Table ss:StyleID=&quot;ta1&quot;&gt;
    &lt;Row ss:AutoFitHeight=&quot;0&quot; ss:Height=&quot;13.4064&quot;&gt;
      &lt;Cell&gt;
        &lt;Data ss:Type=&quot;String&quot;&gt;Preview&lt;/Data&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;Data ss:Type=&quot;String&quot;&gt;unicode&lt;/Data&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;Data ss:Type=&quot;String&quot;&gt;htmlcode&lt;/Data&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;Data ss:Type=&quot;String&quot;&gt;htmlalt&lt;/Data&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;Data ss:Type=&quot;String&quot;&gt;utfcode&lt;/Data&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;Data ss:Type=&quot;String&quot;&gt;utfalt&lt;/Data&gt;
      &lt;/Cell&gt;
    &lt;/Row&gt;
  &lt;/Table&gt;
  &lt;/ss:Worksheet&gt;
&lt;/Workbook&gt;</pre>
<p><span id="more-796"></span></p>
<p>Usage:</p>
<pre class="brush: as3">
namespace ns1 = &quot;urn:schemas-microsoft-com:office:spreadsheet&quot;;
use namespace ns1;
trace(xml..*::Table.Row[0].Cell[0].Data); //Preview</pre>
<p>Here, I just declared the default namespace for the above xml. Try this code without the namespace statement and you will get an error. The namespace declared without a prefix is the default namespace for the xml. For this xml the default namespace is xmlns=&rdquo;urn:schemas-microsoft-com:office:spreadsheet&rdquo;.</p>
<p>In this case what I&rsquo;ve done is declared the default namespace in actionscript. And to reference a deeply nested node I&rsquo;ve used &ldquo;..*::&rdquo; instead of a simple &rdquo; ..&rdquo;</p>
<p>Also, in case you want to remove all the namespaces mentioned in the xml, you can try doing something like this:</p>
<pre class="brush: as3">
var arNS:Array = xml.inScopeNamespaces();
for each (var item:Namespace in arNS)
{
	xml.removeNamespace(item);
}</pre>
<p>However, do note that this will not remove the default namespace.</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/handle-xml-with-namespaces/">Handle XML with namespaces</a></p>
<div class="shr-publisher-796"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/handle-xml-with-namespaces/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft Surface &#8211; What&#8217;s inside</title>
		<link>http://www.radupoenaru.com/microsoft-surface-whats-inside/</link>
		<comments>http://www.radupoenaru.com/microsoft-surface-whats-inside/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 16:58:00 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/microsoft-surface-whats-inside/</guid>
		<description><![CDATA[&#160; After starting the task, I started to be very curios about the technology that drives this device.I started looking over the internet and I found this picture. Very interesting, isn&#8217;t it? Basically contains a normal computer, linked to a projector and few infrared cameras. 1) Screen, the visual part of the device&#160; &#8211; Contains&#8230;<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/microsoft-surface-whats-inside/">Microsoft Surface &#8211; What&#8217;s inside</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fmicrosoft-surface-whats-inside%2F' data-shr_title='Microsoft+Surface+-+What%27s+inside+'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fmicrosoft-surface-whats-inside%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fmicrosoft-surface-whats-inside%2F' data-shr_title='Microsoft+Surface+-+What%27s+inside+'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fmicrosoft-surface-whats-inside%2F' data-shr_title='Microsoft+Surface+-+What%27s+inside+'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>&nbsp;</p>
<p><a href="http://www.radupoenaru.com/wp-content/uploads/microsoft-surface-diagram.jpg"><img width="220" vspace="10" hspace="30" height="169" border="0" align="left" alt="Microsoft Surface - What's inside" src="http://www.radupoenaru.com/wp-content/uploads/microsoft-surface-diagram.jpg" /></a>After starting the task, I started to be very curios about the technology that drives this device.I started looking over the internet and I found this picture. Very interesting, isn&#8217;t it? Basically contains a normal computer, linked to a projector and few infrared cameras.</p>
<p style="text-align: left;"><strong>1)	Screen, the visual part of the device&nbsp; &ndash;</strong> Contains a special diffuser which turns the Surface&rsquo;s acrylic tabletop into a big horizontal &ldquo;multitouch&rdquo; screen, capable of acquiring and processing multiple inputs from multiple users in the same time. The Surface is far more advanced than simple multitouch devices, being capable to be aware of different objects by recognizing their shape or by reading coded &ldquo;domino&rdquo; tags when placed on the table.</p>
<p><span id="more-700"></span></p>
<p style="text-align: left;"><strong>2)	Infrared, the &quot;eyes&quot;&ndash;</strong> Surface&rsquo;s &ldquo;machine vision&rdquo; is able to &quot;see&quot; in the near-infrared spectrum, using a 850-nanometer-wavelength LED light source pointed to the screen. When different shaped objects touch the table, the light is reflected back and is acquired by multiple infrared cameras with a resolution of 1280 x 960 points.</p>
<p style="text-align: left;"><strong>3)	CPU, the heart &ndash;</strong>  Surface uses a normal computer, composed by many components found in everyday desktop computers, neither extreme powerful nor extraordinary &mdash; a Core 2 Duo processor, 2GB of RAM and a 256MB graphics card. It has a wireless communication with devices on the surface using WiFi and Bluetooth antennas (maybe the next versions will incorporate advanced technologies like RFID or Near Field Communications). The operating system is a modified version of Microsoft Vista.</p>
<p style="text-align: left;"><strong>4)	Projector -</strong> Microsoft&rsquo;s Surface takes advantage of a normal DLP light engine which can be seen in many rear-projection HDTV&rsquo;s. Very reliable and easy to interconnect. The visible screen has a resolution of&nbsp; 1024 x 768 pixels, quite smaller compared with invisible overlapping infrared projection &#8211; allows better recognition at the edges of the screen, place where the most interesting menus are shown.</p>
<p style="text-align: left;">Apart from these, also has:</p>
<ol>
<li>normal USB ports for connecting devices,</li>
<li>a VGA-out for connecting an external monitor for development or for enhancing user experience &#8211; connecting a big Plasma or LCD Screen</li>
<li>power and reset switches</li>
</ol>
<p>Bottom up, this is a regular computer but where the genius intervene is that it is packed with a interesting top screen and infrared cameras and a custom framework to enable the ubiquitous experience.</p>
<p>Quite cool, after all, isn&#8217;t it?</p>
<p>&nbsp;</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/microsoft-surface-whats-inside/">Microsoft Surface &#8211; What&#8217;s inside</a></p>
<div class="shr-publisher-700"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/microsoft-surface-whats-inside/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Microsoft Surface – new task and new challenges</title>
		<link>http://www.radupoenaru.com/microsoft-surface-%e2%80%93-new-task-and-new-challenges/</link>
		<comments>http://www.radupoenaru.com/microsoft-surface-%e2%80%93-new-task-and-new-challenges/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 16:44:34 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/microsoft-surface-%e2%80%93-new-task-and-new-challenges/</guid>
		<description><![CDATA[New day, new task, new challenges &#8211; Today I started working on a social collaborative tool which will work on Surface, but extended eventually to Flex 3, Silverlight and iPhone. First impression: Visual Studio is an old friend. Still, bad news: Surface SDK is kept locked in a website, having access only those who bought&#8230;<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/microsoft-surface-%e2%80%93-new-task-and-new-challenges/">Microsoft Surface – new task and new challenges</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fmicrosoft-surface-%25e2%2580%2593-new-task-and-new-challenges%2F' data-shr_title='Microsoft+Surface+%E2%80%93+new+task+and+new+challenges'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fmicrosoft-surface-%25e2%2580%2593-new-task-and-new-challenges%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fmicrosoft-surface-%25e2%2580%2593-new-task-and-new-challenges%2F' data-shr_title='Microsoft+Surface+%E2%80%93+new+task+and+new+challenges'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fmicrosoft-surface-%25e2%2580%2593-new-task-and-new-challenges%2F' data-shr_title='Microsoft+Surface+%E2%80%93+new+task+and+new+challenges'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img align="left" src="http://www.radupoenaru.com/wp-content/uploads/Surface[3].png" alt="Microsoft Surface - new task new challenges" style="width: 196px; height: 150px;" />New day, new task, new challenges &ndash; Today I started working on a social  collaborative tool which will work on Surface, but extended eventually to Flex  3, Silverlight and iPhone.</p>
<p>First impression: Visual Studio is an old friend. Still, bad news: Surface  SDK is kept locked in a website, having access only those who bought a license.  Shame, Microsoft!</p>
<p>After installing the SDK I started running the examples, I noticed that many  events are new, a lot of new interaction techniques appeared ( the device can  track up to 50 different fingers) and also the trackers who can be identified  and corresponding menus, actions, interactions can be setup.</p>
<p>I&rsquo;m looking forward to this new style of programming and really hope to learn  it as fast as Objective-C.</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/microsoft-surface-%e2%80%93-new-task-and-new-challenges/">Microsoft Surface – new task and new challenges</a></p>
<div class="shr-publisher-697"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/microsoft-surface-%e2%80%93-new-task-and-new-challenges/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interconnecting Flex modules</title>
		<link>http://www.radupoenaru.com/interconnecting-flex-modules/</link>
		<comments>http://www.radupoenaru.com/interconnecting-flex-modules/#comments</comments>
		<pubDate>Tue, 05 May 2009 10:09:00 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[My work]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Interconnecting]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/interconnecting-flex-modules/</guid>
		<description><![CDATA[Adobe Flex 3 has a very interesting component : LocalConnection. The idea behind is that the modules (which runs on client side) might change some data. The exchanged data is not limited at all to simple forms, but can be from a simple String to a XML or Arrays. Few things must be known from&#8230;<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/interconnecting-flex-modules/">Interconnecting Flex modules</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Finterconnecting-flex-modules%2F' data-shr_title='Interconnecting+Flex+modules'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Finterconnecting-flex-modules%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Finterconnecting-flex-modules%2F' data-shr_title='Interconnecting+Flex+modules'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Finterconnecting-flex-modules%2F' data-shr_title='Interconnecting+Flex+modules'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Adobe Flex 3 has a very interesting component : LocalConnection. The idea behind is that the modules (which runs on client side) might change some data. The exchanged data is not limited at all to simple forms, but can be from a simple String to a XML or Arrays.</p>
<p>Few things must be known from the start, but as any technology, only after you learn it everything becomes easy.</p>
<ol>
<li>First of all, the communication can be restrained to a certain domain, let&rsquo;s say by example <a href="http://www.radupoenaru.com">www.radupoenaru.com</a> .</li>
<li>You can&rsquo;t have bidirectional communication from a single LocalConnection. One module acts as a server and another one as a client.</li>
<li>Server module opens a connection to which client connects. If the client loads but the server don&rsquo;t, then an error occurs in client module.</li>
<li>Be very careful to the name of the procedure called by server &ndash; should be the same in server as in client module.<span id="more-421"></span></li>
</ol>
<p>All these pointed out, let&rsquo;s see some code, first on server module:</p>
<pre class="brush:as3">
// server module function for communication
private function CommunicateToClient(evt:ContextMenuEvent):void {
  if (dataGrid.selectedIndex != -1){
    // just a variable
    var id:String = new String();
    //instantiate the connection
    var commLocalConnection:LocalConnection
      = new LocalConnection();
    // add error error handling
    commLocalConnection.addEventListener(
    StatusEvent.STATUS,commLocalConnection_Status);
    // create on this connection a logical connection called
    // showModule which calls filepath function with
    // two parameters: pathtofile=movie.flv and the id of the file
    commLocalConnection.send(&quot;showMovie&quot;, &quot;filePath&quot;,
     &quot;movie.flv&quot;, dg.selectedItem.name.toString());
  }
}

And on client module there are more modifications, first in the init() function, to instantiate and configure the communication link :
 // this local conn needs to be public, placed just above init() function
public var viewPicsConn:LocalConnection = new LocalConnection();
private function init():void {
    //set viewPics conn !!! next line is very important !!!
    commLocalClient.client = this;
    // restrict the domains to whom this server listen - security caution
    commLocalClient.allowDomain(strServer);
    //test the connection
    try {
      commLocalClient.connect(&quot;filePath&quot;);
    } catch (error:ArgumentError) {
      Alert.show(&quot;Can't connect to Server module. Please check this.\n
      Error: &quot; + error.message);
      // also add a trace to know where error occured
      trace(&quot;Can't connect in init function.&quot;);
    }
}

Second modification is the client module function called from the server module:
 // it must be public in order to be available for linkage
 public function filePath(path:String, Name: String):void{
    trace(&quot;path:&quot; + path + &quot;\nname:&quot; +Name);
    // now do your stuff with the parameters received
    // have fun !
    //
    // If you consider this article useful,
    // please add a link to it !
 }
</pre>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/interconnecting-flex-modules/">Interconnecting Flex modules</a></p>
<div class="shr-publisher-421"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/interconnecting-flex-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 3 debugging &amp;&amp; Nod32 != Love</title>
		<link>http://www.radupoenaru.com/flex-3-debugging-nod32-love/</link>
		<comments>http://www.radupoenaru.com/flex-3-debugging-nod32-love/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 19:36:27 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[My work]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Fraunhofer FIT]]></category>
		<category><![CDATA[Nod32]]></category>
		<category><![CDATA[SWF module]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/flex-3-debugging-nod32-love/</guid>
		<description><![CDATA[While working at Fraunhofer FIT, I had few small projects to develop internal modules for extending the interaction between researchers. The technologies were set from the start to Flex 3 and ActionScript. As starter in Flex, but not ActionScript, I was quite anxious to begin coding in this interesting tool. But after I created my&#8230;<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/flex-3-debugging-nod32-love/">Flex 3 debugging &#038;&#038; Nod32 != Love</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fflex-3-debugging-nod32-love%2F' data-shr_title='Flex+3+debugging+%26%26+Nod32+%21%3D+Love'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fflex-3-debugging-nod32-love%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fflex-3-debugging-nod32-love%2F' data-shr_title='Flex+3+debugging+%26%26+Nod32+%21%3D+Love'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fflex-3-debugging-nod32-love%2F' data-shr_title='Flex+3+debugging+%26%26+Nod32+%21%3D+Love'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>While working at Fraunhofer FIT, I had few small projects to develop internal modules for extending the interaction between researchers. The technologies were set from the start to Flex 3 and ActionScript.</p>
<p>As starter in Flex, but not ActionScript, I was quite anxious to begin coding in this interesting tool. But after I created my new Workspace (seems that now everyone creates its own paradigm for Project) and wrote some code, I hit a wall: the&#160; Flex IDE debugger interface raised an error that he couldn’t connect to the Flash debugger:<a href="http://www.radupoenaru.com/wp-content/uploads/2009/04/flex3-1.jpg" target="_blank"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="284" title="Flex3_1"  alt="Flex3_1" src="http://www.radupoenaru.com/wp-content/uploads/2009/04/flex3-1-thumb.jpg" width="466" border="0" /></a> </p>
<p> <span id="more-411"></span>
<p>I started to find a fix to this problem by reinstalling from Adobe website the latest version of their Flash player debugger(10.0.0.640). Tried to connect, but same error occurred again. Downgrading the Flash player debugger didn’t solved the problem, neither changing the target browser from Internet Explorer 7 to Firefox3.</p>
<p>After several hours spent into this problem I found the issue: the firewall that I had installed. Seems that good firewalls have a lot of options&#160; and features that both secure the Internet browsing experience, but also enforce a very high level of security. Basically, it blocked all my Flex IDE calls to Flash debugger running in a browser instance.</p>
<p>The solution is pretty simple after you find it:</p>
<ol>
<li>
<p>open the Nod32 window and switch to Advanced Mode:<a href="http://www.radupoenaru.com/wp-content/uploads/2009/04/nod32.jpg" target="_blank"><img title="Nod32" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="359" alt="Nod32" src="http://www.radupoenaru.com/wp-content/uploads/2009/04/nod32-thumb.jpg" width="466" border="0" /></a> </p>
</li>
<li>
<p>Choose from the left menu Setup &gt; Antivirus &amp; AntiSpyware and from the right panel under Web Access protection area click on Configure:<a href="http://www.radupoenaru.com/wp-content/uploads/2009/04/nod32-2.jpg" target="_blank"><img title="Nod32_2" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="359" alt="Nod32_2" src="http://www.radupoenaru.com/wp-content/uploads/2009/04/nod32-2-thumb.jpg" width="466" border="0" /></a> </p>
</li>
<li>
<p>Navigate in tree from the left to Antivirus and antispyware/Web access protection/Web browsers and in the right panel search for IExplore.exe and uncheck the box:<img title="Nod32_3" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="335" alt="Nod32_3" src="http://www.radupoenaru.com/wp-content/uploads/2009/04/nod32-3-thumb.jpg" width="466" border="0" /></p>
</li>
<li>
<p>Hit Ok and see the result: </p>
<p>     <a href="http://www.radupoenaru.com/wp-content/uploads/2009/04/flex3-2.jpg" target="_blank"><img title="Flex3_2" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="303" alt="Flex3_2" src="http://www.radupoenaru.com/wp-content/uploads/2009/04/flex3-2-thumb.jpg" width="466" border="0" /></a></li>
</ol>
<p>&#160;</p>
<p>Hope it helped you !&#160; </p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/flex-3-debugging-nod32-love/">Flex 3 debugging &#038;&#038; Nod32 != Love</a></p>
<div class="shr-publisher-411"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/flex-3-debugging-nod32-love/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working in Fraunhofer Institute of Technology</title>
		<link>http://www.radupoenaru.com/working-in-fraunhofer-institute-of-technology/</link>
		<comments>http://www.radupoenaru.com/working-in-fraunhofer-institute-of-technology/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 10:40:00 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[2009 - Fraunhofer FIT]]></category>
		<category><![CDATA[My work]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Germany]]></category>
		<category><![CDATA[Interface Buider]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Prof. Phd. Wolfgang Prinz]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/working-in-fraunhofer-institute-of-technology/</guid>
		<description><![CDATA[Starting today, I work as a Student Helper in Fraunhofer Institute for Applied Information Technology. The branch from Sankt Augustin, which I joined, is focused on the research of human-centered computing in a process context. I will activate in the Cooperation and Community Support department, which deals with the research and development of community portals,&#8230;<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/working-in-fraunhofer-institute-of-technology/">Working in Fraunhofer Institute of Technology</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fworking-in-fraunhofer-institute-of-technology%2F' data-shr_title='Working+in+Fraunhofer+Institute+of+Technology'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fworking-in-fraunhofer-institute-of-technology%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fworking-in-fraunhofer-institute-of-technology%2F' data-shr_title='Working+in+Fraunhofer+Institute+of+Technology'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fworking-in-fraunhofer-institute-of-technology%2F' data-shr_title='Working+in+Fraunhofer+Institute+of+Technology'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Starting today, I work as a Student Helper in <a href="http://www.fit.fraunhofer.de/index_en.html" target="_blank">Fraunhofer Institute for Applied Information Technology</a>. The branch from Sankt Augustin, which I joined, is focused on the research of human-centered computing in a process context. I will activate in the <strong>Cooperation and Community Support</strong> department, which deals with the research and development of community portals, (mobile) communities and cooperation, Internet-based groupware, cooperative knowledge management, application service providing for cooperative work and virtual teams, rating and recommender systems and cooperative learning environments.</p>
<p>The head of the department is <a href="http://www.fit.fraunhofer.de/~prinz/" target="_blank">Prof. Wolfgang Prinz, PhD</a> and I will work closely with Mr. Nils Jeners, researcher in FIT. I had the pleasure of attending Mr. Prinz course, CSCW and Groupware, while being student in the Media Informatics Master, held by RWTH Aachen University. CSCW stands for Computer Supported Collaborative Work.</p>
<p>My first task is to study the Twitter community, applications based on it and the actual phenomena. My work should help in better understanding the aspects of human behavior, social interaction between humans and in particular the tools and services used for microblogging. This will allow also to discover ways to extract patterns in the context of this technology, who is changing the ways that people interact and socialize over the Internet.</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/working-in-fraunhofer-institute-of-technology/">Working in Fraunhofer Institute of Technology</a></p>
<div class="shr-publisher-360"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/working-in-fraunhofer-institute-of-technology/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->

