<?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>wide thoughts &#187; microsoft</title>
	<atom:link href="http://kozak.si/widethoughts/tag/microsoft/feed/" rel="self" type="application/rss+xml" />
	<link>http://kozak.si/widethoughts</link>
	<description>a blog of one of those ... software developer creatures</description>
	<lastBuildDate>Sat, 31 Jul 2010 12:30:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Iterating over properties in window object</title>
		<link>http://kozak.si/widethoughts/2009/09/06/iterating-over-properties-in-window-object/</link>
		<comments>http://kozak.si/widethoughts/2009/09/06/iterating-over-properties-in-window-object/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 12:20:03 +0000</pubDate>
		<dc:creator>Gašper</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[objects]]></category>
		<category><![CDATA[properties]]></category>

		<guid isPermaLink="false">http://kozak.si/widethoughts/?p=436</guid>
		<description><![CDATA[I've been playing around a bit with JavaScript, and found out an interesting thing concerning property iteration in the <em>window</em> object in IE. In some cases, properties that are set on the window object, don't show up in the iteration.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around a bit with JavaScript, and found out an interesting thing concerning property iteration in the <em>window</em> object in IE. In some cases, properties that are set on the <em>window</em> object don&#8217;t show up in the iteration.<br />
<span id="more-436"></span><br />
As you probably know, setting a variable outside a function (in the so called global scope) actually writes to the window object.</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1">window.<span class="me1">X</span> = <span class="nu0">123</span>;</div>
</li>
<li class="li1">
<div class="de1">window<span class="br0">&#91;</span><span class="st0">&#39;X&#39;</span><span class="br0">&#93;</span> = <span class="nu0">123</span>;</div>
</li>
<li class="li1">
<div class="de1">X = <span class="nu0">123</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> X = <span class="nu0">123</span>;</div>
</li>
</ol>
</div>
<p>All of these do exactly the same: set a property <em>X</em> on object <em>window</em>.</p>
<p>But, when it comes to iterating window properties in IE (surprise), there seems to be a difference between the first two assignments and the last two. The code for iterating is simple; it iterates through all of the window&#8217;s properties and alerts if <em>X</em> is found.</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> v <span class="kw1">in</span> window<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>v == <span class="st0">&#39;X&#39;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span>v + <span class="st0">&#39;=&#39;</span> + window<span class="br0">&#91;</span>v<span class="br0">&#93;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>With the first two assignments (the ones that write explicitly to <em>window</em>), the property shows up, but with the last two (where properties are implicitly assigned to <em>window</em>), it doesn&#8217;t. It works in Firefox, Opera, Chrome, Safari, but not in IE (not even in IE8). You can try it out <a href='http://kozak.si/widethoughts/wp-content/uploads/2009/09/obj_iter.html'>here</a>.</p>
<p>Why this is so, I can only guess. The property obviously exists, because <em>window['X']</em> and <em>window.X</em> always contain the correct value. One possibility is that iterating over object properties in IE doesn&#8217;t iterate over the properties that object actually <em>owns</em>, but rather over a separate collection of property names. This separate collection isn&#8217;t updated properly when variables are assigned to the <em>window</em> object implicitly. Another possibility is that such variables exist in a global closure, and as such aren&#8217;t true members of the <em>window</em> object. When you access <em>window.X</em> and if it doesn&#8217;t exist, it&#8217;s looked up in that closure.</p>
<p>Interesting if not life-changing stuff. Maybe I&#8217;ll do some more research on this.</p>
]]></content:encoded>
			<wfw:commentRss>http://kozak.si/widethoughts/2009/09/06/iterating-over-properties-in-window-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux isn&#8217;t safe enough?</title>
		<link>http://kozak.si/widethoughts/2009/03/28/linux-isnt-safe-enough/</link>
		<comments>http://kozak.si/widethoughts/2009/03/28/linux-isnt-safe-enough/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 12:45:23 +0000</pubDate>
		<dc:creator>Gašper</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://kozak.si/widethoughts/?p=263</guid>
		<description><![CDATA[Slovenian government decided that Linux and open-source aren&#8217;t appropriate for government usage. The reasons being (a recap from the source):

Using open-source browser instead of horrible MSIE is inappropriate because &#8220;MSIE is free anyway, and using other browsers can cause problems with existing applications&#8221;. The facts that MSIE is the least secure A-grade browser on the [...]]]></description>
			<content:encoded><![CDATA[<p>Slovenian government decided that Linux and open-source aren&#8217;t appropriate for government usage. The reasons being (a recap from the source):</p>
<ol>
<li>Using open-source browser instead of horrible MSIE is inappropriate because &#8220;MSIE is free anyway, and using other browsers can cause problems with existing applications&#8221;. The facts that MSIE is the least secure A-grade browser on the market, and that in Slovenia <a href="http://www.spreadfirefox.com/node/3275">Firefox has the biggest share</a> apparently aren&#8217;t important.</li>
<li>OpenOffice is a viable option (wow!)</li>
<li>&#8220;Linux isn&#8217;t appropriate for workstations because it&#8217;s code is <strong>too open</strong> and it can become too vulnerable in case of mass usage.&#8221; I&#8217;m speechless.</li>
<li>Linux is already used on most servers. Impressive.</li>
<li>&#8220;Security is an issue with OSS, because the source code is available to general public.&#8221; Just as for #3, I remain speechless.</li>
</ol>
<p>Source: <a href="http://slo-tech.com/forum/t351913/0">slo-tech.com</a> (in Slovene)</p>
<p>This is what you get if uninformed people make decisions. It&#8217;s utter non-sense with no solid arguments. Some of the points can in all fairness be called STUPID.</p>
]]></content:encoded>
			<wfw:commentRss>http://kozak.si/widethoughts/2009/03/28/linux-isnt-safe-enough/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
