<?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>Some stuff &#187; call</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=call" rel="self" type="application/rss+xml" />
	<link>https://blog.yhuang.org</link>
	<description>here.</description>
	<lastBuildDate>Wed, 27 Aug 2025 08:50:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>disgusting linux package installation issues</title>
		<link>https://blog.yhuang.org/?p=973</link>
		<comments>https://blog.yhuang.org/?p=973#comments</comments>
		<pubDate>Sun, 09 Dec 2012 01:13:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[conf]]></category>
		<category><![CDATA[database configuration file]]></category>
		<category><![CDATA[default configuration file]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux package]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[reinstall]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=973</guid>
		<description><![CDATA[Was installing a package on Linux and ran into huge problems. First, the package &#8212; let&#8217;s call it &#8216;somecrap&#8217; &#8212; contained a post-installation configuration. Linux has this terminal pseudo-GUI used sometimes for configuration of packages. You may have seen it, it looks like ASCII art. Unfortunately it&#8217;s so brittle that when you Ctrl-Z out of [...]]]></description>
			<content:encoded><![CDATA[<p>Was installing a package on Linux and ran into huge problems.</p>
<p>First, the package &#8212; let&#8217;s call it &#8216;somecrap&#8217; &#8212; contained a post-installation configuration. Linux has this terminal pseudo-GUI used sometimes for configuration of packages. You may have seen it, it looks like ASCII art. Unfortunately it&#8217;s so brittle that when you Ctrl-Z out of it there is no way to get it back. So I had to just Ctrl-C out of it. Turns out the process that runs it (&#8216;whiptail&#8217;) is stuck using 100% of CPU. So that&#8217;s fine, it too can be killed, but how to get a configuration do-over? The package thinks it&#8217;s already configured &#8212; and indeed, wrote out a default configuration file. There is no way to get a redo short of removing and reinstalling the package. Right? And that&#8217;s where the real problem starts.<br />
<span id="more-973"></span><br />
The package uses &#8216;dbconfig-common&#8217;. When you remove the package, the database modifications are not reverted (understandable), but the database configuration file &#8216;/etc/dbconfig-common/somecrap.conf&#8217; that was generated by this pseudo-GUI was also not removed. When you remove and reinstall the package, it refuses to reconfigure that file, probably because dbconfig-common thinks everything is already configured! So then I just deleted &#8216;somecrap.conf&#8217;, in the quite natural belief that the package will then rerun the configuration to generate it, like on a fresh install.</p>
<p>Turns out no. Every installation gives</p>
<p>dbconfig-common: writing config to /etc/dbconfig-common/somecrap.conf<br />
Not replacing deleted config file /etc/dbconfig-common/somecrap.conf<br />
unable to read input file /etc/dbconfig-common/somecrap.conf</p>
<p>And the configuration fails. It&#8217;s really unbelievable how fatuous &#8216;dbconfig-common&#8217; is here. Somewhere it&#8217;s tracking that &#8216;somecrap.conf&#8217; is supposed to exist, instead of determining whether it actually does, from the ground truth.</p>
<p>All the ideas about removing, purging packages, reinstalling are not going to help here. The thing that worked was to reinstall dbconfig-common, to get it to fix itself:</p>
<p>apt-get install &#8211;reinstall dbconfig-common</p>
<p>debconf then screeches about &#8216;possible database corruption&#8217; and &#8216;adding back missing question&#8217; w.r.t. &#8216;dbconfig-common&#8217;. Reinstalling &#8216;somecrap&#8217; at this point finally brings back the original pseudo-GUI configuration process.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=973</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>different kind of coupon collector&#8217;s problem</title>
		<link>https://blog.yhuang.org/?p=283</link>
		<comments>https://blog.yhuang.org/?p=283#comments</comments>
		<pubDate>Mon, 11 Oct 2010 09:18:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[column sums]]></category>
		<category><![CDATA[math 1]]></category>
		<category><![CDATA[math types]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[partition functions]]></category>
		<category><![CDATA[pigeonhole principle]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[sum]]></category>
		<category><![CDATA[theory]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=283</guid>
		<description><![CDATA[The classic coupon collector&#8217;s problem asks for the number of samples it takes to collect all coupon types from a sequence of coupons in which each of the types of coupons has an unlimited number of copies. Here is a different kind of problem: if there are limited copies of each of the coupon types [...]]]></description>
			<content:encoded><![CDATA[<p>The classic coupon collector&#8217;s problem asks for the number of samples it takes to collect all coupon types from a sequence of coupons in which each of the \(k\) types of coupons has an unlimited number of copies.</p>
<p>Here is a different kind of problem: if there are limited copies of each of the \(k\) coupon types (say, \(d\) copies), how many samples does it take to collect \(t\) coupon types?</p>
<p><span id="more-283"></span><br />
By the pigeonhole principle, we have two extremes: from \(n=0\) to \(n=t-1\) samples, it is impossible to collect \(t\) coupon types; and for \(n>(t-1)d\) samples, it is impossible not to. For number of samples in between, there is some monotonically decreasing probability that \(t\) or more types are <strong>not</strong> collected. Let&#8217;s call the latter probability \(P(n)\). The expected number of samples it takes to collect \(t\) types is then</p>
\(\sum_{n=1}^{(t-1)d} P(n)\)
<p>Finding \(P(n)\) for \(n\ge t\) doesn&#8217;t appear easy, though the combinatorics could be written down (in theory), maybe involving partition functions, Stirling numbers, or whatever. But the question is reduced to the following, which somebody must have solved: given a \(d \times k\) 0-1 matrix, in which \(n\) 1&#8242;s are placed randomly, what is the probability that exactly \(z\) columns are 0-weight (have 0 column sums)?</p>
<p>These papers give some approximations:</p>
<p>http://arxiv.org/PS_cache/arxiv/pdf/0806/0806.1480v3.pdf</p>
<p>http://cs.anu.edu.au/~bdm/papers/irregular.pdf</p>
<p>Does anybody know the actual answer?</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=283</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A call from King County Jail</title>
		<link>https://blog.yhuang.org/?p=149</link>
		<comments>https://blog.yhuang.org/?p=149#comments</comments>
		<pubDate>Wed, 21 Jan 2009 00:19:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[buzz]]></category>
		<category><![CDATA[buzz buzz]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[collect call]]></category>
		<category><![CDATA[Jail]]></category>
		<category><![CDATA[king county jail]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=149</guid>
		<description><![CDATA[What? xxx-xxx-3910 &#8220;This is a collect call from [buzz buzz, anytime]&#8220;.]]></description>
			<content:encoded><![CDATA[<p>What?</p>
<p>xxx-xxx-3910</p>
<p>&#8220;This is a collect call from [buzz buzz, anytime]&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=149</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>another combinatorial puzzle (allocation)</title>
		<link>https://blog.yhuang.org/?p=69</link>
		<comments>https://blog.yhuang.org/?p=69#comments</comments>
		<pubDate>Sun, 01 Apr 2007 23:48:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[combinatorial puzzle]]></category>
		<category><![CDATA[lower bound]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[proof]]></category>
		<category><![CDATA[sterile surface]]></category>
		<category><![CDATA[sterile surgical gloves]]></category>
		<category><![CDATA[surface]]></category>
		<category><![CDATA[upper bound]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=69</guid>
		<description><![CDATA[Well, the original problem was X-rated, so let me recast it. Three surgeons (A, B, C) participate in an operation involving three patients (a, b, c). For simplicity, each surgeon operates with just one hand, and operates just once on each patient. There are a bunch of sterile surgical gloves that stop contamination from one [...]]]></description>
			<content:encoded><![CDATA[<p>Well, the original problem was X-rated, so let me recast it.</p>
<p>Three surgeons (A, B, C) participate in an operation involving three patients (a, b, c). For simplicity, each surgeon operates with just one hand, and operates just once on each patient. There are a bunch of sterile surgical gloves that stop contamination from one side to the other. What&#8217;s the minimum number of gloves needed to ensure that no body part ever comes into contact with another, even indirectly? Note, surgeons do not want to contaminate each other either.</p>
<p>Clearly, the upper bound is 9, for the 9 pairings. The lower bound is 3, for the 3 patients, or alternatively the 3 surgeons. Is the answer something in between?<br />
<span id="more-69"></span><br />
Here&#8217;s a hint, they are allowed to wear multiple gloves or flip them inside out or do any such thing as needed.</p>
<p>It turns out 3 is not sufficient, but 4 is. There are many ways to achieve 4. Here is one:</p>
<p>First label the 4 gloves 1, 2, 3, 4. The notation &#8220;X-m-n-y&#8221; indicates surgeon X wears glove n outside glove m and operates on patient y.</p>
<p>A-1-3-c<br />
A-1-2-b<br />
A-1-a<br />
B-4-3-c<br />
B-4-2-b<br />
B-4-1-a<br />
C-3-c<br />
C-3-2-b<br />
C-3-1-a</p>
<p>But no matter how you try, 3 is not possible. You are always short by 1 or 2 sterile surfaces, depending on how you count. And this counting argument lies behind the following proof that 3 is not sufficient. The proof is rather short:</p>
<p>First, two facts.</p>
<ol>
<li>Clearly, once a sterile surface is used by a surgeon or patient, it cannot come into contact with somebody else, so each surface is somehow &#8220;assigned&#8221; to a specific person.</li>
<li>After all the operations involving that person is finished, only then can that person&#8217;s assigned surface be contaminated</li>
</ol>
<p>So, suppose 3 were sufficient. Then, there are 6 persons in total, and 6 sterile surfaces initially. That means there can be no sterile-to-used surface contact until all 6 surfaces are assigned, or there would be a shortage.</p>
<p>There are three types of operations, one type involves contaminating sterile surfaces by direct use, let&#8217;s call this an &#8220;allocation&#8221; operation; a second type involves already contaminated surfaces cross-contaminating each other, let&#8217;s call this a &#8220;contamination&#8221; operation; a third type reuses already contaminated surfaces but in a different yet contact-compatible combination, without introducing additional contamination, let&#8217;s call this a &#8220;reuse&#8221; operation.</p>
<p>There can be at most 5 &#8220;allocation&#8221; operations to allocate the 6 sterile surfaces to the 6 persons. (The first operation necessarily contaiminates 2 sterile surfaces.)</p>
<p>There can be at most 1 &#8220;reuse&#8221; operation. This is due to a kind of parity constraint. 4 surfaces have to already be allocated, with 2 sterile surfaces left for this operation.</p>
<p>Now there are 9 operations in total, so there are at least 3 more to go. These remaining operations are &#8220;contamination&#8221; operations. That means any operation involving surgeons or patients associated with any of the contaminating &#8220;inside&#8221; glove surfaces must not occur again.</p>
<p>Now, without loss of generality, suppose the glove surface assignments are</p>
<p>A-1-a<br />
B-2-b<br />
C-3-c</p>
<p>(It has to be surgeon on one side, patient on the other, because any other way is necessarily more wasteful.) Now note that any 2 operations involves at least 3 distinct people, and simultaneously &#8220;disable&#8221; the 3 other sides of the gloves (and the associated people) from further operations. Further, for any 3 people, there can be at most 2 operations between them. That means we can only perform 2 &#8220;contamination&#8221; operations. As an example, the two operations A-1-2-b, A-1-3-c forbids a, B, and C from being in any further operations. That leaves A, b, c, but between them, there are only the two pairs that have already occurred (A-b and A-c).</p>
<p>Since there is 1 of the 9 operations that cannot be performed in safe conditions, that&#8217;s a contradiction. Q.E.D.</p>
<p>Now only if this can be generalized to larger numbers of patients and surgeons. One key number series in making bounds is the least number of distinct people that must be involved for \(N\) operations. We know that a full bipartite graph between \(n\) nodes and \(k\) nodes has \(n \times k\) edges, so \(N\) operations will involve at least about \(2\sqrt{N}\) people. The problem is this approximate lower bound grows too slowly and becomes loose for larger numbers of pairings so that doesn&#8217;t guarantee as simple a proof for those cases. So maybe another day for the generalization.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=69</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
