<?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; problem</title> <atom:link href="https://bogdan.org.ua/tags/problem/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>Evernote web-interface beta: how to fix: saved searches are crossed out and do not work</title><link>https://bogdan.org.ua/2016/05/09/evernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html</link> <comments>https://bogdan.org.ua/2016/05/09/evernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html#comments</comments> <pubDate>Mon, 09 May 2016 10:30:10 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[evernote]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[problem]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2403</guid> <description><![CDATA[Another symptom is a message along the lines of the notebook you are searching in has been moved or renamed since the saved search was created (which is not true). I had this problem, and found a solution. Go to your Evernote on a client where you can edit saved searches (Windows for me), edit [&#8230;]]]></description> <content:encoded><![CDATA[<p>Another symptom is a message along the lines of</p><blockquote><p>the notebook you are searching in has been moved or renamed since the saved search was created</p></blockquote><p>(which is not true).</p><p>I had this problem, and found a <strong>solution</strong>.</p><p>Go to your Evernote on a client where you can <strong>edit saved searches</strong> (Windows for me),<br
/> edit all the searches, and make sure that <strong>notebook name is quoted</strong> in the search (and also, possibly, with all <strong>proper letter cases</strong>).</p><p>I found this solution by first creating a search from the web-beta interface, it looked like this: <code>notebook:"Mynotebook" tag:1-now</code><br
/> All the crossed-out searches (despite working totally fine on Windows) looked like this: <code>notebook:Mynotebook tag:1-now</code><br
/> or even like this (note the lower-case 1stÂ letter of the notebook name): <code>notebook:mynotebook tag:1-now</code>.</p><p>After editing saved searches and synchronizing, they all appear (and work) just fine in the beta web-interface.</p><p>If you cannot edit your searches right now, there is <strong>another workaround</strong>: all the saved searches <strong>work fine</strong> for me <strong>from the ShortcutsÂ menu</strong> (a star in the left panel).</p><p>Hope this helps!</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" 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%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" 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%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" 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%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" 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%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" 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%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&#038;title=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" data-a2a-url="https://bogdan.org.ua/2016/05/09/evernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html" data-a2a-title="Evernote web-interface beta: how to fix: saved searches are crossed out and do not work"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2016/05/09/evernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>WordPress and Google Analytics external nofollow problem in comment links</title><link>https://bogdan.org.ua/2009/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html</link> <comments>https://bogdan.org.ua/2009/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html#comments</comments> <pubDate>Fri, 13 Feb 2009 19:41:55 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[CMS]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[comment]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[link]]></category> <category><![CDATA[problem]]></category> <category><![CDATA[wordpress]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=594</guid> <description><![CDATA[Since some WP release, the comment author&#8217;s link in comments is broken &#8211; it has &#8216; external nofollow&#8217; attached straight to the href attribute (which breaks the link). I assume that the problem is caused by Google Analytics, namely the &#8220;track outgoing clicks&#8221; feature (as recalled, might be inaccurate feature name). &#8220;Track outgoing links&#8221; adds [&#8230;]]]></description> <content:encoded><![CDATA[<p>Since some WP release, the comment author&#8217;s link in comments is broken &#8211; it has &#8216; external nofollow&#8217; attached straight to the href attribute (which breaks the link).</p><p>I assume that the problem is caused by Google Analytics, namely the &#8220;track outgoing clicks&#8221; feature (as recalled, might be inaccurate feature name). &#8220;Track outgoing links&#8221; adds some JavaScript code to all outgoing links, and that script has tick characters like this one &#8216; which, incidentally, are also used for delimiting the values of comment anchor tags.</p><p>To fix:<br
/> <span
id="more-594"></span></p><ol><li>locate file <strong>wp-includes/comment-template.php</strong></li><li>in that file, find the <strong>get_comment_author_link</strong> function (lines 140-150 in WP 2.7.1)</li><li>replace the line<div
id="ig-sh-1" class="syntax_hilite"><div
class="code"><ol
class="php" 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;">$return = &quot;&lt;a href='$url' rel='external nofollow' class='url'&gt;$author&lt;/a&gt;&quot;;</div></li></ol></div></div><p>with</p><div
id="ig-sh-2" class="syntax_hilite"><div
class="code"><ol
class="php" 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;">$return = '&lt;a href=&quot;'.$url.'&quot; rel=&quot;external nofollow&quot; class=&quot;url&quot;&gt;'.$author.'&lt;/a&gt;';</div></li></ol></div></div></li></ol><p>This helped me and might help you.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" 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%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" 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%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" 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%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" 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%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" 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%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&#038;title=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" data-a2a-url="https://bogdan.org.ua/2009/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html" data-a2a-title="WordPress and Google Analytics external nofollow problem in comment links"><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/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Fresh install of Debian Etch 4.0r1 hangs/freezes dead after boot: solution</title><link>https://bogdan.org.ua/2007/10/24/fresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html</link> <comments>https://bogdan.org.ua/2007/10/24/fresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html#comments</comments> <pubDate>Wed, 24 Oct 2007 12:38:02 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[Links]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[install]]></category> <category><![CDATA[laptop]]></category> <category><![CDATA[module]]></category> <category><![CDATA[problem]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/2007/10/24/fresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html</guid> <description><![CDATA[Recently, I installed Debian Etch 4.0r1 onto my laptop. However, after the first boot into plain console, computer was dead-frozen after some console usage. I rebooted using the Power button &#8211; this time to gdm; and again, after some keyboard input system was hanging dead. I found the reason at debianhelp.org forums. Basically, it&#8217;s the [&#8230;]]]></description> <content:encoded><![CDATA[<p>Recently, I installed Debian Etch 4.0r1 onto my laptop. However, after the first boot into plain console, computer was dead-frozen after some console usage. I rebooted using the Power button &#8211; this time to gdm; and again, after some keyboard input system was hanging dead.</p><p>I found the reason at debianhelp.org forums. Basically, it&#8217;s the PC speaker module (pcspr) not functioning correctly. I suspect this problem manifests itself only on some types of laptops. The solution is either to somehow reconfigure the pcspkr module, or just disable it. More on how to disable the module below.<br
/> <span
id="more-240"></span><br
/> First of all, boot into console-only mode or even single-user mode. On my install GRUB loader, configured by the Debian Installer, had an option in the boot menu to boot into single-user mode.</p><p>Remember, that any sound emission attempt will freeze your computer in this scenario. So avoid any actions, which might generate a system beep. These actions include (but are in no way limited to): using TAB filename/command autocompletion, using up/down arrows in command line when there is nothing in the history above or below the current command, etc.</p><p>After successfully booting, remove the pcspkr module: <strong>modprobe -r pcspkr</strong> (if that doesn&#8217;t work, try <strong>rmmod pcspkr</strong>). Note, that this command only removes pcspkr module for the current session, and the module will be loaded again on next boot.</p><p>To permanently disable the pcspkr module, you can blacklist it. To do so, add the line <strong>blacklist pcspkr</strong> to the <strong>/etc/modprobe.d/blacklist.local</strong> file. If this file does not exist, you can create it.</p><p>On my system I already had <strong>/etc/modprobe.d/blacklist</strong> file, so I also added <strong>blacklist pcspkr</strong> line to that file. I did not check which one actually worked for me, but on the next boot pcspkr didn&#8217;t load.</p><p>I also did one more thing &#8211; configured console not to beep. This is done in <strong>/etc/inputrc</strong> file by uncommenting the following line: <strong>set bell-style visible</strong> (or you can uncomment <strong>set bell-style none</strong> to have absolutely no bell notifications).</p><p>There&#8217;s also a <a
href="http://www.ducea.com/2006/06/01/disable-ipv6-module-on-default-kernels/">method to disable IPv6 module</a>, which can be adopted for the pcspkr module. However, I didn&#8217;t use it &#8211; methods listed above helped me.</p><p>References other than already cited: <a
href="http://www.thinkwiki.org/wiki/How_to_disable_the_pc_speaker_(beep!)">how to disable PC speaker</a>, <a
href="http://ramblingfoo.blogspot.com/2007/01/how-to-disable-pcspkr-in-etch.html">how to disable PC speaker in Etch</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%2F24%2Ffresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html&amp;linkname=Fresh%20install%20of%20Debian%20Etch%204.0r1%20hangs%2Ffreezes%20dead%20after%20boot%3A%20solution" 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%2F24%2Ffresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html&amp;linkname=Fresh%20install%20of%20Debian%20Etch%204.0r1%20hangs%2Ffreezes%20dead%20after%20boot%3A%20solution" 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%2F24%2Ffresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html&amp;linkname=Fresh%20install%20of%20Debian%20Etch%204.0r1%20hangs%2Ffreezes%20dead%20after%20boot%3A%20solution" 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%2F24%2Ffresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html&amp;linkname=Fresh%20install%20of%20Debian%20Etch%204.0r1%20hangs%2Ffreezes%20dead%20after%20boot%3A%20solution" 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%2F24%2Ffresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html&amp;linkname=Fresh%20install%20of%20Debian%20Etch%204.0r1%20hangs%2Ffreezes%20dead%20after%20boot%3A%20solution" 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%2F24%2Ffresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html&#038;title=Fresh%20install%20of%20Debian%20Etch%204.0r1%20hangs%2Ffreezes%20dead%20after%20boot%3A%20solution" data-a2a-url="https://bogdan.org.ua/2007/10/24/fresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html" data-a2a-title="Fresh install of Debian Etch 4.0r1 hangs/freezes dead after boot: solution"><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/24/fresh-install-of-debian-etch-40r1-hangsfreezes-dead-after-boot-solution.html/feed</wfw:commentRss> <slash:comments>1</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-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;">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-4" 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-5" 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>GoDaddy: undocumented 20-second CPU time maximal execution limit? (python, ELF, etc)</title><link>https://bogdan.org.ua/2007/10/16/godaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html</link> <comments>https://bogdan.org.ua/2007/10/16/godaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html#comments</comments> <pubDate>Tue, 16 Oct 2007 10:32:17 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[Misc]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[behaviour]]></category> <category><![CDATA[CPU]]></category> <category><![CDATA[godaddy]]></category> <category><![CDATA[hosting]]></category> <category><![CDATA[killed]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[problem]]></category> <category><![CDATA[script]]></category> <category><![CDATA[server]]></category> <category><![CDATA[shared]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/2007/10/16/godaddy-undocumented-20-second-cpu-time-limit-on-all-executables-python-elf-etc.html</guid> <description><![CDATA[Today, setting up a relatively serious (in CPU resources needed) web-system, I ran into a weird problem of python scripts ending prematurely. After some investigation, it looked like any process which uses up more than 20 seconds of CPU time, is automatically killed. To verify this, I wrote an infinite loop in C, int main [&#8230;]]]></description> <content:encoded><![CDATA[<p>Today, setting up a relatively serious (in CPU resources needed) web-system, I ran into a weird problem of python scripts ending prematurely. After some investigation, it looked like any process which uses up more than 20 seconds of CPU time, is automatically killed. To verify this, I wrote an infinite loop in C,</p><p>int main () {<br
/> unsigned int i;</p><p> for (i = 0; i < 2 ; i++ ) {
i = 0;
}
return 0;
}
[/c]
compiled it and executed several times on the GoDaddy shared hosting server. I did observe the program running for the maximum of 20 seconds of CPU time, not a second more. Please note, that 20 seconds of CPU time can be much more of &#8220;real&#8221; time, if the script isn&#8217;t using 100% of CPU, which often the case for shared hosting. Thus if you have in your php.ini max_execution_time set to, say, 60 seconds, your php script may actually execute as long as one minute; but I&#8217;m pretty sure that if your script has lots of CPU-intensive procedures, then as soon as it uses 20 seconds of CPU time, it will be terminated (however, this statement still needs checking &#8211; anyone?).
To verify, I also created a cron job with the same file. It ran for 30 seconds CPU time.
Strangely, this behaviour is not documented anywhere.
This limit may also explain a number of other problems, if you have heavy web-applications: they just might be killed before they are finished, causing errors.
I do understand the reason for this limitation, and am sure similar limitations exist in other shared hosting environments. The only important thing here is that this limit should have been documented and even put upfront somewhere in the hosting plans descriptions.
I also wonder if the limit is the same for all godaddy shared hosting plans, or if it differs. 20 seconds when executed from PHP, and 30 seconds when executed as a cron job were observed on the Deluxe Linux Hosting plan.
Extensions, additions and comments are welcome.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2007%2F10%2F16%2Fgodaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html&amp;linkname=GoDaddy%3A%20undocumented%2020-second%20CPU%20time%20maximal%20execution%20limit%3F%20%28python%2C%20ELF%2C%20etc%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%2F10%2F16%2Fgodaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html&amp;linkname=GoDaddy%3A%20undocumented%2020-second%20CPU%20time%20maximal%20execution%20limit%3F%20%28python%2C%20ELF%2C%20etc%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%2F10%2F16%2Fgodaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html&amp;linkname=GoDaddy%3A%20undocumented%2020-second%20CPU%20time%20maximal%20execution%20limit%3F%20%28python%2C%20ELF%2C%20etc%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%2F10%2F16%2Fgodaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html&amp;linkname=GoDaddy%3A%20undocumented%2020-second%20CPU%20time%20maximal%20execution%20limit%3F%20%28python%2C%20ELF%2C%20etc%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%2F10%2F16%2Fgodaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html&amp;linkname=GoDaddy%3A%20undocumented%2020-second%20CPU%20time%20maximal%20execution%20limit%3F%20%28python%2C%20ELF%2C%20etc%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%2F10%2F16%2Fgodaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html&#038;title=GoDaddy%3A%20undocumented%2020-second%20CPU%20time%20maximal%20execution%20limit%3F%20%28python%2C%20ELF%2C%20etc%29" data-a2a-url="https://bogdan.org.ua/2007/10/16/godaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html" data-a2a-title="GoDaddy: undocumented 20-second CPU time maximal execution limit? (python, ELF, etc)"><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/16/godaddy-undocumented-20-second-cpu-time-maximal-execution-limit-python-elf.html/feed</wfw:commentRss> <slash:comments>22</slash:comments> </item> </channel> </rss>