{
    "componentChunkName": "component---src-templates-index-template-js",
    "path": "/page/21",
    "result": {"data":{"site":{"siteMetadata":{"title":"Viksit Gaur Online","description":"Viksit's home on the WWW. Estd 1997 :)","url":"https://www.viksit.org"}},"allMarkdownRemark":{"nodes":[{"id":"fbc48f88-451e-5418-97bb-96e5d9401b1a","html":"<p>A whiff of citrus – vibrant,<br>\nshiny, dimpled and thick,<br>\nyour fingers move, probing<br>\ntextural ecstacy,<br>\nas your tastes await<br>\nthe sweet tartness within.<br>\nPeel away the layers<br>\nsoftly, envelop a piece,<br>\nlet your tongue steep<br>\nin a myriad of flavors,<br>\nwith the lingering scent<br>\nof summer under a blue sky,<br>\nlook around,<br>\nand all is well again.</p>\n<p>--</p>\n<p><em>If you have any questions or thoughts, don't hesitate to reach out. You can find me as <a href=\"http://twitter.com/viksit\">@viksit</a> on Twitter.</em></p>","excerpt":"A whiff of citrus – vibrant, shiny, dimpled and thick, your fingers move, probing textural ecstacy, as your tastes await the sweet tartness within. Peel away the layers softly, envelop a piece, let your tongue steep in a myriad of flavors, with the…","frontmatter":{"title":"Ode to an Orange","date":"June 11, 2010","slug":"/blog/ode-to-an-orange","tags":null}},{"id":"06b2ed46-179c-54c4-84aa-5e172c834d62","html":"<p>My last post on the topic was creating a stack implementation using Clojure protocols and records – except, it used atoms internally and wasn’t inherently “functional”.</p>\n<p>Here’s my take on a new implementation that builds on the existing protocol and internally, always returns a new stack keeping the original one unmodified. Comments welcome!</p>\n<deckgo-highlight-code   >\n          <code slot=\"code\">\n(ns viksit-stack\n  (:refer-clojure :exclude ))\n\n(defprotocol PStack\n  &quot;A stack protocol&quot;\n  (push  &quot;Push element in&quot;)\n  (pop  &quot;Pop element from stack&quot;)\n  (top  &quot;Get top element from stack&quot;))\n\n; A functional stack record that uses immutable semantics\n; It returns a copy of the datastructure while ensuring the original\n; is not affected.\n(defrecord FStack \n  PStack\n  (push \n\t&quot;Return the stack with the new element inserted&quot;\n\t(FStack. (conj coll val)))\n  (pop \n       &quot;Return the stack without the top element&quot;\n\t (FStack. (rest coll)))\n  (top \n       &quot;Return the top value of the stack&quot;\n       (first coll)))\n\n; The funtional stack can be used in conjunction with a ref or atom\n\nviksit-stack&gt; (def s2 (atom (FStack. &#39;())))\n#&#39;viksit-stack/s2\nviksit-stack&gt; s2\n#&lt;atom&gt;\nviksit-stack&gt; (swap! s2 push 10)\n#:viksit-stack.FStack{:coll (10)}\nviksit-stack&gt; (swap! s2 push 20)\n#:viksit-stack.FStack{:coll (20 10)}\nviksit-stack&gt; (swap! s2 pop)\n#:viksit-stack.FStack{:coll (10)}\nviksit-stack&gt; (top @s2)\n10\n&lt;/atom&gt;</code>\n        </deckgo-highlight-code>\n<p>--</p>\n<p><em>If you have any questions or thoughts, don't hesitate to reach out. You can find me as <a href=\"http://twitter.com/viksit\">@viksit</a> on Twitter.</em></p>","excerpt":"My last post on the topic was creating a stack implementation using Clojure protocols and records – except, it used atoms internally and wasn’t inherently “functional”. Here’s my take on a new implementation that builds on the existing protocol and…","frontmatter":{"title":"Stack implementation in Clojure II - A functional approach","date":"June 04, 2010","slug":"/blog/stack-implementation-in-clojure-ii-a-functional-approach","tags":null}},{"id":"10b998e5-0505-5025-bf36-5de7601c5389","html":"<p>I recently started getting a number of SSL related errors on accessing https links with Google Chrome on Ubuntu. One looks like,</p>\n<blockquote>\n<p>107 (net::ERR_SSL_PROTOCOL_ERROR)</p>\n</blockquote>\n<p>The top link on Google’s search results is pretty fuzzy, so here’s the solution that works for me.</p>\n<p>Go to Settings -> Options -> Under the hood, and enable both SSL 2.0 and SSL 3.0. This should allow Chrome to talk to the server with either protocol.</p>\n<p>There’s also a DEFLATE bug that got fixed to solve this issue in release 340 something. <a href=\"http://codereview.chromium.org/1585041\">http://codereview.chromium.org/1585041</a></p>\n<p>--</p>\n<p><em>If you have any questions or thoughts, don't hesitate to reach out. You can find me as <a href=\"http://twitter.com/viksit\">@viksit</a> on Twitter.</em></p>","excerpt":"I recently started getting a number of SSL related errors on accessing https links with Google Chrome on Ubuntu. One looks like, 107 (net::ERR_SSL_PROTOCOL_ERROR) The top link on Google’s search results is pretty fuzzy, so here’s the solution that…","frontmatter":{"title":"Resolving Chrome's SSL Error","date":"June 03, 2010","slug":"/blog/resolving-chromes-ssl-error","tags":null}},{"id":"34b0c7cf-728d-5c89-8638-3ba9c600c90c","html":"<p>I was trying to experiment with Clojure Protocols and Records recently, and came up with a toy example to clarify my understanding of their usage in the context of developing a simple Stack Abstract Data Type.</p>\n<p>For an excellent tutorial on utilizing protocols and records in Clojure btw – check out (<a href=\"http://kotka.de/blog/2010/03/memoize_done_right.html#protocols\">http://kotka.de/blog/2010/03/memoize_done_right.html#protocols</a>).</p>\n<deckgo-highlight-code   >\n          <code slot=\"code\">\n;; Stack example abstract data type using Clojure protocols and records\n;; viksit at gmail dot com\n;; 2010\n\n(ns viksit.stack\n  (:refer-clojure :exclude ))\n\n(defprotocol PStack\n  &quot;A stack protocol&quot;\n  (push  &quot;Push element into the stack&quot;)\n  (pop  &quot;Pop element from stack&quot;)\n  (top  &quot;Get top element from stack&quot;))\n\n(defrecord Stack \n  PStack\n  (push \n\t(swap! coll conj val))\n  (pop \n       (let \n\t (swap! coll rest)\n\t ret))\n  (top \n       (first @coll)))\n\n;; Testing\nstack&gt; (def s (Stack. (atom &#39;())))\n#&#39;stack/s\nstack&gt; (push s 10)\n(10)\nstack&gt; (push s 20)\n(20 10)\nstack&gt; (top s)\n20\nstack&gt; s\n#:stack.Stack{:coll #&lt;atom&gt;}\nstack&gt; (pop s)\n20\n\n&lt;/atom&gt;</code>\n        </deckgo-highlight-code>\n<p>More tutorial links on Protocols,</p>\n<p>\\ <a href=\"http://blog.higher-order.net/2010/05/05/circuitbreaker-clojure-1-2/\">http://blog.higher-order.net/2010/05/05/circuitbreaker-clojure-1-2/</a><br>\n\\ <a href=\"http://freegeek.in/blog/2010/05/clojure-protocols-datatypes-a-sneak-peek/\">http://freegeek.in/blog/2010/05/clojure-protocols-datatypes-a-sneak-peek/</a><br>\n\\ <a href=\"http://groups.google.com/group/clojure/browse%5C_thread/thread/b8620db0b7424712\">http://groups.google.com/group/clojure/browse\\_thread/thread/b8620db0b7424712</a></p>\n<p>--</p>\n<p><em>If you have any questions or thoughts, don't hesitate to reach out. You can find me as <a href=\"http://twitter.com/viksit\">@viksit</a> on Twitter.</em></p>","excerpt":"I was trying to experiment with Clojure Protocols and Records recently, and came up with a toy example to clarify my understanding of their usage in the context of developing a simple Stack Abstract Data Type. For an excellent tutorial on utilizing…","frontmatter":{"title":"Stack implementation in Clojure using Protocols and Records","date":"June 02, 2010","slug":"/blog/stack-implementation-in-clojure-using-protocols-and-records","tags":null}},{"id":"f6ec8ca7-3219-545b-9fea-5e222c4c0e62","html":"<p><strong>Update</strong></p>\n<p>As Hans points out in the comment below, it appears pycassa natively supports authentication with <em>org.apache.cassandra.auth.SimpleAuthenticator</em>. Lazyboy on the other hand doesn’t by default.</p>\n<p>It’s not too hard to do it though. Intuitively, we could do something like this.</p>\n<p><strong>NB: Untested code!!</strong>  I might create a patch for this when I get the time, so this is just an outline.</p>\n<deckgo-highlight-code   >\n          <code slot=\"code\">\n# Add this to lazyboy&#39;s connection package\nfrom cassandra.ttypes import AuthenticationRequest</code>\n        </deckgo-highlight-code>\n<p>And in lazyboy’s _connect() function, add another parameter called logins, that is a dict of keyspaces and credentials which looks like the following.</p>\n<deckgo-highlight-code   >\n          <code slot=\"code\">\n# logins format\n{&#39;Keyspace1&#39; : {&#39;username&#39;:&#39;myuser&#39;, &#39;password&#39;:&#39;mypass&#39;}}</code>\n        </deckgo-highlight-code>\n<deckgo-highlight-code   >\n          <code slot=\"code\">\ndef _connect(self, logins):\n&quot;&quot;&quot;Connect to Cassandra if not connected.&quot;&quot;&quot;\n\n    client = self._get_server()\n    if client.transport.isOpen() and self._recycle:\n        if (client.connect_time + self._recycle) &gt; time.time():\n            return client\n        else:\n            client.transport.close()\n    \n    elif client.transport.isOpen():\n        return client\n    \n    try:\n        client.transport.open()\n        # Login code \n        # Remember that client is an instance of Cassandra.Client(protocol)\n        if logins is not None:\n            for keyspace, credentials in logins.iteritems():\n                request = AuthenticationRequest(credentials=credentials)\n            client.login(keyspace, request)\n    \n        client.connect_time = time.time()\n    except thrift.transport.TTransport.TTransportException, ex:\n        client.transport.close()\n        raise exc.ErrorThriftMessage(\n            ex.message, self._servers)\n</code>\n        </deckgo-highlight-code>\n<p><strong>Original Post</strong><br>\nI’ve been looking to answer which Python library is currently more fully featured to use to communicate with Cassandra.</p>\n<p>From Reddit,</p>\n<blockquote>\n<p>API-wise, both look like they are pretty much basic wrappers around the Cassandra Thrift bindings. I’d prefer lazyboy over pycassa though, given that firstly, it’s being used in production right now at Digg, and because it looks like lazyboy’s connection code is more featured than pycassa.</p>\n</blockquote>\n<p>and</p>\n<blockquote>\n<p>The connection code (Lazyboy) seems to be much more suited for use in production (use of auto pooling, auto load balancing, integrated failover/retry, etc.) (than PyCassa)</p>\n</blockquote>\n<p>Thanks to GitHub, I was able to do some analysis of their traffic and commits,</p>\n<h3>Traffic Data</h3>\n<p>!(<a href=\"http://chart.apis.google.com/chart?chd=s:LMMeDMGFJFDEBECGCAEEEFFGKHEHOMEGBCDFGQEDDGIFEMCDEEEGBKDFDNCEODCJCFWLHJushZOQn9VgRbMMeVsn0i&#x26;chs=460x100&#x26;cht=lc&#x26;chxl=0:%7C2009-12-14%7C2010-01-13%7C2010-02-12%7C2010-03-14%7C1:%7C0%7C80%7C101%7C134%7C202%7C404&#x26;chm=B,EBF5FB,0,0,0&#x26;chco=008Cd6&#x26;chls=3,1,0&#x26;chg=8.3,20,1,4&#x26;chxt=x,y\">http://chart.apis.google.com/chart?chd=s:LMMeDMGFJFDEBECGCAEEEFFGKHEHOMEGBCDFGQEDDGIFEMCDEEEGBKDFDNCEODCJCFWLHJushZOQn9VgRbMMeVsn0i&#x26;chs=460x100&#x26;cht=lc&#x26;chxl=0:%7C2009-12-14%7C2010-01-13%7C2010-02-12%7C2010-03-14%7C1:%7C0%7C80%7C101%7C134%7C202%7C404&#x26;chm=B,EBF5FB,0,0,0&#x26;chco=008Cd6&#x26;chls=3,1,0&#x26;chg=8.3,20,1,4&#x26;chxt=x,y</a>)</p>\n<center>**LazyBoy**</center>!(http://chart.apis.google.com/chart?chd=s:AAAAAAAAJGGDCABCBAADADADHACAEFADABHDCAABNGFCCJCCDCDCCCGFDCACBACDCAFCDANVNIHLWcfUILOLVUZh9Z&chs=460x100&cht=lc&chxl=0:%7C2009-12-14%7C2010-01-13%7C2010-02-12%7C2010-03-14%7C1:%7C0%7C46%7C57%7C77%7C115%7C231&chm=B,EBF5FB,0,0,0&chco=008Cd6&chls=3,1,0&chg=8.3,20,1,4&chxt=x,y)\n<center> **Pycassa** </center>###  Commit Data \n<p>!(<a href=\"http://chart.apis.google.com/chart?chs=400x150&#x26;chds=-1,24,-1,7,0,13&#x26;chf=bg,s,efefef&#x26;chd=t:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23%7C0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7%7C0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,7,7,13,5,4,6,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,1,2,0,2,8,2,4,6,2,0,1,1,0,0,0,0,0,0,0,0,0,0,0,7,8,7,0,11,7,5,5,4,0,3,1,3,0,0,0,0,0,0,0,0,0,0,3,1,9,3,10,9,4,10,2,2,2,1,0,0,0,0,0,0,0,0,0,1,0,0,0,9,8,6,10,0,3,7,3,2,0,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&#x26;chxt=x,y&#x26;chm=o,333333,1,1.0,25.0&#x26;chxl=0:%7C%7C12am%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12pm%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C%7C1:%7C%7CSun%7CMon%7CTue%7CWed%7CThr%7CFri%7CSat%7C&#x26;cht=s\">http://chart.apis.google.com/chart?chs=400x150&#x26;chds=-1,24,-1,7,0,13&#x26;chf=bg,s,efefef&#x26;chd=t:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,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0,25.0&#x26;chxl=0:%7C%7C12am%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12pm%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C%7C1:%7C%7CSun%7CMon%7CTue%7CWed%7CThr%7CFri%7CSat%7C&#x26;cht=s</a>)</p>\n<center>**LazyBoy**</center>!(http://chart.apis.google.com/chart?chs=400x150&chds=-1,24,-1,7,0,10&chf=bg,s,efefef&chd=t:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23%7C0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7%7C0,0,0,0,0,0,0,1,0,5,0,0,0,0,0,1,1,0,0,2,1,4,1,0,0,0,0,0,0,2,3,2,2,0,6,0,0,2,0,0,0,0,0,0,0,0,0,2,10,1,0,0,1,0,2,1,0,2,0,0,0,1,0,1,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,2,1,6,0,2,3,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&chxt=x,y&chm=o,333333,1,1.0,25.0&chxl=0:%7C%7C12am%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12pm%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C%7C1:%7C%7CSun%7CMon%7CTue%7CWed%7CThr%7CFri%7CSat%7C&cht=s)\n<center> **Pycassa** </center>A larger number of people know about LazyBoy but code commits on it are currently on a stand still. Pycassa on the other hand seems to be growing at a pretty fast rate.\n<p>It looks like LazyBoy is probably a better library to start with, for now. I’ll talk about my experiences with both in another post.</p>\n<p>--</p>\n<p><em>If you have any questions or thoughts, don't hesitate to reach out. You can find me as <a href=\"http://twitter.com/viksit\">@viksit</a> on Twitter.</em></p>","excerpt":"Update As Hans points out in the comment below, it appears pycassa natively supports authentication with org.apache.cassandra.auth.SimpleAuthenticator. Lazyboy on the other hand doesn’t by default. It’s not too hard to do it though. Intuitively, we…","frontmatter":{"title":"PyCassa vs Lazyboy (updated)","date":"May 21, 2010","slug":"/blog/pycassa-vs-lazyboy-updated","tags":null}}]}},"pageContext":{"limit":5,"skip":100,"numPages":27,"currentPage":21}},
    "staticQueryHashes": ["4202924991","512065377"]}