<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for mikhail panchenko / blog</title>
	<atom:link href="http://mihasya.com/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://mihasya.com/blog</link>
	<description>good things now come in packages of three</description>
	<lastBuildDate>Sat, 06 Mar 2010 19:36:51 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Django: exposing settings in templates, the easy way by Mike Blackaller</title>
		<link>http://mihasya.com/blog/django-exposing-settings-in-templates-the-easy-way/comment-page-1/#comment-3728</link>
		<dc:creator>Mike Blackaller</dc:creator>
		<pubDate>Sat, 06 Mar 2010 19:36:51 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=285#comment-3728</guid>
		<description>&lt;p&gt;Thanks for this post. I am new at development and this is a big help.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for this post. I am new at development and this is a big help.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on daemontools 0.76 on Ubuntu 9.04 by moumou</title>
		<link>http://mihasya.com/blog/daemontools-0-76-on-ubuntu-9-04/comment-page-1/#comment-3724</link>
		<dc:creator>moumou</dc:creator>
		<pubDate>Fri, 19 Feb 2010 10:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=272#comment-3724</guid>
		<description>&lt;p&gt;Hi thanks for the tips !
For the user of ubuntu 9.10 just note that upstart is now using /etc/init instead of /etc/event.d.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi thanks for the tips !
For the user of ubuntu 9.10 just note that upstart is now using /etc/init instead of /etc/event.d.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on streamstats: easier log analysis by mihasya</title>
		<link>http://mihasya.com/blog/streamstats-easier-log-analysis/comment-page-1/#comment-3689</link>
		<dc:creator>mihasya</dc:creator>
		<pubDate>Sat, 02 Jan 2010 07:52:34 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=288#comment-3689</guid>
		<description>&lt;p&gt;Ooops never replied to this.&lt;/p&gt;

&lt;p&gt;The problem is that the data is arbitrary. While everything you suggest is absolutely correct, this ain&#039;t the arena for it. This is meant simply as a quick and dirty tool to help parse logs on the spot to detect unusual activity, not long-term analysis. Most of the time, the red highlight is unnecessary anyway - you&#039;ll be able to tell immediately which value occurs an unusual number of times, regardless of what the distribution is. I may do away with it entirely, since it is, as you pointed out, not entirely correct.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ooops never replied to this.</p>

<p>The problem is that the data is arbitrary. While everything you suggest is absolutely correct, this ain&#8217;t the arena for it. This is meant simply as a quick and dirty tool to help parse logs on the spot to detect unusual activity, not long-term analysis. Most of the time, the red highlight is unnecessary anyway &#8211; you&#8217;ll be able to tell immediately which value occurs an unusual number of times, regardless of what the distribution is. I may do away with it entirely, since it is, as you pointed out, not entirely correct.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Chiming in on Duck Typing vs Static Typing by Adam</title>
		<link>http://mihasya.com/blog/chiming-in-on-duck-typing-vs-static-typing/comment-page-1/#comment-3586</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 16 Dec 2009 07:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=307#comment-3586</guid>
		<description>&lt;p&gt;Turkey typing seems to be exactly like ocaml and the ml family of languages &#039;type hinting&#039; (I don&#039;t really know what its called). Its not new, and not having comments do suck.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Turkey typing seems to be exactly like ocaml and the ml family of languages &#8216;type hinting&#8217; (I don&#8217;t really know what its called). Its not new, and not having comments do suck.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Chiming in on Duck Typing vs Static Typing by mihasya</title>
		<link>http://mihasya.com/blog/chiming-in-on-duck-typing-vs-static-typing/comment-page-1/#comment-3304</link>
		<dc:creator>mihasya</dc:creator>
		<pubDate>Sat, 26 Sep 2009 18:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=307#comment-3304</guid>
		<description>&lt;p&gt;I do see exactly what he&#039;s trying to do - an optional &quot;type hint&quot; in method signatures. All of my points are aimed at that argument.&lt;/p&gt;

