<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/" >
<channel>
<title>tech - Justin&#x27;s Ramblings</title>
<link>http://bouncybouncy.net//ramblings/tags/tech/</link>
<description>BB.Net</description>
<item>
	
	<title>shared http caching</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/shared_http_caching/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/shared_http_caching/</link>
	
	
	<category>tags/tech</category>
	
	
	<pubDate>Fri, 12 Jun 2009 12:12:45 -0400</pubDate>
	<dcterms:modified>2009-06-12T16:14:16Z</dcterms:modified>
	
	<description><![CDATA[<p>I've been wondering why the web doesn't have a mechanism for
uniquely identifying a resource by a means other than its URL. I
think if such a thing existed, then HTTP caches for common files
could be shared between sites.</p>
<p>There has been a <a href=
"http://www.google.com/search?q=google+host+jquery">push</a> lately
to let <a href="http://code.google.com/apis/ajaxlibs/">Google</a>
host common JS libraries for you. The main reason for this is
increased performance, there are two cases where this helps:</p>
<ul>
<li>The user has never loaded jQuery before - They get to download
it from fast servers</li>
<li>The user has visited another site that also hosted jQuery on
google - They don't have to download it at all.</li>
</ul>
<p>However, there are issues with this:</p>
<ul>
<li>This will not work on a restricted intranet</li>
<li>If the copy of jQuery on google was somehow compromised, a
large number of sites would be effected.</li>
<li>If google is unreachable(it happens!), the site will fail to
function properly</li>
</ul>
<p>There should be a way to include a checksum like so:</p>
<div class="syntax">
<pre>
&lt;script type="text/javascript"
    src="/js/jquery-1.3.2.min.js"
    sha1="3dc9f7c2642efff4482e68c9d9df874bf98f5bcb"&gt;
&lt;/script&gt;

</pre></div>
<p>(sha1 usage here is just an example, a more secure method could
easily be used instead)</p>
<p>This would have two benefits:</p>
<ul>
<li>If the copy of jQuery was maliciously modified, or simply
corrupted, the browser would refuse to load it.</li>
<li>The browser may be able to use a cached copy of jQuery from
another site with the same checksum.</li>
</ul>
<p>This sort of fits in with one of the ideas in the <a href=
"http://video.google.com/videoplay?docid=-6972678839686672840">A
New Way to look at Networking talk by Van Jacobson</a>.</p>

]]></description>
	
</item>
<item>
	
	<title>remap capslock to z</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/remap_capslock_to_z/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/remap_capslock_to_z/</link>
	
	
	<category>tags/tech</category>
	
	
	<pubDate>Thu, 16 Apr 2009 19:52:25 -0400</pubDate>
	<dcterms:modified>2009-04-16T23:52:25Z</dcterms:modified>
	
	<description><![CDATA[<p>My 'z' key has been (physically) broken for a while now.
Generally this isn't a problem because there aren't that many
places where I need to type a 'z' that I can't autocomplete it.
Between tab completion in the shell, and the irssi dictcomplete
plugin, it hasn't bothered me that much.</p>
<p>I finally got around to figuring out how to remap Caps lock to
'z', the magic lines to add to ~/.Xmodmap are</p>
<div class="syntax">
<pre>
remove Lock = Caps_Lock
keycode 66 = z

</pre></div>
<p>Most of the examples I found are for swapping capslock with
control or escape(which are mostly obsolete now that you can use
the Keyboard prefs thing in Gnome and swap keys around with a
single click). Remapping caps lock to z is still too obscure to be
in the nice GUI.</p>
<p>Now, if only two lines in a config file could fix the battery
<img src="http://bouncybouncy.net//ramblings/tags/tech/../../../smileys/smile.png" alt=":-)" /></p>

]]></description>
	
