PageRenderTime 66ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/mfabrik-blog.html

https://github.com/aaitxcoder/mobilize.js
HTML | 1094 lines | 969 code | 118 blank | 7 comment | 0 complexity | 7d56177c5fbd7d2d3774e84e7458238e MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <!DOCTYPE html>
  2. <!-- Test mobilize.js against another blog with lots of content -->
  3. <html dir="ltr" lang="en-US">
  4. <head>
  5. <meta charset="UTF-8" />
  6. <title>mFabrik - mobile sites, apps, HTML5 and CMS software development</title>
  7. <link rel="profile" href="http://gmpg.org/xfn/11" />
  8. <link rel="stylesheet" type="text/css" media="all" href="http://blog.mfabrik.com/wp-content/themes/twentyten/style.css" />
  9. <link rel="pingback" href="http://blog.mfabrik.com/xmlrpc.php" />
  10. <link rel="alternate" type="application/rss+xml" title="mFabrik - mobile sites, apps, HTML5 and CMS software development &raquo; Feed" href="http://blog.mfabrik.com/feed/" />
  11. <link rel="alternate" type="application/rss+xml" title="mFabrik - mobile sites, apps, HTML5 and CMS software development &raquo; Comments Feed" href="http://blog.mfabrik.com/comments/feed/" />
  12. <link rel='stylesheet' id='shashin_css-css' href='http://blog.mfabrik.com/wp-content/plugins/shashin/display/shashin.css?ver=2.6.3' type='text/css' media='all' />
  13. <link rel='stylesheet' id='highslide_css-css' href='http://blog.mfabrik.com/wp-content/plugins/shashin/display/highslide.css?ver=4.1.4' type='text/css' media='all' />
  14. <script type='text/javascript' src='http://blog.mfabrik.com/wp-includes/js/l10n.js?ver=20101110'></script>
  15. <script type='text/javascript'>
  16. /* <![CDATA[ */
  17. var highslide_settings = {
  18. graphics_dir: "http://blog.mfabrik.com/wp-content/plugins/shashin/display/highslide/graphics/",
  19. outline_type: "rounded-white",
  20. dimming_opacity: "0.75",
  21. interval: "5000",
  22. repeat: "1",
  23. position: "top center",
  24. hide_controller: "0"
  25. };
  26. /* ]]> */
  27. </script>
  28. <script type='text/javascript' src='http://blog.mfabrik.com/wp-content/plugins/shashin/display/highslide_settings.js?ver=2.6.3'></script>
  29. <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://blog.mfabrik.com/xmlrpc.php?rsd" />
  30. <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://blog.mfabrik.com/wp-includes/wlwmanifest.xml" />
  31. <link rel='index' title='mFabrik &#8211; mobile sites, apps, HTML5 and CMS software development' href='http://blog.mfabrik.com/' />
  32. <meta name="generator" content="WordPress 3.1" />
  33. <!-- All in One SEO Pack 1.6.13.1 by Michael Torbert of Semper Fi Web Design[78,176] -->
  34. <meta name="keywords" content="all files,cyberduck,doc,download,drag and drop,export,import,mass upload,osx,pdf,photos,plone,webdav,answer,discussion,forum,irc,mailing list,python,question,smart questions,apache,error_log,php,php.ini,tail,xampp,chrome,commit hook,compress,console,firefox,git,github,ie,internet explorer,javascript,jquery,preprocessor,safari,webkit,app engine,data,mirror,remote api,sqlite,upload,always on,appengine,cloud,cloud computing,cron,deadlineexceedederror,dynamic,gaeutilities,google,http requiest,instance,monitoring,new process,response time,zabbix,ironpython,jython,microsoft,net,pypy,python tools for visual studio,adapter,interface,page template,portlet,render,zope,ajax,comments,disqus,lazy load,static,varnish,crawl,find,follow,full text,full text search,pypdf,scrape,scrapy,search,trademark,user policy,violation,web crawler" />
  35. <link rel="canonical" href="http://blog.mfabrik.com/" />
  36. <!-- /all in one seo pack -->
  37. <link type="text/css" rel="stylesheet" href="http://blog.mfabrik.com/wp-content/plugins/syntax/Styles/SyntaxHighlighter.css" />
  38. </head>
  39. <body class="home blog logged-in">
  40. <body>
  41. <script type="text/javascript">
  42. // Don't start executing mobilize whilst loaading JS file, but wait
  43. // for our manual (development commands)
  44. window.mobilizeAutoload = false;
  45. function mobilizeCustomInit() {
  46. // Include mFabrik specific Javascript initialization layer
  47. mobilize.cdnOptions.javascriptBundles.push("http://localhost:8080/js/mobilize.mfabrik-blog.js");
  48. }
  49. </script>
  50. <script class="mobilize-js-source"
  51. type="text/javascript"
  52. src="http://localhost:8080/js/mobilize.js"
  53. >
  54. </script>
  55. <script type="text/javascript"
  56. src="http://localhost:8080/js/mobilize.wordpress.js"
  57. >
  58. </script>
  59. <script type="text/javascript">
  60. // Setup mobilize.js to load our additional mobilize.mfabrik-blog.js layer
  61. function setupCustomBlog(){
  62. mobilize.init({
  63. }, {
  64. // Don't do cloud error reporting
  65. // (it would useful for production deployment only)
  66. errorReportingURL: false,
  67. baseURL: "http://localhost:8080", // Test server
  68. // Load JS files locally, unbundled
  69. javascriptBundles : ["js/jquery.js",
  70. "js/mobilize.onjq.js",
  71. "js/jquery.mobile.js",
  72. ],
  73. // Load CSS files locally, unbundled
  74. cssBundles: ["css/jquery.mobile.css",
  75. "css/wordpress.css"],
  76. });
  77. // Since we are not in auto-run mode,
  78. // we start doing the stuff after we have set-up
  79. // our options for development correctly
  80. mobilize.bootstrap();
  81. }
  82. setupCustomBlog();
  83. </script>
  84. <div id="wrapper" class="hfeed">
  85. <div id="header">
  86. <div id="masthead">
  87. <div id="branding" role="banner">
  88. <h1 id="site-title">
  89. <span>
  90. <a href="http://blog.mfabrik.com/" title="mFabrik &#8211; mobile sites, apps, HTML5 and CMS software development" rel="home">mFabrik &#8211; mobile sites, apps, HTML5 and CMS software development</a>
  91. </span>
  92. </h1>
  93. <div id="site-description">Freedom delivered.</div>
  94. <img src="http://blog.mfabrik.com/wp-content/themes/twentyten/images/headers/path.jpg" width="940" height="198" alt="" />
  95. </div><!-- #branding -->
  96. <div id="access" role="navigation">
  97. <div class="skip-link screen-reader-text"><a href="#content" title="Skip to content">Skip to content</a></div>
  98. <div class="menu"><ul><li class="current_page_item"><a href="http://blog.mfabrik.com/" title="Home">Home</a></li><li class="page_item page-item-2"><a href="http://blog.mfabrik.com/about/" title="About this blog">About this blog</a></li><li class="page_item page-item-336"><a href="http://blog.mfabrik.com/phonegap-on-maemo/" title="PhoneGap on Maemo">PhoneGap on Maemo</a></li></ul></div>
  99. </div><!-- #access -->
  100. </div><!-- #masthead -->
  101. </div><!-- #header -->
  102. <div id="main">
  103. <div id="container">
  104. <div id="content" role="main">
  105. <div id="nav-above" class="navigation">
  106. <div class="nav-previous"><a href="http://blog.mfabrik.com/page/2/" ><span class="meta-nav">&larr;</span> Older posts</a></div>
  107. <div class="nav-next"></div>
  108. </div><!-- #nav-above -->
  109. <div id="post-1133" class="post-1133 post type-post status-publish format-standard hentry category-plone category-technology tag-all-files tag-cyberduck tag-doc tag-download tag-drag-and-drop tag-export tag-import tag-mass-upload tag-osx tag-pdf tag-photos tag-plone tag-webdav">
  110. <h2 class="entry-title"><a href="http://blog.mfabrik.com/2011/03/18/making-an-offline-file-system-copy-of-a-plone-site-using-webdav/" title="Permalink to Making an offline file system copy of a Plone site using WebDAV" rel="bookmark">Making an offline file system copy of a Plone site using WebDAV</a></h2>
  111. <div class="entry-meta">
  112. <span class="meta-prep meta-prep-author">Posted on</span> <a href="http://blog.mfabrik.com/2011/03/18/making-an-offline-file-system-copy-of-a-plone-site-using-webdav/" title="12:06 pm" rel="bookmark"><span class="entry-date">March 18, 2011</span></a> <span class="meta-sep">by</span> <span class="author vcard"><a class="url fn n" href="http://blog.mfabrik.com/author/moo/" title="View all posts by Mikko Ohtamaa">Mikko Ohtamaa</a></span> </div><!-- .entry-meta -->
  113. <div class="entry-content">
  114. <p>You might want to create an offline copy of a Plone site because</p>
  115. <ul>
  116. <li>You are traveling and you want to have all files on the site (PDFs for reading)</li>
  117. <li>You are taking a site down and making the final back-up</li>
  118. <li>You just want to feel how cool Plone is</li>
  119. </ul>
  120. <p><a href="http://plone.org/documentation/kb/webdav">Plone supports WebDAV</a>.</p>
  121. <p>Creating a file system viewable offline copy of a Plone site is a task of</p>
  122. <ul>
  123. <li><a href="http://plone.org/documentation/kb/webdav">Enabling WebDAV</a></li>
  124. <li>Login to site via WebDAV. On OSX use <a href="http://cyberduck.ch/">Cyberduck</a>, Finder (the file browser of OSX itself) may have issues, though works. You might need Zope admin priviledges for certain operations.</li>
  125. <li>Drag and drop Plone site to your hard disk</li>
  126. </ul>
  127. <p>WebDAV copy process works smoothly</p>
  128. <ul>
  129. <li>Folder and page structure is intact</li>
  130. <li>Files are copied as is (think PDFs, Docs)</li>
  131. <li>Images are copied as is</li>
  132. <li>Pages (HTML) are converted to special files, which are still readable in plain-text editor</li>
  133. </ul>
  134. <p>Note that some special folders (acl_users, reference_catalog, etc.) might be exposed through WebDAV, but they are not really copyable. Just ignore these during the copy process.</p>
  135. <p>You can also use WebDAV to mass upload files and images for your image bank instead of manually uploading them through web interface.
  136. <p class="signature">
  137. <a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></img></a> <a href="http://mfabrik.com/@@zoho-contact-form"">Get developers</a> <a href="http://twitter.com/mfabrik"> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></img></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
  138. </div><!-- .entry-content -->
  139. <div class="entry-utility">
  140. <span class="cat-links">
  141. <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://blog.mfabrik.com/category/plone/" title="View all posts in plone" rel="category tag">plone</a>, <a href="http://blog.mfabrik.com/category/technology/" title="View all posts in technology" rel="category tag">technology</a> </span>
  142. <span class="meta-sep">|</span>
  143. <span class="tag-links">
  144. <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://blog.mfabrik.com/tag/all-files/" rel="tag">all files</a>, <a href="http://blog.mfabrik.com/tag/cyberduck/" rel="tag">cyberduck</a>, <a href="http://blog.mfabrik.com/tag/doc/" rel="tag">doc</a>, <a href="http://blog.mfabrik.com/tag/download/" rel="tag">download</a>, <a href="http://blog.mfabrik.com/tag/drag-and-drop/" rel="tag">drag and drop</a>, <a href="http://blog.mfabrik.com/tag/export/" rel="tag">export</a>, <a href="http://blog.mfabrik.com/tag/import/" rel="tag">import</a>, <a href="http://blog.mfabrik.com/tag/mass-upload/" rel="tag">mass upload</a>, <a href="http://blog.mfabrik.com/tag/osx/" rel="tag">osx</a>, <a href="http://blog.mfabrik.com/tag/pdf/" rel="tag">pdf</a>, <a href="http://blog.mfabrik.com/tag/photos/" rel="tag">photos</a>, <a href="http://blog.mfabrik.com/tag/plone/" rel="tag">plone</a>, <a href="http://blog.mfabrik.com/tag/webdav/" rel="tag">webdav</a> </span>
  145. <span class="meta-sep">|</span>
  146. <span class="comments-link"><a href="http://blog.mfabrik.com/2011/03/18/making-an-offline-file-system-copy-of-a-plone-site-using-webdav/#respond" title="Comment on Making an offline file system copy of a Plone site using WebDAV">Leave a comment</a></span>
  147. <span class="meta-sep">|</span> <span class="edit-link"><a class="post-edit-link" href="http://blog.mfabrik.com/wp-admin/post.php?post=1133&amp;action=edit" title="Edit Post">Edit</a></span> </div><!-- .entry-utility -->
  148. </div><!-- #post-## -->
  149. <div id="post-1128" class="post-1128 post type-post status-publish format-standard hentry category-plone category-python category-technology tag-answer tag-discussion tag-forum tag-irc tag-mailing-list tag-plone tag-python tag-question tag-smart-questions">
  150. <h2 class="entry-title"><a href="http://blog.mfabrik.com/2011/03/17/rfc-simple-internet-question-asking-protocol-for-human-beings/" title="Permalink to RFC: Simple Internet Question Asking Protocol (for human beings)" rel="bookmark">RFC: Simple Internet Question Asking Protocol (for human beings)</a></h2>
  151. <div class="entry-meta">
  152. <span class="meta-prep meta-prep-author">Posted on</span> <a href="http://blog.mfabrik.com/2011/03/17/rfc-simple-internet-question-asking-protocol-for-human-beings/" title="8:32 pm" rel="bookmark"><span class="entry-date">March 17, 2011</span></a> <span class="meta-sep">by</span> <span class="author vcard"><a class="url fn n" href="http://blog.mfabrik.com/author/moo/" title="View all posts by Mikko Ohtamaa">Mikko Ohtamaa</a></span> </div><!-- .entry-meta -->
  153. <div class="entry-content">
  154. <p>This is my  attempt version 0.1 to teach the world how one should ask questions in the simplest possible way in Internet discussion. To make it simple, I try to keep this short. This post sprouts from my frustration from the lack of people&#8217;s ability to form questions one could easily answer.</p>
  155. <h2>Assumptions</h2>
  156. <p>If you want to ask a question in forum, IRC (chat) or mailing list</p>
  157. <ol>
  158. <li>Assume people are busy</li>
  159. <li>Assume that people want to help you, even though they are busy, since they volunteer to participate the community discussion and thus they must care about the community</li>
  160. </ol>
  161. <p>To make it win-win situation, you as the question maker, are responsible of making the process of asking the question and answering the question as easy as possible. <strong>Form your question in such a way that it is as easy as possible for the readers to place themselves into your situation and think how they would themselves solve the situation </strong>(Mikko&#8217;s rule of empathy)<strong>.</strong></p>
  162. <p>The less time it takes to undestand your situation the more likely people are willing to contribute their time.</p>
  163. <h2>Question process</h2>
  164. <p>Thus, I propose that you always follow the simple three steps when asking a question</p>
  165. <ol>
  166. <li>Before asking the question tell what you <strong>already know</strong></li>
  167. <li>Describe<strong> the problem</strong></li>
  168. <li>Ask what you <strong>do not know</strong> yet</li>
  169. </ol>
  170. <p>Then <strong>wait</strong> patiently for the answer (the busy part).</p>
  171. <h2>Pitfalls</h2>
  172. <p>These issues often stem from the fact that the person asking the question is not familiar with text-based communication where people&#8217;s time (bandwidth) is limited and the lack of body gestures often leads to misinterpretations.</p>
  173. <ol>
  174. <li>Do not ask yes / no questions. You are skipping steps #1 and #3.</li>
  175. <li>Do not saturate the bandwidth: do not repeat yourself or otherwise flood the medium. If people are busy it it does not make them un-busy by repeating yourself. You are breaking the assumption #1.</li>
  176. <li>Do not try to pull excessive attention on you &#8211; do not try to highlight your question like &#8220;PLEASE HELP !!!!&#8221; Even if it is a matter of life and dead for you it is not for the other people who are dealing with their own matters of life and dead. You are breaking the assumption #2.</li>
  177. </ol>
  178. <h2>Example</h2>
  179. <p><span style="text-decoration: line-through;">Q: Is it possible to fly me to the Moon? A: Yes</span></p>
  180. <p>Q: I am an evil super-villain whose plan overtake the world failed.  Now I must escape. I am looking for methods to take me to the Moon or the orbit where national laws to do not apply. I am not sure should I use a shuttle or a rocket. Where could I obtain such a vehicle?</p>
  181. <p>A: US of A just retired one reliable space shuttle what you could use. But if I were you I&#8217;d consider underwater base instead, as they will become cheaper in long run, since you can more easily produce breathable oxygen.</p>
  182. <h2>More info</h2>
  183. <ul>
  184. <li><a href="http://doctormo.deviantart.com/#/d2unj89">How to ask smart questions</a></li>
  185. <li><a href="http://plone.org/documentation/kb/ask-for-help">Plone community guidelines asking for help</a></li>
  186. </ul>
  187. <p class="signature">
  188. <a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></img></a> <a href="http://mfabrik.com/@@zoho-contact-form"">Get developers</a> <a href="http://twitter.com/mfabrik"> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></img></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
  189. </div><!-- .entry-content -->
  190. <div class="entry-utility">
  191. <span class="cat-links">
  192. <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://blog.mfabrik.com/category/plone/" title="View all posts in plone" rel="category tag">plone</a>, <a href="http://blog.mfabrik.com/category/python/" title="View all posts in python" rel="category tag">python</a>, <a href="http://blog.mfabrik.com/category/technology/" title="View all posts in technology" rel="category tag">technology</a> </span>
  193. <span class="meta-sep">|</span>
  194. <span class="tag-links">
  195. <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://blog.mfabrik.com/tag/answer/" rel="tag">answer</a>, <a href="http://blog.mfabrik.com/tag/discussion/" rel="tag">discussion</a>, <a href="http://blog.mfabrik.com/tag/forum/" rel="tag">forum</a>, <a href="http://blog.mfabrik.com/tag/irc/" rel="tag">irc</a>, <a href="http://blog.mfabrik.com/tag/mailing-list/" rel="tag">mailing list</a>, <a href="http://blog.mfabrik.com/tag/plone/" rel="tag">plone</a>, <a href="http://blog.mfabrik.com/tag/python/" rel="tag">python</a>, <a href="http://blog.mfabrik.com/tag/question/" rel="tag">question</a>, <a href="http://blog.mfabrik.com/tag/smart-questions/" rel="tag">smart questions</a> </span>
  196. <span class="meta-sep">|</span>
  197. <span class="comments-link"><a href="http://blog.mfabrik.com/2011/03/17/rfc-simple-internet-question-asking-protocol-for-human-beings/#respond" title="Comment on RFC: Simple Internet Question Asking Protocol (for human beings)">Leave a comment</a></span>
  198. <span class="meta-sep">|</span> <span class="edit-link"><a class="post-edit-link" href="http://blog.mfabrik.com/wp-admin/post.php?post=1128&amp;action=edit" title="Edit Post">Edit</a></span> </div><!-- .entry-utility -->
  199. </div><!-- #post-## -->
  200. <div id="post-1124" class="post-1124 post type-post status-publish format-standard hentry category-php category-technology tag-apache tag-errorlog tag-osx tag-php tag-php-ini tag-tail tag-xampp">
  201. <h2 class="entry-title"><a href="http://blog.mfabrik.com/2011/03/16/enable-php-log-output-error_log-on-xampp-on-osx/" title="Permalink to Enable PHP log output (error_log) on XAMPP on OSX" rel="bookmark">Enable PHP log output (error_log) on XAMPP on OSX</a></h2>
  202. <div class="entry-meta">
  203. <span class="meta-prep meta-prep-author">Posted on</span> <a href="http://blog.mfabrik.com/2011/03/16/enable-php-log-output-error_log-on-xampp-on-osx/" title="12:29 am" rel="bookmark"><span class="entry-date">March 16, 2011</span></a> <span class="meta-sep">by</span> <span class="author vcard"><a class="url fn n" href="http://blog.mfabrik.com/author/moo/" title="View all posts by Mikko Ohtamaa">Mikko Ohtamaa</a></span> </div><!-- .entry-meta -->
  204. <div class="entry-content">
  205. <p>If you are using <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> to develop PHP software (WordPress, Joomla!) on OSX you might want to get some advanced logging output from your code. PHP provides nice <a href="http://php.net/manual/en/function.error-log.php">error_log</a>() function, but it is silent by default. Here are short instructions how to enable it and follow the log.</p>
  206. <p>Use your favorite editor to edit php.ini file in <em>/Applications/XAMPP/etc/php.ini</em> &#8211; sudo priviledges needed, <a href="http://www.peterborgapps.com/smultron/">Smultron</a> does it out of the box.</p>
  207. <p>Change lines:</p>
  208. <pre>log_errors = Off</pre>
  209. <pre>;error_log = filename</pre>
  210. <p>To:</p>
  211. <pre>log_errors = on</pre>
  212. <pre>error_log = /tmp/php.log</pre>
  213. <p>Restart Apache using <em>XAMPP controller</em> in <em>Finder -&gt; Applications</em>.</p>
  214. <p>Now use the following UNIX command to see continuous log flow in your terminal:</p>
  215. <pre>tail -f /tmp/php.log
  216. </pre>
  217. <p>See also the earlier article about <a href="http://blog.mfabrik.com/2010/12/22/local-xampp-development-and-unix-file-permissions/">XAMPP and file permissions</a>.
  218. <p class="signature">
  219. <a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></img></a> <a href="http://mfabrik.com/@@zoho-contact-form"">Get developers</a> <a href="http://twitter.com/mfabrik"> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></img></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
  220. </div><!-- .entry-content -->
  221. <div class="entry-utility">
  222. <span class="cat-links">
  223. <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://blog.mfabrik.com/category/php/" title="View all posts in php" rel="category tag">php</a>, <a href="http://blog.mfabrik.com/category/technology/" title="View all posts in technology" rel="category tag">technology</a> </span>
  224. <span class="meta-sep">|</span>
  225. <span class="tag-links">
  226. <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://blog.mfabrik.com/tag/apache/" rel="tag">apache</a>, <a href="http://blog.mfabrik.com/tag/error_log/" rel="tag">error_log</a>, <a href="http://blog.mfabrik.com/tag/osx/" rel="tag">osx</a>, <a href="http://blog.mfabrik.com/tag/php/" rel="tag">php</a>, <a href="http://blog.mfabrik.com/tag/php-ini/" rel="tag">php.ini</a>, <a href="http://blog.mfabrik.com/tag/tail/" rel="tag">tail</a>, <a href="http://blog.mfabrik.com/tag/xampp/" rel="tag">xampp</a> </span>
  227. <span class="meta-sep">|</span>
  228. <span class="comments-link"><a href="http://blog.mfabrik.com/2011/03/16/enable-php-log-output-error_log-on-xampp-on-osx/#respond" title="Comment on Enable PHP log output (error_log) on XAMPP on OSX">Leave a comment</a></span>
  229. <span class="meta-sep">|</span> <span class="edit-link"><a class="post-edit-link" href="http://blog.mfabrik.com/wp-admin/post.php?post=1124&amp;action=edit" title="Edit Post">Edit</a></span> </div><!-- .entry-utility -->
  230. </div><!-- #post-## -->
  231. <div id="post-1119" class="post-1119 post type-post status-publish format-standard hentry category-javascript category-technology tag-chrome tag-commit-hook tag-compress tag-console tag-firefox tag-git tag-github tag-ie tag-internet-explorer tag-javascript tag-jquery tag-plone tag-preprocessor tag-python tag-safari tag-webkit">
  232. <h2 class="entry-title"><a href="http://blog.mfabrik.com/2011/03/15/everyone-loves-and-hates-console-log/" title="Permalink to Everyone loves and hates console.log()" rel="bookmark">Everyone loves and hates console.log()</a></h2>
  233. <div class="entry-meta">
  234. <span class="meta-prep meta-prep-author">Posted on</span> <a href="http://blog.mfabrik.com/2011/03/15/everyone-loves-and-hates-console-log/" title="4:35 pm" rel="bookmark"><span class="entry-date">March 15, 2011</span></a> <span class="meta-sep">by</span> <span class="author vcard"><a class="url fn n" href="http://blog.mfabrik.com/author/moo/" title="View all posts by Mikko Ohtamaa">Mikko Ohtamaa</a></span> </div><!-- .entry-meta -->
  235. <div class="entry-content">
  236. <p>console.log()  is the best friend of every Javascript junkie. However, the lack of it isn&#8217;t. console.log() function is only available in Webkit based browsers and with Firebug in Firefox. It&#8217;s the infamous situation that someone leaves console.log() to Javascript code, doesn&#8217;t notice its presence, commits the file and suddenly all Javascript on the production server stops working for Internet Explorer users&#8230;.</p>
  237. <p>To tackle the lack of console.log() problem there are several approaches.</p>
  238. <h2>Use dummy placeholder if console is missing</h2>
  239. <p>This snippet wraps console.log (need to repeat for console.error etc.):</p>
  240. <pre>// Ignore console on platforms where it is not available
  241. if (typeof(window["console"]) == "undefined") { console = {}; console.log = function(a) {}; }</pre>
  242. <p>Pros</p>
  243. <ul>
  244. <li>Easy</li>
  245. </ul>
  246. <p>Cons</p>
  247. <ul>
  248. <li>Need to add to every Javascript file</li>
  249. <li>Messes with global namespace</li>
  250. </ul>
  251. <h2>Use module specific log function</h2>
  252. <p>This makes your code little bit ugly, more Java like. Each Javascript module declares their own log() function which checks the existence of console.log() and outputs there if it&#8217;s present.</p>
  253. <pre>mfabrik.log =function(x) {
  254. if(console.log) {
  255. console.log(x);
  256. }
  257. }
  258. mfabrik.log("My log messages")</pre>
  259. <p>Pros</p>
  260. <ul>
  261. <li>Easy to hook other logg</li>
  262. <li>You can disable all logging output with one if</li>
  263. </ul>
  264. <p>Cons</p>
  265. <ul>
  266. <li>Not as natural to write as console.log()</li>
  267. <li>Need to add to every Javascript module</li>
  268. </ul>
  269. <h2>Preprocess Javascript files</h2>
  270. <p>Plone (Kukit / KSS) uses this approach. All debug Javascript is hidden behind conditional comments and it is filtered out when JS files are bundled for the production deployment. (<a href="http://codespeak.net/svn/kukit/kss.core/trunk/kss/core/pluginregistry/_concatresource/compression/javascript.py">The preprocessing code is here in Python for those who are interested in it</a>).</p>
  271. <pre>if (_USE_BASE2) {
  272. // Base2 legacy version: matchAll has to be used
  273. // Base2 recent version: querySelectorAll has to be used
  274. var _USE_BASE2_LEGACY = (typeof(base2.DOM.Document.querySelectorAll) == 'undefined');
  275. if (! _USE_BASE2_LEGACY) {
  276. ;;;     kukit.log('Using cssQuery from base2.');</pre>
  277. <p>Pros</p>
  278. <ul>
  279. <li>Makes production Javascript files lighter</li>
  280. <li>Make production Javascript files more professional &#8211; you do not deliver logging statements indented for internal purposes for your site visitors</li>
  281. </ul>
  282. <p>Cons</p>
  283. <ul>
  284. <li>Complex &#8211; preprocessing is required</li>
  285. </ul>
  286. <h2>Commit hooks</h2>
  287. <p>You can use Subversion and Git commit hooks to check that committed JS files do not contain console.log. For example, Plone repositories do this for the Python statement  import pdb ; pdb.set_trace() (enforce pdb breakpoint).</p>
  288. <p>Pros</p>
  289. <ul>
  290. <li>Very robust approach &#8211; you cannot create code with console.log()</li>
  291. </ul>
  292. <p>Cons</p>
  293. <ul>
  294. <li>Prevents also legitimate use of console.log()</li>
  295. <li>Github, for example, lacks possibility to push client-side commit hooks to the repository cloners. This means that every developer must manually install commit hooks themselves. Everything manual you need to do makes the process error prone.</li>
  296. </ul>
  297. <h2>Other approaches?</h2>
  298. <p>Please tell us!
  299. <p class="signature">
  300. <a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></img></a> <a href="http://mfabrik.com/@@zoho-contact-form"">Get developers</a> <a href="http://twitter.com/mfabrik"> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></img></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
  301. </div><!-- .entry-content -->
  302. <div class="entry-utility">
  303. <span class="cat-links">
  304. <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://blog.mfabrik.com/category/javascript/" title="View all posts in javascript" rel="category tag">javascript</a>, <a href="http://blog.mfabrik.com/category/technology/" title="View all posts in technology" rel="category tag">technology</a> </span>
  305. <span class="meta-sep">|</span>
  306. <span class="tag-links">
  307. <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://blog.mfabrik.com/tag/chrome/" rel="tag">chrome</a>, <a href="http://blog.mfabrik.com/tag/commit-hook/" rel="tag">commit hook</a>, <a href="http://blog.mfabrik.com/tag/compress/" rel="tag">compress</a>, <a href="http://blog.mfabrik.com/tag/console/" rel="tag">console</a>, <a href="http://blog.mfabrik.com/tag/firefox/" rel="tag">firefox</a>, <a href="http://blog.mfabrik.com/tag/git/" rel="tag">git</a>, <a href="http://blog.mfabrik.com/tag/github/" rel="tag">github</a>, <a href="http://blog.mfabrik.com/tag/ie/" rel="tag">ie</a>, <a href="http://blog.mfabrik.com/tag/internet-explorer/" rel="tag">internet explorer</a>, <a href="http://blog.mfabrik.com/tag/javascript/" rel="tag">javascript</a>, <a href="http://blog.mfabrik.com/tag/jquery/" rel="tag">jquery</a>, <a href="http://blog.mfabrik.com/tag/plone/" rel="tag">plone</a>, <a href="http://blog.mfabrik.com/tag/preprocessor/" rel="tag">preprocessor</a>, <a href="http://blog.mfabrik.com/tag/python/" rel="tag">python</a>, <a href="http://blog.mfabrik.com/tag/safari/" rel="tag">safari</a>, <a href="http://blog.mfabrik.com/tag/webkit/" rel="tag">webkit</a> </span>
  308. <span class="meta-sep">|</span>
  309. <span class="comments-link"><a href="http://blog.mfabrik.com/2011/03/15/everyone-loves-and-hates-console-log/#comments" title="Comment on Everyone loves and hates console.log()">1 Comment</a></span>
  310. <span class="meta-sep">|</span> <span class="edit-link"><a class="post-edit-link" href="http://blog.mfabrik.com/wp-admin/post.php?post=1119&amp;action=edit" title="Edit Post">Edit</a></span> </div><!-- .entry-utility -->
  311. </div><!-- #post-## -->
  312. <div id="post-1105" class="post-1105 post type-post status-publish format-standard hentry category-appengine category-python category-technology tag-app-engine tag-data tag-download tag-mirror tag-python tag-remote-api tag-sqlite tag-upload">
  313. <h2 class="entry-title"><a href="http://blog.mfabrik.com/2011/03/14/mirroring-app-engine-production-data-to-development-server-using-appcfg-py/" title="Permalink to Mirroring App Engine production data to development server using appcfg.py" rel="bookmark">Mirroring App Engine production data to development server using appcfg.py</a></h2>
  314. <div class="entry-meta">
  315. <span class="meta-prep meta-prep-author">Posted on</span> <a href="http://blog.mfabrik.com/2011/03/14/mirroring-app-engine-production-data-to-development-server-using-appcfg-py/" title="12:14 am" rel="bookmark"><span class="entry-date">March 14, 2011</span></a> <span class="meta-sep">by</span> <span class="author vcard"><a class="url fn n" href="http://blog.mfabrik.com/author/moo/" title="View all posts by Mikko Ohtamaa">Mikko Ohtamaa</a></span> </div><!-- .entry-meta -->
  316. <div class="entry-content">
  317. <p>Google App Engine provides some <a href="http://code.google.com/appengine/docs/python/tools/uploadingdata.html#Setting_Up_remote_api">remote API functionality out of the box</a>. One of the remote API features  is to download data from the development server. After downloading, then you can upload the downloaded data to your development server, effectively mirroring the content of the production server to your local development server. This is very useful if you are working CMS, sites, etc. where you want to test new layout or views locally against the old data before putting them to the production.</p>
  318. <p>First enable remote API in <em>app.yaml</em>:</p>
  319. <pre>- url: /remote_api
  320.   script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
  321.   login: admin</pre>
  322. <blockquote><p>Note: Using <em>builtins</em> app.yaml directive didn&#8217;t work for me some reason, so I had to specify remote API URI manually.</p></blockquote>
  323. <p>After this you should be able <a href="http://code.google.com/appengine/docs/python/tools/uploadingdata.html#Downloading_and_Uploading_All_Data">to download data</a>. Here I am using <em>appcfg.py</em> global installation on OSX. Below is the command and sample output.</p>
  324. <pre>appcfg.py -e yourgoogleaccount@gmail.com download_data --url=http://yourappid.appspot.com/remote_api --filename=data.sqlite3
  325. ...
  326. Downloading data records.
  327. [INFO    ] Logging to bulkloader-log-20110313.222523
  328. [INFO    ] Throttling transfers:
  329. [INFO    ] Bandwidth: 250000 bytes/second
  330. [INFO    ] HTTP connections: 8/second
  331. [INFO    ] Entities inserted/fetched/modified: 20/second
  332. [INFO    ] Batch Size: 10
  333. ...
  334. [INFO    ] Have 1803 entities, 0 previously transferred
  335. [INFO    ] 1803 entities (972883 bytes) transferred in 91.0 seconds</pre>
  336. <p>data.sqlite3 is your production database dump in SQLite 3 binary format (used internally by the development server).</p>
  337. <p>If you have sqlite command line tool installed you can explore around the data dump there:</p>
  338. <pre>sqlite3 data.sqlite
  339. SQLite version 3.7.5
  340. Enter ".help" for instructions
  341. Enter SQL statements terminated with a ";"
  342. sqlite&gt; .tables
  343. Apps                                   your-app!Model1!Entities
  344. IdSeq                                  your-app!Model1!EntitiesByProperty
  345. Namespaces                             your-app!Model2!Entities
  346. bulkloader_database_signature          your-app!Model2!EntitiesByProperty
  347. your-app!!Entities                     result
  348. your-app!!EntitiesByProperty</pre>
  349. <p>Now you can upload data.</p>
  350. <blockquote><p><em>Note: </em>Even though there exists option &#8211;use_sqlite for dev_appserver.py looks like it cannot directly use the database file produced by download_data. You cannot just swap database files, you need upload the downloaded data to the development server.</p></blockquote>
  351. <p>Start your development server:</p>
  352. <pre>dev_appserver.py .</pre>
  353. <p>In another terminal, go to downloaded data.sqlite folder and give the command:</p>
  354. <pre>appcfg.py upload_data --url http://localhost:8080/remote_api --file=data.sqlite --application=yourappid</pre>
  355. <p>It will ask you for credentials, but it seems that any username and password is accepted for the local development server.</p>
  356. <p>Now you can login to your local development server to explore the data:</p>
  357. <pre>http://localhost:8080/_ah/admin</pre>
  358. <p>Ensure your data got copied over using Data Viewer:</p>
  359. <pre>http://localhost:8080/_ah/admin</pre>
  360. <p class="signature">
  361. <a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></img></a> <a href="http://mfabrik.com/@@zoho-contact-form"">Get developers</a> <a href="http://twitter.com/mfabrik"> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></img></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
  362. </div><!-- .entry-content -->
  363. <div class="entry-utility">
  364. <span class="cat-links">
  365. <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://blog.mfabrik.com/category/appengine/" title="View all posts in appengine" rel="category tag">appengine</a>, <a href="http://blog.mfabrik.com/category/python/" title="View all posts in python" rel="category tag">python</a>, <a href="http://blog.mfabrik.com/category/technology/" title="View all posts in technology" rel="category tag">technology</a> </span>
  366. <span class="meta-sep">|</span>
  367. <span class="tag-links">
  368. <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://blog.mfabrik.com/tag/app-engine/" rel="tag">app engine</a>, <a href="http://blog.mfabrik.com/tag/data/" rel="tag">data</a>, <a href="http://blog.mfabrik.com/tag/download/" rel="tag">download</a>, <a href="http://blog.mfabrik.com/tag/mirror/" rel="tag">mirror</a>, <a href="http://blog.mfabrik.com/tag/python/" rel="tag">python</a>, <a href="http://blog.mfabrik.com/tag/remote-api/" rel="tag">remote api</a>, <a href="http://blog.mfabrik.com/tag/sqlite/" rel="tag">sqlite</a>, <a href="http://blog.mfabrik.com/tag/upload/" rel="tag">upload</a> </span>
  369. <span class="meta-sep">|</span>
  370. <span class="comments-link"><a href="http://blog.mfabrik.com/2011/03/14/mirroring-app-engine-production-data-to-development-server-using-appcfg-py/#respond" title="Comment on Mirroring App Engine production data to development server using appcfg.py">Leave a comment</a></span>
  371. <span class="meta-sep">|</span> <span class="edit-link"><a class="post-edit-link" href="http://blog.mfabrik.com/wp-admin/post.php?post=1105&amp;action=edit" title="Edit Post">Edit</a></span> </div><!-- .entry-utility -->
  372. </div><!-- #post-## -->
  373. <div id="post-1092" class="post-1092 post type-post status-publish format-standard hentry category-appengine category-python category-technology tag-always-on tag-appengine tag-cloud tag-cloud-computing tag-cron tag-deadlineexceedederror tag-dynamic tag-gaeutilities tag-google tag-http-requiest tag-instance tag-monitoring tag-new-process tag-php tag-python tag-response-time tag-zabbix">
  374. <h2 class="entry-title"><a href="http://blog.mfabrik.com/2011/03/11/google-app-engine-issues-with-dynamic-instances-and-deadlineexceedederrors/" title="Permalink to Google App Engine: issues with dynamic instances and DeadlineExceededErrors" rel="bookmark">Google App Engine: issues with dynamic instances and DeadlineExceededErrors</a></h2>
  375. <div class="entry-meta">
  376. <span class="meta-prep meta-prep-author">Posted on</span> <a href="http://blog.mfabrik.com/2011/03/11/google-app-engine-issues-with-dynamic-instances-and-deadlineexceedederrors/" title="1:24 pm" rel="bookmark"><span class="entry-date">March 11, 2011</span></a> <span class="meta-sep">by</span> <span class="author vcard"><a class="url fn n" href="http://blog.mfabrik.com/author/moo/" title="View all posts by Mikko Ohtamaa">Mikko Ohtamaa</a></span> </div><!-- .entry-meta -->
  377. <div class="entry-content">
  378. <h2>Dynamic instances and processing time</h2>
  379. <p>This Google App Engine feature came me as a surprise, though it makes perfect sense. Your site is slow if it has low traffic.</p>
  380. <p>Google App Engine runs Python code on instances. By default, instances are dynamic. Instances are shutdown if they do not have enough traffic (requests per minute). Thus, when you get the individual hits to App Engine now and then, App Engine must restart your instance every time for each hit.</p>
  381. <p>When this happens, you see the following in App Engine console logs for every request on low volume traffic:</p>
  382. <pre>This request caused a new process to be started for your application,
  383. and thus caused your application code to be loaded for the first time.</pre>
  384. <p>It is not always ok to add 500 &#8211; 2000 milliseconds processing delay on the top of the normal processing time. Google&#8217;s own recommendation was that each page should be served within 200 milliseconds.</p>
  385. <p>There are three ways to optimize this issue</p>
  386. <ul>
  387. <li>Use App Engine premium feature &#8220;Always on&#8221; 0,30 $ / day which keeps your instance always running</li>
  388. <li>Use cron job or such to keep your instance alive (polling once in a minute seems to do the job)</li>
  389. <li>Optimize your imports and split your code to several modules with light amount of imports, so that start up is fast (modules are imported only once)</li>
  390. </ul>
  391. <p>We are using <a href="http://www.zabbix.com/">Zabbix</a> software to monitor our sites (sidenote: I don&#8217;t recommend Zabbix as the first monitoring software choice as it is very difficult to use and has bad user experience, alienating both sysadmins and developers away from it). This is what we had before optimizations &#8211; App Engine was starting a new process for every request:</p>
  392. <p><a href="http://blog.mfabrik.com/wp-content/uploads/2011/03/zabbix31.png"><img class="alignnone size-full wp-image-1095" title="zabbix3" src="http://blog.mfabrik.com/wp-content/uploads/2011/03/zabbix31.png" alt="" width="791" height="490" /></a></p>
  393. <p>&#8230; and this is output we got after optimizations:</p>
  394. <p><a href="http://blog.mfabrik.com/wp-content/uploads/2011/03/zabbix4.png"><img class="alignnone size-full wp-image-1096" title="zabbix4" src="http://blog.mfabrik.com/wp-content/uploads/2011/03/zabbix4.png" alt="" width="786" height="392" /></a></p>
  395. <p>Here is the corresponding diagram after optimizations from App Engine dashboard itself. These processing times are without network latency. As far as I know Google does not expose the endpoints of App Engine hosting, so you don&#8217;t know from which site of the world your responses come from. By comparing this diagram to the diagram above, you can see how Internet traffic is affecting to your App Engine application.</p>
  396. <p><a href="http://blog.mfabrik.com/wp-content/uploads/2011/03/appengine.png"><img class="alignnone size-full wp-image-1097" title="appengine" src="http://blog.mfabrik.com/wp-content/uploads/2011/03/appengine.png" alt="" width="824" height="280" /></a></p>
  397. <h2>The PITA of dying instances</h2>
  398. <p>For some reason, App Engine instances misbehave sometimes. This causes the HTTP requests die ungracefully.</p>
  399. <p>Normally it is not a problem as you lost few page loads now and then. People are used to &#8220;Internet grade&#8221; service and can hit the refresh button if they have problems opening a page.</p>
  400. <p>However if you are monitoring your site and the site gives an unnecessary alarm in the middle of the night, waking up your bastard operator from Hell, he will be very angry next morning and tell you to migrate the crappy software from unreliable Python / App Engine to more reliable PHP servers <img src='http://blog.mfabrik.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
  401. <p>This is what you see in App Engine logs:</p>
  402. <pre>A serious problem was encountered with the process that handled this request, causing it to exit.
  403. This is likely to cause a new process to be used for the next request to your application.
  404. If you see this message frequently, you may be throwing exceptions during the initialization of your application. (Error code 104)</pre>
  405. <p>After digging in deeper, you see that it is a problem of instating a new object in the database, exceeding 30 seconds hard limit for processing a HTTP request:</p>
  406. <pre>2011-03-09 05:06:20.794 / 500 30094ms 86cpu_ms 40api_cpu_ms
  407. 0kb Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
  408. .NET CLR 2.0.50727),gzip(gfe),gzip(gfe),gzip(gfe)
  409. &lt;class 'google.appengine.runtime.DeadlineExceededError'&gt;:
  410. Traceback (most recent call last):
  411. File "/base/data/home/apps/mfabrikkampagne/1.347249742610459821/main.py", line 494, in main
  412. run_wsgi_app(application)
  413. File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/util.py", line 97, in run_wsgi_app
  414. run_bare_wsgi_app(add_wsgi_middleware(application))
  415. File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/util.py", line 115, in run_bare_wsgi_app
  416. result = application(env, _start_response)
  417. File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 515, in __call__
  418. handler.get(*groups)
  419. File "/base/data/home/apps/mfabrikkampagne/1.347249742610459821/main.py", line 296, in get
  420. try: self.session = Session()</pre>
  421. <p>So it looks like there is a temporary hick-up in Google App Engine&#8217;s Data Store (Big Table?). In the example above the error comes from <a href="http://gaeutilities.appspot.com/">gaeutilities</a>&#8216;s Session model, but it could be any other model.</p>
  422. <p><a href="http://code.google.com/intl/fi-FI/appengine/docs/python/runtime.html#The_Request_Timer">It is possible to catch DeadlineExceededError and temporarily work-around it, as shown in App Engine documentation</a>.</p>
  423. <p>The best way to handle this situation is to adjust your monitoring software &#8211; Zabbix in our case. Zabbix allows you to configure triggers so that they don&#8217;t alarm on every bad item state change. Instead, you can use <em>min()</em> function and trigger the alarm after the trigger condition has failed every time during a monitoring period. Just make sure that the trigger period is at least twice long as the update interval of your web scenario: this way Zabbix can logs at least two item state changes and allows one of them to be failed one.</p>
  424. <p>For example if</p>
  425. <ul>
  426. <li>Update interval of web scenario is 60 seconds</li>
  427. <li>Trigger function must check minimal failures of 1 during 2*60 seconds + some buffer = 150 seconds.</li>
  428. </ul>
  429. <pre>{xxx.fi:web.test.fail[de.mfabrik.com].min(150)}=1</pre>
  430. <p>This will allow one failed response before triggering the alarm.
  431. <p class="signature">
  432. <a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></img></a> <a href="http://mfabrik.com/@@zoho-contact-form"">Get developers</a> <a href="http://twitter.com/mfabrik"> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <img valign="middle" src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></img></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
  433. </div><!-- .entry-content -->
  434. <div class="entry-utility">
  435. <span class="cat-links">
  436. <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://blog.mfabrik.com/category/appengine/" title="View all posts in appengine" rel="category tag">appengine</a>, <a href="http://blog.mfabrik.com/category/python/" title="View all posts in python" rel="category tag">python</a>, <a href="http://blog.mfabrik.com/category/technology/" title="View all posts in technology" rel="category tag">technology</a> </span>
  437. <span class="meta-sep">|</span>
  438. <span class="tag-links">
  439. <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://blog.mfabrik.com/tag/always-on/" rel="tag">always on</a>, <a href="http://blog.mfabrik.com/tag/appengine/" rel="tag">appengine</a>, <a href="http://blog.mfabrik.com/tag/cloud/" rel="tag">cloud</a>, <a href="http://blog.mfabrik.com/tag/cloud-computing/" rel="tag">cloud computing</a>, <a href="http://blog.mfabrik.com/tag/cron/" rel="tag">cron</a>, <a href="http://blog.mfabrik.com/tag/deadlineexceedederror/" rel="tag">DeadlineExceededError</a>, <a href="http://blog.mfabrik.com/tag/dynamic/" rel="tag">dynamic</a>, <a href="http://blog.mfabrik.com/tag/gaeutilities/" rel="tag">gaeutilities</a>, <a href="http://blog.mfabrik.com/tag/google/" rel="tag">google</a>, <a href="http://blog.mfabrik.com/tag/http-requiest/" rel="tag">http requiest</a>, <a href="http://blog.mfabrik.com/tag/instance/" rel="tag">instance</a>, <a href="http://blog.mfabrik.com/tag/monitoring/" rel="tag">monitoring</a>, <a href="http://blog.mfabrik.com/tag/new-process/" rel="tag">new process</a>, <a href="http://blog.mfabrik.com/tag/php/" rel="tag">php</a>, <a href="http://blog.mfabrik.com/tag/python/" rel="tag">python</a>, <a href="http://blog.mfabrik.com/tag/response-time/" rel="tag">response

Large files files are truncated, but you can click here to view the full file