&lt;p&gt;Richard&#039;s syntax is fine if all you&#039;re interested in is the type. However, he is interested in the capabilities. So the part that didn&#039;t make it into his post is that you&#039;d have to define an interface-like structure somewhere to say what &quot;iterable&quot; means - what methods it has to support in order to satisfy the requirement. Then you get to the part where you also have to define the signatures for all those methods. If those methods have turkey type requirements, you have to define all of those subtypes somewhere too. To me, it seems easier to just do (pseudo)&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;&lt;code&gt;if (foo.&lt;strong&gt;iter&lt;/strong&gt;):
    for bar in foo:
        if isinstance(bar, SomeClass):
            bar.DoEeeeet()
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;I&#039;ll concede that I&#039;ve presented another weak example after pointing out weaknesses in Richards. Your point is well taken.&lt;/p&gt;

&lt;p&gt;The more I think about it, the more I don&#039;t see why this has to be a syntax change at all. I believe what Richard wants can be accomplished using some pretty generic helpers. Maybe I&#039;ll talk to him about that possibility.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I do see exactly what he&#8217;s trying to do &#8211; an optional &#8220;type hint&#8221; in method signatures. All of my points are aimed at that argument.</p>

<p>Richard&#8217;s syntax is fine if all you&#8217;re interested in is the type. However, he is interested in the capabilities. So the part that didn&#8217;t make it into his post is that you&#8217;d have to define an interface-like structure somewhere to say what &#8220;iterable&#8221; means &#8211; what methods it has to support in order to satisfy the requirement. Then you get to the part where you also have to define the signatures for all those methods. If those methods have turkey type requirements, you have to define all of those subtypes somewhere too. To me, it seems easier to just do (pseudo)</p>

<p><pre><code>if (foo.<strong>iter</strong>):
    for bar in foo:
        if isinstance(bar, SomeClass):
            bar.DoEeeeet()
</code></pre></p>

<p>I&#8217;ll concede that I&#8217;ve presented another weak example after pointing out weaknesses in Richards. Your point is well taken.</p>

<p>The more I think about it, the more I don&#8217;t see why this has to be a syntax change at all. I believe what Richard wants can be accomplished using some pretty generic helpers. Maybe I&#8217;ll talk to him about that possibility.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pull random data out of MySQL without making it cry &#8211; using and optimizing ORDER BY, LIMIT, OFFSET etc. by mihasya</title>
		<link>http://mihasya.com/blog/pull-random-data-out-of-mysql-without-making-it-cry-using-and-optimizing-order-by-limit-offset-etc/comment-page-1/#comment-3303</link>
		<dc:creator>mihasya</dc:creator>
		<pubDate>Sat, 26 Sep 2009 17:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=297#comment-3303</guid>
		<description>&lt;p&gt;That seems like it would probably give you &quot;more random&quot; data, which is good. However, it would be more expensive. It would seem you&#039;d have to build that table the first time you ran the query (could take a while if your table is large, even though it&#039;s in memory), then maintain it on every insert/delete, or rebuild it periodically.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That seems like it would probably give you &#8220;more random&#8221; data, which is good. However, it would be more expensive. It would seem you&#8217;d have to build that table the first time you ran the query (could take a while if your table is large, even though it&#8217;s in memory), then maintain it on every insert/delete, or rebuild it periodically.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Chiming in on Duck Typing vs Static Typing by David Hall</title>
		<link>http://mihasya.com/blog/chiming-in-on-duck-typing-vs-static-typing/comment-page-1/#comment-3287</link>
		<dc:creator>David Hall</dc:creator>
		<pubDate>Fri, 25 Sep 2009 02:37:06 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=307#comment-3287</guid>
		<description>&lt;p&gt;What I don&#039;t get in people&#039;s criticisms of Richard is that they assume you have to specify a type.  I don&#039;t see why we can&#039;t have the ability to specify types in methods if we want to, and get duck typing if we don&#039;t do it.&lt;/p&gt;