</item>
<item>
	
	<title>json vs thrift and protocol buffers round 2</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/json_vs_thrift_and_protocol_buffers_round_2/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/json_vs_thrift_and_protocol_buffers_round_2/</link>
	
	
	<category>tags/python</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Mon, 02 Mar 2009 21:54:57 -0500</pubDate>
	<dcterms:modified>2009-03-03T03:06:44Z</dcterms:modified>
	
	<description><![CDATA[<p>Following up to the <a href="http://bouncybouncy.net//ramblings/tags/tech/../../posts/thrift_and_protocol_buffers/">previous</a> <a href="http://bouncybouncy.net//ramblings/tags/tech/../../posts/more_on_json_vs_thrift_and_protocol_buffers/">posts</a>,
A few comments out on the internet mentioned that my first tests
werent very fair to thrift and protocol buffers because they were
mostly serializing strings. I gutted the test code and re-wrote the
IDL files to use this structure:</p>
<div class="syntax">
<pre>
message DnsRecord {
  required fixed32 sip  = 1;
  required fixed32 dip  = 2;
  required uint32 sport = 3;
  required uint32 dport = 4;
}

</pre></div>
<p>Nothing fancy, basically the standard ipv4 4-tuple.</p>
<p>I also replaced the random record generation with this:</p>
<div class="syntax">
<pre>
<span class="synStatement">def</span> <span class=
"synIdentifier">get_random_records</span>(num=10000):
    data = []
    <span class="synStatement">for</span> x <span class=
"synStatement">in</span> xrange(num):
        data.append({
            '<span class=
"synConstant">sip</span>':     192*255**3+168*255**2+255+random.randrange(0,255),
            '<span class=
"synConstant">dip</span>':     random.randrange(1,255**4),
            '<span class=
"synConstant">sport</span>':   random.randrange(1024,2048),
            '<span class=
"synConstant">dport</span>':   random.choice([21,22,25,80,110,443])
        })
    <span class="synStatement">return</span> data

</pre></div>
<p>This will generate 10000 records with:</p>
<ul>
<li>a random source IP on the 192.168.1.0/24 network</li>
<li>a completely random destination IP</li>
<li>a source port between 1024 and 2048</li>
<li>a destination port chosen from six common ports.</li>
</ul>
<p>The raw size of this data using fixed length ints would be
10000*(4+4+4+4) = 160,000 bytes. The variable length encoding that
protocol buffers does should be able to save some space when
storing the smaller port numbers.</p>
<p>Running the test code produces the following output:</p>
<div class="syntax">
<pre>
10000 total records (0.280s)

get_thrift          (0.060s)
get_pb              (0.950s)

ser_thrift          (0.560s)  370009 bytes
ser_pb              (4.850s)  171650 bytes
ser_json            (0.080s)  680680 bytes
ser_cjson           (0.120s)  680680 bytes
ser_yaml            (17.330s) 610680 bytes

ser_thrift_compressed (0.620s)  111326 bytes
ser_pb_compressed     (3.980s)   98571 bytes
ser_json_compressed   (0.110s)  124919 bytes
ser_cjson_compressed  (0.120s)  124919 bytes
ser_yaml_compressed   (17.160s) 121065 bytes

serde_thrift        (2.130s)
serde_pb            (7.550s)
serde_json          (0.130s)
serde_cjson         (0.110s)
serde_yaml          (56.740s)

</pre></div>
<p>These results show that protocol buffers and thrift do indeed
excel at serializing numeric values. The pre-compressed output from
protocol buffers is considerably smaller than the other
serialization methods, with thrift ending up somewhere in the
middle. In fact, the protocol buffers output is barely larger than
the original data would be in compact binary form. Since JSON and
YAML serialize numbers to strings, their output ends up being 4
times bigger.</p>
<p>However, once you add in compression, all this fancy extra work
to save space only slightly improves on JSON. The speed and
simplicity of the JSON+zlib approach can not be ignored...</p>
<p>The protocol buffers speed issues are still there, but I'm sure
that over time things will improve. If the C extension for
simplejson can speed up serialization by an order of magnitude, I
have no doubt that similar improvements can be made to protocol
buffers and thrift.</p>
<p>If you want to run these tests for yourself, the code is
available from <a href="http://bouncybouncy.net//ramblings/tags/tech/../../files/sertest2.tgz">sertest2.tgz</a></p>
<p>Some other things to try would be to set the default dport to
80, and see how that effects serialization size and speed.</p>

]]></description>
	
