<?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>Jason Filley - SnakeLegs</title>
	<atom:link href="http://www.snakelegs.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.snakelegs.org</link>
	<description>Upon thy belly shalt thou go....</description>
	<lastBuildDate>Mon, 07 May 2012 20:14:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Java 2753 regutils.dll error</title>
		<link>http://www.snakelegs.org/2012/05/07/java-2753-regutils-dll-error/</link>
		<comments>http://www.snakelegs.org/2012/05/07/java-2753-regutils-dll-error/#comments</comments>
		<pubDate>Mon, 07 May 2012 20:09:23 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=732</guid>
		<description><![CDATA[What perverse incentives exist to prevent Sun/Oracle from streamlining Java installations on Windows?  They have FAQ items that have been unresolved for years.  Don&#8217;t tell me you can&#8217;t reproduce them; I can.  You&#8217;d think that routine professional curiosity would impel them to troubleshoot a live customer issue.  Sheer laziness. I had a workstation today that would <a href='http://www.snakelegs.org/2012/05/07/java-2753-regutils-dll-error/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>What perverse incentives exist to prevent Sun/Oracle from streamlining Java installations on Windows?  They have FAQ items that have been unresolved for <em>years</em>.  Don&#8217;t tell me you can&#8217;t reproduce them; I can.  You&#8217;d think that routine professional curiosity would impel them to troubleshoot a live customer issue.  <a href="https://forums.oracle.com/forums/thread.jspa?messageID=9375934&amp;#9375934">Sheer laziness</a>.</p>
<p>I had a workstation today that would not install the 6.0_update32 JRE, getting the error &#8220;error 2753 regutils.dll&#8221;.</p>
<p><a href="https://forums.oracle.com/forums/thread.jspa?threadID=1316410&amp;start=15&amp;tstart=30">Sun/Oracle&#8217;s &#8216;troubleshooting&#8217; is worthless</a>.  Nobody else&#8217;s was any help, either, though.  <a href="http://singularlabs.com/software/javara/">JavaRa</a> gave it a good try. (Seriously, you just have a comprehensive list of registry keys and files/directories to delete.  That&#8217;s all.)</p>
<p>So, fire up <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645">procmon</a>, include &#8220;msiexec.exe&#8221; and see what pops up&#8230;.</p>
<p><a href="http://www.snakelegs.org/wp-content/uploads/2012/05/java_2753_regutil_dll_error.png"><img class="aligncenter size-full wp-image-733" title="java_2753_regutil_dll_error" src="http://www.snakelegs.org/wp-content/uploads/2012/05/java_2753_regutil_dll_error.png" alt="" width="766" height="299" /></a></p>
<p>Simple enough.  The installer thinks there&#8217;s another conflicting existing installation:</p>
<p><a href="http://www.snakelegs.org/wp-content/uploads/2012/05/java_2753_error_registry.png"><img class="aligncenter size-full wp-image-734" title="java_2753_error_registry" src="http://www.snakelegs.org/wp-content/uploads/2012/05/java_2753_error_registry.png" alt="" width="657" height="212" /></a></p>
<p>Delete the registry key (and subkeys):</p>
<p>HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120632FF</p>
<p>Grand.</p>
<p>So, why can&#8217;t Sun/Oracle release a utility to clean up all traces of Java?  Laziness, pure and simple.  This has been a pain for admins for years.  Fix your installer.</p>
<p>cf the <a href="http://blogs.msdn.com/b/astebner/archive/2008/08/28/8904493.aspx">.NET Framework Cleanup Tool</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/05/07/java-2753-regutils-dll-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tickle Me, Honduran Samurai</title>
		<link>http://www.snakelegs.org/2012/04/22/tickle-me-honduran-samurai/</link>
		<comments>http://www.snakelegs.org/2012/04/22/tickle-me-honduran-samurai/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 16:22:05 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=728</guid>
		<description><![CDATA[Netflix suggests I watch an Elmo film, based in part on my like of 13 Assassins, and Sin Nombre&#8230;.]]></description>
			<content:encoded><![CDATA[<p>Netflix suggests I watch an Elmo film, based in part on my like of <a href="http://www.imdb.com/title/tt1436045/">13 Assassins</a>, and <a href="http://www.imdb.com/title/tt1127715/">Sin Nombre</a>&#8230;.</p>
<p><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/elmo.png"><img class="aligncenter size-full wp-image-729" title="elmo" src="http://www.snakelegs.org/wp-content/uploads/2012/04/elmo.png" alt="" width="419" height="373" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/04/22/tickle-me-honduran-samurai/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SAP ATP Server</title>
		<link>http://www.snakelegs.org/2012/04/20/sap-atp-server/</link>
		<comments>http://www.snakelegs.org/2012/04/20/sap-atp-server/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 22:32:47 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=720</guid>
		<description><![CDATA[Overview The SAP ATP (Available To Promise) server caches availability checks in the export/import buffer, replacing database calls to RESB and VBBE. Reference: SAP Note 99999 &#8211; ATP server: Installation and sizing (https://service.sap.com/sap/support/notes/99999) SAP Note 702728 &#8211; Profile parameter for export/import buffer instances (https://service.sap.com/sap/support/notes/702728) SAP Note 373986 &#8211; Overflow of the export/import buffer (https://service.sap.com/sap/support/notes/373986) &#8220;SAP <a href='http://www.snakelegs.org/2012/04/20/sap-atp-server/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<h1>Overview</h1>
<p>The SAP ATP (Available To Promise) server caches availability checks in the export/import buffer, replacing database calls to <span style="font-family: Consolas;">RESB</span> and <span style="font-family: Consolas;">VBBE</span>.</p>
<p><span id="more-720"></span></p>
<p>Reference:</p>
<ul>
<li><a href="https://service.sap.com/sap/support/notes/99999"><span style="font-family: Times New Roman; font-size: 12pt;">SAP Note 99999</span></a><span style="font-family: Times New Roman; font-size: 12pt;"> &#8211; ATP server: Installation and sizing (https://service.sap.com/sap/support/notes/99999)<br />
</span></li>
<li><a href="https://service.sap.com/sap/support/notes/702728"><span style="font-family: Times New Roman; font-size: 12pt;">SAP Note 702728</span></a><span style="font-family: Times New Roman; font-size: 12pt;"> &#8211; Profile parameter for export/import buffer instances (https://service.sap.com/sap/support/notes/702728)<br />
</span></li>
<li><a href="https://service.sap.com/sap/support/notes/373986"><span style="font-family: Times New Roman; font-size: 12pt;">SAP Note 373986</span></a><span style="font-family: Times New Roman; font-size: 12pt;"> &#8211; Overflow of the export/import buffer (https://service.sap.com/sap/support/notes/373986)<br />
</span></li>
<li><span style="font-family: Times New Roman; font-size: 12pt;">&#8220;<a href="http://www.sap-press.com/products/SAP-Performance-Optimization-Guide-%286th-Edition%29.html">SAP Performance Optimization Guide (6<sup>th</sup> Edition)</a>,&#8221; Thomas Schneider, Galileo Press (2009), section 10.4, pp. 443-450. (http://www.sap-press.com/products/SAP-Performance-Optimization-Guide-%286th-Edition%29.html)<br />
</span></li>
</ul>
<h1>Install the ATP Server</h1>
<p>Pick a suitable SAP Instance to run the ATP server, subject to the space constraints below.</p>
<p>The ATP server is a logical service activated by a profile parameter, and since all of the instance&#8217;s servers will use this same server, the parameter should be set in the DEFAULT profile (transaction RZ10). The ATP server and Enqueue server should run in the same instance.</p>
<p>Set both:</p>
<ul>
<li><span style="font-family: Consolas; font-size: 12pt;">rdisp/enqname<br />
</span></li>
<li><span style="font-family: Consolas; font-size: 12pt;">rdisp/atp_server<br />
</span></li>
</ul>
<p><img src="http://www.snakelegs.org/wp-content/uploads/2012/04/042012_2232_SAPATPServe1.png" alt="" /></p>
<p>Restart the instances to pick up the changes.</p>
<p><img src="http://www.snakelegs.org/wp-content/uploads/2012/04/042012_2232_SAPATPServe2.png" alt="" /></p>
<h1>Tune the Export/Import Buffer</h1>
<p>Figure out how many objects you plan to cache. Either follow the elaborate formulas in the references above, or just flush the cache, run a sample test, and extrapolate. Quick and dirty guideline: figure out how many maximum objects you&#8217;ll ever need (<span style="font-family: Consolas;">rsdb/obj/max_objects</span>) and set it, and set the Export/Import Buffer (size in KB) to twice that number (<span style="font-family: Consolas;">rsdb/obj/buffersize</span>), since each object should take a little less than half a KB. Tune as needed.</p>
<p><img src="http://www.snakelegs.org/wp-content/uploads/2012/04/042012_2232_SAPATPServe3.png" alt="" /></p>
<p>In ST02&#8242;s &#8220;Detailed Analysis&#8221; menu, select &#8220;Buffered Objects&#8221; to see individual records (Table Name = &#8220;ATPSB&#8221;). See transaction ACDB, as well. You can view or delete individual, or all, entries.</p>
<p><img src="http://www.snakelegs.org/wp-content/uploads/2012/04/042012_2232_SAPATPServe4.png" alt="" /></p>
<p><img src="http://www.snakelegs.org/wp-content/uploads/2012/04/042012_2232_SAPATPServe5.png" alt="" /></p>
<p><img src="http://www.snakelegs.org/wp-content/uploads/2012/04/042012_2232_SAPATPServe6.png" alt="" /></p>
<h1>Transactions</h1>
<ul style="margin-left: 72pt;">
<li><span style="font-size: 12pt;"><span style="font-family: Consolas;">RZ10</span><span style="font-family: Times New Roman;"> – Set parameters.<br />
</span></span></li>
<li><span style="font-size: 12pt;"><span style="font-family: Consolas;">ST02</span><span style="font-family: Times New Roman;"> – View buffer statistics.<br />
</span></span></li>
<li><span style="font-size: 12pt;"><span style="font-family: Consolas;">SM50/SM51</span><span style="font-family: Times New Roman;"> – Verify ATP and Enqueue servers activated.<br />
</span></span></li>
<li>
<div><span style="font-size: 12pt;"><span style="font-family: Consolas;">ACDB </span><span style="font-family: Times New Roman;">– View and delete export/import buffer table entries.<br />
</span></span></div>
<p><span style="font-family: Times New Roman; font-size: 12pt;"><br />
</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/04/20/sap-atp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The SAP Elf</title>
		<link>http://www.snakelegs.org/2012/04/13/the-sap-elf/</link>
		<comments>http://www.snakelegs.org/2012/04/13/the-sap-elf/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 16:38:23 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=691</guid>
		<description><![CDATA[I laugh every time I see this screen in SAP &#8230; &#8230; because I know what the girl on the right is thinking &#8230; For posterity, here&#8217;s an edited picture that doesn&#8217;t make the girl on the left have pointy ears. There went my lunch hour.]]></description>
			<content:encoded><![CDATA[<p>I laugh every time I see this screen in SAP &#8230;</p>
<p><img class="aligncenter size-full wp-image-695" title="elves" src="http://www.snakelegs.org/wp-content/uploads/2012/04/elves3.png" alt="" width="569" height="192" /></p>
<p>&#8230; because I know what the girl on the right is thinking &#8230;</p>
<p><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/elves22.png"><img class="aligncenter size-full wp-image-700" title="thinking" src="http://www.snakelegs.org/wp-content/uploads/2012/04/elves22.png" alt="" width="569" height="192" /></a></p>
<p>For posterity, here&#8217;s an edited picture that doesn&#8217;t make the girl on the left have pointy ears.</p>
<p><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/elves32.png"><img class="aligncenter size-full wp-image-701" title="edited" src="http://www.snakelegs.org/wp-content/uploads/2012/04/elves32.png" alt="" width="569" height="192" /></a></p>
<p>There went my lunch hour.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/04/13/the-sap-elf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Harbinger of Sorrow &#8211; Who What When Where Why</title>
		<link>http://www.snakelegs.org/2012/04/12/harbinger-of-sorrow-who-what-when-where-why/</link>
		<comments>http://www.snakelegs.org/2012/04/12/harbinger-of-sorrow-who-what-when-where-why/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 02:18:00 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=680</guid>
		<description><![CDATA[Google auto-suggests queries based on your input. Start typing, and it will fill in, based on popular queries.  We&#8217;re doomed as a species&#8230;. &#160;]]></description>
			<content:encoded><![CDATA[<p>Google auto-suggests queries based on your input. Start typing, and it will fill in, based on popular queries.  We&#8217;re doomed as a species&#8230;.</p>
<p>&nbsp;</p>
<p><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_01_why.png"><img class="aligncenter size-full wp-image-681" title="goog_01_why" src="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_01_why.png" alt="" width="541" height="92" /></a><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_02_who.png"><img class="aligncenter size-full wp-image-682" title="goog_02_who" src="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_02_who.png" alt="" width="541" height="92" /></a><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_03_what.png"><img class="aligncenter size-full wp-image-683" title="goog_03_what" src="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_03_what.png" alt="" width="541" height="92" /></a><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_04_when.png"><img class="aligncenter size-full wp-image-684" title="goog_04_when" src="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_04_when.png" alt="" width="541" height="92" /></a><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_05_where.png"><img class="aligncenter size-full wp-image-685" title="goog_05_where" src="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_05_where.png" alt="" width="541" height="92" /></a><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_06_how.png"><img class="aligncenter size-full wp-image-686" title="goog_06_how" src="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_06_how.png" alt="" width="541" height="92" /></a><a href="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_07_how_often.png"><img class="aligncenter size-full wp-image-687" title="goog_07_how_often" src="http://www.snakelegs.org/wp-content/uploads/2012/04/goog_07_how_often.png" alt="" width="541" height="92" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/04/12/harbinger-of-sorrow-who-what-when-where-why/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Constraint Satisfaction &#8211; Product Mix &#8211; Wood Paneling Example</title>
		<link>http://www.snakelegs.org/2012/03/15/constraint-satisfaction-product-mix-wood-paneling-example/</link>
		<comments>http://www.snakelegs.org/2012/03/15/constraint-satisfaction-product-mix-wood-paneling-example/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 05:45:29 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=671</guid>
		<description><![CDATA[Don&#8217;t get me started&#8230;. It&#8217;s amazing that Operations Research / Optimization / Contraint Satisfaction have come so far ( the Holy Grail of Computing ), yet so very few IT personnel even know about it&#8230;.]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t get me started&#8230;. It&#8217;s amazing that Operations Research / Optimization / Contraint Satisfaction have come so far ( the Holy Grail of Computing ), yet so very few IT personnel even know about it&#8230;.<br />
<span id="more-671"></span></p>
<pre class="brush: plain; title: ; notranslate">
% minizinc product mix model from http://www.solver.com/stepbystep.htm
% 2012 Jason Filley (jason@snakelegs.org)

%%%% parameters
int: glue = 5800;		% glue (quarts)
int: pressing = 730;	% pressing time (hours)
int: pine = 29200;		% pine chips (pounds)
int: oak = 32500;		% oak chips (pounds)

constraint assert(glue &gt;= 0,&quot;Invalid datafile: &quot; ++
	&quot;glue must be non-negative.&quot;);
constraint assert(pressing &gt;= 0,&quot;Invalid datafile: &quot; ++
	&quot;pressing must be non-negative.&quot;);
constraint assert(pine &gt;= 0,&quot;Invalid datafile: &quot; ++
	&quot;pine must be non-negative.&quot;);
constraint assert(oak &gt;= 0,&quot;Invalid datafile: &quot; ++
	&quot;oak must be non-negative.&quot;);

%%%% decision variables
var 0..100: tahoe;
var 0..100: pacific;
var 0..100: savannah;
var 0..100: aspen;

%%%% constraints

% glue
constraint  50*tahoe + 50*pacific + 100*savannah + 50*aspen &lt;= glue;

% pressing time
constraint  5*tahoe + 15*pacific + 10*savannah + 5*aspen &lt;= pressing;

% pine chips
constraint  500*tahoe + 400*pacific + 250*savannah + 200*aspen &lt;= pine;

% oak chips
constraint  500*tahoe + 750*pacific + 250*savannah + 500*aspen &lt;= oak;

%%%% objective function -- maximize profit
var 0..100000: profit;
profit = 450*tahoe + 1150*pacific + 800*savannah + 400*aspen;
solve maximize profit;

output [&quot;Tahoe: &quot;, show(tahoe), &quot;\n&quot;,
		&quot;Pacific: &quot;, show(pacific), &quot;\n&quot;,
		&quot;Savannah: &quot;, show(savannah), &quot;\n&quot;,
		&quot;Aspen: &quot;, show(aspen), &quot;\n&quot;,
		&quot;Profit: &quot;, show(profit), &quot;\n&quot;];

% minizinc.exe product_mix_wood_paneling.mzn
% Tahoe: 23
% Pacific: 15
% Savannah: 39
% Aspen: 0
% Profit: 58800
% ----------
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/03/15/constraint-satisfaction-product-mix-wood-paneling-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C &#8211; Assignment vs. Equality</title>
		<link>http://www.snakelegs.org/2012/03/11/c-assignment-vs-equality/</link>
		<comments>http://www.snakelegs.org/2012/03/11/c-assignment-vs-equality/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 01:57:47 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=638</guid>
		<description><![CDATA[DISCLAIMER &#8211; I DON&#8217;T DO C. And my Perl isn&#8217;t great, either. I routinely browse the openbsd-cvs mailing list, and I saw this easy openbsd-cvs bug fix (&#8220;Fix a stupid bug in tcpdump print-bgp.c&#8220;) the other night when doing some really late-night, partial-involvement sysadmin work.  So I decided to pass the time (&#8220;stay awake&#8221;) by <a href='http://www.snakelegs.org/2012/03/11/c-assignment-vs-equality/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>DISCLAIMER &#8211; I DON&#8217;T DO C.  And my Perl isn&#8217;t great, either.</p>
<p>I routinely browse the openbsd-cvs mailing list, and I saw this easy openbsd-cvs bug fix (&#8220;<a href="http://marc.info/?l=openbsd-tech&amp;m=132966574603292&amp;w=2">Fix a stupid bug in tcpdump print-bgp.c</a>&#8220;) the other night when doing some really late-night, partial-involvement sysadmin work.  So I decided to pass the time (&#8220;stay awake&#8221;) by doing a regex exercise to find similar patterns in the OpenBSD source tree.</p>
<p><span id="more-638"></span></p>
<p>In C:</p>
<ul>
<li>&#8220;a = b&#8221; (single equals sign) is the assignment operator.  Take the value of &#8220;b&#8221; and put it in &#8220;a.&#8221;</li>
<li>&#8220;a == b&#8221; (double equals signs) is an equality test.  If &#8220;a&#8221; equals &#8220;b&#8221; then the expression evaluates true.</li>
</ul>
<p>It&#8217;s an <a href="http://www.andromeda.com/people/ddyer/topten.html">easy bug to introduce</a>, using a single = when you want two, so I tried to find more.  Mainly, it was regex practice.</p>
<pre class="brush: perl; title: ; notranslate">
#!/usr/bin/perl -w

use strict;

if ( $#ARGV &lt; 0 ) {
    die &quot;Specify a file.\n&quot;;
}

my $file = $ARGV[0];

open( SOURCEFILE, &quot;&lt;$file&quot; ) || die &quot;Can't open file $file.\n&quot;;

while (&lt;SOURCEFILE&gt;) {

    my $line = $_;
    chomp($line);

    if ( $line =~ /^\s*if\s.*\s=\s(-)?\d/ ) {

        $line =~ s/^\s*//;s/\s*$//;

        unless ( $line =~ /^(\*|\/\*)/ ) {
            unless ( $line =~ /(\(.*\).*\s=\s)/ ) {
                print &quot;/*$file: $. */\n$line\n\n&quot;;
            }
        }
    }
}

close(SOURCEFILE);
</pre>
<p>It includes lines that are part of a multi-line comment, but my time and interest are exhausted, and I could have sworn there were compiler options to test for this anyway &#8230;?  And I don&#8217;t do C.</p>
<p>In the whole tree, I ended up with only a few cases where an assignment occurs in the condition of an if statement:</p>
<pre class="brush: bash; title: ; notranslate">
$ find /usr/src -type f -name \*.c -exec ./assigntest.pl '{}' \;
</pre>
<pre class="brush: cpp; title: ; notranslate">
/*/usr/src/sys/arch/alpha/alpha/in_cksum.c: 101 */
if ((offset = 3 &amp; (long) lw) != 0) {

/*/usr/src/sys/dev/gpio/gpiodcf.c: 466 */
if ((ymdhm.dt_year = 2000 + FROMBCD(year_bits)) &gt; 2037) {

/*/usr/src/sys/dev/usb/udcf.c: 669 */
if ((ymdhm.dt_year = 2000 + FROMBCD(year_bits)) &gt; 2037) {

/*/usr/src/sys/net/zlib.c: 3830 */
if ((f = 1 &lt;&lt; (j = k - w)) &gt; a + 1)     /* try a k-w bit table */

/*/usr/src/bin/ed/main.c: 603 */
if ((garrulous = 1 - garrulous) &amp;&amp; *errmsg)

/*/usr/src/bin/rmail/rmail.c: 188 */
if ((from_path = malloc(fptlen = 256)) == NULL)

/*/usr/src/gnu/egcs/libio/floatconv.c: 1878 */
if (j = 11 - hi0bits(word0(d2) &amp; Frac_mask))

/*/usr/src/gnu/usr.bin/binutils/gas/config/tc-i860.c: 606 */
if ((c = 10 * (c - '0') + (*s++ - '0')) &gt;= 32)

/*/usr/src/gnu/usr.bin/binutils/gas/config/tc-sparc.c: 2052 */
if ((c = 10 * (c - '0') + (*s++ - '0')) &gt;= 32)

/*/usr/src/gnu/usr.bin/binutils/gas/config/tc-tic4x.c: 464 */
if (flonum.low &gt; flonum.leader  /* = 0.0e0 */

/*/usr/src/gnu/usr.bin/binutils/gdb/ns32knbsd-nat.c: 297 */
if (enter_addr = 0)

/*/usr/src/gnu/usr.bin/cvs/zlib/inftrees.c: 218 */
if ((f = 1 &lt;&lt; (j = k - w)) &gt; a + 1)     /* try a k-w bit table */

/*/usr/src/gnu/usr.bin/gas/config/tc-i860.c: 499 */
if ((c = 10 * (c - '0') + (*s++ - '0')) &gt;= 32) {

/*/usr/src/gnu/usr.bin/gas/config/tc-sparc.c: 745 */
if ((c = 10 * (c - '0') + (*s++ - '0')) &gt;= 32) {

/*/usr/src/gnu/usr.bin/gcc/gcc/testsuite/gcc.c-torture/execute/20001221-1.c: 4 */
if (! (a = 0xfedcba9876543210ULL))

/*/usr/src/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/20020426-2.c: 103 */
if ((f = 1 &lt;&lt; (j = k - w)) &gt; a + 1)

/*/usr/src/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/c99-bool-1.c: 207 */
if ((u = 2) != 1)

/*/usr/src/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/compare4.c: 36 */
if (u &lt; (x = -1)) /* { dg-warning &quot;signed and unsigned&quot; &quot;MODIFY_EXPR&quot; } */

/*/usr/src/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/compare4.c: 38 */
if (u &lt; (x = 10))

/*/usr/src/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/compare4.c: 40 */
if ((x = 10) &lt; u)

/*/usr/src/gnu/usr.bin/binutils-2.17/gas/config/tc-i860.c: 606 */
if ((c = 10 * (c - '0') + (*s++ - '0')) &gt;= 32)

/*/usr/src/gnu/usr.bin/binutils-2.17/gas/config/tc-sparc.c: 2102 */
if ((c = 10 * (c - '0') + (*s++ - '0')) &gt;= 32)

/*/usr/src/gnu/usr.bin/binutils-2.17/gas/config/tc-tic4x.c: 463 */
if (flonum.low &gt; flonum.leader  /* = 0.0e0 */

/*/usr/src/gnu/usr.sbin/sendmail/rmail/rmail.c: 228 */
if ((from_path = malloc(fptlen = 256)) == NULL)

/*/usr/src/lib/libc/gdtoa/dtoa.c: 212 */
if (( j = 11 - hi0bits(word0(&amp;d2) &amp; Frac_mask) )!=0)

/*/usr/src/lib/libc/gdtoa/gdtoa.c: 211 */
if ( (j = 11 - hi0bits(word0(&amp;d) &amp; Frac_mask)) !=0)

/*/usr/src/lib/libc/gdtoa/gdtoa.c: 344 */
if ( (j = 11 - hi0bits(word0(&amp;d) &amp; Frac_mask)) !=0)

/*/usr/src/lib/libc/gdtoa/strtod.c: 74 */
if (!scale || (i = 2*P + 1 - ((word0(x) &amp; Exp_mask) &gt;&gt; Exp_shift)) &lt;= 0)

/*/usr/src/lib/libc/gdtoa/strtod.c: 532 */
if (scale &amp;&amp; (j = 2*P + 1 - ((word0(&amp;rv) &amp; Exp_mask)

/*/usr/src/lib/libedit/common.c: 909 */
if (tmplen &lt; 0 || (tmpbuf[tmplen] = 0, parse_line(el, tmpbuf)) == -1)

/*/usr/src/usr.bin/apply/apply.c: 146 */
if ((c = malloc(clen = 1024)) == NULL)

/*/usr/src/usr.bin/xlint/lint1/decl.c: 1913 */
if (!redec &amp;&amp; !isredec(dsym, (warn = 0, &amp;warn))) {

/*/usr/src/usr.bin/xlint/lint1/func.c: 306 */
if (!isredec(fsym, (warn = 0, &amp;warn))) {

/*/usr/src/usr.bin/xlint/lint1/tree.c: 3284 */
if (!eqtype(tp, tn-&gt;tn_type, 1, 0, (warn = 0, &amp;warn)) || warn)
</pre>
<p>They look fine to me, but all the same, it&#8217;s still a curious idiom to occur so few times.</p>
<pre class="brush: cpp; title: ; notranslate">
#toy test
#include &lt;stdio.h&gt;

int main(){
    int     a;
    if ((a = 2000 + 50) &gt; 2037) {
        printf(&quot;TRUE - a is %d\n&quot;,a);
    }
    else {
        printf(&quot;FALSE - a is %d\n&quot;,a);
    }
return 0;
}
/* TRUE - a is 2050 */
</pre>
<p>And then I went to bed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/03/11/c-assignment-vs-equality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP SOAP Handling of SAP Table Reads</title>
		<link>http://www.snakelegs.org/2012/03/11/php-soap-handling-of-sap-table-reads/</link>
		<comments>http://www.snakelegs.org/2012/03/11/php-soap-handling-of-sap-table-reads/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 20:29:08 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=626</guid>
		<description><![CDATA[Here’s how to handle tables returned from SAP, with PHP+SOAP. Note that “AtpTable” is listed as input (non-optional). Just pass it an empty string. For the output, you have to handle 3 cases: empty, 1 result (returns a single object), more than 1 result (returns an array). Make sure SOAP_SINGLE_ELEMENT_ARRAYS is set, which returns an <a href='http://www.snakelegs.org/2012/03/11/php-soap-handling-of-sap-table-reads/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Here’s how to handle tables returned from SAP, with PHP+SOAP.<br />
<span id="more-626"></span><br />
<a href="http://www.snakelegs.org/wp-content/uploads/2012/03/sap_php_table.jpg"><img class="aligncenter size-full wp-image-631" title="SAP PHP SOAP table" src="http://www.snakelegs.org/wp-content/uploads/2012/03/sap_php_table.jpg" alt="" width="376" height="398" /></a></p>
<p>Note that “AtpTable” is listed as input (non-optional). Just pass it an empty string. For the output, you have to handle 3 cases: empty, 1 result (returns a single object), more than 1 result (returns an array). Make sure SOAP_SINGLE_ELEMENT_ARRAYS is set, which returns an array of 1 item when only 1 item exists (PHP considers that a feature, not a bug). Then you just test that the array exists (isset).</p>
<p>&nbsp;</p>
<pre class="brush: php; highlight: [4,31,32,33]; title: ; wrap-lines: true; notranslate">
&lt;?php
$SOAP_OPTS = array( 'login' =&gt; '&lt;THEACCOUNT&gt;',
                    'password' =&gt; '&lt;THEPASSWORD&gt;',
                    'features' =&gt; SOAP_SINGLE_ELEMENT_ARRAYS);
$WSDL = &quot;http://sap.corp.example.com:8000/sap/bc/srt/wsdl/bndg_BLAHBLAHBLAH/wsdl11/allinone/standard/document?sap-client=100&quot;;
$client = new SoapClient($WSDL,$SOAP_OPTS);
$params = array(
    'AtpTable' =&gt; &quot;&quot;,
    'Branch' =&gt; &quot;1&quot;,
    'CheckRule' =&gt; &quot;A&quot;,
    'GetRows' =&gt; &quot;100&quot;,
    'IncludeUnsavSo' =&gt; &quot;X&quot;,
    'StartMaterial' =&gt; &quot;12345&quot;,
    'Sloc' =&gt; &quot;0001&quot;
);

try
{
    $result = $client-&gt;ZfmGetAtpTest($params);
}

catch (SoapFault $exception)
{
    print &quot;***Caught Exception***\n&quot;;
    print_r($exception);
    print &quot;***END Exception***\n&quot;;
    die();
}

#print_r($result);
if (isset($result-&gt;AtpTable-&gt;item)) {
    foreach ($result-&gt;AtpTable-&gt;item as $row) {
        print &quot;$row-&gt;Material\t$row-&gt;Branch\t$row-&gt;AtpQty\n&quot;;
    }
}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/03/11/php-soap-handling-of-sap-table-reads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>John and Lillian</title>
		<link>http://www.snakelegs.org/2012/03/08/john-and-lillian/</link>
		<comments>http://www.snakelegs.org/2012/03/08/john-and-lillian/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 05:49:12 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=608</guid>
		<description><![CDATA[Out of high school, I worked in a nursing home, in the diatetic department [which means "kitchen"].  I washed dishes and set up the tables for the residents. Lillian was an old woman.  She had liver spots the size of quarters.  She had Coke-bottle glasses [Literally.  They were thick.].  She was diabetic and had one <a href='http://www.snakelegs.org/2012/03/08/john-and-lillian/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Out of high school, I worked in a nursing home, in the diatetic department [which means "kitchen"].  I washed dishes and set up the tables for the residents.</p>
<p>Lillian was an old woman.  She had liver spots the size of quarters.  She had Coke-bottle glasses [Literally.  They were <em>thick</em>.].  She was diabetic and had one leg amputated above her knee, and she was, of course, in a wheelchair.  She was a <em>very</em> sweet woman, but her faculties had left her, for the most part, and she wasn&#8217;t too keen about what was going on.</p>
<p>Her husband John was an old, overall-wearing farmer, and he came in every day before lunch.  He&#8217;d wait while the nurses assistants got Lillian ready for lunch, sitting out by Lillian&#8217;s table.  He&#8217;d help her eat lunch, and then he&#8217;d spend the day with her.  She&#8217;d nap, or watch the kids come in for piano recitals, or play Bingo, or get her fingernails done, or roll her wheelchair around, or nap, or just watch Lawrence Welk, or just spend the afternoon doing nothing.</p>
<p>John helped Lillian eat supper, and when the nurses assistants came to take her to bed, John took his van and went home.</p>
<p><span style="text-decoration: underline;">Every</span> day.</p>
<p>One day, John was sitting out at the lunch table, waiting for the assistants to bring Lillian out, and one of the other women, Lenora, asked John, &#8220;John, you know she would never know if you didn&#8217;t come.  You have so many other things you could be doing.  Why on earth do you come here every day?&#8221;</p>
<p>And John said, &#8220;Because I said, &#8216;For better, or for worse.&#8217;  And I <em>meant</em> it.&#8221;</p>
<p>Well, Kristi, I said for better or for worse, and I <em>meant</em> it.  Happy 15th anniversary.  We&#8217;ll see who&#8217;s pushing who around the nursing home, later&#8230;..</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/03/08/john-and-lillian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Best Phone Malware Ever</title>
		<link>http://www.snakelegs.org/2012/03/03/the-best-phone-malware-ever/</link>
		<comments>http://www.snakelegs.org/2012/03/03/the-best-phone-malware-ever/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 02:49:34 +0000</pubDate>
		<dc:creator>Jason Filley</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.snakelegs.org/?p=604</guid>
		<description><![CDATA[I was on a conference call last week, and there was a terrible echo.  It was oddly distracting and made it difficult for me to speak.  I was going to mention it to the other parties, but it sounded more like a cranky irritability than anything, and I was kind of embarassed to say anything. <a href='http://www.snakelegs.org/2012/03/03/the-best-phone-malware-ever/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I was on a conference call last week, and there was a terrible echo.  It was oddly distracting and made it difficult for me to speak.  I was going to mention it to the other parties, but it sounded more like a cranky irritability than anything, and I was kind of embarassed to say anything.</p>
<p>Well, two days later, Drudge linked to &#8220;<a href="http://www.myfoxorlando.com/dpp/news/scitech/science/030212-japan-invents-speech-jamming-gun-that-silences-people-mid-sentence">Japan invents speech-jamming gun that silences people mid-sentence</a>&#8220;.</p>
<blockquote><p>&#8220;The device works by recording its target&#8217;s speech then firing their words back at them with a 0.2-second delay, which affects the brain&#8217;s cognitive processes and causes speakers to stutter before silencing them completely.&#8221;</p></blockquote>
<p>So I&#8217;m not some weirdo who gets distracted by echoes.  It&#8217;s <span style="text-decoration: underline;">science</span>. I feel better.  (Unless it doesn&#8217;t actually work, of course.)</p>
<p>Now, wouldn&#8217;t it be funny to have some iPhone/Android/whatever malware that did the same thing, rendering people unable to speak into their own phones?  They could speak as long as they&#8217;re not listening, too, turning the phone into a walkie-talkie.</p>
<p>That&#8217;s as funny as my relative when 3-way calling first came out.  He&#8217;d call a Chinese restaurant and a Vietnamese restaurant at the same time and let them fight over who called who.  &#8220;You call me! I no call you!&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snakelegs.org/2012/03/03/the-best-phone-malware-ever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 4.479 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-19 16:53:36 -->

