<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Adventures in coding</title>
        <link>http://dkowalski.com/blog/Default.aspx</link>
        <description>random thoughts about being a developer</description>
        <language>pl-PL</language>
        <copyright>Dawid Kowalski</copyright>
        <generator>Subtext Version 2.1.2.2</generator>
        <image>
            <title>Adventures in coding</title>
            <url>http://dkowalski.com/images/RSS2Image.gif</url>
            <link>http://dkowalski.com/blog/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Autonomous positioning system in a confined space based on MPEG-7 descriptors and physical markers (ARTags)</title>
            <link>http://dkowalski.com/blog/archive/2010/06/01/autonomous-positioning-system-in-a-confined-space-based-on-mpeg-7.aspx</link>
            <description>&lt;p&gt;I was inspired (by really really great person) to contribute my master thesis to global www heap. If it may actually help even one person then it is more then worth it. My work was finished two years ago, send to a drawer, but maybe someone can use this in process of creating something valuable? I do regret only one thing, it was written in Polish, so it might be an obstacle, but I’m willing to answer any question if someone gets really interested. &lt;/p&gt;  &lt;p&gt;Main idea of my master thesis was to answer a question how to help vision impaired people in environments that haven’t been thought about them in a first place. Since I was always more practically, then theoretically, oriented I decided to create an actual software prototype that can be run in embedded devices (my platform of choice was signal processor Blackfin from Analog Devices). System consisted of camera to gather live data, signal processor to process it and software to decided weather something important for blind person is in front of him. Warnings or information could be send to this person in form of voice commands. &lt;/p&gt;  &lt;p&gt;I decided to check two tracks – first one was using designed for &lt;a href="http://en.wikipedia.org/wiki/Augmented_reality"&gt;Augmented Reality&lt;/a&gt; tags – called &lt;a title="http://www.artag.net/" href="http://www.artag.net/"&gt;ARTags&lt;/a&gt; (if you haven’t seen what Augmented Reality is – I do truly encourage you to see some demos on &lt;a href="http://www.youtube.com/results?search_query=augmented+reality&amp;amp;aq=f"&gt;youtube&lt;/a&gt; – possibilities of this idea are just mind bubbling). Main goal was to put ARTags on some important obstacles (like doors, near stairs etc), and make my software recognize them in real time. As signal processors are designed in terms of power efficiency my software was using library specifically written for small devices (like PDAs, smartphones etc). It is called &lt;a href="http://www.icg.tu-graz.ac.at/Members/daniel/Publications/ARToolKitPlus"&gt;ARToolkitPlus&lt;/a&gt;, and I have ported it for Analog Devices environment needs. Source codes on request. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://dkowalski.com/images/dkowalski_com/blog/WindowsLiveWriter/Autonomouspositioningsysteminaconfinedsp_142E2/artags_blindpeople_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 5px; display: inline; border-top: 0px; border-right: 0px" title="artags_blindpeople" border="0" alt="artags_blindpeople" src="http://dkowalski.com/images/dkowalski_com/blog/WindowsLiveWriter/Autonomouspositioningsysteminaconfinedsp_142E2/artags_blindpeople_thumb.png" width="634" height="225" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;My second idea wasn’t really explored before (or at least Google said so). I was thinking how do describe an image in a way that we can actually tell that in front of us is some specific shape or obstacle. My weapon of choice were &lt;a href="http://en.wikipedia.org/wiki/Visual_descriptors"&gt;Visual Descriptors&lt;/a&gt; from &lt;a href="http://en.wikipedia.org/wiki/MPEG-7"&gt;MPEG-7&lt;/a&gt; standard. I checked two - Color Layout and Edge Histogram. As first was really very tightly tied to specific location (different buildings – different colors), and prone to poor light conditions, the latter gave surprisingly quite good results. Edge Histogram can extract edge distribution in an image, it means it can actually describe shapes of some specific locations. Stairs happened to be very good subject, as their recognition level was very high. As a matter of fact they are a big threat for vision impaired people and I think universal warning system could find a real life usage. How it worked ? Well at first I made pictures of different stairs locations and “described” them using Visual Descriptors. By that we gained a set of attributes with whom we can compare live pictures gathered by camera working as a blind man eyes. Every image captured by signal processors is described using this same descriptors and then compared with database of previously tagged shapes. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://dkowalski.com/images/dkowalski_com/blog/WindowsLiveWriter/Autonomouspositioningsysteminaconfinedsp_142E2/2_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="2" border="0" alt="2" src="http://dkowalski.com/images/dkowalski_com/blog/WindowsLiveWriter/Autonomouspositioningsysteminaconfinedsp_142E2/2_thumb.jpg" width="644" height="267" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As I mentioned at the beginning of this article I would be very happy if this information can be useful to somebody, instead of laying and catching dust on my hard drive. Maybe you should share your work with world as well, who know what combined knowledge of us all can create ?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dkowalski.com/files/master_thesis_presentation_Dawid_Kowalski.pdf"&gt;Presentation about my master thesis&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dkowalski.com/files/Dawid_Kowalski_master_thesis_artags_MPEG7_descriptors.pdf"&gt;My master thesis&lt;/a&gt;&lt;/p&gt;&lt;img src="http://dkowalski.com/blog/aggbug/36.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2010/06/01/autonomous-positioning-system-in-a-confined-space-based-on-mpeg-7.aspx</guid>
            <pubDate>Mon, 31 May 2010 22:00:00 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/36.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2010/06/01/autonomous-positioning-system-in-a-confined-space-based-on-mpeg-7.aspx#feedback</comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/36.aspx</wfw:commentRss>
        </item>
        <item>
            <title>C2C Conference</title>
            <link>http://dkowalski.com/blog/archive/2010/03/16/c2c-conference.aspx</link>
            <description>&lt;p&gt;This years &lt;a href="http://www.c2c.org.pl/en/default.aspx"&gt;Communities 2 Communities&lt;/a&gt; conference is going to be held 17th of April 2010 at Warsaw. At a glance this is a Microsoft community conference, focused on Microsoft products. It’s divided into 3 paths, .NET, SQL Server and IT professionals. I’m really looking forward to see Hadi Hariri speech “Deep Dive into ASP.NET MVC” as I’m really into this subject recently. Of course there are a lot of others great speakers but for details please visit conference site. &lt;/p&gt;  &lt;p&gt;This year I was involved in it’s organization, so I think I should strongly encourage you to visit it :-)&lt;/p&gt;&lt;img src="http://dkowalski.com/blog/aggbug/35.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2010/03/16/c2c-conference.aspx</guid>
            <pubDate>Tue, 16 Mar 2010 17:51:15 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/35.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2010/03/16/c2c-conference.aspx#feedback</comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/35.aspx</wfw:commentRss>
        </item>
        <item>
            <title>ReadOnly WPF containers</title>
            <link>http://dkowalski.com/blog/archive/2010/02/04/readonly-wpf-containers.aspx</link>
            <description>&lt;p&gt;One thing has been really annoying me for a long time – when I was setting IsEnabled property on some WPF container to false all its contained controls automatically became disabled as well. Ok, that really wasn’t a source of my annoyance – it was rather expected. Really frustrating thing is that you are unable to scroll a DataGrid, to copy and paste a text from TextBox etc. One can say – but there is a ReadOnly property – and he’s going to be right, but unfortunately it’s available on only few of these controls. TextBox for instance has an IsReadOnly property and DataGrid control that I’m currently using has a ReadOnly property. &lt;/p&gt;  &lt;p&gt;After a while of googling and finding nothing I decided to do it my way. At first I thought that it will be a great idea to have an attached property on one of container controls. That control could recursively look through all its children’s and decide whether it should be set to ReadOnly or Enabled. Few whiles later I had my code ready but something wasn’t right. When I was trying to iterate through my controls collection it turned out that my container is empty ? But it wasn’t. Ok, in fact it was at that moment, apparently the visual/logical tree is empty until the Window undergoes layout at least once. Now that was a pity. I had an option to do it by utilizing OnContentRendered(EventArgs e) event method but it would rather make my code ugly, dependent and evil.&lt;/p&gt;  &lt;p&gt;Finally I decided do create some extension methods and set this property from code-behind. It’s still something that I’m not proud of, but well, it works. If someone has a better idea please don’t hesitate to write a comment or contact me.&lt;/p&gt;  &lt;p&gt;Some code:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:dc6371b7-9ea8-468b-96b5-a5d3ab1d3a44" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; ControlsExtensions
{
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; IsReadOnly(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt; GroupBox gb, &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;bool&lt;/span&gt;&lt;span style="color: #000000;"&gt; isReadOnly)
    {
        RecurseTree(gb, isReadOnly);
    }

    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; more extension methods for other containers...&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; RecurseTree(FrameworkElement control, 
                                    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;bool&lt;/span&gt;&lt;span style="color: #000000;"&gt; isReadOnly)
    {
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;foreach&lt;/span&gt;&lt;span style="color: #000000;"&gt; (var c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; LogicalTreeHelper.GetChildren(control))
        {                
            var frameworkElement &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;as&lt;/span&gt;&lt;span style="color: #000000;"&gt; FrameworkElement;
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (frameworkElement &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;) &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;continue&lt;/span&gt;&lt;span style="color: #000000;"&gt;;

            var tb &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;as&lt;/span&gt;&lt;span style="color: #000000;"&gt; TextBox;
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (tb &lt;/span&gt;&lt;span style="color: #000000;"&gt;!=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;)
            {
                tb.IsReadOnly &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; isReadOnly;
                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;continue&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
            }

            var dg &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;as&lt;/span&gt;&lt;span style="color: #000000;"&gt; SomeDataGrid;
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (dg &lt;/span&gt;&lt;span style="color: #000000;"&gt;!=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;)
            {
                dg.ReadOnly &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; isReadOnly;
                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;continue&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
            }

            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;is&lt;/span&gt;&lt;span style="color: #000000;"&gt; GroupBox &lt;/span&gt;&lt;span style="color: #000000;"&gt;||&lt;/span&gt;&lt;span style="color: #000000;"&gt; c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;is&lt;/span&gt;&lt;span style="color: #000000;"&gt; DockPanel &lt;/span&gt;&lt;span style="color: #000000;"&gt;||&lt;/span&gt;&lt;span style="color: #000000;"&gt; c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;is&lt;/span&gt;&lt;span style="color: #000000;"&gt; Grid 
                &lt;/span&gt;&lt;span style="color: #000000;"&gt;||&lt;/span&gt;&lt;span style="color: #000000;"&gt; c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;is&lt;/span&gt;&lt;span style="color: #000000;"&gt; StackPanel &lt;/span&gt;&lt;span style="color: #000000;"&gt;||&lt;/span&gt;&lt;span style="color: #000000;"&gt; c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;is&lt;/span&gt;&lt;span style="color: #000000;"&gt; TabControl)
            {
                RecurseTree(frameworkElement, isReadOnly);
            }
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;else&lt;/span&gt;&lt;span style="color: #000000;"&gt;
            {
                frameworkElement.IsEnabled &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;!&lt;/span&gt;&lt;span style="color: #000000;"&gt;isReadOnly;
            }
        }
    }
}&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;You might notice that I don’t repeat recursion for not container types – that is intentional in terms of my project, and it saves a few processor cycles.&lt;/p&gt;