</item>
<item>
	
	<title>more on json vs thrift and protocol buffers</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/more_on_json_vs_thrift_and_protocol_buffers/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/more_on_json_vs_thrift_and_protocol_buffers/</link>
	
	
	<category>tags/python</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Sun, 01 Mar 2009 13:19:58 -0500</pubDate>
	<dcterms:modified>2009-03-01T18:49:44Z</dcterms:modified>
	
	<description><![CDATA[<p>Following up to the <a href="http://bouncybouncy.net//ramblings/tags/tech/../../posts/thrift_and_protocol_buffers/">previous post</a>, a
couple of people pointed out to me that the cjson library is faster
than simplejson, and that the latest simplejson has a small C
extension.</p>
<p>Re running the tests with simplejson 2.0.9 and cjson yields the
following results:</p>
<div class="syntax">
<pre>
5000 total records (0.730s)

get_thrift          (0.040s)
get_pb              (0.620s)

ser_thrift          (0.550s) 555125 bytes
ser_pb              (2.980s) 415125 bytes
ser_json            (0.030s) 718455 bytes
ser_cjson           (0.040s) 718455 bytes
ser_yaml            (12.770s) 623455 bytes

ser_thrift_compressed (0.630s) 287621 bytes
ser_pb_compressed     (3.020s) 284441 bytes
ser_json_compressed   (0.090s) 293073 bytes
ser_cjson_compressed  (0.080s) 293073 bytes
ser_yaml_compressed   (13.260s) 291106 bytes

serde_thrift        (1.460s)
serde_pb            (5.250s)
serde_json          (0.070s)
serde_cjson         (0.060s)
serde_yaml          (44.110s)

</pre></div>
<p>There doesn't seem to be much doubt about it, if you need to
serialize basic python data structures and don't need the extra
features of thrift or protocol buffers, it is hard to beat
JSON.</p>
<p>The test code at <a href="http://bouncybouncy.net//ramblings/tags/tech/../../files/sertest.tgz">sertest.tgz</a> has also been updated to
use time.clock instead of time.time.</p>

]]></description>
	
</item>
<item>
	
	<title>thrift and protocol buffers</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/thrift_and_protocol_buffers/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/thrift_and_protocol_buffers/</link>
	
	
	<category>tags/python</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Sat, 28 Feb 2009 11:53:08 -0500</pubDate>
	<dcterms:modified>2009-02-28T18:08:47Z</dcterms:modified>
	
	<description><![CDATA[<p>I've been experimenting with thrift and protocol buffers
recently. For the most part when I need to serialize something I've
been using JSON or compressed JSON. Thrift and protocol buffers
have a couple of advantages, and are also supposedly faster and
produce smaller output.</p>
<p>The test I've been using is a simple list of hashes, nothing too
complicated. here is the protocol buffers file. The thrift file is
pretty much the same thing.</p>
<div class="syntax">
<pre>
package passive_dns;

message DnsRecord {
  required string key = 1;
  required string value = 2;
  required string first = 3;
  required string last = 4;
  optional string type = 5 [default = "A"];
  optional int32  ttl = 6 [default = 86400];
}

message DnsResponse {
  repeated DnsRecord records = 1;
}

</pre></div>
<p>The optional and default values are one of the benefits of both
serialization libraries. A record that matches the default value
does not need to be included in the serialized output.</p>
<p>I wrote up a simple test program to compare thrift, protocol
buffers, json, and compressed json for size and speed. The results,
at least for the type of data I use, are very interesting:</p>
<div class="syntax">
<pre>
5000 total records (0.745s)

get_thrift          (0.044s)
get_pb              (0.608s)

ser_thrift          (0.474s) 554953 bytes
ser_pb              (3.087s) 414862 bytes
ser_json            (0.273s) 718191 bytes
ser_yaml            (13.121s) 623191 bytes

ser_thrift_compressed (0.545s) 287617 bytes
ser_pb_compressed     (3.150s) 284297 bytes
ser_json_compressed   (0.326s) 292904 bytes
ser_yaml_compressed   (13.665s) 290993 bytes

serde_thrift        (1.289s)
serde_pb            (5.411s)
serde_json          (1.474s)
serde_yaml          (45.637s)

</pre></div>
<p>EDIT: Updated to include yaml results</p>
<p>The get_* functions are the times needed to covert the python
data structure into the classes that the library needs.</p>
<p>The ser_* functions are the times needed to get and serialize
the python data structure to a string.</p>
<p>The ser_*_compressed functions are the times needed to get,
serialize, and compress the python data structure.</p>
<p>The serde_* functions are the times needed to get, serialize,
and de-serialize the python data structure to and from a
string.</p>
<p>The results show that serializing to compressed JSON is both
smaller and faster than thrift, and serializing+de-serializing is
only slightly slower. If I converted the python data to be (header,
rows) like a csv file, rather than a flat list of dicts, the json
output would be smaller, and likely faster to serialize.</p>
<p>The totally unexpected result was that protocol buffers clocked
in at over 4 times slower than thrift. I find it hard to believe
that protocol buffers could be that slow, so I will have to run
some more tests to make sure that I am using the library
correctly.</p>
<p>If you want to run my tests for yourself, the code is available
from <a href="http://bouncybouncy.net//ramblings/tags/tech/../../files/sertest.tgz">sertest.tgz</a></p>

]]></description>
	
