<?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>KenKinder.com &#187; Bugs</title>
	<atom:link href="http://kenkinder.com/tag/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://kenkinder.com</link>
	<description>Ken Kinder&#039;s personal website</description>
	<lastBuildDate>Mon, 14 Jun 2010 22:27:25 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to fix NiftyCube IE 8 width problem</title>
		<link>http://kenkinder.com/2009/10/26/how-to-fix-niftycube-ie-8-width-problem/</link>
		<comments>http://kenkinder.com/2009/10/26/how-to-fix-niftycube-ie-8-width-problem/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 17:28:57 +0000</pubDate>
		<dc:creator>Ken Kinder</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[patch]]></category>

		<guid isPermaLink="false">http://kenkinder.com/?p=241</guid>
		<description><![CDATA[At work we use this tool called NiftyCube to round corners of elements (it even works with divs that have gradients in them). The problem, however, is that on Internet Explorer 8, 100% width divs are shrunk to the contents of the div.

That happens because NiftyCube has code to correct rendering problems in previous version [...]]]></description>
			<content:encoded><![CDATA[<p>At work we use this tool called <a href="http://www.html.it/articoli/niftycube/index.html">NiftyCube</a> to round corners of elements (it even works with divs that have gradients in them). The problem, however, is that on Internet Explorer 8, 100% width divs are shrunk to the contents of the div.</p>
<p><span id="more-241"></span></p>
<p>That happens because NiftyCube has code to correct rendering problems in previous version of IE. Since IE 8 renders more elements correctly, NiftyCube&#8217;s hack actually makes things worse in IE 8. To fix the problem, disable their fix for IE 8. Apply this change to niftycube.js:</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;">Index: tuber/trunk/common/web/htdocs/assets/js/niftycube.js
===================================================================
<span style="color: #888822;">--- a/tuber/trunk/common/web/htdocs/assets/js/niftycube.js</span>
<span style="color: #888822;">+++ b/tuber/trunk/common/web/htdocs/assets/js/niftycube.js</span>
<span style="color: #440088;">@@ -<span style="">156</span>,<span style="">7</span> +<span style="">156</span>,<span style="">22</span> @@</span>
 <span style="">&#125;</span>
&nbsp;
<span style="color: #00b000;">+function getIeVersion<span style="">&#40;</span><span style="">&#41;</span> <span style="">&#123;</span></span>
<span style="color: #00b000;">+    var rv = -<span style="">1</span>;</span>
<span style="color: #00b000;">+    if <span style="">&#40;</span>navigator.appName == 'Microsoft Internet Explorer'<span style="">&#41;</span> <span style="">&#123;</span></span>
<span style="color: #00b000;">+        var ua = navigator.userAgent;</span>
<span style="color: #00b000;">+        var re = new RegExp<span style="">&#40;</span>&quot;MSIE <span style="">&#40;</span><span style="">&#91;</span><span style="">0</span>-<span style="">9</span><span style="">&#93;</span><span style="">&#123;</span><span style="">1</span>,<span style="">&#125;</span><span style="">&#91;</span>\.0-<span style="">9</span><span style="">&#93;</span><span style="">&#123;</span><span style="">0</span>,<span style="">&#125;</span><span style="">&#41;</span>&quot;<span style="">&#41;</span>;</span>
<span style="color: #00b000;">+        if <span style="">&#40;</span>re.exec<span style="">&#40;</span>ua<span style="">&#41;</span> != null<span style="">&#41;</span> <span style="">&#123;</span></span>
<span style="color: #00b000;">+            rv = parseFloat<span style="">&#40;</span>RegExp.$<span style="">1</span><span style="">&#41;</span>;</span>
<span style="color: #00b000;">+        <span style="">&#125;</span></span>
<span style="color: #00b000;">+    <span style="">&#125;</span></span>
<span style="color: #00b000;">+    return rv;</span>
<span style="color: #00b000;">+<span style="">&#125;</span></span>
<span style="color: #00b000;">+</span>
 function FixIE<span style="">&#40;</span>el<span style="">&#41;</span><span style="">&#123;</span>
 if<span style="">&#40;</span>el.currentStyle!=null &amp;&amp; el.currentStyle.hasLayout!=null &amp;&amp; el.currentStyle.hasLayout==false<span style="">&#41;</span>
<span style="color: #991111;">-    el.style.display=&quot;inline-block&quot;;</span>
<span style="color: #00b000;">+    var ver = getIeVersion<span style="">&#40;</span><span style="">&#41;</span>;</span>
<span style="color: #00b000;">+    if <span style="">&#40;</span>ver &lt; <span style="">8</span><span style="">&#41;</span> <span style="">&#123;</span></span>
<span style="color: #00b000;">+        el.style.display=&quot;inline-block&quot;;</span>
<span style="color: #00b000;">+    <span style="">&#125;</span></span>
 <span style="">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kenkinder.com/2009/10/26/how-to-fix-niftycube-ie-8-width-problem/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Worst lock acquisition code ever.</title>
		<link>http://kenkinder.com/2008/11/24/worst-lock-acquisition-code-ever/</link>
		<comments>http://kenkinder.com/2008/11/24/worst-lock-acquisition-code-ever/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 05:27:01 +0000</pubDate>
		<dc:creator>Ken Kinder</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[CherryPy]]></category>

		<guid isPermaLink="false">/?p=82</guid>
		<description><![CDATA[Courtesy of CherryPy:

while True:
    try:
        lockfd = os.open&#40;path, os.O_CREAT&#124;os.O_WRONLY&#124;os.O_EXCL&#41;
    except OSError:
        time.sleep&#40;0.1&#41;
    else:
        os.close&#40;lockfd&#41;
        break
self.locked = True

Really people, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cherrypy.org/browser/tags/cherrypy-3.1.1/cherrypy/lib/sessions.py">Courtesy of CherryPy</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">True</span>:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        lockfd = <span style="color: #dc143c;">os</span>.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span>path, <span style="color: #dc143c;">os</span>.<span style="color: black;">O_CREAT</span>|os.<span style="color: black;">O_WRONLY</span>|os.<span style="color: black;">O_EXCL</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">OSError</span>:
        <span style="color: #dc143c;">time</span>.<span style="color: black;">sleep</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.1</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #dc143c;">os</span>.<span style="color: black;">close</span><span style="color: black;">&#40;</span>lockfd<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">break</span>
<span style="color: #008000;">self</span>.<span style="color: black;">locked</span> = <span style="color: #008000;">True</span></pre></div></div>

<p>Really people, really? We silently loop until an error goes away? <a href="http://groups.google.com/group/cherrypy-devel/browse_thread/thread/5c02051b151bc916?pli=1">Really</a>? </p>
]]></content:encoded>
			<wfw:commentRss>http://kenkinder.com/2008/11/24/worst-lock-acquisition-code-ever/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
