{"id":228,"date":"2021-03-12T22:44:20","date_gmt":"2021-03-12T14:44:20","guid":{"rendered":"http:\/\/madapapa.com\/wordpress\/?p=228"},"modified":"2021-03-26T21:49:15","modified_gmt":"2021-03-26T13:49:15","slug":"cha-zhaowordpress-shu-ju-ku-mi-ma","status":"publish","type":"post","link":"http:\/\/madapapa.com\/wordpress\/?p=228","title":{"rendered":"\u67e5\u627ewordpress\u6570\u636e\u5e93\u5bc6\u7801"},"content":{"rendered":"<h2 id=\"toc_0\">\u67e5\u627emariadb\u6570\u636e\u5e93\u5bc6\u7801<\/h2>\n<p>\u67e5\u627ewp-config.php\u8fd9\u4e2a\u6587\u4ef6\uff0c\u627e\u5230password\u5c31\u53ef\u4ee5<\/p>\n<pre><code class=\"language-text\"># find -name wp-config.php\n.\/var\/www\/html\/wordpress\/wp-config.php\n# vi .\/var\/www\/html\/wordpress\/wp-config.php\n<\/code><\/pre>\n<h2 id=\"toc_1\">while\u7528\u6cd5<\/h2>\n<p>When condition is true, which include the result(true or false) of operator like &#39;not equal(!=)&#39; or &#39;less than(&lt;)&#39;or &#39;greater than or equal to(&gt;=)&#39;, the statement after colon will be executed.<\/p>\n<p>When we use function input, the function will return string type, so if we want compare result with number, we can use str() to convert number to string and int() to convert string to int.<\/p>\n<pre><code class=\"language-text\">message = input(&#39;if you input 0,then everthing is over&#39;)\ni = 1\nwhile message != str(0) and i &lt;=10 :\n    print(str(i)+&#39; &#39;+message)\n    i +=1\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/madapapa.com\/wordpress\/wp-content\/uploads\/2021\/03\/16156209891763.png\" alt=\"\" style=\"width:472px;\"\/><\/p>\n<h2 id=\"toc_2\">cv2.destroyAllWindows\uff08\uff09\u51fa\u9519<\/h2>\n<p>Jupyter&#39;s error can not be solved immediately, however when I run the script in terminal, error message is here:<\/p>\n<pre><code class=\"language-text\">...\/Study\/learningOC[15:52]python3 cameraFrames.py\nShowing camera feed. Click window or press any key to stop.\nTraceback (most recent call last):\n  File &quot;...Study\/learningOC\/cameraFrames.py&quot;, line 19, in &lt;module&gt;\n    cv2.destroyAllWindows(&#39;MyWindow&#39;)\nSystemError: &lt;built-in function destroyAllWindows&gt; returned NULL without setting an error\n<\/code><\/pre>\n<p>Therefore I check the demo code:<\/p>\n<pre><code class=\"language-text\">import cv2\n\nclicked = False\ndef onMouse(event, x, y, flags, param):\n    global clicked\n    if event == cv2.EVENT_LBUTTONUP:\n        clicked = True\n\ncameraCapture = cv2.VideoCapture(0)\ncv2.namedWindow(&#39;MyWindow&#39;)\ncv2.setMouseCallback(&#39;MyWindow&#39;, onMouse)\n\nprint(&#39;Showing camera feed. Click window or press any key to stop.&#39;)\nsuccess, frame = cameraCapture.read()\nwhile success and cv2.waitKey(1) == -1 and not clicked:\n    cv2.imshow(&#39;MyWindow&#39;,frame)\n    success, frame = cameraCapture.read()\n\n#cv2.destroyAllWindows(&#39;MyWindow&#39;)\ncv2.destroyAllWindows()\ncameraCapture.release()\n<\/code><\/pre>\n<p>After deleting the arguments &#39;MyWidows&#39; in destroyAllWindows, the script is running well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u627emariadb\u6570\u636e\u5e93\u5bc6\u7801 \u67e5\u627ewp-config.php\u8fd9\u4e2a\u6587\u4ef6\uff0c\u627e\u5230password\u5c31\u53ef\u4ee5 # find -name wp-config.php .\/var\/www\/html\/wordpress\/wp-config.php # vi .\/var\/www\/html\/wordpress\/wp-config.php while\u7528\u6cd5 When condition is true, which include the result(true or false) of operator like &#39;not equal(!=)&#39; or &#39;less than(&lt;)&#39;or &#39;greater than or equal to(&gt;=)&#39;, the statement after colon will be executed. When we use function input, the function will return string type, so if we &hellip; <a href=\"http:\/\/madapapa.com\/wordpress\/?p=228\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u67e5\u627ewordpress\u6570\u636e\u5e93\u5bc6\u7801<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[11,1],"tags":[16,40,12],"class_list":["post-228","post","type-post","status-publish","format-standard","hentry","category-tech","category-uncategorized","tag-mysql","tag-whiile","tag-wordpress"],"_links":{"self":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=228"}],"version-history":[{"count":4,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":233,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/228\/revisions\/233"}],"wp:attachment":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}