</item>
<item>
	
	<title>setInterval and setTimeout</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/setinterval_and_settimeout/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/setinterval_and_settimeout/</link>
	
	
	<category>tags/js</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Sat, 03 Jan 2009 17:35:42 -0500</pubDate>
	<dcterms:modified>2009-01-03T22:35:42Z</dcterms:modified>
	
	<description><![CDATA[<p>What I learned today: setInterval is not the same as setTimeout.
It seems you can still easily forkbomb firefox with some trivial JS
code.</p>
<div class="syntax">
<pre>
<span class="synIdentifier">&lt;</span><span class=
"synStatement">html</span><span class="synIdentifier">&gt;</span>

Ran <span class="synIdentifier">&lt;</span><span class=
"synStatement">span</span><span class=
"synIdentifier"> </span><span class="synType">id</span><span class=
"synIdentifier">=</span><span class=
"synConstant">"num"</span><span class=
"synIdentifier">&gt;</span>0<span class=
"synIdentifier">&lt;/</span><span class=
"synStatement">span</span><span class=
"synIdentifier">&gt;</span> times

<span class="synIdentifier">&lt;</span><span class=
"synStatement">script</span><span class="synIdentifier">&gt;</span>
<span class="synIdentifier">var</span><span class=
"synSpecial"> f = </span><span class=
"synIdentifier">function</span>()
<span class="synIdentifier">{</span>
<span class="synSpecial">    </span><span class=
"synIdentifier">var</span><span class=
"synSpecial"> e = </span><span class=
"synStatement">document</span><span class=
"synSpecial">.getElementById</span>(<span class=
"synConstant">"num"</span>)<span class="synSpecial">;</span>
<span class="synSpecial">    e.innerHTML++;</span>
<span class="synSpecial">    setInterval</span>(<span class=
"synSpecial">f, </span>100)<span class="synSpecial">;</span>
<span class="synIdentifier">}</span>
<span class="synSpecial">f</span>()<span class=
"synSpecial">;</span>
<span class="synIdentifier">&lt;/</span><span class=
"synStatement">script</span><span class="synIdentifier">&gt;</span>

<span class="synIdentifier">&lt;/</span><span class=
"synStatement">html</span><span class="synIdentifier">&gt;</span>

</pre>
<span class="synTitle"><a href=
"http://www.bouncybouncy.net//crash.html">download file
"/crash.html"</a></span></div>

]]></description>
	
