<?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>Autarchy of the Private Cave &#187; example</title> <atom:link href="https://bogdan.org.ua/tags/example/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Wed, 28 Dec 2022 16:09:04 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>C: how to specify comparison operators floating precision</title><link>https://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html</link> <comments>https://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html#comments</comments> <pubDate>Thu, 11 Jun 2009 17:47:37 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[C]]></category> <category><![CDATA[comparison]]></category> <category><![CDATA[double]]></category> <category><![CDATA[example]]></category> <category><![CDATA[float]]></category> <category><![CDATA[floating]]></category> <category><![CDATA[operator]]></category> <category><![CDATA[precision]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=774</guid> <description><![CDATA[There is no way I&#8217;m aware of to do what the title says. However&#8230; I&#8217;m sure that you are aware of the fact that floats representation in any programming language is limited by the precision of the internal binary representations. In other words, you can never have an exact float representation &#8211; there will always [&#8230;]]]></description> <content:encoded><![CDATA[<p>There is no way I&#8217;m aware of to do what the title says. However&#8230;</p><p>I&#8217;m sure that you are aware of the fact that floats representation in any programming language is limited by the precision of the internal binary representations. In other words, you can never have an <strong>exact</strong> float representation &#8211; there will always be some precision associated with the float you are working with. The simplest example is the difference in precision between the <em>float</em> and <em>double</em> types in <strong>C</strong>.</p><p>Suppose I have the following code fragment:<br
/> [C] if ( result.score  >= input->raw_cut_off ) [/C]</p><p>Both <em>result.score</em> and <em>input->raw_cut_off</em> are of type <strong>float</strong>, and can have positive and negative values. When compared with the greater than or equal ( >= ) operator, it is not always that condition is true &#8211; for the precision reasons shortly mentioned above.</p><p>As I already said, there is no precision specification for equality operators in <strong>C</strong>. But it is quite simple to &#8220;invent&#8221; precision specification; e.g. if I wanted to test for equality only, I could write<br
/> [C] if ( fabsf( result.score &#8211; input->raw_cut_off ) <  0.000001 )[/C]
In this example, I'm effectively asking for 6-digit precision for the equality comparison of floating-point values. Note, that if you replace that 0.000001 with the actual precision limit of the floating type you are using, you will be "exactly" comparing floating-point numbers - up to that type's precision, of course <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> .</p><p>The first-most example with the >= operator can be rewritten as<br
/> [C] if ( result.score  > ( input->raw_cut_off &#8211; precision) ) [/C]<br
/> where <em>precision</em> is exactly what it is named, e.g. <em>precision</em> = 0.000001.</p><p>Sources used:</p><ul><li>comment by <a
href="http://bytes.com/topic/c-sharp/answers/233215-float-double-arithmetic-precision-error#post953273">Randy A. Ynchausti</a></li><li><a
href="http://www.shokhirev.com/nikolai/abc/sciprog/sciprognum.html">scientific programming</a></li></ul><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&#038;title=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" data-a2a-url="https://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html" data-a2a-title="C: how to specify comparison operators floating precision"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to use ffmpeg if libmp3lame support is not present</title><link>https://bogdan.org.ua/2008/04/12/how-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html</link> <comments>https://bogdan.org.ua/2008/04/12/how-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html#comments</comments> <pubDate>Sat, 12 Apr 2008 20:41:07 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Software]]></category> <category><![CDATA[direct stream copy]]></category> <category><![CDATA[example]]></category> <category><![CDATA[ffmpeg]]></category> <category><![CDATA[libmp3lame]]></category> <category><![CDATA[sample command]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=291</guid> <description><![CDATA[I&#8217;m providing regularly updated compiled linux and freebsd ffmpeg binaries, and also described how to use ffmpeg on shared hostings if not all the required libraries (like libmp3lame) are present. However, the solution recommended might not &#8220;fit all&#8221;, so here is another one &#8211; simpler and even more portable/universal than setting LD_LIBRARY_PATH. The solution is [&#8230;]]]></description> <content:encoded><![CDATA[<p>I&#8217;m providing <a
href="http://bogdan.org.ua/2007/06/28/compiled-linux-ffmpeg-binary-for-gallery2-download.html">regularly updated compiled linux and freebsd ffmpeg binaries</a>, and also <a
href="http://bogdan.org.ua/2008/03/12/instructions-on-installing-libmp3lame-enabled-ffmpeg-on-shared-linux-hosting.html">described how to use ffmpeg on shared hostings if not all the required libraries (like libmp3lame) are present</a>. However, the solution recommended might not &#8220;fit all&#8221;, so here is another one &#8211; simpler and even more portable/universal than setting LD_LIBRARY_PATH.<br
/> <span
id="more-291"></span><br
/> The solution is simple &#8211; I first proposed it in the <a
href="http://drupal.org/node/137203#comment-802272" class="broken_link" rel="nofollow">Getting ffmpeg working with flashvideo on various platforms</a> issue page on <a
href="http://drupal.org/" class="broken_link" rel="nofollow">Drupal.org</a>.</p><p>The idea is: if the original audio stream in the file is already compressed (most of the time it is), then you do not need to recompress it &#8211; and do not need libmp3lame or any other audio codec! To achieve the &#8220;ffmpeg direct stream copy&#8221; functionality, you can add one of the two options:<br
/> <strong>-vcodec copy</strong> will direct-stream-copy video (no re-compression),<br
/> <strong>-acodec copy</strong> will direct-stream-copy audio (no re-compression).</p><p>In other words, ffmpeg option <strong>-acodec copy</strong> should just copy the original audio from input file to output file without alteration, and will not require any audio codecs support.</p><p>Sample command line could be (in the example, a 1-minute fragment of the input file is just copied into the output file):</p><p><strong>ffmpeg -t 00:01:00 -i movie.avi -vcodec copy -acodec copy preview.avi</strong></p><p>This tip is based on the information initially obtained from the ffmpeg-user mailing list archive for June of 2005.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F04%2F12%2Fhow-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html&amp;linkname=How%20to%20use%20ffmpeg%20if%20libmp3lame%20support%20is%20not%20present" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F04%2F12%2Fhow-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html&amp;linkname=How%20to%20use%20ffmpeg%20if%20libmp3lame%20support%20is%20not%20present" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F04%2F12%2Fhow-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html&amp;linkname=How%20to%20use%20ffmpeg%20if%20libmp3lame%20support%20is%20not%20present" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F04%2F12%2Fhow-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html&amp;linkname=How%20to%20use%20ffmpeg%20if%20libmp3lame%20support%20is%20not%20present" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F04%2F12%2Fhow-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html&amp;linkname=How%20to%20use%20ffmpeg%20if%20libmp3lame%20support%20is%20not%20present" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2008%2F04%2F12%2Fhow-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html&#038;title=How%20to%20use%20ffmpeg%20if%20libmp3lame%20support%20is%20not%20present" data-a2a-url="https://bogdan.org.ua/2008/04/12/how-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html" data-a2a-title="How to use ffmpeg if libmp3lame support is not present"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2008/04/12/how-to-use-ffmpeg-if-libmp3lame-support-is-not-present.html/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>MySQL: INSERT IF NOT EXISTS syntax</title><link>https://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html</link> <comments>https://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html#comments</comments> <pubDate>Thu, 18 Oct 2007 13:20:21 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[database]]></category> <category><![CDATA[example]]></category> <category><![CDATA[examples]]></category> <category><![CDATA[exists]]></category> <category><![CDATA[insert]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[problem]]></category> <category><![CDATA[syntax]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html</guid> <description><![CDATA[To start: as of the latest MySQL, syntax presented in the title is not possible. But there are several very easy ways to accomplish what is expected using existing functionality. There are 3 possible solutions: using INSERT IGNORE, REPLACE, or INSERT &#8230; ON DUPLICATE KEY UPDATE. Imagine we have a table: CREATE TABLE `transcripts` &#40; [&#8230;]]]></description> <content:encoded><![CDATA[<p>To start: as of the latest MySQL, syntax presented in the title is not possible. But there are several very easy ways to accomplish what is expected using existing functionality.</p><p>There are 3 possible solutions: using INSERT IGNORE, REPLACE, or INSERT &#8230; ON DUPLICATE KEY UPDATE.</p><p>Imagine we have a table:</p><div
id="ig-sh-1" class="syntax_hilite"><div
class="code"><ol
class="sql" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #993333; font-weight: bold;">CREATE</span> <span
style="color: #993333; font-weight: bold;">TABLE</span> <span
style="color: #ff0000;">`transcripts`</span> <span
style="color: #66cc66;">&#40;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span
style="color: #ff0000;">`ensembl_transcript_id`</span> <span
style="color: #993333; font-weight: bold;">varchar</span><span
style="color: #66cc66;">&#40;</span><span
style="color: #cc66cc;">20</span><span
style="color: #66cc66;">&#41;</span> <span
style="color: #993333; font-weight: bold;">NOT</span> <span
style="color: #993333; font-weight: bold;">NULL</span><span
style="color: #66cc66;">,</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span
style="color: #ff0000;">`transcript_chrom_start`</span> <span
style="color: #993333; font-weight: bold;">int</span><span
style="color: #66cc66;">&#40;</span><span
style="color: #cc66cc;">10</span><span
style="color: #66cc66;">&#41;</span> <span
style="color: #993333; font-weight: bold;">unsigned</span> <span
style="color: #993333; font-weight: bold;">NOT</span> <span
style="color: #993333; font-weight: bold;">NULL</span><span
style="color: #66cc66;">,</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span
style="color: #ff0000;">`transcript_chrom_end`</span> <span
style="color: #993333; font-weight: bold;">int</span><span
style="color: #66cc66;">&#40;</span><span
style="color: #cc66cc;">10</span><span
style="color: #66cc66;">&#41;</span> <span
style="color: #993333; font-weight: bold;">unsigned</span> <span
style="color: #993333; font-weight: bold;">NOT</span> <span
style="color: #993333; font-weight: bold;">NULL</span><span
style="color: #66cc66;">,</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span
style="color: #993333; font-weight: bold;">PRIMARY</span> <span
style="color: #993333; font-weight: bold;">KEY</span> &nbsp;<span
style="color: #66cc66;">&#40;</span><span
style="color: #ff0000;">`ensembl_transcript_id`</span><span
style="color: #66cc66;">&#41;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #66cc66;">&#41;</span> ENGINE<span
style="color: #66cc66;">=</span>InnoDB <span
style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span
style="color: #66cc66;">=</span>latin1;</div></li></ol></div></div><p>Now imagine that we have an automatic pipeline importing transcripts meta-data from Ensembl, and that due to various reasons the pipeline might be broken at any step of execution. Thus, we need to ensure two things: 1) repeated executions of the pipeline will not destroy our database, and 2) repeated executions will not die due to &#8216;duplicate primary key&#8217; errors.</p><p>Method 1: using REPLACE<br
/> <span
id="more-238"></span><br
/> It&#8217;s very simple:</p><div
id="ig-sh-2" class="syntax_hilite"><div
class="code"><ol
class="sql" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #993333; font-weight: bold;">REPLACE</span> <span
style="color: #993333; font-weight: bold;">INTO</span> <span
style="color: #ff0000;">`transcripts`</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #993333; font-weight: bold;">SET</span> <span
style="color: #ff0000;">`ensembl_transcript_id`</span> <span
style="color: #66cc66;">=</span> <span
style="color: #ff0000;">'ENSORGT00000000001'</span><span
style="color: #66cc66;">,</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff0000;">`transcript_chrom_start`</span> <span
style="color: #66cc66;">=</span> <span
style="color: #cc66cc;">12345</span><span
style="color: #66cc66;">,</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff0000;">`transcript_chrom_end`</span> <span
style="color: #66cc66;">=</span> <span
style="color: #cc66cc;">12678</span>;</div></li></ol></div></div><p>If the record exists, it will be overwritten; if it does not yet exist, it will be created.<br
/> However, using this method isn&#8217;t efficient for our case: we do not need to overwrite existing records, it&#8217;s fine just to skip them.</p><p>Method 2: using INSERT IGNORE<br
/> Also very simple:</p><div
id="ig-sh-3" class="syntax_hilite"><div
class="code"><ol
class="sql" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #993333; font-weight: bold;">INSERT</span> <span
style="color: #993333; font-weight: bold;">IGNORE</span> <span
style="color: #993333; font-weight: bold;">INTO</span> <span
style="color: #ff0000;">`transcripts`</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #993333; font-weight: bold;">SET</span> <span
style="color: #ff0000;">`ensembl_transcript_id`</span> <span
style="color: #66cc66;">=</span> <span
style="color: #ff0000;">'ENSORGT00000000001'</span><span
style="color: #66cc66;">,</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff0000;">`transcript_chrom_start`</span> <span
style="color: #66cc66;">=</span> <span
style="color: #cc66cc;">12345</span><span
style="color: #66cc66;">,</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff0000;">`transcript_chrom_end`</span> <span
style="color: #66cc66;">=</span> <span
style="color: #cc66cc;">12678</span>;</div></li></ol></div></div><p>Here, if the &#8216;ensembl_transcript_id&#8217; is already present in the database, it will be silently skipped (ignored). (To be more precise, here&#8217;s a quote from MySQL reference manual: &#8220;If you use the IGNORE keyword, errors that occur while executing the INSERT statement are treated as warnings instead. For example, without IGNORE, a row that duplicates an existing UNIQUE index or PRIMARY KEY value in the table causes a duplicate-key error and the statement is aborted.&#8221;.) If the record doesn&#8217;t yet exist, it will be created.</p><p>This second method has several potential weaknesses, including non-abortion of the query in case any other problem occurs (<a
href="http://dev.mysql.com/doc/refman/5.0/en/insert.html" class="broken_link" rel="nofollow">see the manual</a>). Thus it should be used if previously tested without the IGNORE keyword.</p><p>There is one more option: to use <a
href="http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html" class="broken_link" rel="nofollow">INSERT &#8230; ON DUPLICATE KEY UPDATE syntax</a>, and in the UPDATE part just <del
datetime="2008-08-30T14:13:11+00:00">do nothing</del> do some meaningless (empty) operation, like calculating 0+0 (<a
href="http://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html#comment-80275">Geoffray</a> <ins
datetime="2008-08-30T14:13:11+00:00">suggests doing the id=id assignment for the MySQL optimization engine to ignore this operation</ins>). Advantage of this method is that it only ignores duplicate key events, and still aborts on other errors.</p><p>As a final notice: this post was inspired by <a
href="http://www.xaprb.com/blog/2005/09/25/insert-if-not-exists-queries-in-mysql/">Xaprb</a>. I&#8217;d also advise to consult his other <a
href="http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/">post on writing flexible SQL queries</a>.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F18%2Fmysql-insert-if-not-exists-syntax.html&amp;linkname=MySQL%3A%20INSERT%20IF%20NOT%20EXISTS%20syntax" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F18%2Fmysql-insert-if-not-exists-syntax.html&amp;linkname=MySQL%3A%20INSERT%20IF%20NOT%20EXISTS%20syntax" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F18%2Fmysql-insert-if-not-exists-syntax.html&amp;linkname=MySQL%3A%20INSERT%20IF%20NOT%20EXISTS%20syntax" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F18%2Fmysql-insert-if-not-exists-syntax.html&amp;linkname=MySQL%3A%20INSERT%20IF%20NOT%20EXISTS%20syntax" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F18%2Fmysql-insert-if-not-exists-syntax.html&amp;linkname=MySQL%3A%20INSERT%20IF%20NOT%20EXISTS%20syntax" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F18%2Fmysql-insert-if-not-exists-syntax.html&#038;title=MySQL%3A%20INSERT%20IF%20NOT%20EXISTS%20syntax" data-a2a-url="https://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html" data-a2a-title="MySQL: INSERT IF NOT EXISTS syntax"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html/feed</wfw:commentRss> <slash:comments>46</slash:comments> </item> <item><title>Useful Python looping techniques</title><link>https://bogdan.org.ua/2007/09/26/useful-python-looping-techniques.html</link> <comments>https://bogdan.org.ua/2007/09/26/useful-python-looping-techniques.html#comments</comments> <pubDate>Wed, 26 Sep 2007 09:21:00 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[example]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[looping]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/2007/09/26/useful-python-looping-techniques.html</guid> <description><![CDATA[These are all excerpts from the Python documentation. To synchronously and simultaneously loop over two sequences: questions = &#91;'name', 'quest', 'favourite colour'&#93; answers = &#91;'Lancelot', 'the holy grail', 'blue'&#93; &#160; for q, a in zip&#40;questions, answers&#41;: &#160; &#160; print 'What is your %s? &#160;It is %s.' % &#40;q, a&#41; To loop over a sequence with [&#8230;]]]></description> <content:encoded><![CDATA[<p>These are all excerpts from the Python documentation.</p><p>To synchronously and simultaneously loop over two sequences:</p><div
id="ig-sh-4" class="syntax_hilite"><div
class="code"><ol
class="python" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">questions <span
style="color: #66cc66;">=</span> <span
style="color: black;">&#91;</span><span
style="color: #483d8b;">'name'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'quest'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'favourite colour'</span><span
style="color: black;">&#93;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">answers <span
style="color: #66cc66;">=</span> <span
style="color: black;">&#91;</span><span
style="color: #483d8b;">'Lancelot'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'the holy grail'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'blue'</span><span
style="color: black;">&#93;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff7700;font-weight:bold;">for</span> q<span
style="color: #66cc66;">,</span> a <span
style="color: #ff7700;font-weight:bold;">in</span> <span
style="color: #008000;">zip</span><span
style="color: black;">&#40;</span>questions<span
style="color: #66cc66;">,</span> answers<span
style="color: black;">&#41;</span>:</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #ff7700;font-weight:bold;">print</span> <span
style="color: #483d8b;">'What is your %s? &nbsp;It is %s.'</span> % <span
style="color: black;">&#40;</span>q<span
style="color: #66cc66;">,</span> a<span
style="color: black;">&#41;</span></div></li></ol></div></div><p>To loop over a sequence with both key and value:<br
/> <span
id="more-229"></span></p><div
id="ig-sh-5" class="syntax_hilite"><div
class="code"><ol
class="python" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff7700;font-weight:bold;">for</span> i<span
style="color: #66cc66;">,</span> v <span
style="color: #ff7700;font-weight:bold;">in</span> <span
style="color: #008000;">enumerate</span><span
style="color: black;">&#40;</span><span
style="color: black;">&#91;</span><span
style="color: #483d8b;">'tic'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'tac'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'toe'</span><span
style="color: black;">&#93;</span><span
style="color: black;">&#41;</span>:</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #ff7700;font-weight:bold;">print</span> i<span
style="color: #66cc66;">,</span> v</div></li></ol></div></div><p>To loop over dictionary, again with key and value:</p><div
id="ig-sh-6" class="syntax_hilite"><div
class="code"><ol
class="python" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">knights <span
style="color: #66cc66;">=</span> <span
style="color: black;">&#123;</span><span
style="color: #483d8b;">'gallahad'</span>: <span
style="color: #483d8b;">'the pure'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'robin'</span>: <span
style="color: #483d8b;">'the brave'</span><span
style="color: black;">&#125;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff7700;font-weight:bold;">for</span> k<span
style="color: #66cc66;">,</span> v <span
style="color: #ff7700;font-weight:bold;">in</span> knights.<span
style="color: black;">iteritems</span><span
style="color: black;">&#40;</span><span
style="color: black;">&#41;</span>:</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #ff7700;font-weight:bold;">print</span> k<span
style="color: #66cc66;">,</span> v</div></li></ol></div></div><p>To loop over some sorted sequence, but without modifying the original sequence (beware the use of set() in this example):</p><div
id="ig-sh-7" class="syntax_hilite"><div
class="code"><ol
class="python" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">basket <span
style="color: #66cc66;">=</span> <span
style="color: black;">&#91;</span><span
style="color: #483d8b;">'apple'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'orange'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'apple'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'pear'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'orange'</span><span
style="color: #66cc66;">,</span> <span
style="color: #483d8b;">'banana'</span><span
style="color: black;">&#93;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff7700;font-weight:bold;">for</span> f <span
style="color: #ff7700;font-weight:bold;">in</span> <span
style="color: #008000;">sorted</span><span
style="color: black;">&#40;</span><span
style="color: #008000;">set</span><span
style="color: black;">&#40;</span>basket<span
style="color: black;">&#41;</span><span
style="color: black;">&#41;</span>:</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #ff7700;font-weight:bold;">print</span> f</div></li></ol></div></div><p>For looping sorted dictionaries, see also <a
href="http://bogdan.org.ua/2007/09/26/how-to-sort-python-dict-dictionary.html">How to sort Python dict (dictionary)</a>.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fuseful-python-looping-techniques.html&amp;linkname=Useful%20Python%20looping%20techniques" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fuseful-python-looping-techniques.html&amp;linkname=Useful%20Python%20looping%20techniques" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fuseful-python-looping-techniques.html&amp;linkname=Useful%20Python%20looping%20techniques" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fuseful-python-looping-techniques.html&amp;linkname=Useful%20Python%20looping%20techniques" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fuseful-python-looping-techniques.html&amp;linkname=Useful%20Python%20looping%20techniques" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fuseful-python-looping-techniques.html&#038;title=Useful%20Python%20looping%20techniques" data-a2a-url="https://bogdan.org.ua/2007/09/26/useful-python-looping-techniques.html" data-a2a-title="Useful Python looping techniques"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2007/09/26/useful-python-looping-techniques.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to sort Python dict (dictionary)</title><link>https://bogdan.org.ua/2007/09/26/how-to-sort-python-dict-dictionary.html</link> <comments>https://bogdan.org.ua/2007/09/26/how-to-sort-python-dict-dictionary.html#comments</comments> <pubDate>Wed, 26 Sep 2007 06:20:57 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[example]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[sorting]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/2007/09/26/how-to-sort-python-dict-dictionary.html</guid> <description><![CDATA[Sample script (copypasted from Well House Consultants training course): click the PLAIN TEXT header for copy-pasteable version #!/usr/local/bin/python &#160; author = &#123;&#34;php&#34;:&#34;Rasmus Lerdorf&#34;,\ &#160; &#160; &#34;perl&#34;:&#34;Larry Wall&#34;,\ &#160; &#160; &#34;tcl&#34;:&#34;John Ousterhout&#34;,\ &#160; &#160; &#34;awk&#34;:&#34;Brian Kernighan&#34;,\ &#160; &#160; &#34;java&#34;:&#34;James Gosling&#34;,\ &#160; &#160; &#34;parrot&#34;:&#34;Simon Cozens&#34;,\ &#160; &#160; &#34;python&#34;:&#34;Guido van Rossum&#34;&#125; &#160; langs = author.keys&#40;&#41; langs.sort&#40;&#41; &#160; for [&#8230;]]]></description> <content:encoded><![CDATA[<p>Sample script (copypasted from <a
href="http://www.wellho.net/resources/ex.php4?item=y107/d3.py">Well House Consultants training course</a>):<br
/> <em>click the PLAIN TEXT header for copy-pasteable version</em></p><div
id="ig-sh-8" class="syntax_hilite"><div
class="code"><ol
class="python" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #808080; font-style: italic;">#!/usr/local/bin/python</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">author <span
style="color: #66cc66;">=</span> <span
style="color: black;">&#123;</span><span
style="color: #483d8b;">&quot;php&quot;</span>:<span
style="color: #483d8b;">&quot;Rasmus Lerdorf&quot;</span><span
style="color: #66cc66;">,</span>\</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #483d8b;">&quot;perl&quot;</span>:<span
style="color: #483d8b;">&quot;Larry Wall&quot;</span><span
style="color: #66cc66;">,</span>\</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #483d8b;">&quot;tcl&quot;</span>:<span
style="color: #483d8b;">&quot;John Ousterhout&quot;</span><span
style="color: #66cc66;">,</span>\</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #483d8b;">&quot;awk&quot;</span>:<span
style="color: #483d8b;">&quot;Brian Kernighan&quot;</span><span
style="color: #66cc66;">,</span>\</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #483d8b;">&quot;java&quot;</span>:<span
style="color: #483d8b;">&quot;James Gosling&quot;</span><span
style="color: #66cc66;">,</span>\</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #483d8b;">&quot;parrot&quot;</span>:<span
style="color: #483d8b;">&quot;Simon Cozens&quot;</span><span
style="color: #66cc66;">,</span>\</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #483d8b;">&quot;python&quot;</span>:<span
style="color: #483d8b;">&quot;Guido van Rossum&quot;</span><span
style="color: black;">&#125;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">langs <span
style="color: #66cc66;">=</span> author.<span
style="color: black;">keys</span><span
style="color: black;">&#40;</span><span
style="color: black;">&#41;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">langs.<span
style="color: black;">sort</span><span
style="color: black;">&#40;</span><span
style="color: black;">&#41;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff7700;font-weight:bold;">for</span> language <span
style="color: #ff7700;font-weight:bold;">in</span> langs:</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #ff7700;font-weight:bold;">print</span> language<span
style="color: #66cc66;">,</span><span
style="color: #483d8b;">&quot;is the child of&quot;</span><span
style="color: #66cc66;">,</span>author<span
style="color: black;">&#91;</span>language<span
style="color: black;">&#93;</span></div></li></ol></div></div><p>You can also define the Python <strong>ksort()</strong> function similar to that found in PHP:<br
/> <span
id="more-228"></span></p><div
id="ig-sh-9" class="syntax_hilite"><div
class="code"><ol
class="python" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff7700;font-weight:bold;">def</span> ksort<span
style="color: black;">&#40;</span>d<span
style="color: #66cc66;">,</span> func <span
style="color: #66cc66;">=</span> <span
style="color: #008000;">None</span><span
style="color: black;">&#41;</span>:</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; keys <span
style="color: #66cc66;">=</span> d.<span
style="color: black;">keys</span><span
style="color: black;">&#40;</span><span
style="color: black;">&#41;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; keys.<span
style="color: black;">sort</span><span
style="color: black;">&#40;</span>func<span
style="color: black;">&#41;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #ff7700;font-weight:bold;">return</span> keys</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #808080; font-style: italic;"># example use, assume 'd' is a dictionary</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #ff7700;font-weight:bold;">for</span> k <span
style="color: #ff7700;font-weight:bold;">in</span> ksort<span
style="color: black;">&#40;</span>d<span
style="color: black;">&#41;</span>:</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span
style="color: #ff7700;font-weight:bold;">print</span> k<span
style="color: #66cc66;">,</span> d<span
style="color: black;">&#91;</span>k<span
style="color: black;">&#93;</span></div></li></ol></div></div><p>(example taken from <a
href="http://bytes.com/topic/python/answers/21704-sort-dictionary">TheScript forum</a>)</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fhow-to-sort-python-dict-dictionary.html&amp;linkname=How%20to%20sort%20Python%20dict%20%28dictionary%29" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fhow-to-sort-python-dict-dictionary.html&amp;linkname=How%20to%20sort%20Python%20dict%20%28dictionary%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fhow-to-sort-python-dict-dictionary.html&amp;linkname=How%20to%20sort%20Python%20dict%20%28dictionary%29" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fhow-to-sort-python-dict-dictionary.html&amp;linkname=How%20to%20sort%20Python%20dict%20%28dictionary%29" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fhow-to-sort-python-dict-dictionary.html&amp;linkname=How%20to%20sort%20Python%20dict%20%28dictionary%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2007%2F09%2F26%2Fhow-to-sort-python-dict-dictionary.html&#038;title=How%20to%20sort%20Python%20dict%20%28dictionary%29" data-a2a-url="https://bogdan.org.ua/2007/09/26/how-to-sort-python-dict-dictionary.html" data-a2a-title="How to sort Python dict (dictionary)"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2007/09/26/how-to-sort-python-dict-dictionary.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>