<?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>House of Metnetsky &#187; silverlight</title>
	<atom:link href="http://cowarthill.com/blog/index.php/tag/silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://cowarthill.com/blog</link>
	<description>Run Tortoise Run</description>
	<lastBuildDate>Fri, 26 Feb 2010 17:15:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Filtering File Selectors</title>
		<link>http://cowarthill.com/blog/index.php/2009/01/17/filtering-file-selectors/</link>
		<comments>http://cowarthill.com/blog/index.php/2009/01/17/filtering-file-selectors/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 17:54:27 +0000</pubDate>
		<dc:creator>MET</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://cowarthill.com/blog/?p=16</guid>
		<description><![CDATA[Why is it that almost every language/framework offers totally different, and yet similar, solutions for filtering in/out files from selection menus? .NET In the example there are two types of selectors: text files (.txt); all files (*.*). Labels (Text files) are separated from their filter values (*.txt) by the pipe character and each filter type [...]]]></description>
			<content:encoded><![CDATA[<p>Why is it that almost every language/framework offers totally different, and yet similar, solutions for filtering in/out files from selection menus?</p>
<hr />
<h3>.NET</h3>
<pre class="brush: csharp; title: ; notranslate">OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = &quot;Text files (*.txt)|*.txt|All files (*.*)|*.*&quot;</pre>
<p>In the example there are two types of selectors: text files (.txt); all files (*.*). Labels (Text files) are separated from their filter values (*.txt) by the pipe character and each filter type is separated by&#8230; a pipe too! It looks weird, but considering it&#8217;s based off old-school Windows API I can understand and sort of respect their desire to not change. MFC sucks and using weird DSLs instead of creating more objects can have it&#8217;s <em>benefits</em>.</p>
<hr />
<h3>Flash</h3>
<pre class="brush: jscript; title: ; notranslate">var filters:Array = new Array();
filters.push(new FileFilter('Text Files', '*.txt'));
filters.push(new FileFilter('Rich Text', '*.rtf'));

var file:flash.net.FileReference = new FileReference();
file.browse(filters);</pre>
<p>FileFilter is constructed with the rules like so: FileFilter(&#8216;Text Files&#8217;, &#8216;*.txt&#8217;). You can either specify multiple FileFilters or append multiple rulsets to the same label like so: FileFilter(&#8216;Text files&#8217;, &#8216;*.txt;*.txt2&#8242;). Truly a cleaner interface than .NET&#8217;s, but many could argue it&#8217;s Object over kill (AWT/SWING is probably worse).</p>
<hr />
<h3>Gtk+</h3>
<pre class="brush: cpp; title: ; notranslate">GtkFileFilter *file_filter = gtk_file_filter_new();
gtk_file_filter_set_name(file_filter, &quot;Log Files (*.bab)&quot;);
gtk_file_filter_add_pattern(file_filter, &quot;*.bab&quot;);</pre>
<p>Even though Gtk+ is in C, it has a nice interface (which many languages like Flash could be accused of robbing). The name is different than the pattern, and there aren&#8217;t ugly crazy separators like in .NET/MFC.</p>
<hr />
<h3>Swing</h3>
<pre class="brush: java; title: ; notranslate">ExampleFileFilter filter = new ExampleFileFilter();
filter.addExtension(&quot;jpg&quot;);
filter.addExtension(&quot;gif&quot;);
filter.setDescription(&quot;JPG &amp;amp;amp;amp; GIF Images&quot;);

JFileChooser dialog = new JFileChooser();
dialog.setFileFilter(filter);</pre>
<p>This isn&#8217;t too bad until you realize that <a title="ExampleFileFilter" href="http://kickjava.com/src/demo/swingset/ExampleFileFilter.java.htm" target="_blank">ExampleFileFilter</a> is a custom class which extends abstract <a title="FileFilter" href="http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/filechooser/FileFilter.html" target="_blank">FileFilter</a>. Yes there are other ways, but boy is this annoying!</p>
<hr />
<h3>Python (Gtk+)</h3>
<pre class="brush: python; title: ; notranslate">
        dialog = gtk.FileChooserDialog(title=&quot;Select the World&quot;
                            , action=gtk.FILE_CHOOSER_ACTION_OPEN
                            , buttons=(gtk.STOCK_CANCEL
                                                    , gtk.RESPONSE_CANCEL
                                                    , gtk.STOCK_OPEN
                                                    , gtk.RESPONSE_OK))
        filter = gtk.FileFilter()
        filter.set_name(&quot;All files&quot;)
        filter.add_pattern(&quot;*&quot;)
        dialog.add_filter(filter)
</pre>
<p>Just like Gtk+ but with the Python-esk feel.</p>
<hr />
<h3>Conclusion</h3>
<p>I must be stating the obvious: Framework developers hate programmers.</p>
]]></content:encoded>
			<wfw:commentRss>http://cowarthill.com/blog/index.php/2009/01/17/filtering-file-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE7, IE8 Beta2&#8230; meet &lt;object/&gt;</title>
		<link>http://cowarthill.com/blog/index.php/2008/11/25/ie7-ie8-beta2-meet-object/</link>
		<comments>http://cowarthill.com/blog/index.php/2008/11/25/ie7-ie8-beta2-meet-object/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 01:26:57 +0000</pubDate>
		<dc:creator>MET</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://cowarthill.com/blog/?p=27</guid>
		<description><![CDATA[Why is it that IE7 and IE8 Beta 2 still can&#8217;t quit get the &#60;object/&#62; tag correct? When using Javascript to &#8220;dynamically&#8221; add object tags to the interface my experience, bad luck, and bouts of pain teach me that using the DOM API just doesn&#8217;t cut it. Well, to be fair the following functions don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Why is it that IE7 and IE8 Beta 2 still can&#8217;t quit get the &lt;object/&gt; tag correct? When using Javascript to &#8220;dynamically&#8221; add object tags to the interface my experience, bad luck, and bouts of pain teach me that using the DOM API just doesn&#8217;t cut it. Well, to be fair the following functions don&#8217;t cut it:</p>
<ul>
<li>document.createElement</li>
<li>document.createAttribute</li>
<li>[DOMElement].setAttribute(key, value)</li>
<li>[DOMElement].setAttributeNode([DOMAttribute])</li>
</ul>
<p>For any and all other &#8220;dynamic&#8221; HTML modifications the above functions work great! But if I use them to embed Flash or Silverlight movies it just tanks. Instead you have to construct ugly strings that represent the HTML you want and use [DOMElement].innerHTML. When you do this, suddenly the .swf/.xap loads and all is well.</p>
<p>Why oh why?</p>
<p>And for anyone who cares, following file does a decent job of HTML generation within Javascript&#8230; except for IE and the &lt;object/&gt; tag&#8230;. and input of type radio (WTF!).</p>
<p><a href="http://cowarthill.com/blog/wp-content/uploads/2008/11/html_obj.js">http://cowarthill.com/blog/wp-content/uploads/2008/11/html_obj.js</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cowarthill.com/blog/index.php/2008/11/25/ie7-ie8-beta2-meet-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight vs. Flash</title>
		<link>http://cowarthill.com/blog/index.php/2008/11/24/silverlight-vs-flash/</link>
		<comments>http://cowarthill.com/blog/index.php/2008/11/24/silverlight-vs-flash/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 00:03:15 +0000</pubDate>
		<dc:creator>MET</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[kmbs]]></category>
		<category><![CDATA[printgroove]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://cowarthill.com/blog/?p=3</guid>
		<description><![CDATA[I&#8217;ve been a long time hater of Flash as a web-service consumer because of its inability to use any HTTP method other than GET or POST. People revert to stupid URL argument tricks like ?_method=DELETE and actually use a GET or POST, neither of which work if your service layer is actually &#8230; truly &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a long time hater of Flash as a web-service consumer because of its inability to use any HTTP method other than GET or POST. People revert to stupid URL argument tricks like ?_method=DELETE and actually use a GET or POST, neither of which work if your service layer is actually &#8230; truly &#8230; RESTful.</p>
<p>Silverlight has the same damn issue. Apparently none of the blog posts I read a WHILE back (2+ yrs) mentioned the fact that Flash, and now Silverlight, use the lowest common denominator for their web request classes&#8230;. NPAPI (Gecko/Mozilla Plugin SDK). I&#8217;m sure there are good reasons for using the embedded ones, security, re-usability, performance too &#8211; but it&#8217;s rather annoying!</p>
<p>Why the NPAPI developers don&#8217;t augment the API, I have no idea. But at least Silverlight allows for a HTML event to trigger the OpenFileDialog.ShowDialog() without having to do fun invisible overlays.</p>
<p>Silverlight:<br />
<a class="moz-txt-link-freeext" href="http://wilcob.com/Wilco/Silverlight/http-requests-in-silverlight.aspx">http://wilcob.com/Wilco/Silverlight/http-requests-in-silverlight.aspx</a></p>
<p>Flash:<a class="moz-txt-link-freetext" href="http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_02.html#head34"></p>
<p>http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_02.html#head34</p>
<p></a><a class="moz-txt-link-freetext" href="http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html">http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html<br />
</a><a class="moz-txt-link-freetext" href="http://theflashblog.com/?p=423">http://theflashblog.com/?p=423</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cowarthill.com/blog/index.php/2008/11/24/silverlight-vs-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