&lt;p&gt;I do think that somewhere out there is a more elegant solution, if you know one please let me know.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a4ca5ed4-5bf2-410b-b757-fff6b4251d95" class="wlWriterEditableSmartContent"&gt;Technorati Tagi: &lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;&lt;/div&gt;&lt;img src="http://dkowalski.com/blog/aggbug/34.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2010/02/04/readonly-wpf-containers.aspx</guid>
            <pubDate>Thu, 04 Feb 2010 17:20:35 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/34.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2010/02/04/readonly-wpf-containers.aspx#feedback</comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/34.aspx</wfw:commentRss>
        </item>
        <item>
            <title>25th PG.NET meeting</title>
            <link>http://dkowalski.com/blog/archive/2010/01/31/pg.net-25-meeting.aspx</link>
            <description>&lt;p&gt;On 25th PG.NET meeting I’ve had presentation concerning &lt;a href="http://wiki.sharparchitecture.net/"&gt;S#arp Architecture&lt;/a&gt;. I do really like &lt;a href="http://presentationzen.blogs.com/presentationzen/2005/10/apple_special_e.html"&gt;Steve Jobs style of presentation&lt;/a&gt;. I mean, I’m far from his abilities but I just believe in two things – 1. tell a story 2. don’t put to much information on a single slide. Unfortunately there is a downside of that kind of presentation - there is really nothing to show on internet unless you are going to record it live.&lt;/p&gt;  &lt;p&gt;So &lt;a href="http://www.dkowalski.com/Files/sharpPresentationAng.pdf"&gt;here it is&lt;/a&gt;, almost no text (except the who-can-help.me slide – It was intentionally crowded to rise a question – are there too many third party frameworks and where is it going?). Oh and I’ve changed S#arp Architecture logo color (as a matter of fact I’ve inverted colors) to better match my background color :-) &lt;/p&gt;  &lt;p&gt;Notes to remember:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;while presenting your code live everything can happen, maybe it is better to record it first ? On the other hand doing real live coding is cool :-)&lt;/li&gt;    &lt;li&gt;don’t forget what your next thing to show is while you are doing live code demonstration (again – recording first ?)&lt;/li&gt;    &lt;li&gt;make more questions to audience, involve them (it works great to set their focus)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So far that’s all, I do really like being a speaker and I’m thinking already about next presentation.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8901796b-7c75-4a54-967b-c9fa921e11ab" class="wlWriterEditableSmartContent"&gt;Technorati Tagi: &lt;a href="http://technorati.com/tags/S%23arp+Architecture" rel="tag"&gt;S#arp Architecture&lt;/a&gt;,&lt;a href="http://technorati.com/tags/speaking" rel="tag"&gt;speaking&lt;/a&gt;&lt;/div&gt;&lt;img src="http://dkowalski.com/blog/aggbug/33.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2010/01/31/pg.net-25-meeting.aspx</guid>
            <pubDate>Sun, 31 Jan 2010 17:11:37 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/33.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2010/01/31/pg.net-25-meeting.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/33.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to create a successful product</title>
            <link>http://dkowalski.com/blog/archive/2010/01/06/how-to-create-a-successful-product.aspx</link>
            <description>&lt;p&gt;Well it turns out that’s not so hard, Leon Bambrick @ &lt;a href="http://www.secretgeek.net"&gt;secretgeek.net&lt;/a&gt; came out with a great idea! Just check it out, it’s worth it - &lt;a href="http://www.secretgeek.net/cco.asp"&gt;The Ultimate Agent of WERF Destruction&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;It took me a while to recover after that shocking idea :-) (back to normal = to get up from the floor)&lt;/p&gt;&lt;img src="http://dkowalski.com/blog/aggbug/32.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2010/01/06/how-to-create-a-successful-product.aspx</guid>
            <pubDate>Wed, 06 Jan 2010 22:21:55 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/32.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2010/01/06/how-to-create-a-successful-product.aspx#feedback</comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/32.aspx</wfw:commentRss>
        </item>
        <item>
            <title>User interface design dilemmas</title>
            <link>http://dkowalski.com/blog/archive/2010/01/06/user-interface-design-dilemmas.aspx</link>
            <description>&lt;p&gt;We all struggle when it comes to user interface design. There is a tendency that brilliant ideas when compared with gray matter dissolve into &lt;a href="http://stuffthathappens.com/blog/2008/03/05/simplicity/"&gt;something like this&lt;/a&gt;. I bet that you all seen (done) something similar. Well, let’s face the truth, unless you are making another search engine, FPP shooter or tic-tac-toe game you are probably building another enterprise app, and they are called enterprise because they tend to swallow a lot of data (over generalization was intended ;-). And yes, that data should be entered in them somehow, usually by human beings sitting in front of a computer. So we don’t have an option to run away from creating TextBoxes, ComboBoxes, Grids etc. &lt;/p&gt;  &lt;p&gt;I have to admit that recently I was lost in pursuit of perfect input form design. In order to reduce overwhelming amount of user controls I decided to leverage some features of data grids. My reasoning was quite simple – if I need to show data in a grid, maybe I can enter it using the same control. To straight things up here, I’m writing ERP-like system that is using WPF as a view layer. I’m using 3rd party data grid control that is really powerful, so I had all the means. Anyway, at first it seemed like a great idea, but after a while whole lot of challenges appeared. First, if you don’t have a source code to really complex control, and you want use something extraordinary sooner or later you will run into problems. Even with XAML great templating capabilities. Other issues showed up when the number of fields to display arose – it made scrolling and grouping really useless. Eventually I gave up and decided that grids are great for displaying concise pieces of data. Lesson learned. &lt;/p&gt;  &lt;p&gt;If you are new to WPF and want to see it’s power I suggest to see this &lt;a href="http://www.dnrtv.com/default.aspx?showNum=115"&gt;dnrTv video&lt;/a&gt;. It shows how boring forms can become something like an art yet having a lot more of usability and productivity. It’s a lot more than fancy flash sites, where everything is pretty, but damn hard to use.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:dfc925b0-57de-4d18-ac53-960e3de37905" class="wlWriterEditableSmartContent"&gt;Technorati Tagi: &lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;,&lt;a href="http://technorati.com/tags/user+interface" rel="tag"&gt;user interface&lt;/a&gt;&lt;/div&gt;&lt;img src="http://dkowalski.com/blog/aggbug/31.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2010/01/06/user-interface-design-dilemmas.aspx</guid>
            <pubDate>Wed, 06 Jan 2010 20:59:28 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/31.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2010/01/06/user-interface-design-dilemmas.aspx#feedback</comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/31.aspx</wfw:commentRss>
        </item>
        <item>
            <title>New S#arp Architecture demo - &amp;ldquo;Who can help me&amp;rdquo;</title>
            <link>http://dkowalski.com/blog/archive/2009/12/27/new-sarp-architecture-demo-ldquowho-can-help-merdquo.aspx</link>
            <description>&lt;p&gt;Recently I got very interested in a &lt;a href="http://www.sharparchitecture.net/" target="_blank"&gt;S#arp Architecture&lt;/a&gt; - ASP.NET MVC &amp;amp; nHibernate based architectural foundation. In fact my prolonged &lt;a href="http://100feetunder.com/" target="_blank"&gt;100FeetUnder&lt;/a&gt; project is going to use it. For all you who want to create a new ASP.NET MVC project I strongly suggest to consider S#arp option, it looks very promising and it is truly a time saver (of course at first there is a quite steep learning curve, but well, nothing is for free (except the beer ?)). &lt;/p&gt;  &lt;p&gt;One example of S#arp based commercial app is &lt;a title="http://www.fancydressoutfitters.co.uk/" href="http://www.fancydressoutfitters.co.uk/"&gt;FancyDressOutfitters&lt;/a&gt; and just a few days ago team that created this site decide to contribute and created a new demo project called &lt;a href="http://who-can-help.me"&gt;Who can help me&lt;/a&gt;. This project is currently hosted at CodePlex &lt;a href="http://whocanhelpme.codeplex.com/"&gt;here&lt;/a&gt; and if you got really interested &lt;a href="http://groups.google.com/group/sharp-architecture/browse_thread/thread/aa800fd9f77775b4"&gt;here is&lt;/a&gt; a S#arp Architecture google group post about it.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:32b38b97-befb-4845-b44b-87602e6eafd9" class="wlWriterEditableSmartContent"&gt;Technorati Tagi: &lt;a href="http://technorati.com/tags/S%23arp+Architecture" rel="tag"&gt;S#arp Architecture&lt;/a&gt;,&lt;a href="http://technorati.com/tags/100FeetUnder" rel="tag"&gt;100FeetUnder&lt;/a&gt;&lt;/div&gt;&lt;img src="http://dkowalski.com/blog/aggbug/30.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2009/12/27/new-sarp-architecture-demo-ldquowho-can-help-merdquo.aspx</guid>
            <pubDate>Sun, 27 Dec 2009 10:58:14 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/30.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2009/12/27/new-sarp-architecture-demo-ldquowho-can-help-merdquo.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/30.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to get event handlers list using reflection</title>
            <link>http://dkowalski.com/blog/archive/2009/12/22/how-to-get-event-handlers-list-using-reflection.aspx</link>
            <description>&lt;p&gt;There are times when you have to do something fairly simple that turns out to be quite complicated. Maybe you have to reflect on your code and pull something out - sounds easy. Getting a list of methods or attributes attached to property is straightforward and easy to wrap your mind around. Things can get a little bit more complicated while using reflections to manipulate events. You can easily get their list (type.GetEvents()), add another handler (EventInfo.AddEventHandler()) or remove a handler (EventInfo.RemoveEventHandler()). To get a list of attached delegates you have to do something more.&lt;/p&gt;  &lt;p&gt;Our event is more like a syntactic sugar, and under hood is a little bit more complex (more about it you can find on &lt;a href="http://www.yoda.arachsys.com/csharp/events.html" target="_blank"&gt;this page&lt;/a&gt; in a chapter &lt;strong&gt;“A shortcut: field-like events”&lt;/strong&gt;). In my example I’m looking for all events in an particular class and for each of them I’m adding a simple delegate, but only if this event is empty (has no handlers). &lt;/p&gt;  &lt;p&gt;   &lt;/p&gt;&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ace15518-fc11-49f0-925b-86a068a66e34" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#E4E4E4;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"&gt;&lt;span style="color: #000000;"&gt;TestEventClass instance &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; TestEventClass();