&lt;p&gt;Where python really fails is that if you want this strictness, it makes it a horrible pain to achieve, if not impossible.  And while I consider Richard&#039;s syntax examples ugly, they&#039;re far prettier than what someone has to do in python.&lt;/p&gt;

&lt;p&gt;Your Photo/Video example is semi-silly.  You know that even in these &quot;generic&quot; actions, the first time they were coded, they likely have Photo-specific code in them.  So, you need to go through them and fix that when you decide you&#039;re going to do video.  That&#039;s just a given.  And if it truly generic, Richard&#039;s Turkey-typing does not require superclasses, just you to specify [Photo,Video] instead of Photo, once you verify the method is not Photo-specific.&lt;/p&gt;

&lt;p&gt;I tend to fall on Richard&#039;s side on this one, but maybe that&#039;s because I live in a world where sometimes the people you write code with weren&#039;t hired for their coding, but instead for their knowledge of chemistry, and it just so happens that they need to write some code to try out some ideas, and you want it to be in an easy dynamic language, but you find them running into things like what Richard discusses in his posts.  And C has different problems.  I feel like Richard&#039;s ideas would result in a better Python ecosystem, where there are clearer error messages instead of some deep backtrace of an uncaught exception (often from a C extension when you&#039;re in the world of scientific computing, which means the deepest levels of the backtrace are not in Python and not your standard ValueError type problems).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What I don&#8217;t get in people&#8217;s criticisms of Richard is that they assume you have to specify a type.  I don&#8217;t see why we can&#8217;t have the ability to specify types in methods if we want to, and get duck typing if we don&#8217;t do it.</p>

<p>Where python really fails is that if you want this strictness, it makes it a horrible pain to achieve, if not impossible.  And while I consider Richard&#8217;s syntax examples ugly, they&#8217;re far prettier than what someone has to do in python.</p>

<p>Your Photo/Video example is semi-silly.  You know that even in these &#8220;generic&#8221; actions, the first time they were coded, they likely have Photo-specific code in them.  So, you need to go through them and fix that when you decide you&#8217;re going to do video.  That&#8217;s just a given.  And if it truly generic, Richard&#8217;s Turkey-typing does not require superclasses, just you to specify [Photo,Video] instead of Photo, once you verify the method is not Photo-specific.</p>

<p>I tend to fall on Richard&#8217;s side on this one, but maybe that&#8217;s because I live in a world where sometimes the people you write code with weren&#8217;t hired for their coding, but instead for their knowledge of chemistry, and it just so happens that they need to write some code to try out some ideas, and you want it to be in an easy dynamic language, but you find them running into things like what Richard discusses in his posts.  And C has different problems.  I feel like Richard&#8217;s ideas would result in a better Python ecosystem, where there are clearer error messages instead of some deep backtrace of an uncaught exception (often from a C extension when you&#8217;re in the world of scientific computing, which means the deepest levels of the backtrace are not in Python and not your standard ValueError type problems).</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pull random data out of MySQL without making it cry &#8211; using and optimizing ORDER BY, LIMIT, OFFSET etc. by Mike Malone</title>
		<link>http://mihasya.com/blog/pull-random-data-out-of-mysql-without-making-it-cry-using-and-optimizing-order-by-limit-offset-etc/comment-page-1/#comment-3274</link>
		<dc:creator>Mike Malone</dc:creator>
		<pubDate>Wed, 23 Sep 2009 17:25:39 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=297#comment-3274</guid>
		<description>&lt;p&gt;The other way I&#039;ve heard this being done is by building a &quot;random number table&quot; that you can join against. You&#039;d probably want to use a memory table for this, but the idea is that you create an (id, num) table, where id is the PK and num is some random number between your min and max ID. Once that&#039;s done you can choose a random offset in your random number table, set a limit, join to your real data table on num = real_data_id, and you&#039;ve got a random bit of data.&lt;/p&gt;

