Popular recipes tagged "select"http://code.activestate.com/recipes/tags/select/popular/2013-07-07T02:09:57-07:00ActiveState Code RecipesPrimitive Peer to Peer Chat (Python) 2013-07-07T02:09:57-07:00teddy_khttp://code.activestate.com/recipes/users/4187115/http://code.activestate.com/recipes/578591-primitive-peer-to-peer-chat/ <p style="color: grey"> Python recipe 578591 by <a href="/recipes/users/4187115/">teddy_k</a> (<a href="/recipes/tags/chat/">chat</a>, <a href="/recipes/tags/peer/">peer</a>, <a href="/recipes/tags/select/">select</a>, <a href="/recipes/tags/socket/">socket</a>, <a href="/recipes/tags/threading/">threading</a>). </p> <p>This took me longer than it should have. I am putting it here in the hopes that this post will spare others from having to Google things for extended periods of time.</p> <p>In short, you either listen for a connection (Chat_Server), or connect to a remote IP address (Chat_Client). From there, you can send text strings back and forth. </p> <p>This is a bit rough-hewn, obviously; I apologize in advance.</p> Conjunction select using foreign keys (Text) 2011-06-11T02:43:22-07:00Kaushik Ghosehttp://code.activestate.com/recipes/users/4166965/http://code.activestate.com/recipes/577747-conjunction-select-using-foreign-keys/ <p style="color: grey"> Text recipe 577747 by <a href="/recipes/users/4166965/">Kaushik Ghose</a> (<a href="/recipes/tags/conjunction/">conjunction</a>, <a href="/recipes/tags/foreign/">foreign</a>, <a href="/recipes/tags/key/">key</a>, <a href="/recipes/tags/select/">select</a>, <a href="/recipes/tags/sql/">sql</a>). </p> <p>Say we have a table (notes) containing rows we want to select. Each note has one or more keywords (stored in a table of the same name). We want to select notes that have a conjunction of keywords (AND). notes and keywords are linked through a foreign key table notes_keywords. The following SQL statement allows us to do this</p>