</item>
<item>
	
	<title>JQuery Dotspinner</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/jquery_dotspinner/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/jquery_dotspinner/</link>
	
	
	<category>tags/jquery</category>
	
	<category>tags/js</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Sat, 03 Jan 2009 15:39:10 -0500</pubDate>
	<dcterms:modified>2009-01-13T21:04:19Z</dcterms:modified>
	
	<description><![CDATA[<p>I while back I got fed up with trying to find a decent spinner
gif for some AJAX pages. I gave up and just wrote one using ascii.
This has the benefit of always fitting in with the page style and
users font settings.</p>
<div class="syntax">
<pre>
do_dotspinner = <span class="synIdentifier">function</span> (scope)
<span class="synIdentifier">{</span>
    <span class=
"synIdentifier">var</span> spin_element = <span class=
"synIdentifier">function</span> (el)
    <span class="synIdentifier">{</span>
        max = 5;
        <span class="synIdentifier">var</span> text = el.innerHTML
        <span class="synStatement">if</span> (text.length==max)
            text=<span class="synConstant">""</span>;
        text += <span class="synConstant">"."</span>;
        el.innerHTML = text;
    <span class="synIdentifier">}</span>

    <span class="synIdentifier">var</span> els = $(<span class=
"synConstant">".dotspinner"</span>,scope);

    <span class="synStatement">if</span>(!els.length) <span class=
"synStatement">return</span>;

    els.each(<span class=
"synIdentifier">function</span>()<span class=
"synIdentifier">{</span>
        spin_element(<span class="synIdentifier">this</span>);
    <span class="synIdentifier">}</span>);

    <span class="synIdentifier">var</span> repeat = <span class=
"synIdentifier">function</span>()<span class=
"synIdentifier">{</span>
        do_dotspinner(scope);
    <span class="synIdentifier">}</span>

    setTimeout(repeat, 200);
<span class="synIdentifier">}</span>

</pre>
<span class="synTitle"><a href=
"http://www.bouncybouncy.net//ramblings/files/js/dotspinner.js">download
file "/ramblings/files/js/dotspinner.js"</a></span></div>
<p>And since I doubt it will work if I inline it into a blog post,
<a href=
"http://bouncybouncy.net/ramblings/files/js/dotspinner_example.html">
here is a demo</a>.</p>
<p>I've been trying to make it work like an actual <a href=
"http://docs.jquery.com/Plugins/Authoring">plugin</a>, but I
haven't been able to get that to work yet.</p>
<p>I should be able to make something like this work:</p>
<div class="syntax">
<pre>
$(<span class="synConstant">".dotspinner"</span>).dotspinner();

</pre></div>
<p>But I need to figure out how to tell when an element goes
away</p>
<p>For example, if I have</p>
<div class="syntax">
<pre>
p=$(<span class="synConstant">"#foo"</span>);
<span class="synComment">//and do this:</span>
$(<span class="synConstant">"body"</span>).html(<span class=
"synConstant">"Hi"</span>);
<span class=
"synComment">// then these still works like nothing happend:</span>
p.text();
$(p).text();
<span class=
"synComment">//even though if I do this again, it is gone:</span>
p=$(<span class="synConstant">"#foo"</span>);
<span class=
"synComment">//The one thing I know will work, but is probably wrong, is this:</span>
p = $(<span class="synConstant">'#'</span> + p.attr(<span class=
"synConstant">"id"</span>));

</pre></div>

]]></description>
	
</item>
<item>
	
	<title>web development would be a lot easier if</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/web_development_would_be_a_lot_easier_if/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/web_development_would_be_a_lot_easier_if/</link>
	
	
	<category>tags/tech</category>
	
	
	<pubDate>Thu, 01 Jan 2009 21:27:43 -0500</pubDate>
	<dcterms:modified>2009-01-02T02:31:40Z</dcterms:modified>
	
	<description><![CDATA[<p>Web development would be a lot easier if the W3 would
standardize some new Widgets that browsers have to support. I've
noticed that many Javascript frameworks these days exist primarily
to implement standard GUI widgets for the web. Boring GUI widgets
like:</p>
<ul>
<li>Combo Boxes (<a href=
"http://extjs.com/deploy/dev/examples/form/combos.html">see
example</a>)</li>
<li>Tabs</li>
<li>Trees</li>
<li>Grids</li>
<li>Dialogs</li>
<li>Menus</li>
<li>Tool tips</li>
<li>etc etc</li>
</ul>
<p>My problem isn't that these widgets aren't availabile in web
applications, it is that a hundred different projects are all
re-implementing the same thing. At what point should something so
basic like a combo box just be added to HTML?</p>
<p>I guess there is always HTML6.</p>

]]></description>
	
