<?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>Dammit Jim! &#187; bug</title>
	<atom:link href="http://scott.sherrillmix.com/blog/tag/bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://scott.sherrillmix.com/blog</link>
	<description>I'm a biologist not a...</description>
	<lastBuildDate>Mon, 06 Feb 2012 05:19:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Weird first-letter Floating Bug in Firefox</title>
		<link>http://scott.sherrillmix.com/blog/programmer/weird-first-letter-floating-bug-in-firefox/</link>
		<comments>http://scott.sherrillmix.com/blog/programmer/weird-first-letter-floating-bug-in-firefox/#comments</comments>
		<pubDate>Mon, 16 Oct 2006 02:02:52 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/weird-first-letter-floating-bug-in-firefox/</guid>
		<description><![CDATA[I&#8217;ve ran into a weird bug in Firefox. It seems to mess up p.test:first-letter{float:left;} when there are 2 or more &#60;div&#62; with float:right;clear:right;. Firefox seems to put the floating first letter at the bottom of the first div which seems incorrect to my inexpert judgement. I guess it&#8217;s not too common a problem but it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve ran into a weird bug in Firefox. It seems to mess up <code>p.test:first-letter{float:left;}</code> when there are 2 or more <code>&lt;div&gt;</code> with <code>float:right;clear:right;</code>. Firefox seems to put the floating first letter at the bottom of the first div which seems incorrect to my inexpert judgement. I guess it&#8217;s not too common a problem but it&#8217;s a little annoying especially since Internet Explorer seems to handle it correctly. An example of the problem should be below. This is with <code>p.test:first-letter {color:blue; float:left; font-size:500%;}</code> in the css file since you can&#8217;t use <code>first-letter</code> inline (as far as I know).</p>

<div style="float:right;clear:right;border: 1px dashed black;width:20%">This is a sidenote with some text. Pellentesque auctor mauris eu sapien.</div><div style="float:right;clear:right;border: 1px dashed black;width:20%">This is a sidenote with some other text. Pellentesque auctor mauris eu sapien. </div><p class="test" style="color:red;">This is a paragraph test. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec quis urna vitae ligula aliquam eleifend. Fusce pharetra eros eget purus. In libero. Pellentesque auctor mauris eu sapien. Nullam ultrices pretium neque. Vivamus tempor, diam non egestas pharetra, ante arcu egestas enim, eu sollicitudin dui arcu eu est. Phasellus sed diam posuere lectus pharetra volutpat. Ut bibendum neque sed diam hendrerit sagittis. Maecenas ut libero et urna semper faucibus. Donec dolor risus, tempus id, porta eu, feugiat in, mi. In pulvinar luctus tortor. Nulla lorem quam, molestie vitae, blandit quis, consequat eu, velit. Donec lobortis velit. Donec in ante vitae augue. Vivamus tempor, diam non egestas pharetra, ante arcu egestas enim, eu sollicitudin dui arcu eu est. Phasellus sed diam posuere lectus pharetra volutpat. Ut bibendum neque sed diam hendrerit sagittis. Maecenas ut libero et urna semper faucibus. Donec dolor risus, tempus id, porta eu, feugiat in, mi. In pulvinar luctus tortor. Nulla lorem quam, molestie vitae, blandit quis, consequat eu, velit. Donec lobortis velit. Donec in ante vitae augue.</p>

<p>Here is the same paragraph with only one right floated <code>&lt;div&gt;</code>. On my Firefox at least, it does not display the bug.</p>

<div style="float:right;clear:right;border: 1px dashed black;width:20%;">This is a sidenote with some text. Pellentesque auctor mauris eu sapien.</div><p class="test" style="color:red;">This is a paragraph test. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec quis urna vitae ligula aliquam eleifend. Fusce pharetra eros eget purus. In libero. Pellentesque auctor mauris eu sapien. Nullam ultrices pretium neque. Vivamus tempor, diam non egestas pharetra, ante arcu egestas enim, eu sollicitudin dui arcu eu est. Phasellus sed diam posuere lectus pharetra volutpat. Ut bibendum neque sed diam hendrerit sagittis. Maecenas ut libero et urna semper faucibus. Donec dolor risus, tempus id, porta eu, feugiat in, mi. In pulvinar luctus tortor. Nulla lorem quam, molestie vitae, blandit quis, consequat eu, velit. Donec lobortis velit. Donec in ante vitae augue. Vivamus tempor, diam non egestas pharetra, ante arcu egestas enim, eu sollicitudin dui arcu eu est. Phasellus sed diam posuere lectus pharetra volutpat. Ut bibendum neque sed diam hendrerit sagittis. Maecenas ut libero et urna semper faucibus. Donec dolor risus, tempus id, porta eu, feugiat in, mi. In pulvinar luctus tortor. Nulla lorem quam, molestie vitae, blandit quis, consequat eu, velit. Donec lobortis velit. Donec in ante vitae augue.</p>

<img class="left" src="/res/images/firstletterbug_firefox.jpg" alt="A screenshot of a first-letter bug in Firefox" />
<img class="right" src="/res/images/firstletterbug_ie.jpg" alt="A screenshot of a first-letter bug in Internet Explorer" />

<p>Here are screenshots just to make sure I&#8217;m not crazy. Firefox on the left and Internet Explorer on the right. I do like the way Firefox handles the spacing when it does display it correctly.</p> 

<p>I&#8217;ll try to submit it to Bugzilla. I&#8217;ve never tried that before but I don&#8217;t see it already submitted. Hope it&#8217;s actually a bug and not me doing something stupid. </p> ]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/programmer/weird-first-letter-floating-bug-in-firefox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SAS lag problems</title>
		<link>http://scott.sherrillmix.com/blog/programmer/sas-lag-problems/</link>
		<comments>http://scott.sherrillmix.com/blog/programmer/sas-lag-problems/#comments</comments>
		<pubDate>Wed, 27 Sep 2006 23:07:23 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Programmer]]></category>
		<category><![CDATA[SAS]]></category>
		<category><![CDATA[Statistician]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[caution]]></category>
		<category><![CDATA[conditional]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[difference]]></category>
		<category><![CDATA[if statement]]></category>
		<category><![CDATA[lag]]></category>
		<category><![CDATA[problem]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/sas-lag-problems/</guid>
		<description><![CDATA[I just found an interesting (that's interesting in the 'I just spent an hour debugging that?' sense) characteristic in SAS. If you have a variable, x, and are using the lag of x, do NOT put the lag(x) inside a conditional statement. This can apparently cause some pretty strange results. It is probably easier to [...]]]></description>
			<content:encoded><![CDATA[<p>I just found an interesting (that's interesting in the 'I just spent an hour debugging <em>that</em>?' sense) characteristic in SAS. If you have a variable, <code>x</code>, and are using the <code>lag</code> of <code>x</code>, do NOT put the <code>lag(x)</code> inside a conditional statement. This can apparently cause some pretty strange results. It is probably easier to see through code than to explain:</p>

<div class="syntax_hilite"><span class="langName">SAS:</span><br /><div id="sas-4">
<div class="sas"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000080; font-weight: bold;">data</span> test;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">input</span> id$<span style="color: #2e8b57; font-weight: bold;color:#800000;">1</span> <span style="color: #0000ff;">x</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cards;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; a <span style="color: #2e8b57; font-weight: bold;color:#800000;">1</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; a <span style="color: #2e8b57; font-weight: bold;color:#800000;">2</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; a <span style="color: #2e8b57; font-weight: bold;color:#800000;">3</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; b <span style="color: #2e8b57; font-weight: bold;color:#800000;">12</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; b <span style="color: #2e8b57; font-weight: bold;color:#800000;">13</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; b <span style="color: #2e8b57; font-weight: bold;color:#800000;">15</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000080; font-weight: bold;">run</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000080; font-weight: bold;">data</span> test;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">set</span> test;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; lagid=<span style="color: #0000ff;">lag</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0000ff;">if</span> lagid=id <span style="color: #0000ff;">then</span> <span style="color: #0000ff;">do</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; lagx=<span style="color: #0000ff;">lag</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">x</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; duration=x-lagx;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0000ff;">end</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000080; font-weight: bold;">run</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000080; font-weight: bold;">proc print</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000080; font-weight: bold;">run</span>; </div></li></ol></div>
</div></div><br />

<p>And here are the results:</p>

<div class="syntax_hilite"><span class="langName">SAS:</span><br /><div id="sas-5">
<div class="sas"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Obs&nbsp; &nbsp; id&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">x</span>&nbsp; &nbsp; lagid&nbsp; &nbsp; lagx&nbsp; &nbsp; duration</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #2e8b57; font-weight: bold;color:#800000;">1</span>&nbsp; &nbsp; &nbsp;a&nbsp; &nbsp; &nbsp; <span style="color: #2e8b57; font-weight: bold;color:#800000;">1</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #2e8b57; font-weight: bold;color:#800000;">2</span>&nbsp; &nbsp; &nbsp;a&nbsp; &nbsp; &nbsp; <span style="color: #2e8b57; font-weight: bold;color:#800000;">2</span>&nbsp; &nbsp; &nbsp; a&nbsp; &nbsp; &nbsp; &nbsp; .&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #2e8b57; font-weight: bold;color:#800000;">3</span>&nbsp; &nbsp; &nbsp;a&nbsp; &nbsp; &nbsp; <span style="color: #2e8b57; font-weight: bold;color:#800000;">3</span>&nbsp; &nbsp; &nbsp; a&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #2e8b57; font-weight: bold;color:#800000;">2</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #2e8b57; font-weight: bold;color:#800000;">1</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #2e8b57; font-weight: bold;color:#800000;">4</span>&nbsp; &nbsp; &nbsp;b&nbsp; &nbsp; &nbsp;<span style="color: #2e8b57; font-weight: bold;color:#800000;">12</span>&nbsp; &nbsp; &nbsp; a&nbsp; &nbsp; &nbsp; &nbsp; .&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #2e8b57; font-weight: bold;color:#800000;">5</span>&nbsp; &nbsp; &nbsp;b&nbsp; &nbsp; &nbsp;<span style="color: #2e8b57; font-weight: bold;color:#800000;">13</span>&nbsp; &nbsp; &nbsp; b&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #2e8b57; font-weight: bold;color:#800000;">3</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #2e8b57; font-weight: bold;color:#800000;">10</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #2e8b57; font-weight: bold;color:#800000;">6</span>&nbsp; &nbsp; &nbsp;b&nbsp; &nbsp; &nbsp;<span style="color: #2e8b57; font-weight: bold;color:#800000;">15</span>&nbsp; &nbsp; &nbsp; b&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #2e8b57; font-weight: bold;color:#800000;">13</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #2e8b57; font-weight: bold;color:#800000;">2</span> </div></li></ol></div>
</div></div><br />

<p>There are obviously some strange things going on here. I have no idea what is going on in the 2nd row of the results where <code>lagx</code> is missing when it should be 1. And in the 5th row, <code>lagx</code> is the 3 from 2 rows above when it should be 12. Luckily, the solution is easy. Just execute the lag every time:</p>

<div class="syntax_hilite"><span class="langName">SAS:</span><br /><div id="sas-6">
<div class="sas"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000080; font-weight: bold;">data</span> test;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">set</span> test;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; lagid=<span style="color: #0000ff;">lag</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; lagx=<span style="color: #0000ff;">lag</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">x</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0000ff;">if</span> lagid=id <span style="color: #0000ff;">then</span> <span style="color: #0000ff;">do</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; duration=x-lagx;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0000ff;">end</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000080; font-weight: bold;">run</span>; </div></li></ol></div>
</div></div><br />

<p>Anyway, it took me two years to run into this so I guess this isn't a common mistake but if you're ever having trouble with a <code>lag</code>, check to make sure it is executed for every line of the data.</p>]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/programmer/sas-lag-problems/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

