<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 21:33:50 +0000</lastBuildDate>
    <item>
      <title>(Bash) zenity dialog examples - freephys</title>
      <link>https://snipplr.com/view/39031/zenity-dialog-examples</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 13 Aug 2010 14:02:32 UTC</pubDate>
      <guid>https://snipplr.com/view/39031/zenity-dialog-examples</guid>
    </item>
    <item>
      <title>(Bash) Find total size for some files - freephys</title>
      <link>https://snipplr.com/view/39030/find-total-size-for-some-files</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 13 Aug 2010 13:58:51 UTC</pubDate>
      <guid>https://snipplr.com/view/39030/find-total-size-for-some-files</guid>
    </item>
    <item>
      <title>(Bash) Install Multi OS on Mac: step 1 , partition with diskutil - freephys</title>
      <link>https://snipplr.com/view/38556/install-multi-os-on-mac-step-1--partition-with-diskutil</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 06 Aug 2010 01:37:37 UTC</pubDate>
      <guid>https://snipplr.com/view/38556/install-multi-os-on-mac-step-1--partition-with-diskutil</guid>
    </item>
    <item>
      <title>(Python) 8.4. Trapping and Recording Exceptions - freephys</title>
      <link>https://snipplr.com/view/25018/84-trapping-and-recording-exceptions</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 18 Dec 2009 11:18:29 UTC</pubDate>
      <guid>https://snipplr.com/view/25018/84-trapping-and-recording-exceptions</guid>
    </item>
    <item>
      <title>(Python) print_exc_plus : 8.6. Getting More Information from Tracebacks - freephys</title>
      <link>https://snipplr.com/view/25014/printexcplus--86-getting-more-information-from-tracebacks</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 18 Dec 2009 10:51:36 UTC</pubDate>
      <guid>https://snipplr.com/view/25014/printexcplus--86-getting-more-information-from-tracebacks</guid>
    </item>
    <item>
      <title>(Python) Debugging/logging CGI script in Python - freephys</title>
      <link>https://snipplr.com/view/25011/debugginglogging-cgi-script-in-python</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 18 Dec 2009 10:34:20 UTC</pubDate>
      <guid>https://snipplr.com/view/25011/debugginglogging-cgi-script-in-python</guid>
    </item>
    <item>
      <title>(Perl) Example of circular data structure : Network class - freephys</title>
      <link>https://snipplr.com/view/24163/example-of-circular-data-structure--network-class</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 02 Dec 2009 21:49:47 UTC</pubDate>
      <guid>https://snipplr.com/view/24163/example-of-circular-data-structure--network-class</guid>
    </item>
    <item>
      <title>(Python) Determine if a Sequence is in another sequence in Python - freephys</title>
      <link>https://snipplr.com/view/20626/determine-if-a-sequence-is-in-another-sequence-in-python</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 04 Oct 2009 00:48:47 UTC</pubDate>
      <guid>https://snipplr.com/view/20626/determine-if-a-sequence-is-in-another-sequence-in-python</guid>
    </item>
    <item>
      <title>(Python) Determine if a Sequence is in another sequence in Python : solution 1 - freephys</title>
      <link>https://snipplr.com/view/20625/determine-if-a-sequence-is-in-another-sequence-in-python--solution-1</link>
      <description>&lt;p&gt;This is a generalization of the "string contains substring" problem to (more) arbitrary types.&#13;
&#13;
Given an sequence (such as a list or tuple), what's the best way of determining whether another sequence is inside it? As a bonus, it should return the index of the element where the subsequence starts:&#13;
&#13;
Example usage (Sequence in Sequence):&#13;
&#13;
&gt;&gt;&gt; seq_in_seq([5,6],  [4,'a',3,5,6])&#13;
3&#13;
&gt;&gt;&gt; seq_in_seq([5,7],  [4,'a',3,5,6])&#13;
-1 # or None, or whatever&#13;
&#13;
I second the Knuth-Morris-Pratt algorithm. By the way, your problem (and the KMP solution) is exactly recipe 5.13 in Python Cookbook 2nd edition. You can find the related code at http://code.activestate.com/recipes/117214/&#13;
&#13;
It finds all the correct subsequences in a given sequence, and should be used as an iterator:&#13;
&#13;
For larger ones, look at the Aho-Corasick algorithm.&lt;/p&gt;</description>
      <pubDate>Sun, 04 Oct 2009 00:46:40 UTC</pubDate>
      <guid>https://snipplr.com/view/20625/determine-if-a-sequence-is-in-another-sequence-in-python--solution-1</guid>
    </item>
    <item>
      <title>(Python) Reading multiple lines into list : solution 2 - freephys</title>
      <link>https://snipplr.com/view/20624/reading-multiple-lines-into-list--solution-2</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 04 Oct 2009 00:39:57 UTC</pubDate>
      <guid>https://snipplr.com/view/20624/reading-multiple-lines-into-list--solution-2</guid>
    </item>
  </channel>
</rss>