</item>
<item>
	
	<title>tech vision</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/tech_vision/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/tech_vision/</link>
	
	
	<category>tags/tech</category>
	
	
	<pubDate>Thu, 04 Dec 2008 20:14:46 -0500</pubDate>
	<dcterms:modified>2008-12-06T20:23:20Z</dcterms:modified>
	
	<description><![CDATA[<p>One thing I've noticed recently is a complete lack of vision
when it comes to technology in the future. This is really obvious
when you read those "What the world will be like in 2000" articles
from 1950.</p>
<p>One common theme is simply making things bigger or smaller..
Bigger when it comes to machines, buildings, airplanes. Smaller
when it comes to computers and other gadgets.</p>
<p>I remember one that talked about a revolutionary mail/news
delivery system.. something like pneumatic tubes. What I've noticed
is that when people have tried to predict the future, they tend to
come up with new ways for using existing technology, but not new
technology. Another example: every future prediction story from 100
years ago always talks about flying cars, but never something like
teleportation. A flying car is something we might see in the
future, but to me, that is not <em>futuristic</em>. A system that
delivers a newspaper to your door using pneumatic tubes might have
been cool in 1950, but today I read the news from around the world
on my cell phone.</p>
<p>Instead of thinking of new ways to solve the same
problems(delivering a physical newspaper to someone) we should be
taking one more step back and thinking of new problems to solve.
The problem shouldn't be "How to deliver a newspaper to someones
door", it should be "How to deliver the <em>news</em> to someone".
If you think about it, this is also the same problem the recording
industry ran into. Too much time spent thinking about ways to sell
people shiny disks, not enough time spent thinking about how to
sell people music.</p>
<p>Not to pick on <a href=
"http://etbe.coker.com.au/2008/11/27/bill-joy/">Russel Coker</a>,
but I think he falls into the same trap:</p>
<blockquote>
<p>In 2020 a device the size of an iPaQ H39xx with USB (for
keyboard and mouse) and the new DisplayPort [5] digital display
interface (that is used in recent Lenovo laptops [6]) would make a
great PDA/desktop</p>
</blockquote>
<p>While I think such a device would be cool, I hope that in 2020
we are not still using keyboards and mice and hardwired
displays.</p>
<p>Here are some ideas for future portable computers(if such things
even exist, we may just wirelessly tap into a global grid.. who
knows)</p>
<p>There have been a lot of attempts at voice input, and I don't
think it will ever work. I can type a lot faster than I can talk,
and I can <em>think</em> even faster. I think the future in input
devices is going to involve some kind of biofeedback input.. at
least to replace mice.</p>
<p>We are already starting to see the development of tiny embedded
projectors. I think all portable devices are going to have them
within a few years. Even more futuristic would be something like a
wireless high resolution heads up display embedded in a contact
lense. Actually, that isn't nearly futuristic enough.. I'm sure
someone will invent a device that meshes directly with your brain
so you do not even have to read a display.</p>

]]></description>
	
</item>
<item>
	
	<title>odd nmap timings</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/odd_nmap_timings/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/odd_nmap_timings/</link>
	
	
	<category>tags/tech</category>
	
	
	<pubDate>Fri, 22 Aug 2008 22:02:33 -0400</pubDate>
	<dcterms:modified>2008-09-09T00:45:49Z</dcterms:modified>
	
	<description><![CDATA[<h2>Back story</h2>
<p>A section on a web application I have pings (using a background
AJAX request) a list of IP addresses. Most of the time all of these
adresses are up, sometimes one or two of them are down. One day I
noticed that if all of them were down, nmap would take much longer
to ping them all.</p>
<h2>The odd part</h2>
<p>Lets ping 19 addresses on my home network, none of which
exist.</p>
<div class="syntax">
<pre>
justin@latitude:~$ time nmap  -sP 192.168.5.2-20 

Starting Nmap 4.53 ( http://insecure.org ) at 2008-08-22 21:56 EDT
Nmap done: 19 IP addresses (0 hosts up) scanned in 4.072 seconds

real    0m4.081s
user    0m0.068s
sys     0m0.004s

</pre></div>
<p>Ok... now lets add the routers address, which is pingable.</p>
<div class="syntax">
<pre>
justin@latitude:~$ time nmap  -sP 192.168.5.1-19

Starting Nmap 4.53 ( http://insecure.org ) at 2008-08-22 21:58 EDT
Host router (192.168.5.1) appears to be up.
Nmap done: 19 IP addresses (1 host up) scanned in 2.258 seconds

real    0m2.259s
user    0m0.048s
sys     0m0.008s

</pre></div>
<p>Notice anything odd?</p>
<p>I have experimented with the usual host timeout and max rtt time
options, but I am not sure what the problem is. As soon as I get a
chance I will look into the code. I am not sure if it is a BUG or
just user error. A simple strace of the two commands show much
different 'select' behaviour.</p>

]]></description>
	
</item>

</channel>
</rss>

