<?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>node.to &#187; code or systems</title>
	<atom:link href="http://node.to/wordpress/category/code-or-systems/feed/" rel="self" type="application/rss+xml" />
	<link>http://node.to/wordpress</link>
	<description>work outside the frame</description>
	<lastBuildDate>Mon, 19 Sep 2011 14:12:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Shell trick: track new tcp connections per second in Linux</title>
		<link>http://node.to/wordpress/2010/02/11/shell-trick-track-new-tcp-connections-per-second-in-linux/</link>
		<comments>http://node.to/wordpress/2010/02/11/shell-trick-track-new-tcp-connections-per-second-in-linux/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 02:35:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code or systems]]></category>
		<category><![CDATA[migrated from old]]></category>

		<guid isPermaLink="false">http://node.to/wordpress/2010/02/11/shell-trick-track-new-tcp-connections-per-second-in-linux/</guid>
		<description><![CDATA[
This little snippet is for when you want to see new active connections per second, not concurrent established, as most tools show you:


C=0; while true; do echo "new connections: $C"; c1=`netstat -s -t&#124;grep "active connections openings"&#124;awk '{print $1;}'`; sleep 1; c2=`netstat -s -t&#124;grep "active connections openings"&#124;awk '{print $1;}'`; C=`expr $c2 - $c1` ; done

Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>
This little snippet is for when you want to see <b>new</b> active connections per second, not concurrent established, as most tools show you:
</p>
<p><code><br />
C=0; while true; do echo "new connections: $C"; c1=`netstat -s -t|grep "active connections openings"|awk '{print $1;}'`; sleep 1; c2=`netstat -s -t|grep "active connections openings"|awk '{print $1;}'`; C=`expr $c2 - $c1` ; done<br />
</code></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://node.to/wordpress/2010/02/11/shell-trick-track-new-tcp-connections-per-second-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby for are these chars in this string&#8230;</title>
		<link>http://node.to/wordpress/2010/02/11/ruby-for-are-these-chars-in-this-string/</link>
		<comments>http://node.to/wordpress/2010/02/11/ruby-for-are-these-chars-in-this-string/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 02:32:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code or systems]]></category>
		<category><![CDATA[migrated from old]]></category>

		<guid isPermaLink="false">http://node.to/wordpress/?p=25</guid>
		<description><![CDATA[I find myself wanting to know if the characters in one string are in another.
For example, if you have a key space for a string key name, making sure the provided key is valid.

  require 'set'
  def chars_subset_of? checkme, inme
    checkme.split(//).to_set.subset? inme.split(//).to_set
  end

You could also toss this inside class [...]]]></description>
			<content:encoded><![CDATA[<p>I find myself wanting to know if the characters in one string are in another.<br />
For example, if you have a key space for a string key name, making sure the provided key is valid.</p>
<p><code><br />
  require 'set'<br />
  def chars_subset_of? checkme, inme<br />
    checkme.split(//).to_set.subset? inme.split(//).to_set<br />
  end<br />
</code></p>
<p>You could also toss this inside class String to dynamically add the method</p>
<p><code><br />
  require 'set'<br />
  def chars_subset_of? other_string<br />
    if other_string.class == String<br />
      self.split(//).to_set.subset? other_string.split(//).to_set<br />
    else # just try<br />
      self.split(//).to_set.subset? other_string.to_set<br />
    end<br />
  end<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://node.to/wordpress/2010/02/11/ruby-for-are-these-chars-in-this-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Appengine: Auccumulate and Rejoin Fragmented Data or Buffer Small Object Floods in Memcache</title>
		<link>http://node.to/wordpress/2010/02/11/appengine-auccumulate-and-rejoin-fragmented-data-or-buffer-small-object-floods-in-memcache/</link>
		<comments>http://node.to/wordpress/2010/02/11/appengine-auccumulate-and-rejoin-fragmented-data-or-buffer-small-object-floods-in-memcache/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 02:31:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code or systems]]></category>
		<category><![CDATA[migrated from old]]></category>

		<guid isPermaLink="false">http://node.to/wordpress/?p=23</guid>
		<description><![CDATA[I put this together to solve a problem where contiguous data generated in JavaScript on the browser side needed to be broken into pieces and sent to the server and reconstructed there. The same tool could be used to buffer rapidly incoming small objects to queue for batch inserts for higher performance / less contention [...]]]></description>
			<content:encoded><![CDATA[<p>I put this together to solve a problem where contiguous data generated in JavaScript on the browser side needed to be broken into pieces and sent to the server and reconstructed there. The same tool could be used to buffer rapidly incoming small objects to queue for batch inserts for higher performance / less contention on the Appengine datastore.</p>
<p><a href="#code">Jump to the code.</a> I apologize for the CSS failfailfail.</p>
<p><strong>For the &#8220;large object out of many small fragments&#8221; use case:<br />
</strong></p>
<p>The principle is the sender provides some kind of identifier that uniquely identifies the batch. I use a cookie that is generated on page load combined with a counter in the JS that is incremented once for each batch from that client. The cookie was conveniently already there for another purpose.</p>
<p>On the server, the library takes this identifier and uses it as the memcache root key or &#8220;groupkey&#8221; in the code. Each fragment sent should include the total expected, and the index in the array of fragments of the current fragment. On the server an atomic global counter keeps track of when all pieces are sent. The api allows you to use the library to preserve the array order, or you can just stick order info in the stored value and figure it out yourself when the server gives you the completed array of accumulated fragments. Very simply, the server uses the unique identifier both to store the fragments in memcache and to keep track of the fragment count, which when equal to the expected count raises a Complete exception, allowing you to fetch back an array of all the fragments. Typically this would be done inline with the request that&#8217;s sending the last missing fragment.</p>
<p><strong>For the case of queueing up small objects for batch insert into BigTable:<br />
</strong></p>
<p>This use case is obvious, and analysis is left to the reader as exercise (smile). Basically, the above concern about order is removed, and the reconstruction is unneeded.</p>
<p><a name="code"></a><ins datetime="2009-05-22T13:30:31+00:00"><br />
<script src='http://pastie.org/486368.js'></script></ins></p>
]]></content:encoded>
			<wfw:commentRss>http://node.to/wordpress/2010/02/11/appengine-auccumulate-and-rejoin-fragmented-data-or-buffer-small-object-floods-in-memcache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