&lt;p&gt;Of course I&#039;ve never actually tried this in production anywhere, and I can&#039;t remember where I heard about this tactic, but aside from the join it seems just clever enough to work.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The other way I&#8217;ve heard this being done is by building a &#8220;random number table&#8221; that you can join against. You&#8217;d probably want to use a memory table for this, but the idea is that you create an (id, num) table, where id is the PK and num is some random number between your min and max ID. Once that&#8217;s done you can choose a random offset in your random number table, set a limit, join to your real data table on num = real_data_id, and you&#8217;ve got a random bit of data.</p>

<p>Of course I&#8217;ve never actually tried this in production anywhere, and I can&#8217;t remember where I heard about this tactic, but aside from the join it seems just clever enough to work.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on streamstats: easier log analysis by David Hall</title>
		<link>http://mihasya.com/blog/streamstats-easier-log-analysis/comment-page-1/#comment-2909</link>
		<dc:creator>David Hall</dc:creator>
		<pubDate>Sun, 23 Aug 2009 14:55:33 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=288#comment-2909</guid>
		<description>&lt;p&gt;before you get too far, I would suggest doing some plots just to test what kind of distribution you have.  You&#039;re making an assumption that mean and standard deviation are meaningful values, when they might not be.  I see people do it all the time and draw pretty silly conclusions.&lt;/p&gt;

&lt;p&gt;Plot yourself a histogram where you are counting how many people make 1 request, 2 requests, etc (bins may need to be wider, depending on how much data you have, but I feel like you can get a lot).  If you actually get a Gaussian, then you&#039;re okay using those, but you might get something else.  In which case, hit the statistics books some more to try to decide what you have.  (one hint, if it&#039;s bimodal, you probably have the sum of two distributions, say one is normal users, one is power users, in which case, you may be able to split out power users, treat them as a gaussian, then look for outliers 2 or 3 std dev above that mean.)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>before you get too far, I would suggest doing some plots just to test what kind of distribution you have.  You&#8217;re making an assumption that mean and standard deviation are meaningful values, when they might not be.  I see people do it all the time and draw pretty silly conclusions.</p>

<p>Plot yourself a histogram where you are counting how many people make 1 request, 2 requests, etc (bins may need to be wider, depending on how much data you have, but I feel like you can get a lot).  If you actually get a Gaussian, then you&#8217;re okay using those, but you might get something else.  In which case, hit the statistics books some more to try to decide what you have.  (one hint, if it&#8217;s bimodal, you probably have the sum of two distributions, say one is normal users, one is power users, in which case, you may be able to split out power users, treat them as a gaussian, then look for outliers 2 or 3 std dev above that mean.)</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Django: exposing settings in templates, the easy way by Mike Malone</title>
		<link>http://mihasya.com/blog/django-exposing-settings-in-templates-the-easy-way/comment-page-1/#comment-2576</link>
		<dc:creator>Mike Malone</dc:creator>
		<pubDate>Mon, 27 Jul 2009 17:47:27 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=285#comment-2576</guid>
		<description>&lt;p&gt;Another approach is to use the get_safe_settings function from django.views.debug. If you use that function, make sure you look at it&#039;s implementation since it just filters for certain words that make a setting &quot;dangerous&quot; (like &quot;password&quot;). Here&#039;s my context processor for getting settings into templates: http://gist.github.com/156638&lt;/p&gt;

&lt;p&gt;The code for get_safe_settings is here: http://code.djangoproject.com/browser/django/trunk/django/views/debug.py#L13&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Another approach is to use the get_safe_settings function from django.views.debug. If you use that function, make sure you look at it&#8217;s implementation since it just filters for certain words that make a setting &#8220;dangerous&#8221; (like &#8220;password&#8221;). Here&#8217;s my context processor for getting settings into templates: <a href="http://gist.github.com/156638" rel="nofollow">http://gist.github.com/156638</a></p>

<p>The code for get_safe_settings is here: <a href="http://code.djangoproject.com/browser/django/trunk/django/views/debug.py#L13" rel="nofollow">http://code.djangoproject.com/browser/django/trunk/django/views/debug.py#L13</a></p>]]></content:encoded>
	</item>
</channel>
</rss>
