<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>George Birbilis @zoomicon</title>
	<atom:link href="http://zoomicon.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zoomicon.wordpress.com</link>
	<description>Computer Engineer, Microsoft MVP J# - R&#38;D 2004-2010, Borland Spirit of Delphi 2001</description>
	<lastBuildDate>Sat, 18 May 2013 03:38:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='zoomicon.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/417c78ce535a030b2b5eadb9f05ec746?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>George Birbilis @zoomicon</title>
		<link>http://zoomicon.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://zoomicon.wordpress.com/osd.xml" title="George Birbilis @zoomicon" />
	<atom:link rel='hub' href='http://zoomicon.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Vita: &#949;&#957;&#949;&#961;&#947;&#949;&#953;&#945;&#954;ά &#946;&#961;&#945;&#967;&#953;&#959;&#955;ά&#954;&#953;&#945; &#954;&#945;&#953; &#967;ά&#957;&#964;&#961;&#949;&#962; &#947;&#953;&#945; &#964;&#959;&#965;&#962; &#953;&#952;&#945;&#947;&#949;&#957;&#949;ί&#962;</title>
		<link>http://zoomicon.wordpress.com/2013/04/14/vita-%ce%ac-%ce%ac-%ce%acepsi/</link>
		<comments>http://zoomicon.wordpress.com/2013/04/14/vita-%ce%ac-%ce%ac-%ce%acepsi/#comments</comments>
		<pubDate>Sun, 14 Apr 2013 19:20:35 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Βραχιολάκια]]></category>
		<category><![CDATA[Γενική Γραμματεία]]></category>
		<category><![CDATA[Καταναλωτής]]></category>
		<category><![CDATA[Παραπλάνηση]]></category>
		<category><![CDATA[Πολίτης]]></category>
		<category><![CDATA[Vita]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1211</guid>
		<description><![CDATA[Πρόσφατα η Γενική Γραμματεία Καταναλωτή (http://www.efpolis.gr) είχε καταδικάσει τις εταιρείες με τα ενεργειακά (τάχα μου) βραχιολάκια όπως διαβάζει κανείς στο παρακάτω: http://www.ethnos.gr/article.asp?catid=22768&#38;subid=2&#38;pubid=63733163 Πρόστιμα συνολικού ύψους 350.000 ευρώ σε πέντε εταιρείες για προώθηση και διάθεση προς πώληση ενεργειακών βραχιολιών με αναληθείς ισχυρισμούς, επέβαλε η Γενική Γραμματεία Καταναλωτή. Πρόκειται για βραχιόλια με διάφορες εμπορικές επωνυμίες (Power Balance, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1211&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Πρόσφατα η Γενική Γραμματεία Καταναλωτή (<a href="http://www.efpolis.gr">http://www.efpolis.gr</a>) είχε καταδικάσει τις εταιρείες με τα ενεργειακά (τάχα μου) βραχιολάκια όπως διαβάζει κανείς στο παρακάτω:</p>
<p><a title="http://www.ethnos.gr/article.asp?catid=22768&amp;subid=2&amp;pubid=63733163" href="http://www.ethnos.gr/article.asp?catid=22768&amp;subid=2&amp;pubid=63733163">http://www.ethnos.gr/article.asp?catid=22768&amp;subid=2&amp;pubid=63733163</a></p>
<blockquote><h4>
<p>Πρόστιμα συνολικού ύψους 350.000 ευρώ σε πέντε εταιρείες για προώθηση και διάθεση προς πώληση ενεργειακών βραχιολιών με αναληθείς ισχυρισμούς, επέβαλε η Γενική Γραμματεία Καταναλωτή.</p>
</h4>
<p>Πρόκειται για βραχιόλια με διάφορες εμπορικές επωνυμίες (Power Balance, Bios Balance, Trymax, ENERGY BALANCE PERFORMANCE TECHNOLOGY, SB Super Balance κ.λπ.), τα οποία, σύμφωνα με τους ισχυρισμούς των εταιρειών, είναι προϊόντα ειδικής τεχνολογίας που χαρίζουν ισορροπία, ενέργεια, δύναμη, βοηθούν στην υγεία, αθλητικά προϊόντα τεχνολογίας για καλύτερες επιδόσεις, βελτιώνουν την ισορροπία, τη δύναμη και την ευελιξία του σώματος και βοηθούν στην καθημερινή, καλύτερη λειτουργία και απόδοση του οργανισμού του ανθρώπου.</p>
<p>Οι ισχυρισμοί αυτοί κρίθηκαν αναληθείς, επειδή οι εταιρείες δεν προσκόμισαν αποδεικτικά στοιχεία για την επαρκή επιστημονική τεκμηρίωσή τους. Επιπλέον, δεν διέθεταν αποδεικτικά στοιχεία βασισμένα σε μελέτες, σχετικά με βελτίωση των αθλητικών επιδόσεων από τη χρήση των προϊόντων αυτών.</p>
<p>Παραπλανητική, επίσης, κρίθηκε και η προώθηση ορισμένων από τα προϊόντα αυτά, σε περιοδικά και στις σχετικές ιστοσελίδες ηλεκτρονικών καταστημάτων πώλησής τους, μέσω δηλώσεων γνωστών αθλητών, που παροτρύνουν τους καταναλωτές να αγοράσουν προϊόντα, τα οφέλη των οποίων στερούνται επιστημονικής τεκμηρίωσης.</p>
<p>Η Γενική Γραμματεία Καταναλωτή, επίσης, απέστειλε επιστολή στον Πανελλήνιο Φαρμακευτικό Σύλλογο, προκειμένου να ενημερωθούν τα φαρμακεία όλης της χώρας για τα συγκεκριμένα προϊόντα και να προχωρήσουν άμεσα στην απομάκρυνση του προωθητικού υλικού με τους παραπλανητικούς ισχυρισμούς.</p>
</blockquote>
<p>&#160;</p>
<p>Όμως φαίνεται μας θεωρούν ιθαγενείς αυτοί οι απατεώνες και έχουν συνηθίσει το κράτος να είναι ανύπαρκτο. Βλέπετε τι να τους κάνουν τα πρόστιμα όταν αυτοί έχουν θησαυρίσει εν τω μεταξύ; (έφταιγε μετά ο Κατής στη γνωστή τηλεοπτική σειρά Σουλεϊμάν ο Μεγαλοπρεπής που κάρφωνε από τ’αυτιά στη θύρα τους όσους εμπόρους εξαπατούσαν τους πελάτες τους;)</p>
<p>Θαυμάστε διαφήμιση λοιπόν της bios balance στο τεύχος Απριλίου του Vita, όπου έδινε και βραχιολάκι της μαζί. Οπότε ένα γερό πρόστιμο αξίζει και στο Vita που προσπάθησε να πουλήσει περισσότερα αντίτυπα προωθώντας αυτό το &quot;προϊόν&quot; και βγάζοντας χρήματα και από τη διαφήμιση του ενώ θα έπρεπε να γνωρίζει το ιστορικό (πιθανώς επειδή ακριβώς το γνώριζε να πήρε και κάτι παραπάνω για να βάλει τη διαφήμιση εξαπατώντας τους αναγνώστες του που απευθύνονται σε αυτό για υγεινή διατροφή κλπ.). Ακριβώς δηλαδή όπως εξαπατούσαν και τα αφαρμακεία τους πελάτες τους (μέχρι και επίδειξη τους έκαναν με το πείραμα-απάτη για να σε πείσουν πως ισορροπείς καλύτερα) και οι φαρμακευτικοί σύλλογοι που είχαν τέτοιες διαφημίσεις στα περιοδικά τους (δεν είναι τυχαίο που η ΓΓ Καταναλωτή είχε ζητήσει να φύγουν τα βραχιολάκια από τα φαρμακεία).</p>
<p>Και τι άλλο μας λέει η διαφήμιση στο κάτω μέρος; “<em>Ζητήστε από το φαρμακοποιό σας να σας κάνει τα test Bios Balance</em>”. Σαν να μην πέρασε μια μέρα δηλαδή! Για ποιά test μιλούν; Πήγαινες στο φαρμακείο και ο φαρμακοποιός που προφανώς έπαιρνε καλή προμήθεια αφού σου έλεγε πως και ο τότε πρωθυπουργός ο Γ. Παπαδρέου φόραγε φραχιολάκι όταν έτρεχε (επιφυλάσομαι αν ήταν κάποιο “ενεργειακό”) σου έλεγε να κλείσεις τα μάτια και ν’ανοίξεις τα χέρια. Σου πίεζε το ένα χέρι κάτω και φυσικά εμφάνιζες αστάθεια. Μετά σου έβαζε το βραχιολάκια και ξανακάνατε το πείραμα. Γιατί άραγε δεν έκανε πρώτα τη δοκιμή με το βραχιολάκι και μετά να το βγάλεις; Γιατί φυσικά τη 2η φορά ήξερες τι θα κάνει και αφού ήσουν προετοιμασμένος δεν εμφάνιζες αστάθεια και αν ήσουν αδαής πειθώσουν που σε βοήθησε το βραχιολάκι με το μοναδικό “<em>ενεργειακό ολόγραμμα που έχει διαμορφωθεί σύμφωνα με συχνότητες που λειτουργούν σε αρμονία με το φυσικό ενεργειακό πεδίο του σώματος</em>” (όπως γράφει η παρακάτω διαφήμιση) και κουραφέξαλα (για όσους δεν ξέρουν τον <a href="http://en.wikipedia.org/wiki/Holography" target="_blank">ορισμό του ολογραμματος</a>).</p>
<p><a href="http://zoomicon.files.wordpress.com/2013/04/biosbalancevita1.jpg"><img title="BiosBalanceVita1" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="BiosBalanceVita1" src="http://zoomicon.files.wordpress.com/2013/04/biosbalancevita1_thumb.jpg?w=600&#038;h=799" width="600" height="799" /></a></p>
<p>Μάλιστα βλέπουμε και τη κυρία Πηγή Δεβεντζή να φιγουράρει εκεί προωθώντας προϊόν που ως αθλήτρια θα έπρεπε να γνωρίζει πως είναι απάτη (και δεν είναι η πρώτη φορά που το κάνει αφού και παλαιότερα – πριν τα πρόστιμα από τη ΓΓ Καταναλωτή &#8211; ήταν στις διαφημίσεις της bios balance στο περιοδικό μεγάλου φαρμακευτικού συλλόγου). </p>
<p>Αλλά απορώ πως εμφανίζεται ακόμη η κυρία Δεβεντζή με τις δάφνες της Ολυμπιονίκη ως υπόδειγμα αθλήτριας όταν στο <a title="http://www.skai.gr/news/sports/article/165344/dietis-apokleismos-gia-tin-pigi-devetzi/" href="http://www.skai.gr/news/sports/article/165344/dietis-apokleismos-gia-tin-pigi-devetzi/">http://www.skai.gr/news/sports/article/165344/dietis-apokleismos-gia-tin-pigi-devetzi/</a> διαβάζουμε:</p>
<blockquote><p>ο ΣΕΓΑΣ ενημερώθηκε από τη διεθνή ομοσπονδία στίβου πως η πρωταθλήτρια του τριπλούν τιμωρείται με διετή ποινή αποκλεισμού.      <br />Το παράπτωμα που βαρύνει την Δεβετζή- το όνομά της είναι ήδη στη λίστα των τιμωρημένων αθλητών στην ιστοσελίδα της IAAF- είναι της «αποτυχίας να δώσει δείγμα» σε αιφνίδιο έλεγχο που έγινε στις 23 Μαϊου του 2009 στην Γιάλτα. Ηταν η εποχή που η άλτρια συνεργαζόταν με έναν προπονητή στην Ουκρανία. </p>
</blockquote>
<p>&#160;</p>
<p><a href="http://zoomicon.files.wordpress.com/2013/04/biosbalancevita2.jpg"><img title="BiosBalanceVita2" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="BiosBalanceVita2" src="http://zoomicon.files.wordpress.com/2013/04/biosbalancevita2_thumb.jpg?w=566&#038;h=753" width="566" height="753" /></a></p>
<p>Πότε θα τους μαζέψουν όλους αυτούς τους κυρίους και τα σκουπίδια τους; Η σχετική ευρωπαϊκή οδηγία υπάρχει από χρόνια:</p>
<blockquote><p>Η οδηγία2005/29/EΚ για τις αθέμιτες εμπορικές πρακτικές, που εγκρίθηκε το 2005, προβλέπει εναρμονισμένους κανόνες για την αντιμετώπιση των αθέμιτων εμπορικών πρακτικών. Εξασφαλίζει ότι οι καταναλωτές δεν παραπλανούνται ούτε εκτίθενται σε επιθετικές μεθόδους μάρκετινγκ και ότι οποιοσδήποτε ισχυρισμός από πλευράς των εμπορευόμενων στην Ευρωπαϊκή Ένωση είναι σαφής, ακριβής και αιτιολογημένη, παρέχοντας τη δυνατότητα στους καταναλωτές να προβαίνουν σε ενημερωμένες και εύλογες επιλογές. Η οδηγία στοχεύει επίσης να εξασφαλίσει, να προωθήσει και να προστατεύσει τον θεμιτό ανταγωνισμό στον τομέα των εμπορικών πρακτικών. Έχει ευρύ πεδίο εφαρμογής και ισχύει σε όλους τους οικονομικούς τομείς.</p>
</blockquote>
<p><a href="http://europa.eu/rapid/press-release_IP-13-227_el.htm" target="_blank">http://europa.eu/rapid/press-release_IP-13-227_el.htm</a></p>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/%ce%b2%cf%81%ce%b1%cf%87%ce%b9%ce%bf%ce%bb%ce%ac%ce%ba%ce%b9%ce%b1/'>Βραχιολάκια</a>, <a href='http://zoomicon.wordpress.com/tag/%ce%b3%ce%b5%ce%bd%ce%b9%ce%ba%ce%ae-%ce%b3%cf%81%ce%b1%ce%bc%ce%bc%ce%b1%cf%84%ce%b5%ce%af%ce%b1/'>Γενική Γραμματεία</a>, <a href='http://zoomicon.wordpress.com/tag/%ce%ba%ce%b1%cf%84%ce%b1%ce%bd%ce%b1%ce%bb%cf%89%cf%84%ce%ae%cf%82/'>Καταναλωτής</a>, <a href='http://zoomicon.wordpress.com/tag/%cf%80%ce%b1%cf%81%ce%b1%cf%80%ce%bb%ce%ac%ce%bd%ce%b7%cf%83%ce%b7/'>Παραπλάνηση</a>, <a href='http://zoomicon.wordpress.com/tag/%cf%80%ce%bf%ce%bb%ce%af%cf%84%ce%b7%cf%82/'>Πολίτης</a>, <a href='http://zoomicon.wordpress.com/tag/vita/'>Vita</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1211&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2013/04/14/vita-%ce%ac-%ce%ac-%ce%acepsi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>

		<media:content url="http://zoomicon.files.wordpress.com/2013/04/biosbalancevita1_thumb.jpg" medium="image">
			<media:title type="html">BiosBalanceVita1</media:title>
		</media:content>

		<media:content url="http://zoomicon.files.wordpress.com/2013/04/biosbalancevita2_thumb.jpg" medium="image">
			<media:title type="html">BiosBalanceVita2</media:title>
		</media:content>
	</item>
		<item>
		<title>.NET String extension methods to check for array of prefixes or suffixes</title>
		<link>http://zoomicon.wordpress.com/2013/04/05/net-string-extension-methods-to-check-for-array-of-prefixes-or-suffixes/</link>
		<comments>http://zoomicon.wordpress.com/2013/04/05/net-string-extension-methods-to-check-for-array-of-prefixes-or-suffixes/#comments</comments>
		<pubDate>Fri, 05 Apr 2013 19:51:49 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[ClipFlair]]></category>
		<category><![CDATA[CurrentCulture]]></category>
		<category><![CDATA[EndsWith]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Methods]]></category>
		<category><![CDATA[Prefix]]></category>
		<category><![CDATA[StartsWith]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[StringComparison]]></category>
		<category><![CDATA[Suffix]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1206</guid>
		<description><![CDATA[Seems StartsWith and EndsWith methods of String class in .NET are missing a version that accepts multiple (as an array) prefixes or suffixes respectively when testing the string. To achieve this I just added the following extension methods to StringExtensions class (of Utils.Extensions namespace) under Utils.Silverlight project at the ClipFlair source code. public static bool [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1206&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Seems <em>StartsWith</em> and <em>EndsWith</em> methods of <em>String</em> class in .NET are missing a version that accepts multiple (as an array) prefixes or suffixes respectively when testing the string. To achieve this I just added the following extension methods to StringExtensions class (of Utils.Extensions namespace) under Utils.<a href="http://www.Silverlight.net" target="_blank">Silverlight</a> project at the <a href="http://clipflair.codeplex.com/" target="_blank">ClipFlair source</a> code.</p>
<pre class="code"><span style="color:blue;">public static bool </span>StartsWith(<br />  <span style="color:blue;">this string </span>s, <br />  <span style="color:blue;">string</span>[] suffixes, <br /><span style="color:#2b91af;">  StringComparison </span>comparisonType = <span style="color:#2b91af;">StringComparison</span>.CurrentCulture)
{
  <span style="color:blue;">foreach </span>(<span style="color:blue;">string </span>suffix <span style="color:blue;">in </span>suffixes)
    <span style="color:blue;">if </span>(s.StartsWith(suffix, comparisonType))
      <span style="color:blue;">return true</span>;
  <span style="color:blue;">return false</span>;
}

<span style="color:blue;">public static bool </span>EndsWith(<br />  <span style="color:blue;">this string </span>s, <br /><span style="color:blue;">  string</span>[] suffixes, <br />  <span style="color:#2b91af;">StringComparison </span>comparisonType = <span style="color:#2b91af;">StringComparison</span>.CurrentCulture)
{
  <span style="color:blue;">foreach </span>(<span style="color:blue;">string </span>suffix <span style="color:blue;">in </span>suffixes)
    <span style="color:blue;">if </span>(s.EndsWith(suffix, comparisonType)) 
      <span style="color:blue;">return true</span>;
  <span style="color:blue;">return false</span>;
}</pre>
<p>&#160;</p>
<p>To use them, you add a reference to Utils.<a href="http://www.Silverlight.net" target="_blank">Silverlight</a> project to your own one and then add a using clause for the namespace that hosts a static class with these extension methods (e.g. “using Utils.Extensions;”) and then you can use them on any String at the respective source file. Can even use them on literal strings, since most .NET compilers support Boxing of literals into respective types.</p>
<p>I’m using a default value for the <em>comparisonType</em> method argument to make it optional. I use <em>StringComparison.CurrentCulture</em> as the default value for it (performing a word case-sensitive and culture-sensitive comparison using the current culture), as Microsoft is doing at “<a href="http://msdn.microsoft.com/en-us/library/baketfxw.aspx" target="_blank">String.StartsWith(String)”</a> method. However, do note the following text from that method’s documentation:</p>
<blockquote>
<p><strong>Notes to Callers</strong></p>
<p>As explained in <a href="http://msdn.microsoft.com/en-us/library/dd465121.aspx">Best Practices for Using Strings in the .NET Framework</a>, we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string begins with a particular substring by using the string comparison rules of the current culture, call the <a href="http://msdn.microsoft.com/en-us/library/ms131452.aspx">StartsWith(String, StringComparison)</a> method overload with a value of <a href="http://msdn.microsoft.com/en-us/library/system.stringcomparison.aspx">StringComparison.CurrentCulture</a> for its comparisonType parameter.</p>
</blockquote>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/net/'>.NET</a>, <a href='http://zoomicon.wordpress.com/tag/array/'>Array</a>, <a href='http://zoomicon.wordpress.com/tag/class/'>Class</a>, <a href='http://zoomicon.wordpress.com/tag/clipflair/'>ClipFlair</a>, <a href='http://zoomicon.wordpress.com/tag/currentculture/'>CurrentCulture</a>, <a href='http://zoomicon.wordpress.com/tag/endswith/'>EndsWith</a>, <a href='http://zoomicon.wordpress.com/tag/extensions/'>Extensions</a>, <a href='http://zoomicon.wordpress.com/tag/methods/'>Methods</a>, <a href='http://zoomicon.wordpress.com/tag/prefix/'>Prefix</a>, <a href='http://zoomicon.wordpress.com/tag/startswith/'>StartsWith</a>, <a href='http://zoomicon.wordpress.com/tag/string/'>String</a>, <a href='http://zoomicon.wordpress.com/tag/stringcomparison/'>StringComparison</a>, <a href='http://zoomicon.wordpress.com/tag/suffix/'>Suffix</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1206/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1206&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2013/04/05/net-string-extension-methods-to-check-for-array-of-prefixes-or-suffixes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>
	</item>
		<item>
		<title>.NET String class extensions to replace prefix or suffix</title>
		<link>http://zoomicon.wordpress.com/2013/03/26/net-string-class-extensions-to-replace-prefix-or-suffix/</link>
		<comments>http://zoomicon.wordpress.com/2013/03/26/net-string-class-extensions-to-replace-prefix-or-suffix/#comments</comments>
		<pubDate>Tue, 26 Mar 2013 15:47:47 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[ClipFlair]]></category>
		<category><![CDATA[CurrentCulture]]></category>
		<category><![CDATA[EndsWith]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Methods]]></category>
		<category><![CDATA[Prefix]]></category>
		<category><![CDATA[Replace]]></category>
		<category><![CDATA[StartsWith]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[StringComparison]]></category>
		<category><![CDATA[Suffix]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1202</guid>
		<description><![CDATA[Just added the following extension methods to StringExtensions class (of Utils.Extensions namespace) under Utils.Silverlight project at the ClipFlair source code. public static string ReplacePrefix( this string s, string fromPrefix, string toPrefix, StringComparison comparisonType = StringComparison.CurrentCulture) { return (s.StartsWith(fromPrefix, comparisonType)) ? toPrefix + s.Substring(fromPrefix.Length) : s; } public static string ReplacePrefix( this string s, string[] fromPrefix, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1202&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Just added the following extension methods to StringExtensions class (of Utils.Extensions namespace) under Utils.<a href="http://www.Silverlight.net" target="_blank">Silverlight</a> project at the <a href="http://clipflair.codeplex.com/" target="_blank">ClipFlair source</a> code.</p>
<pre class="code"><span style="color:blue;">public static string </span>ReplacePrefix(<br />  <span style="color:blue;">this string </span>s,<br />  <span style="color:blue;">string </span>fromPrefix, <br />  <span style="color:blue;">string </span>toPrefix, <br />  <span style="color:#2b91af;">StringComparison </span>comparisonType = <span style="color:#2b91af;">StringComparison</span>.CurrentCulture)
{
  <span style="color:blue;">return </span>(s.StartsWith(fromPrefix, comparisonType)) ? <br />                         toPrefix + s.Substring(fromPrefix.Length) : s;
}

<span style="color:blue;">public static string </span>ReplacePrefix(<br />  <span style="color:blue;">this string </span>s, <br />  <span style="color:blue;">string</span>[] fromPrefix,<br />  <span style="color:blue;">string </span>toPrefix, <br />  <span style="color:#2b91af;">StringComparison </span>comparisonType = <span style="color:#2b91af;">StringComparison</span>.CurrentCulture)
{
  <span style="color:blue;">foreach </span>(<span style="color:blue;">string </span>prefix <span style="color:blue;">in </span>fromPrefix)
    <span style="color:blue;">if </span>(s.StartsWith(prefix, comparisonType))
      <span style="color:blue;">return </span>toPrefix + s.Substring(prefix.Length);
  <span style="color:blue;">return </span>s;
}

<span style="color:blue;">public static string </span>ReplaceSuffix(<br />  <span style="color:blue;">this string </span>s, <br />  <span style="color:blue;">string </span>fromSuffix, <br />  <span style="color:blue;">string </span>toSuffix, <br />  <span style="color:#2b91af;">StringComparison </span>comparisonType = <span style="color:#2b91af;">StringComparison</span>.CurrentCulture)
{
  <span style="color:blue;">return </span>(s.EndsWith(fromSuffix, comparisonType)) ? <br />                   s.Substring(0, s.Length - fromSuffix.Length) + toSuffix : s;
}

<span style="color:blue;">public static string </span>ReplaceSuffix(<br />  <span style="color:blue;">this string </span>s,<br />  <span style="color:blue;">string</span>[] fromSuffix, <br />  <span style="color:blue;">string </span>toSuffix, <br />  <span style="color:#2b91af;">StringComparison </span>comparisonType = <span style="color:#2b91af;">StringComparison</span>.CurrentCulture)
{
  <span style="color:blue;">foreach </span>(<span style="color:blue;">string </span>suffix <span style="color:blue;">in </span>fromSuffix)
    <span style="color:blue;">if </span>(s.EndsWith(suffix, comparisonType))
      <span style="color:blue;">return </span>s.Substring(0, s.Length - suffix.Length) + toSuffix;
  <span style="color:blue;">return </span>s;
}</pre>
<p>&#160;</p>
<p>To use them, you add a reference to Utils.<a href="http://www.Silverlight.net" target="_blank">Silverlight</a> project to your own one and then add a using clause for the namespace that hosts a static class with these extension methods (e.g. “using Utils.Extensions;”) and then you can use them on any String at the respective source file. Can even use them on literal strings, since most .NET compilers support Boxing of literals into respective types.</p>
<p>e.g.</p>
<blockquote>
<p>s = s.ReplacePrefix(&quot;<a href="https://&#038;quot" rel="nofollow">https://&#038;quot</a>;, &quot;<a href="http://&#038;quot" rel="nofollow">http://&#038;quot</a>;, StringComparison.OrdinalIgnoreCase);</p>
<p><em>//&#8211; converts https:// prefix to http:// ignoring character case</em></p>
</blockquote>
<p>or</p>
<blockquote>
<p>s = s.ReplacePrefix(new String[]{&quot;<a href="https://&#038;quot" rel="nofollow">https://&#038;quot</a>;, &quot;<a href="http://&#038;quot" rel="nofollow">http://&#038;quot</a>;}, &quot;&quot;, StringComparison.OrdinalIgnoreCase);</p>
<p><em>//&#8211; removes https:// or http:// prefix ignoring character case</em></p>
</blockquote>
<p>&#160;</p>
<p><strong><u>Update:</u></strong></p>
<p>I added a default value for the <em>comparisonType</em> method argument to make it optional. I use <em>StringComparison.CurrentCulture</em> as the default value for it (performing a word case-sensitive and culture-sensitive comparison using the current culture), as Microsoft is doing at “<a href="http://msdn.microsoft.com/en-us/library/baketfxw.aspx" target="_blank">String.StartsWith(String)”</a> method. However, do note the following text from that method’s documentation:</p>
<blockquote>
<p><strong>Notes to Callers</strong></p>
<p>As explained in <a href="http://msdn.microsoft.com/en-us/library/dd465121.aspx">Best Practices for Using Strings in the .NET Framework</a>, we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string begins with a particular substring by using the string comparison rules of the current culture, call the <a href="http://msdn.microsoft.com/en-us/library/ms131452.aspx">StartsWith(String, StringComparison)</a> method overload with a value of <a href="http://msdn.microsoft.com/en-us/library/system.stringcomparison.aspx">StringComparison.CurrentCulture</a> for its comparisonType parameter.</p>
</blockquote>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/net/'>.NET</a>, <a href='http://zoomicon.wordpress.com/tag/class/'>Class</a>, <a href='http://zoomicon.wordpress.com/tag/clipflair/'>ClipFlair</a>, <a href='http://zoomicon.wordpress.com/tag/currentculture/'>CurrentCulture</a>, <a href='http://zoomicon.wordpress.com/tag/endswith/'>EndsWith</a>, <a href='http://zoomicon.wordpress.com/tag/extensions/'>Extensions</a>, <a href='http://zoomicon.wordpress.com/tag/methods/'>Methods</a>, <a href='http://zoomicon.wordpress.com/tag/prefix/'>Prefix</a>, <a href='http://zoomicon.wordpress.com/tag/replace/'>Replace</a>, <a href='http://zoomicon.wordpress.com/tag/startswith/'>StartsWith</a>, <a href='http://zoomicon.wordpress.com/tag/string/'>String</a>, <a href='http://zoomicon.wordpress.com/tag/stringcomparison/'>StringComparison</a>, <a href='http://zoomicon.wordpress.com/tag/suffix/'>Suffix</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1202&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2013/03/26/net-string-class-extensions-to-replace-prefix-or-suffix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix: remove &#8216;optimized for Bing and MSN&#8217; from IE titlebar</title>
		<link>http://zoomicon.wordpress.com/2013/03/20/fix-remove-optimized-for-bing-and-msn-from-ie-titlebar/</link>
		<comments>http://zoomicon.wordpress.com/2013/03/20/fix-remove-optimized-for-bing-and-msn-from-ie-titlebar/#comments</comments>
		<pubDate>Wed, 20 Mar 2013 16:39:22 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Advertisement]]></category>
		<category><![CDATA[Bing]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[MSN]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1201</guid>
		<description><![CDATA[Seems some Microsoft software (probably Bing bar) version is changing Internet Explorer title bar to write “optimized for Bing and MSN”. To remove this: Use Start/Run or Start/Find and type there regedit then press ENTER to launch the Registry Editor. At the tree on the left navigate to HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main At the right handside of [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1201&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Seems some Microsoft software (probably Bing bar) version is changing Internet Explorer title bar to write “optimized for Bing and MSN”. </p>
<p>To remove this:</p>
<ol>
<li>Use Start/Run or Start/Find and type there regedit then press ENTER to launch the Registry Editor.</li>
<li>At the tree on the left navigate to HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main </li>
<li>At the right handside of the window right click the value “WindowTitle” and select “Delete” to restore the default “- Windows Internet Explorer” suffix on the IE titlebar</li>
</ol>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/advertisement/'>Advertisement</a>, <a href='http://zoomicon.wordpress.com/tag/bing/'>Bing</a>, <a href='http://zoomicon.wordpress.com/tag/fix/'>Fix</a>, <a href='http://zoomicon.wordpress.com/tag/ie/'>IE</a>, <a href='http://zoomicon.wordpress.com/tag/msn/'>MSN</a>, <a href='http://zoomicon.wordpress.com/tag/registry/'>Registry</a>, <a href='http://zoomicon.wordpress.com/tag/windows/'>Windows</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1201/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1201&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2013/03/20/fix-remove-optimized-for-bing-and-msn-from-ie-titlebar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>
	</item>
		<item>
		<title>IIS FTP login fails after Windows platform update for Server 2008 R2</title>
		<link>http://zoomicon.wordpress.com/2013/02/27/iis-ftp-login-fails-after-windows-platform-update-for-server-2008-r2/</link>
		<comments>http://zoomicon.wordpress.com/2013/02/27/iis-ftp-login-fails-after-windows-platform-update-for-server-2008-r2/#comments</comments>
		<pubDate>Wed, 27 Feb 2013 15:00:31 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[ClipFlair]]></category>
		<category><![CDATA[Filters]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Login]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1197</guid>
		<description><![CDATA[I had recently enabled FTP access to the ClipFlair&#160;Gallery to easy its maintenance during development and after the Windows Server 2008 R2 platform update last night (together with release for Internet Explorer 10), the FTP login stopped working. To fix it, from a command prompt with administrator rights (Start/Find, type Command and right click the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1197&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I had recently enabled FTP access to the <a title="ClipFlair - Foreign Language Learning through Interactive Captioning and Revoicing of Clips" href="http://clipflair.net" target="_blank">ClipFlair</a>&#160;<a href="http://gallery.clipflair.net" target="_blank">Gallery</a> to easy its maintenance during development and after the <a href="http://windows.microsoft.com" target="_blank">Windows</a> Server 2008 R2 platform update last night (together with release for Internet Explorer 10), the FTP login stopped working.</p>
<p>To fix it, from a command prompt with administrator rights (Start/Find, type Command and right click the Command Prompt item found to open as administrator), give the command:</p>
<p><strong>netsh advfirewall set global StatefulFtp disable</strong></p>
<p>It’s easy to copy-paste it from here and right-click on the command prompt title bar, then select Edit&gt;Paste (no shortcut key for that unfortunately), then press the ENTER key and it should reply “Ok”. </p>
<p>Had done this before, but seems the platform update re-enabled filtering for Stateful FTP (also note that at <a href="http://www.iis.net/learn/publish/using-the-ftp-service/configuring-ftp-firewall-settings-in-iis-7">http://www.iis.net/learn/publish/using-the-ftp-service/configuring-ftp-firewall-settings-in-iis-7</a> it seems to erroneously say that you need to use “enble” instead of “disable” when not using SSL).</p>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/clipflair/'>ClipFlair</a>, <a href='http://zoomicon.wordpress.com/tag/filters/'>Filters</a>, <a href='http://zoomicon.wordpress.com/tag/firewall/'>Firewall</a>, <a href='http://zoomicon.wordpress.com/tag/fix/'>Fix</a>, <a href='http://zoomicon.wordpress.com/tag/ftp/'>FTP</a>, <a href='http://zoomicon.wordpress.com/tag/gallery/'>Gallery</a>, <a href='http://zoomicon.wordpress.com/tag/login/'>Login</a>, <a href='http://zoomicon.wordpress.com/tag/security/'>Security</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1197&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2013/02/27/iis-ftp-login-fails-after-windows-platform-update-for-server-2008-r2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>
	</item>
		<item>
		<title>HowTo: format XML output of DataContractSerializer</title>
		<link>http://zoomicon.wordpress.com/2013/02/22/howto-format-xml-output-of-datacontractserializer/</link>
		<comments>http://zoomicon.wordpress.com/2013/02/22/howto-format-xml-output-of-datacontractserializer/#comments</comments>
		<pubDate>Fri, 22 Feb 2013 14:52:13 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ClipFlair]]></category>
		<category><![CDATA[Contracts]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Formatting]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Serialization]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[ZIP]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1194</guid>
		<description><![CDATA[based on the other samples posted at StackOverflow on how to format XML created by DataContractSerializer, that use XmlWriter, here&#8217;s a version (from ClipFlair source code) that works with streams (and Ionic.Zip library in specific). It also shows how the code is when you don&#8217;t apply formatting (using conditional compilation).&#160; Just comment out the #define [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1194&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>based on the other samples posted at <a href="http://www.stackoverflow.com" target="_blank">StackOverflow</a> on <a href="http://stackoverflow.com/questions/739114/formatting-of-xml-created-by-datacontractserializer/" target="_blank">how to format XML created by DataContractSerializer</a>, that use XmlWriter, here&#8217;s a version (from <a href="http://ClipFlair.codeplex.com" target="_blank">ClipFlair source code</a>) that works with streams (and Ionic.Zip library in specific).</p>
<p>It also shows how the code is when you don&#8217;t apply formatting (using conditional compilation).&#160; Just comment out the #define (prefix it with //) to make it write unformatted XML.</p>
<p>&#160;</p>
<pre><code>#define WRITE_FORMATTED_XML

using System.Xml;

namespace ClipFlair.Windows
{

  public partial class BaseWindow : FloatingWindow
  {

    //...

    #if WRITE_FORMATTED_XML
    private static XmlWriterSettings XML_WRITER_SETTINGS = <br />            new XmlWriterSettings() { Indent=true, IndentChars=&quot;  &quot;};
    #endif

    //...

    public virtual void SaveOptions(ZipFile zip, string zipFolder = &quot;&quot;) <br />                 //THIS IS THE CORE SAVING LOGIC
    {
      if (SavingOptions != null) SavingOptions(this, null); //notify any listeners

      View.Busy = true;
      try
      {
        ZipEntry optionsXML = <br />        zip.AddEntry(zipFolder + &quot;/&quot; + View.GetType().FullName + &quot;.options.xml&quot;,
          new WriteDelegate((entryName, stream) =&gt;
          {
            DataContractSerializer serializer = <br />                      new DataContractSerializer(View.GetType()); <br />                              //assuming current View isn't null
            #if WRITE_FORMATTED_XML
            using (XmlWriter writer = XmlWriter.Create(stream, XML_WRITER_SETTINGS))
              serializer.WriteObject(writer, View);
            #else
            serializer.WriteObject(stream, View);
            #endif
          }));
      }
      catch (Exception e)
      {
        MessageBox.Show(&quot;ClipFlair options save failed: &quot; + e.Message); 
      }
      finally
      {
        View.Busy = false; //in any case (error or not) clear the Busy flag
      }

      if (SavedOptions != null) SavedOptions(this, null); //notify any listeners
    }

    //...

  }

}</code></pre>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/net/'>.NET</a>, <a href='http://zoomicon.wordpress.com/tag/clipflair/'>ClipFlair</a>, <a href='http://zoomicon.wordpress.com/tag/contracts/'>Contracts</a>, <a href='http://zoomicon.wordpress.com/tag/data/'>Data</a>, <a href='http://zoomicon.wordpress.com/tag/formatting/'>Formatting</a>, <a href='http://zoomicon.wordpress.com/tag/howto/'>HowTo</a>, <a href='http://zoomicon.wordpress.com/tag/serialization/'>Serialization</a>, <a href='http://zoomicon.wordpress.com/tag/silverlight/'>Silverlight</a>, <a href='http://zoomicon.wordpress.com/tag/xml/'>XML</a>, <a href='http://zoomicon.wordpress.com/tag/zip/'>ZIP</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1194&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2013/02/22/howto-format-xml-output-of-datacontractserializer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix: Silverlight Media Framework Player VolumeElement out of sync</title>
		<link>http://zoomicon.wordpress.com/2013/02/11/fix-silverlight-media-framework-player-volumeelement-out-of-sync/</link>
		<comments>http://zoomicon.wordpress.com/2013/02/11/fix-silverlight-media-framework-player-volumeelement-out-of-sync/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 16:54:24 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Binding]]></category>
		<category><![CDATA[ClipFlair]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[Persistence]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[SMF]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[Volume]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1192</guid>
		<description><![CDATA[I was just adding a storable (persistent) Volume property to the MediaPlayerView class used at ClipFlair’s MediaPlayerWindow (connected to the underlying SMF player’s VolumeLevel property), when I realized that after reloading saved state, the SMF player’s Volume control would show a different value than the value set to it (which I could confirm by flipping [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1192&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I was just adding a storable (persistent) Volume property to the MediaPlayerView class used at <a title="ClipFlair - Foreign Language Learning through Interactive Captioning and Revoicing of Clips" href="http://clipflair.net" target="_blank">ClipFlair</a>’s MediaPlayerWindow (connected to the underlying <a href="http://smf.codeplex.com/" target="_blank">SMF</a> player’s VolumeLevel property), when I realized that after reloading saved state, the SMF player’s Volume control would show a different value than the value set to it (which I could confirm by flipping the MediaPlayer control and looking at its properties on the backpanel that the ClipFlair app features for each component and for the activity container itself).</p>
<p>It seems to be some bug in the SMF logic or in its default template, since the following fix makes the issue disappear. The trick is that at a descendent class from SMFPlayer (like the MediaPlayer class that ClipFlair’s MediaPlayerWindow uses), one can override the OnApplyTemplate method (a standard method in templated XAML-based controls at <a href="http://www.microsoft.com/silverlight/" target="_blank">Silverlight</a> and <a href="http://windowsclient.net/wpf/" target="_blank">WPF</a>) and call the UpdateVolumeElement method shown below.</p>
<p>That method <strong>temporarily sets the volume to another value than its current one (this is important, just setting again to the same value would be ignored), then set again the current value to force the VolumeElement control’s UI to update.</strong></p>
<p>&#160;</p>
<pre class="code"><span style="color:green;">//Project: ClipFlair (http://ClipFlair.codeplex.com)
//Filename: MediaPlayer.cs
//Version: 20130211

</span><span style="color:blue;">using </span>System;
<span style="color:blue;">using </span>System.Linq;
<span style="color:blue;">using </span>System.Windows;
<span style="color:blue;">using </span>System.Windows.Media;

<span style="color:blue;">using </span>Microsoft.SilverlightMediaFramework.Core;
<span style="color:blue;">using </span>Microsoft.SilverlightMediaFramework.Core.Media;
<span style="color:blue;">using </span>Microsoft.SilverlightMediaFramework.Core.Accessibility.Captions;
<span style="color:blue;">using </span>Microsoft.SilverlightMediaFramework.Plugins.Primitives;

<span style="color:blue;">namespace </span>ClipFlair.MediaPlayer
{

  <span style="color:blue;">public class </span><span style="color:#2b91af;">MediaPlayer </span>: <span style="color:#2b91af;">SMFPlayer
  </span>{

    <span style="color:blue;">public override void </span>OnApplyTemplate()
    {
      <span style="color:blue;">base</span>.OnApplyTemplate();

<span style="color:green;"><font color="#555555">      //...</font>
      </span>UpdateVolumeElement(); <span style="color:green;">//patch for SMF bug
    </span>}

    <span style="color:blue;">protected void </span>UpdateVolumeElement()
    {
      <span style="color:green;">//patch for SMF to update VolumeElement UI with any already set VolumeLevel
      </span><span style="color:blue;">double </span>volume = VolumeLevel;
      VolumeLevel = (volume == 1) ? 0.9 : 1;
      VolumeLevel = volume;
    }

//...</pre>
<p>&#160;</p>
<p><strong><u>Update:</u></strong> While submitting this as a <a href="http://smf.codeplex.com/workitem/23897" target="_blank">bug</a> to <a href="http://smf.codeplex.com" target="_blank">SMF source</a> site on <a href="http://www.codeplex.com" target="_blank">Codeplex</a> it came to me that I could try setting the VolumeElement&#8217;s VolumeLevel value directly at ApplyTemplate and indeed it works:</p>
<pre><code><span style="color:blue;">protected void </span>UpdateVolumeElement() <br />{
  <span style="color:green;">//patch for SMF to update VolumeElement UI with any already set VolumeLevel </span>
  VolumeElement.VolumeLevel = VolumeLevel;
}</code></pre>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/audio/'>Audio</a>, <a href='http://zoomicon.wordpress.com/tag/binding/'>Binding</a>, <a href='http://zoomicon.wordpress.com/tag/clipflair/'>ClipFlair</a>, <a href='http://zoomicon.wordpress.com/tag/fix/'>Fix</a>, <a href='http://zoomicon.wordpress.com/tag/persistence/'>Persistence</a>, <a href='http://zoomicon.wordpress.com/tag/silverlight/'>Silverlight</a>, <a href='http://zoomicon.wordpress.com/tag/smf/'>SMF</a>, <a href='http://zoomicon.wordpress.com/tag/templates/'>Templates</a>, <a href='http://zoomicon.wordpress.com/tag/ui/'>UI</a>, <a href='http://zoomicon.wordpress.com/tag/volume/'>Volume</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1192/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1192&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2013/02/11/fix-silverlight-media-framework-player-volumeelement-out-of-sync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix: Visual Studio opens class diagram in XML editor with double click</title>
		<link>http://zoomicon.wordpress.com/2013/02/10/fix-visual-studio-opens-class-diagram-in-xml-editor-with-double-click/</link>
		<comments>http://zoomicon.wordpress.com/2013/02/10/fix-visual-studio-opens-class-diagram-in-xml-editor-with-double-click/#comments</comments>
		<pubDate>Sun, 10 Feb 2013 10:00:26 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[ClipFlair]]></category>
		<category><![CDATA[Diagrams]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[VisualStudio]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1190</guid>
		<description><![CDATA[Recently, to save myself sometime after having renamed some interfaces/classes in the ClipFlair project sourcecode, I right-clicked one of the class diagrams (.cd files) in it at Visual Studio’s “Solution Navigator” (this is an enhanced Solution Explorer addon) and using “Open With…” I opened up the diagrams with the XML editor to do a rename-all [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1190&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p align="justify">Recently, to save myself sometime after having renamed some interfaces/classes in the <a title="ClipFlair - Foreign Language Learning through Interactive Captioning and Revoicing of Clips" href="http://clipflair.net" target="_blank">ClipFlair</a> project <a href="http://clipflair.codeplex.com/" target="_blank">sourcecode</a>, I right-clicked one of the class diagrams (.cd files) in it at Visual Studio’s “Solution Navigator” (this is an enhanced Solution Explorer addon) and using “Open With…” I opened up the diagrams with the XML editor to do a rename-all operation for the respective class names.</p>
<p align="justify">However, after saving the project I found out that from then on, that specific .cd file was opening up as XML file when double-clicked instead of opening up as a Class Diagram in the respective designer pane. Using Open With dialog would open it as a Class Diagram when asked to specifically, but using the checkbox to always open up as Class Diagram wouldn’t help fix the double-click problem for that specific .cd file (others would open up fine as class diagrams, not as XML files, when double-clicked).</p>
<p align="justify">I just managed to fix that issue by right clicking the file node in solution navigator’s tree and and excluding that file from the project (not deleting!), then saving the project, closing the solution containg the project and adding the file (via “Add existing file”) again after having reopened the solution. I could also possibly have right clicked selected “Unload project” after saving it and then select to reload it again, think that would have worked too.</p>
<p align="justify">Using <a href="http://visualhg.codeplex.com/" target="_blank">VisualHG</a> addon for Visual Studio I commited the changes to the <a href="http://mercurial.selenic.com/" target="_blank">Mercurial</a> repository used by <a href="http://clipflair.codeplex.com/" target="_blank">ClipFlair on Codeplex</a>, which showed me that the file difference that did the fix was the following in the .csproj project file:</p>
<p>&#160;&#160; &lt;ItemGroup&gt;    <br />&#160;&#160;&#160;&#160; &lt;None Include=&quot;Diagrams\Windows.cd&quot; /&gt;     <br /><strong>-&#160;&#160;&#160; &lt;None Include=&quot;Diagrams\Windows.Views.Interfaces.cd&quot;&gt;      <br />-&#160;&#160;&#160;&#160;&#160; &lt;SubType&gt;Designer&lt;/SubType&gt;       <br />-&#160;&#160;&#160; &lt;/None&gt;       <br /></strong>+&#160;&#160;&#160; &lt;None Include=&quot;Diagrams\Windows.Views.Interfaces.cd&quot; /&gt;     <br />&#160;&#160;&#160;&#160; &lt;None Include=&quot;Diagrams\Windows.Views.ViewModels.cd&quot; /&gt;     <br />&#160;&#160; &lt;/ItemGroup&gt;</p>
<p align="justify">&#160;</p>
<p align="justify">That is instead of that marked-as-bold entry above (marked by the diff tool with – prefix), the line marked with + prefix should be used instead. This is obviously some bug in Visual Studio 2010, it’s nice to know though that you can easily take the project offline and edit the .csproj to fix it (or remove the .cd file, save the project, reload it and add the file again).</p>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/bugs/'>Bugs</a>, <a href='http://zoomicon.wordpress.com/tag/clipflair/'>ClipFlair</a>, <a href='http://zoomicon.wordpress.com/tag/diagrams/'>Diagrams</a>, <a href='http://zoomicon.wordpress.com/tag/fix/'>Fix</a>, <a href='http://zoomicon.wordpress.com/tag/ide/'>IDE</a>, <a href='http://zoomicon.wordpress.com/tag/programming/'>Programming</a>, <a href='http://zoomicon.wordpress.com/tag/source/'>Source</a>, <a href='http://zoomicon.wordpress.com/tag/visualization/'>Visualization</a>, <a href='http://zoomicon.wordpress.com/tag/visualstudio/'>VisualStudio</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1190&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2013/02/10/fix-visual-studio-opens-class-diagram-in-xml-editor-with-double-click/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>
	</item>
		<item>
		<title>2012 in review for @zoomicon blog</title>
		<link>http://zoomicon.wordpress.com/2012/12/31/2012-in-review-for-zoomicon-blog/</link>
		<comments>http://zoomicon.wordpress.com/2012/12/31/2012-in-review-for-zoomicon-blog/#comments</comments>
		<pubDate>Mon, 31 Dec 2012 07:10:12 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://zoomicon.wordpress.com/?p=1187</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog. Here&#8217;s an excerpt: 4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 48,000 views in 2012. If each view were a film, this blog would power 11 Film Festivals Click here to see the complete report. Tagged: 2012, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1187&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.</p>
<p>	<a href="http://zoomicon.wordpress.com/2012/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/2012-emailteaser.png" width="100%" alt="" /></a></p>
<p>Here&#8217;s an excerpt:</p>
</p>
<blockquote><p>4,329 films were submitted to the 2012 Cannes Film Festival. This blog had <strong>48,000</strong> views in 2012. If each view were a film, this blog would power 11 Film Festivals</p></blockquote>
<p><a href="http://zoomicon.wordpress.com/2012/annual-report/">Click here to see the complete report.</a></p>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/2012/'>2012</a>, <a href='http://zoomicon.wordpress.com/tag/statistics/'>Statistics</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1187/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1187&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2012/12/31/2012-in-review-for-zoomicon-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/2012-emailteaser.png" medium="image" />
	</item>
		<item>
		<title>Eco-unfriendly Philips shipping empty software CD with just a URL in it</title>
		<link>http://zoomicon.wordpress.com/2012/12/29/eco-unfriendly-philips-shipping-empty-software-cd-with-just-a-url-in-it/</link>
		<comments>http://zoomicon.wordpress.com/2012/12/29/eco-unfriendly-philips-shipping-empty-software-cd-with-just-a-url-in-it/#comments</comments>
		<pubDate>Sat, 29 Dec 2012 15:02:30 +0000</pubDate>
		<dc:creator>George Birbilis</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[Deploying]]></category>
		<category><![CDATA[Ecology]]></category>
		<category><![CDATA[Fail]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Media]]></category>
		<category><![CDATA[Philips]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[TV]]></category>
		<category><![CDATA[Wifi]]></category>

		<guid isPermaLink="false">https://zoomicon.wordpress.com/?p=1186</guid>
		<description><![CDATA[I just got an (overpriced) Philips PTA01 USB adapter the other day to make my Philips Smart TV also work wirelessly (apart from via Ethernet cable) and it came with the Philips MediaConnect software on a CD, or at least I thought so till I placed the CD in my computer. I then found out [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1186&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p align="justify">I just got an (overpriced) Philips <em>PTA01</em> USB adapter the other day to make my Philips Smart TV also work wirelessly (apart from via Ethernet cable) and it came with the Philips <a href="http://www.wifimediaconnect.philips.com/" target="_blank">MediaConnect</a> software on a CD, or at least I thought so till I placed the CD in my computer.</p>
<p><a href="http://zoomicon.files.wordpress.com/2012/12/image2.png"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://zoomicon.files.wordpress.com/2012/12/image_thumb2.png?w=949&#038;h=239" width="949" height="239" /></a></p>
<p align="justify">I then found out<strong> the CD just contains an icon, a URL shortcut and the autorun.inf file that tells Windows to launch that URL shortcut and open a webpage</strong> where you can download the MediaConnect software. The activation key is on a label at the front of the CD paper sleeve.</p>
<p>They haven’t heard of auto-updating software it seems, neither about eco-friendly practices and sustainability. Philips sure gets a prize for the worst practice there. <strong>They could have just placed a sticker with a <a href="http://en.wikipedia.org/wiki/URL_shortening" target="_blank">short URL</a> and a <a href="http://en.wikipedia.org/wiki/QR_code" target="_blank">QR code</a> for downloading the software, together with the activation key at the instructions leaflet instead.</strong></p>
<br /> Tagged: <a href='http://zoomicon.wordpress.com/tag/cd/'>CD</a>, <a href='http://zoomicon.wordpress.com/tag/deploying/'>Deploying</a>, <a href='http://zoomicon.wordpress.com/tag/ecology/'>Ecology</a>, <a href='http://zoomicon.wordpress.com/tag/fail/'>Fail</a>, <a href='http://zoomicon.wordpress.com/tag/internet/'>Internet</a>, <a href='http://zoomicon.wordpress.com/tag/media/'>Media</a>, <a href='http://zoomicon.wordpress.com/tag/philips/'>Philips</a>, <a href='http://zoomicon.wordpress.com/tag/software/'>Software</a>, <a href='http://zoomicon.wordpress.com/tag/tv/'>TV</a>, <a href='http://zoomicon.wordpress.com/tag/wifi/'>Wifi</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zoomicon.wordpress.com/1186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zoomicon.wordpress.com/1186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zoomicon.wordpress.com&#038;blog=16370835&#038;post=1186&#038;subd=zoomicon&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zoomicon.wordpress.com/2012/12/29/eco-unfriendly-philips-shipping-empty-software-cd-with-just-a-url-in-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3105d7c221ad6c73ef4ae3568c65f556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gbirbilis</media:title>
		</media:content>

		<media:content url="http://zoomicon.files.wordpress.com/2012/12/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