&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;foreach&lt;/span&gt;&lt;span style="color: #000000;"&gt; (var e &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;typeof&lt;/span&gt;&lt;span style="color: #000000;"&gt;(TestEventClass).GetEvents())
{
    FieldInfo fi &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; instance.GetType().GetField(e.Name, BindingFlags.NonPublic &lt;/span&gt;&lt;span style="color: #000000;"&gt;|&lt;/span&gt;&lt;span style="color: #000000;"&gt; BindingFlags.Instance);
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;object&lt;/span&gt;&lt;span style="color: #000000;"&gt; value &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; fi.GetValue(instance);
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (value &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;)
    {
        e.AddEventHandler(instance, (TestDelegate)(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;delegate&lt;/span&gt;&lt;span style="color: #000000;"&gt;() {DoSmthg();}));
    }
}&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;


&lt;p&gt;First step is to look for all events in a class. After that we need to get instance field with a name of particular event (notice that this field is private). Then we just need to take a value of it – it’s our System.MulticastDelegate. This class has a GetInvocationList() method that is returning a Delegate[] array.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d0b5c0d9-6e7f-4165-abb6-0d07f491c0ad" class="wlWriterEditableSmartContent"&gt;Technorati Tagi: &lt;a href="http://technorati.com/tags/C%23" rel="tag"&gt;C#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/reflections" rel="tag"&gt;reflections&lt;/a&gt;&lt;/div&gt;&lt;img src="http://dkowalski.com/blog/aggbug/29.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2009/12/22/how-to-get-event-handlers-list-using-reflection.aspx</guid>
            <pubDate>Tue, 22 Dec 2009 22:08:55 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/29.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2009/12/22/how-to-get-event-handlers-list-using-reflection.aspx#feedback</comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/29.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Sometimes it&amp;rsquo;s all about persistence</title>
            <link>http://dkowalski.com/blog/archive/2009/11/28/sometimes-itrsquos-about-persistence.aspx</link>
            <description>&lt;p&gt;And I don’t mean data persistence here. More than two years ago I was a member of Imagine Cup team. We were competing in an embedded category, and our subject was IdeoGraph (&lt;a href="http://www.dkowalski.com/Files/IdeoGraph-PUT.pdf"&gt;IdeoGraph Imagine Cup report&lt;/a&gt;).  Main part of this system was an IdeoPen, 3D pointing device that was a size of and looked like a real pen. It’s main part were 3 3-axis accelerometers so we were able to collect any data consisting it’s location in 3D space. The idea was great, possibilities were infinite, “sky was a limit”. We made it to the Polish finals, and well, that was all. We were thinking about making it a more mature product, but an overwhelming amount of mundane things took all of our free time and in the end IdeoGraph was forgotten. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://dkowalski.com/images/dkowalski_com/blog/WindowsLiveWriter/Sometimesitsaboutpersistence_B727/ideograph_2.png"&gt;&lt;img title="ideograph" 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="70" alt="ideograph" src="http://dkowalski.com/images/dkowalski_com/blog/WindowsLiveWriter/Sometimesitsaboutpersistence_B727/ideograph_thumb.png" width="209" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then about two years later Sony has shown their new controller. And yes, it’s basically the same idea, I think that even the same technology, but their product was finished, polished and was shown to public. Who knows what would have happened if we were more persistent ? I guess that lesson was learned.&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:ce41d410-66e1-42ce-b97f-48be89e0c150" style="padding-right: 0px; display: block; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px auto; width: 425px; padding-top: 0px"&gt;&lt;div id="f6ddeeaa-6599-413d-b3ad-0624ca34f533" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=qiX-26VL4bM&amp;amp;feature=player_embedded" target="_new"&gt;&lt;img src="http://dkowalski.com/images/dkowalski_com/blog/WindowsLiveWriter/Sometimesitsaboutpersistence_B727/video1089e0d1093f.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('f6ddeeaa-6599-413d-b3ad-0624ca34f533'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/qiX-26VL4bM&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/qiX-26VL4bM&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;   &lt;/p&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d390f1f4-3ee4-476c-9f7b-e4e6a5dec390" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Tags: &lt;a href="http://technorati.com/tags/ImagineCup" rel="tag"&gt;ImagineCup&lt;/a&gt;,&lt;a href="http://technorati.com/tags/projects" rel="tag"&gt;projects&lt;/a&gt;&lt;/div&gt;&lt;img src="http://dkowalski.com/blog/aggbug/28.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2009/11/28/sometimes-itrsquos-about-persistence.aspx</guid>
            <pubDate>Sat, 28 Nov 2009 12:23:10 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/28.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2009/11/28/sometimes-itrsquos-about-persistence.aspx#feedback</comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/28.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Unsupported overload used for query operator 'Distinct'</title>
            <link>http://dkowalski.com/blog/archive/2009/11/27/unsupported-overload-used-for-query-operator-distinct.aspx</link>
            <description>&lt;p&gt;When using custom Distinct operator on SQL data source you are going to see “Unsupported overload used for query operator 'Distinct'” exception. Basically it’s because Linq to SQL doesn’t support custom operators. One way to overcome this problem is forcing immediate query evaluation by using for example ToList() method.&lt;/p&gt;  &lt;p&gt;Ex. before:&lt;/p&gt;  &lt;p /&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:66c9afc0-abfc-4f19-9f3f-130923697d3a" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:#E4E4E4;overflow: auto;"&gt;&lt;span style="color: #000000;"&gt;db.SomeTable.Distinct(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomComparer())&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;After:&lt;/p&gt;

&lt;p /&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:d366c680-8b6a-43cc-a335-359806bd963b" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:#E2E2E2;overflow: auto;"&gt;&lt;span style="color: #000000;"&gt;db.SomeTable.ToList().Distinct(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomComparer())&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;img src="http://dkowalski.com/blog/aggbug/27.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dawid Kowalski</dc:creator>
            <guid>http://dkowalski.com/blog/archive/2009/11/27/unsupported-overload-used-for-query-operator-distinct.aspx</guid>
            <pubDate>Fri, 27 Nov 2009 19:25:00 GMT</pubDate>
            <wfw:comment>http://dkowalski.com/blog/comments/27.aspx</wfw:comment>
            <comments>http://dkowalski.com/blog/archive/2009/11/27/unsupported-overload-used-for-query-operator-distinct.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://dkowalski.com/blog/comments/commentRss/27.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>