<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ran on Medium]]></title>
        <description><![CDATA[Stories by Ran on Medium]]></description>
        <link>https://medium.com/@ranblog?source=rss-2f0c8a18f12e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CT3DpFDAOXWejQCsIK8eyA.jpeg</url>
            <title>Stories by Ran on Medium</title>
            <link>https://medium.com/@ranblog?source=rss-2f0c8a18f12e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 01:03:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ranblog/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[All Solutions for Insomnia Sufferers — 2]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://ranblog.medium.com/all-solutions-for-insomnia-sufferers-2-cfe67b109bd4?source=rss-2f0c8a18f12e------2"><img src="https://cdn-images-1.medium.com/max/2600/0*3-jpcc_E1RJa6tcT" width="6000"></a></p><p class="medium-feed-snippet">The complete series is available on my personal website.</p><p class="medium-feed-link"><a href="https://ranblog.medium.com/all-solutions-for-insomnia-sufferers-2-cfe67b109bd4?source=rss-2f0c8a18f12e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://ranblog.medium.com/all-solutions-for-insomnia-sufferers-2-cfe67b109bd4?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfe67b109bd4</guid>
            <category><![CDATA[insomnia]]></category>
            <category><![CDATA[anxiety]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[sleep]]></category>
            <category><![CDATA[sleep-disorders]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Thu, 25 Apr 2024 09:52:50 GMT</pubDate>
            <atom:updated>2024-04-25T13:27:49.416Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[写给失眠患者的所有解决方法 — 2]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://ranblog.medium.com/%E5%86%99%E7%BB%99%E5%A4%B1%E7%9C%A0%E6%82%A3%E8%80%85%E7%9A%84%E6%89%80%E6%9C%89%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-2-0a86b3a47212?source=rss-2f0c8a18f12e------2"><img src="https://cdn-images-1.medium.com/max/2600/0*aUlKbe1XeiI55Viz" width="6000"></a></p><p class="medium-feed-snippet">&#x5206;&#x4EAB;&#x6211;&#x591A;&#x5E74;&#x6765;&#x89E3;&#x51B3;&#x5931;&#x7720;&#x7684;&#x5404;&#x79CD;&#x7ECF;&#x9A8C;&#xFF0C;&#x8FD9;&#x91CC;&#x5305;&#x62EC;&#x751F;&#x7406;&#x548C;&#x5FC3;&#x7406;&#x7684;&#x8C03;&#x7406;&#xFF0C;&#x751A;&#x81F3;&#x8FD8;&#x6709;&#x4E00;&#x90E8;&#x5206;&#x7384;&#x5B66;&#x3002;</p><p class="medium-feed-link"><a href="https://ranblog.medium.com/%E5%86%99%E7%BB%99%E5%A4%B1%E7%9C%A0%E6%82%A3%E8%80%85%E7%9A%84%E6%89%80%E6%9C%89%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-2-0a86b3a47212?source=rss-2f0c8a18f12e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://ranblog.medium.com/%E5%86%99%E7%BB%99%E5%A4%B1%E7%9C%A0%E6%82%A3%E8%80%85%E7%9A%84%E6%89%80%E6%9C%89%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-2-0a86b3a47212?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a86b3a47212</guid>
            <category><![CDATA[睡眠]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[失眠]]></category>
            <category><![CDATA[焦慮]]></category>
            <category><![CDATA[睡眠不足]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Thu, 25 Apr 2024 09:47:40 GMT</pubDate>
            <atom:updated>2024-04-25T09:47:40.066Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[All Solutions for Insomnia Sufferers — 1]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://ranblog.medium.com/all-solutions-for-insomnia-sufferers-1-9ecc64851a73?source=rss-2f0c8a18f12e------2"><img src="https://cdn-images-1.medium.com/max/2600/0*y0oya7jJj04pVKwH" width="6000"></a></p><p class="medium-feed-snippet">The complete series is available on my personal website.</p><p class="medium-feed-link"><a href="https://ranblog.medium.com/all-solutions-for-insomnia-sufferers-1-9ecc64851a73?source=rss-2f0c8a18f12e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://ranblog.medium.com/all-solutions-for-insomnia-sufferers-1-9ecc64851a73?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ecc64851a73</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[sleep]]></category>
            <category><![CDATA[sleep-disorders]]></category>
            <category><![CDATA[insomnia]]></category>
            <category><![CDATA[anxiety]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Tue, 23 Apr 2024 13:27:33 GMT</pubDate>
            <atom:updated>2024-04-25T04:16:48.281Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[写给失眠患者的所有解决方法 — 1]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://ranblog.medium.com/%E5%86%99%E7%BB%99%E5%A4%B1%E7%9C%A0%E6%82%A3%E8%80%85%E7%9A%84%E6%89%80%E6%9C%89%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-1-25da21ecceae?source=rss-2f0c8a18f12e------2"><img src="https://cdn-images-1.medium.com/max/2600/0*k3DxcRUsUhuh9Ovv" width="6000"></a></p><p class="medium-feed-snippet">&#x5206;&#x4EAB;&#x6211;&#x591A;&#x5E74;&#x6765;&#x89E3;&#x51B3;&#x5931;&#x7720;&#x7684;&#x5404;&#x79CD;&#x7ECF;&#x9A8C;&#xFF0C;&#x8FD9;&#x91CC;&#x5305;&#x62EC;&#x751F;&#x7406;&#x548C;&#x5FC3;&#x7406;&#x7684;&#x8C03;&#x7406;&#xFF0C;&#x751A;&#x81F3;&#x8FD8;&#x6709;&#x4E00;&#x90E8;&#x5206;&#x7384;&#x5B66;&#x3002;</p><p class="medium-feed-link"><a href="https://ranblog.medium.com/%E5%86%99%E7%BB%99%E5%A4%B1%E7%9C%A0%E6%82%A3%E8%80%85%E7%9A%84%E6%89%80%E6%9C%89%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-1-25da21ecceae?source=rss-2f0c8a18f12e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://ranblog.medium.com/%E5%86%99%E7%BB%99%E5%A4%B1%E7%9C%A0%E6%82%A3%E8%80%85%E7%9A%84%E6%89%80%E6%9C%89%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-1-25da21ecceae?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/25da21ecceae</guid>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[失眠]]></category>
            <category><![CDATA[焦虑]]></category>
            <category><![CDATA[睡眠]]></category>
            <category><![CDATA[睡眠不足]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Tue, 23 Apr 2024 10:43:55 GMT</pubDate>
            <atom:updated>2024-04-23T10:43:55.151Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Techniques I learned from Playing Sekiro]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://ranblog.medium.com/techniques-i-learned-from-playing-sekiro-english-78a33577ef39?source=rss-2f0c8a18f12e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*HhfuRB4EvGkXZdJWv1wK7w.jpeg" width="3840"></a></p><p class="medium-feed-snippet">Background</p><p class="medium-feed-link"><a href="https://ranblog.medium.com/techniques-i-learned-from-playing-sekiro-english-78a33577ef39?source=rss-2f0c8a18f12e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://ranblog.medium.com/techniques-i-learned-from-playing-sekiro-english-78a33577ef39?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/78a33577ef39</guid>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[sekiro]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[videogames]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 13:23:18 GMT</pubDate>
            <atom:updated>2024-01-19T08:12:32.888Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[我玩只狼悟到的几个技巧]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://ranblog.medium.com/%E6%88%91%E7%8E%A9%E5%8F%AA%E7%8B%BC%E6%82%9F%E5%88%B0%E7%9A%84%E5%87%A0%E4%B8%AA%E6%8A%80%E5%B7%A7-b38d9b844955?source=rss-2f0c8a18f12e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*HhfuRB4EvGkXZdJWv1wK7w.jpeg" width="3840"></a></p><p class="medium-feed-snippet">&#x80CC;&#x666F;</p><p class="medium-feed-link"><a href="https://ranblog.medium.com/%E6%88%91%E7%8E%A9%E5%8F%AA%E7%8B%BC%E6%82%9F%E5%88%B0%E7%9A%84%E5%87%A0%E4%B8%AA%E6%8A%80%E5%B7%A7-b38d9b844955?source=rss-2f0c8a18f12e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://ranblog.medium.com/%E6%88%91%E7%8E%A9%E5%8F%AA%E7%8B%BC%E6%82%9F%E5%88%B0%E7%9A%84%E5%87%A0%E4%B8%AA%E6%8A%80%E5%B7%A7-b38d9b844955?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b38d9b844955</guid>
            <category><![CDATA[游戏]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[sekiro]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 13:17:34 GMT</pubDate>
            <atom:updated>2024-01-09T09:47:33.887Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Python + VS Code Installation and Setup Guide (Windows) — 2]]></title>
            <link>https://ranblog.medium.com/python-vs-code-installation-and-setup-guide-windows-2-bc4ebc639d2c?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc4ebc639d2c</guid>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[setup]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Thu, 18 Mar 2021 15:51:10 GMT</pubDate>
            <atom:updated>2021-10-14T10:55:17.426Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python + VS Code Installation and Setup Guide (Windows) — 2</h3><figure><img alt="Python and Visual Studio Code" src="https://cdn-images-1.medium.com/max/561/1*u2t3cqiu3B8IxBzDRYR86Q.png" /></figure><p>(This article is moved to my personal blog, you can <a href="https://www.ranblog.com/blog/python-vs-code-installation-and-setup-guide-windows-2/">read there</a> without Medium membership.)</p><p><strong>Last Article</strong>:</p><p><a href="https://ranblog.medium.com/python-vs-code-installation-and-setup-guide-windows-1-254236bda39a">Python + VS Code Installation and Setup Guide (Windows) — 1</a></p><h3>Notes before Start:</h3><p>These 2 articles are about installing and setting up <strong>Python</strong> and <strong>Visual Studio Code</strong> on <strong>Windows</strong>.</p><ul><li><strong>By the end of the last article</strong>, you should be able to run simple python code on both <strong>Command Prompt</strong> and <strong>Python IDLE</strong>.</li><li><strong>By the end of this article</strong>, you should be able to run a simple Python program on <strong>VS code</strong>.</li><li>The instructions should work for <strong>any version of Python and VS Code</strong>.</li><li>You can always skip the <strong>Explanations </strong>and “<strong>Q(Questions)</strong>” sections in this article.</li></ul><p>The instructions should work for <strong>any version of Python and VS Code</strong>.</p><h4>Some related questions answered in this article:</h4><ul><li>What are the differences between <strong>VS Code’s </strong>stable and insider version?</li><li>What if you cannot see <strong>PowerShell </strong>in the terminal?</li><li>What are the <strong>2 basic methods</strong> to run a Python program in VS Code?</li><li>What are the <strong>differences between these 2 methods</strong>?</li></ul><h3>Download and Install Visual Studio Code</h3><ol><li>Go to the website: <a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a>. Click the dropdown menu. Download the <strong>Stable </strong>version of <strong>VS Code</strong>.</li></ol><figure><img alt="Download Visual Studio Code" src="https://cdn-images-1.medium.com/max/1024/1*gl4lpfbZEPNkQDIcckNeUg.png" /></figure><h4><strong>Q: Stable v.s. Insiders</strong></h4><ul><li><strong>Insiders</strong>: prerelease versions, contains new features, but not stable</li><li><strong>Stable: </strong>stable</li><li>Can be installed together and used simultaneously</li></ul><p>2. Accept and click “<strong>Next.</strong>”</p><figure><img alt="License Agreement for installing Visual Studio Code" src="https://cdn-images-1.medium.com/max/490/1*oI8xzQDBgP0kqkIq_l1BMA.png" /></figure><p>3. Click “<strong>Next.</strong>”</p><figure><img alt="Destination Location for Visual Studio Code" src="https://cdn-images-1.medium.com/max/493/1*a4q0wH-_jiUzDMpYpZo46g.png" /></figure><p>4. Click “Next.”</p><figure><img alt="Stat Menu Folder for Visual Studio Code" src="https://cdn-images-1.medium.com/max/489/1*wqb5fdqpWuvM8_GZno-2Hg.png" /></figure><p>5. Check “<strong>Create a desktop icon</strong>” and click “<strong>Next.</strong>”</p><figure><img alt="Select Additional Tasks for Visual Studio Code" src="https://cdn-images-1.medium.com/max/492/1*TxzR6HeezAU7JnxLPTVP5A.png" /></figure><p>6. Click “<strong>Install.</strong>”</p><figure><img alt="Click install for Visual Studio Code" src="https://cdn-images-1.medium.com/max/489/1*FaXyB3jE92Nys4N734ijJA.png" /></figure><p>7. Click “<strong>Finish.</strong>”</p><figure><img alt="Click finish and launch visual studio code" src="https://cdn-images-1.medium.com/max/491/1*kLFw2GdnCYRoIE-icLxwDg.png" /></figure><p>8. Launch <strong>VS Code</strong>. At this point, your VS Code is <strong>installed successfully</strong>. (Just close the lower right corner message here)</p><figure><img alt="Launch Visual Studio Code" src="https://cdn-images-1.medium.com/max/1024/1*aPxKryYeqIKjCYeliZKRUg.png" /></figure><h3>Set up VS Code and Python</h3><h4>How to make it look bigger</h4><ul><li>Click “<strong>View</strong>” → “<strong>Appearance</strong>” → “<strong>Zoom In</strong>”</li><li>Or press “<strong>Ctrl</strong>” + “<strong>=</strong>”</li><li>“<strong>Ctrl</strong>” + “<strong>-</strong>” for “<strong>Zoom Out</strong>”</li></ul><figure><img alt="How to Zoom in and Zoom out for Visual Studio Code (Make the fonts larger or smaller)" src="https://cdn-images-1.medium.com/max/1024/1*_hhmcydgHkZG9GmmrLBe_Q.png" /></figure><h4>Set up Python</h4><ol><li>Click “<strong>Extensions</strong>” on the left.</li></ol><figure><img alt="Check extensions for visual studio code" src="https://cdn-images-1.medium.com/max/1024/1*TJvunVa-XM2tPMW3pxwBjQ.png" /></figure><p>2. Search “<strong>python</strong>” and click the first one.</p><figure><img alt="Install python extensions for visual studio code" src="https://cdn-images-1.medium.com/max/1024/1*MvIhDIxwlyk5DjsFpD-1gg.png" /></figure><p>3. Click “<strong>Install.</strong>”</p><figure><img alt="Install python extension for visual studio code" src="https://cdn-images-1.medium.com/max/1024/1*JhY-1Q2LE6AIeUZJIkuP3w.png" /></figure><h4>Q: What are VS Code Extensions?</h4><blockquote>VS Code extensions let you add languages, debuggers, and tools to your installation to support your development workflow. VS Code’s rich extensibility model lets extension authors plug directly into the VS Code UI and contribute functionality through the same APIs used by VS Code.</blockquote><blockquote><a href="https://code.visualstudio.com/docs/editor/extension-gallery#:~:text=VS%20Code%20extensions%20let%20you,APIs%20used%20by%20VS%20Code."><em>Source</em></a></blockquote><p>4. You can now close the pop-ups on the right (if any). Then, you can click the “<strong>Explorer</strong>” on the left.</p><figure><img alt="Click the explorer in visual studio code" src="https://cdn-images-1.medium.com/max/1024/1*PKR3AxdfzFozuUUMUz2xUw.png" /></figure><p><strong>If this shows up, just click “Do not show again.”</strong></p><figure><img alt="Click “do not show again” for linter pylint" src="https://cdn-images-1.medium.com/max/645/1*2mZu9P1JcuKGbIQnKnQ2pQ.png" /></figure><p>5. Click “<strong>File</strong>” → “<strong>Open Folder</strong>” (Ctrl+K Ctrl+O)</p><figure><img alt="Open folder in visual studio code" src="https://cdn-images-1.medium.com/max/1024/1*JPwXSMzQ5KGiLl6MZ6nn9g.png" /></figure><p>6. Choose a folder that you would like to put your python code and click “<strong>Select Folder.</strong>”</p><figure><img alt="Select folder for visual studio code" src="https://cdn-images-1.medium.com/max/943/1*sDeNvELHoGE7a-l5V6qssA.png" /></figure><p>7. We can see that the folder name is shown here. Then we can click the first logo for “<strong>New File</strong>” and name the file “<strong>start.py</strong>” (or whatever you like).</p><figure><img alt="Open a new file under a folder in visual studio code" src="https://cdn-images-1.medium.com/max/684/1*iNcztdJTmyOWrERgAnUaAA.png" /></figure><p>8. Write a simple python program.</p><figure><img alt="Write a simple python program in visual studio code" src="https://cdn-images-1.medium.com/max/435/1*ViWQLmHR-4LE8Civxldvlg.png" /></figure><p>9. Open the terminal section in VS Code. Click “<strong>View</strong>” → “<strong>Terminal</strong>” (Or Ctrl + `)</p><figure><img alt="How to open terminal in visual studio code" src="https://cdn-images-1.medium.com/max/1024/1*GD-OOzSuvukRo7dlFZvVfw.png" /></figure><p>10. You should see <strong>PowerShell </strong>if you did not install something like <strong>git </strong>before.</p><h4>If you did not see PowerShell:</h4><p>Click here and choose “<strong>Select Default Shell</strong>,” and then choose “<strong>Windows PowerShell.</strong>”</p><figure><img alt="What to do if you did not see powershell in the visual studio code’s terminal" src="https://cdn-images-1.medium.com/max/1024/1*lEyCkqwuMFYmbxxY5GxESQ.png" /></figure><p>11. Click “<strong>Kill Terminal</strong>” and then open Terminal again (View →Terminal). You should see “<strong>powershell</strong>” then.</p><figure><img alt="Kill terminal and open terminal again" src="https://cdn-images-1.medium.com/max/1024/1*Fg6ycTMONEjPtX0bHXAp7w.png" /></figure><h3>Now there are 2 ways to run a Python program in VS Code:</h3><h4>1st method:</h4><p>Type “<strong>python start.py</strong>” in the terminal. This is the same as what was mentioned in the last article.</p><figure><img alt="run python code in visual studio code by using “python”" src="https://cdn-images-1.medium.com/max/1024/1*Las8hzTK7IzOzTiJsmP4sA.png" /></figure><h4>2nd method:</h4><figure><img alt="Click “Run python file in terminal”" src="https://cdn-images-1.medium.com/max/1024/1*3wtIzUTgge3P4FPrMk1eiw.png" /></figure><p>Right-click and select “<strong>Run Python File in Terminal.</strong>”</p><figure><img alt="Run python file in visual studio code by the full path of python and your file" src="https://cdn-images-1.medium.com/max/1011/1*c8czfrE4ClNUM9M0zForag.png" /></figure><p>This shows the full path of both Python and your program. The path should be the same as what we mentioned in the last article.</p><h4>Difference Between These 2 Methods</h4><p>They are almost the same. But there is one difference.</p><p><strong>The 1st method is directly related to the path, while the 2nd method is not.</strong></p><p>For example, if I changed the “<strong>python.exe</strong>” to “<strong>python2.exe</strong>” in the path.</p><p>(Read the first article if don’t understand what path is here.)</p><figure><img alt="change the name of python exe file in the path" src="https://cdn-images-1.medium.com/max/644/1*56xJw7aLdTJK9Raws3NfyQ.png" /></figure><p>The <strong>1st method</strong> will work if you typed “<strong>python2 start.py</strong>”:</p><figure><img alt="run a python program after changing the name of the python exe file in the path" src="https://cdn-images-1.medium.com/max/562/1*L_sVcdAa8Ozv_Z9kXLt7fA.png" /></figure><p>The <strong>2nd method</strong> will get error messages.</p><figure><img alt="Error messages: The term is not recognized as the name of a cmdlet, function, script file" src="https://cdn-images-1.medium.com/max/1024/1*AMNfrhnllitQu7Q3C5GKvw.png" /></figure><p>Because the <strong>2nd method</strong> is not directly related to the path, the VS Code actually saved the path information when you start VS Code.</p><p>In order to make the <strong>2nd method </strong>work as well, you can press “<strong>Ctrl+Shift+p</strong>” to open the <strong>Command Palette</strong>.</p><figure><img alt="How to open command palette in visual studio code" src="https://cdn-images-1.medium.com/max/1024/1*eNbpr597u6z_5evjin74Rg.png" /></figure><p>Then type “<strong>reload window</strong>” and press Enter.</p><figure><img alt="How to reload window in visual studio code" src="https://cdn-images-1.medium.com/max/1024/1*-90IjkOzhpRk5DZlrrHMAQ.png" /></figure><p>Then you can click “<strong>Select Python Interpreter</strong>” in the lower-left corner. You should see the new “<strong>python2</strong>” showing in the middle. Select it, and then you can use the <strong>2nd method</strong>.</p><figure><img alt="Select python interpreter" src="https://cdn-images-1.medium.com/max/1024/1*QCvbulxq3Yd1InOvidsgfQ.png" /></figure><p>However, if you changed the name in the path to “<strong>pyt</strong>” (not even containing the string “<strong>python</strong>”), this “<strong>reload window</strong>” method does not work as well, so I think <strong>VS Code</strong> uses the “<strong>python</strong>” string to be the selecting criteria.</p><p>By now, you should know how to run a python program in VS Code. You may see other people use the extension “<strong>Code Runner</strong>” to run the Python program in VS Code, but I don’t use it here because I think it is better to know the basic methods before moving to more advanced tools.</p><p><strong>I hope this article helps you!</strong></p><p><strong>(Support me with a </strong><a href="https://liker.land/ranblog/civic"><strong>coffee</strong></a><strong>. 😊)</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fbutton.like.co%2Fin%2Fembed%2Franblog%2Fbutton&amp;display_name=LikeCoin&amp;url=https%3A%2F%2Fbutton.like.co%2Fin%2Flike%2Franblog&amp;image=https%3A%2F%2Fstorage.googleapis.com%2Flikecoin-foundation.appspot.com%2Flikecoin_store_user_ranblog_main%3FGoogleAccessId%3Dfirebase-adminsdk-eyzut%2540likecoin-foundation.iam.gserviceaccount.com%26Expires%3D2430432000%26Signature%3DwwyukvidR7O6INMsyAIiaji1lBm8A%252BD0E1WYI9%252Fbi4q00HHh4y6JEbMMQIB1CFcoilMrEc5OQv288AeEzeVJDG5fYhLYrZWlKrF%252Fzn43uje94kyLn7tmcZ6DBLpAvEyvnWPNqq2RJ0D7lYbVeeiIMIH1Hw3W8Btl029%252FNoSf6TqMbjpxl7Mhdz5Mr%252BaB2gu51lZC%252B6D%252Bk8J6D0uOcxYXTz5dEne9Y0erk9tEgNiru%252FFtuRyXUNpQnvXWGR958fkDNCwQN6CXFdXxPFrlN38m9jbKHDOwHzXBtYuSROUiwHLAVw%252B7vvPSQGeHUN2GI8HAuBgR5Ee551E8W1Syidp%252BkQ%253D%253D&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=like" width="360" height="212" frameborder="0" scrolling="no"><a href="https://medium.com/media/530161b042dfd84e2d392f5b86fc87bc/href">https://medium.com/media/530161b042dfd84e2d392f5b86fc87bc/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc4ebc639d2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python + VS Code Installation and Setup Guide (Windows) — 1]]></title>
            <link>https://ranblog.medium.com/python-vs-code-installation-and-setup-guide-windows-1-254236bda39a?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/254236bda39a</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[setup]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Thu, 18 Mar 2021 15:51:06 GMT</pubDate>
            <atom:updated>2021-10-14T10:56:55.508Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python + VS Code Installation and Setup Guide (Windows) — 1</h3><figure><img alt="Python and Visual Studio Code" src="https://cdn-images-1.medium.com/max/561/1*u2t3cqiu3B8IxBzDRYR86Q.png" /></figure><p>(This article is moved to my personal blog, you can <a href="https://www.ranblog.com/blog/python-vs-code-installation-and-setup-guide-windows-1/">read there</a> without Medium membership.)</p><p><strong>Next Article</strong>:</p><p><a href="https://ranblog.medium.com/python-vs-code-installation-and-setup-guide-windows-2-bc4ebc639d2c">Python + VS Code Installation and Setup Guide (Windows) — 2</a></p><h3>Notes before Start:</h3><p>These 2 articles are about installing and setting up <strong>Python</strong> and <strong>Visual Studi Code</strong> on <strong>Windows</strong>.</p><ul><li><strong>By the end of this article</strong>, you will be able to run a simple Python program on both <strong>Command Prompt</strong> and <strong>Python IDLE</strong>.</li><li><strong>By the end of the next article</strong>, you will be able to run a simple Python program on <strong>VS code</strong>.</li><li>The instructions should work for <strong>any version of Python and VS Code</strong>.</li><li>You can always skip the <strong>Explanations </strong>and “<strong>Q(Questions)</strong>” sections in this article.</li></ul><h4>Alternative Choices at Some Steps</h4><p>I will use Steps 1, 2, 3 in the following instructions, but there are some steps that involve alternative choices. For example, for step 2, you can choose “2. (<strong>Directly Download</strong>)” or “2. (<strong>Specific Version)</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*nmMXvvLEqkv0YrhF_LKYhA.png" /></figure><h4><strong>Some related questions answered in this article:</strong></h4><ul><li>How to know your Windows is running a 32-bit or 64-bit version?</li><li>Which one should you download: 32-bit or 64-bit version of Python?</li><li>What are <strong>Environment Variables </strong>in Windows<strong>?</strong></li><li>Why do we need to check “<strong>Add Python 3.x to PATH</strong>”?</li></ul><h3>Download Python</h3><p>1. Go to the website: <a href="https://www.python.org/">https://www.python.org/</a>. Click the “Downloads” button.</p><figure><img alt="Download Python" src="https://cdn-images-1.medium.com/max/1024/1*Pgam3PBLBmTDmDjpwsZuhA.png" /></figure><p>2. (<strong>Directly Download</strong>) You can click the <strong>“Download Python 3.x”</strong> button directly. However, if you need to download a specific version of Python, you need to scroll down the page.</p><figure><img alt="Click “Download Python” directly" src="https://cdn-images-1.medium.com/max/1024/1*TchbAtyYvgg7mXMwuNwhQw.png" /></figure><h4><strong>Q: Why do you need a specific version of Python?</strong></h4><ul><li>The newest version may not be compatible with some libraries. It means that the application you are developing may have version dependencies.</li></ul><p>2. (<strong>Specific Version-1</strong>): Scroll down the page and select the version you are looking for.</p><figure><img alt="Download a specific version of Python" src="https://cdn-images-1.medium.com/max/1024/1*0jP3oAVBPoZQCfCj4wnZIQ.png" /></figure><p>2. (<strong>Specific Version-2</strong>) Scroll down again, and you will see the “Files” section.</p><figure><img alt="Find the correct Python installer" src="https://cdn-images-1.medium.com/max/1024/1*8zZVL9BpaERHGxME-6AHyw.png" /></figure><h4>Explanations — Python Installer:</h4><p>You can see there are <strong>3 types of Python installer </strong>for Windows here:</p><ul><li><strong>embeddable zip file: </strong>can be put into an application written in Python for distribution purpose (More details can be found: <a href="https://docs.python.org/3.5/using/windows.html#embedded-distribution">https://docs.python.org/3.5/using/windows.html#embedded-distribution</a>)</li><li><strong>executable installer: </strong>a .exe file, the most commonly used installer.</li><li><strong>web-based installer: </strong>smaller installer, download the necessary components and install automatically, requires a network connection.</li><li><strong>x86–64: </strong>64 bits</li><li><strong>x86</strong>: 32bits</li></ul><h4><strong>Q: How to know your Windows is running a 32-bit or 64-bit version?</strong></h4><p>Most machines are running a 64-bit operating system nowadays. If you are not sure about your Windows, type “<strong>About your PC</strong>” in the lower-left search box. Click and look for the “<strong>System type</strong>.” You should see your computer’s info there.</p><h4><strong>Q: Download 32-bit or 64-bit version?</strong></h4><ul><li>64-bit version of Windows can usually run 32-bit Python nowadays.</li><li>If your computer is running a 64–bit operating system, you should better choose “x86–64”. People might say the 32-bit version is more stable. However, the 64-bit version allows your program to <strong>access more RAM </strong>than the 32-bit version. Also, some machine learning libraries only support the 64-bit version (e.g., TensorFlow).</li></ul><h3>Install Python</h3><p>3. After you choose the right version, you can select the corresponding “<strong>executable installer</strong>” and download. You should see the following when you open the installer:</p><figure><img alt="Add Python 3.x to PATH" src="https://cdn-images-1.medium.com/max/659/1*juw5jQOdRrA5E8wEoYlmNw.png" /></figure><p>4. Make sure you check the box “<strong>Add Python 3.x to PATH</strong>” first. I will explain why this is necessary later.</p><p>5. (<strong>Install Now-1</strong>) (<strong>Not Recommended</strong>) If you are Okay with the installation path (user directory), you can click the “<strong>Install Now</strong>.” You don’t need to be the admin to do this option.</p><p>5. (<strong>Install Now-2</strong>)</p><p>You should see this window after clicking “<strong>Install Now</strong>.” You can click “<strong>Close</strong>” here.</p><figure><img alt="Python setup was successful" src="https://cdn-images-1.medium.com/max/659/1*LDiymXHxdCuqC8Js4DyRZw.png" /></figure><p>5. (<strong>Customize-1</strong>) (<strong>Recommended</strong>) You should see the following window if you clicked on the “<strong>Customize Installation</strong>.” This might require you to have administrative credentials or approval.</p><figure><img alt="Python Setup Optional Features" src="https://cdn-images-1.medium.com/max/661/1*lQezci-8hiXLoJWKL_tIiQ.png" /></figure><p>5. (<strong>Customize-2</strong>) Leave it as default and click “<strong>Next</strong>.”</p><p>5. (<strong>Customize-3</strong>) You should see the following window. We want to change the install location here.</p><figure><img alt="Python Setup Advanced Options" src="https://cdn-images-1.medium.com/max/662/1*PkgO1VpND-kAu0raM8QSzQ.png" /></figure><p>5. (<strong>Customize-4</strong>) Change the path to “C:\Python\Python39” (Change Python39 to the version you are downloading, 3.8.3 → Python383).</p><p>If you want to check the “<strong>Install for all users</strong>,” you can check the first box. This will also check the “<strong>Precompile standard library</strong>” automatically. This has little effect; leaving it unchecked is recommended if you don’t know the meaning.</p><figure><img alt="Python setup: customize install location" src="https://cdn-images-1.medium.com/max/659/1*wxe3wjQO3edJe9MO82PZFw.png" /></figure><p>For the bottom three checkboxes, leave it unchecked if you don’t know the meaning.</p><p>5. (<strong>Customize-5</strong>) Click “<strong>Install,</strong>” and you will see the following. You can click “<strong>Close</strong>” here.</p><figure><img alt="Python setup was successful" src="https://cdn-images-1.medium.com/max/661/1*3WdHk7WNDSqiXUOBON6yCQ.png" /></figure><p>6. Now, let’s check whether the python was installed correctly. Open your command prompt. (Press <strong>Windows+R</strong>, type “<strong>cmd</strong>” and then click “<strong>OK</strong>”)</p><figure><img alt="Open command prompt on windows" src="https://cdn-images-1.medium.com/max/397/1*B9gdx4hLZM4XcgJyQOB_5w.png" /></figure><p>7. Type “<strong>python --version</strong>” and press Enter. You should see the corresponding python version.</p><figure><img alt="Type “python --version” in the command prompt" src="https://cdn-images-1.medium.com/max/977/1*BMXsDDfUqOc0OVLzBXQzRQ.png" /></figure><p>8. Type python and press Enter. You can also write some simple python codes here like “<strong>print(“Hello World”)</strong>”</p><figure><img alt="Type “python” in command prompt for writing simple code" src="https://cdn-images-1.medium.com/max/978/1*k4gpuVorgJ0sPfLax30dKw.png" /></figure><p>9. If you press the Windows button, you should see there will be “<strong>IDLE (Python 3.9 64-bit)</strong>” under the “<strong>Recently added</strong>”</p><figure><img alt="Find Python IDLE in the recently added" src="https://cdn-images-1.medium.com/max/308/1*ppHo6oQZCO_jw22ec4A7bg.png" /></figure><p>10. Click and open it. You will find that you can also write python code here.</p><figure><img alt="Write simple python code in IDLE Shell" src="https://cdn-images-1.medium.com/max/669/1*fOuTxAiVu8KgObBulbEKwA.png" /></figure><p>11. Also, you can click the “<strong>File</strong>,” open “<strong>New File</strong>,” and write the following code.</p><figure><img alt="Write longer python code in IDLE shell by using “New File”" src="https://cdn-images-1.medium.com/max/664/1*hcKdSq1XikgJ-UPHJv_qmw.png" /></figure><p>12. Then press Ctrl+s for save, and click “<strong>Run</strong>” → “<strong>Run Module.</strong>”</p><figure><img alt="Run module for python file" src="https://cdn-images-1.medium.com/max/644/1*rA3CWdijh7_ezQCii5Nk4A.png" /></figure><h4>Q: Why do we need to check “<strong>Add Python 3.x to PATH</strong>”?</h4><p>To understand this, we first need to know what is the “<strong>Environment Variables</strong>.”</p><p>Type “<strong>environment variables</strong>” in the search box and open the “<strong>Edit the system environment variables.</strong>”</p><figure><img alt="Edit the system environment variables for Windows" src="https://cdn-images-1.medium.com/max/782/1*cgJTB6zzrf--2sSU_tig9Q.png" /></figure><p>You should see the “<strong>System Properties</strong>.”</p><figure><img alt="Find environment variables in system properties" src="https://cdn-images-1.medium.com/max/408/1*icqJOkSOW23V2mp5vZFkpA.png" /></figure><p>Click on the “<strong>Environment Variables,</strong>” and you should see two Path variables under the User variables and System variables.</p><figure><img alt="Find path variables in the environment variables" src="https://cdn-images-1.medium.com/max/612/1*G7AhyXnD9pwOOYCxQfVobA.png" /></figure><p>If you chose “<strong>Install for all users</strong>,” double-click the “<strong>Path</strong>” under the <strong>System variables</strong>. If not, then double-click the “<strong>Path</strong>” under the <strong>user variables</strong>.</p><p>You should see these two paths.</p><figure><img alt="Find the path for python in the environment variables" src="https://cdn-images-1.medium.com/max/509/1*-6NANyBMUbrIyDvoP4DAZQ.png" /></figure><p>If you open the folder, you will see that there is a <strong>python EXE file</strong>.</p><figure><img alt="Check the python exe file in the path" src="https://cdn-images-1.medium.com/max/645/1*pR7TrD7MdU24TJ1mLE4eGg.png" /></figure><p>Basically, when you type “<strong>python</strong>” in the command prompt, it goes to the <strong>Path </strong>to find the .exe file named “<strong>python</strong>” and run it. You can change the file name and tried type “<strong>python</strong>” again in the command prompt. You will find that it does not work anymore.</p><p><strong>I hope this article helps you!</strong></p><p><strong>(Support me with a </strong><a href="https://liker.land/ranblog/civic"><strong>coffee</strong></a><strong>. 😊)</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fbutton.like.co%2Fin%2Fembed%2Franblog%2Fbutton&amp;display_name=LikeCoin&amp;url=https%3A%2F%2Fbutton.like.co%2Fin%2Flike%2Franblog&amp;image=https%3A%2F%2Fstorage.googleapis.com%2Flikecoin-foundation.appspot.com%2Flikecoin_store_user_ranblog_main%3FGoogleAccessId%3Dfirebase-adminsdk-eyzut%2540likecoin-foundation.iam.gserviceaccount.com%26Expires%3D2430432000%26Signature%3DwwyukvidR7O6INMsyAIiaji1lBm8A%252BD0E1WYI9%252Fbi4q00HHh4y6JEbMMQIB1CFcoilMrEc5OQv288AeEzeVJDG5fYhLYrZWlKrF%252Fzn43uje94kyLn7tmcZ6DBLpAvEyvnWPNqq2RJ0D7lYbVeeiIMIH1Hw3W8Btl029%252FNoSf6TqMbjpxl7Mhdz5Mr%252BaB2gu51lZC%252B6D%252Bk8J6D0uOcxYXTz5dEne9Y0erk9tEgNiru%252FFtuRyXUNpQnvXWGR958fkDNCwQN6CXFdXxPFrlN38m9jbKHDOwHzXBtYuSROUiwHLAVw%252B7vvPSQGeHUN2GI8HAuBgR5Ee551E8W1Syidp%252BkQ%253D%253D&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=like" width="360" height="212" frameborder="0" scrolling="no"><a href="https://medium.com/media/530161b042dfd84e2d392f5b86fc87bc/href">https://medium.com/media/530161b042dfd84e2d392f5b86fc87bc/href</a></iframe><p><strong>Next Article</strong>:</p><p><a href="https://ranblog.medium.com/python-vs-code-installation-and-setup-guide-windows-2-bc4ebc639d2c">Python + VS Code Installation and Setup Guide (Windows) — 2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=254236bda39a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[如何變得自律 — 1 （習慣培養）]]></title>
            <link>https://ranblog.medium.com/%E5%A6%82%E4%BD%95%E8%AE%8A%E5%BE%97%E8%87%AA%E5%BE%8B-1-%E7%BF%92%E6%85%A3%E5%9F%B9%E9%A4%8A-1165425ffdda?source=rss-2f0c8a18f12e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1165425ffdda</guid>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[習慣]]></category>
            <category><![CDATA[自律]]></category>
            <category><![CDATA[健康]]></category>
            <category><![CDATA[個人成長]]></category>
            <dc:creator><![CDATA[Ran]]></dc:creator>
            <pubDate>Sun, 02 Aug 2020 11:54:11 GMT</pubDate>
            <atom:updated>2021-08-20T15:49:26.558Z</atom:updated>
            <content:encoded><![CDATA[<h3>如何變得自律 — 1 （習慣培養）</h3><p>那些你真正需要知道，卻不知道的。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2NVOmmWR0Ba4p-L-" /><figcaption>Photo by <a href="https://unsplash.com/@dsmacinnes?utm_source=medium&amp;utm_medium=referral">Danielle MacInnes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>1. 背景介紹</strong></h3><p>如何變得自律，一直是很多人困擾的問題。在網上找到的大部分資料都會告訴你要設定目標，要規律作息，學會規劃時間，或者就是直接講一個自己受到刺激然後從此奮發圖强的故事給你打上幾針鷄血。然而這些都對具體如何實現的步驟少有提及，現實情況往往是你看完這些資料的頭一兩天充滿幹勁，第三天開始繼續混吃等死，然後不知不覺一個月過去了，一年過去了，仍然沒有什麽改變。</p><p>我個人認爲<strong>“如何變得自律”</strong>就和<strong>“如何能快速睡着”</strong>這個問題一樣的複雜，做得到的人不太懂做不到的人爲什麽做不到。這裏面其實涉及了很多心理層面的動機，和循序漸進才能慢慢走到終點的過程。</p><p>我一直認爲所有的事情都應該是循序漸進的，正如我非常相信n+1法則。n+1法則就是說假設你現在的水平是n，你的學習應該保持在n+1難度，这样才能長久堅持以及保持學習的效率和動力。所以這個系列我也盡量秉承著這樣的一個原則，我會先假設你是個實現自律零進度，曾經燃起無數改變的熱情，然後在誘惑中迷失自我，看著日曆從1月變12月的小白。然後以這樣的假設，告訴你每一步應該做些什麽來往前進步。（這裏關於n+1法則我有點沒法確定來源。。。）</p><p>這是這個系列的第一篇文章，我選擇討論習慣培養這個課題，因爲這應該是很多想要自律的人都會接觸到的第一件事，比如想要學語言需要堅持每天背單詞，想要好身材需要保持健身習慣，想要增長見識需要常看書等等。這篇文章結合了我多年的個人經驗以及我對<strong>《原子習慣》(《Atomic Habit》/《掌控習慣》)</strong>這本書的讀後感。</p><h3>2. 心理期望與現實不符</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*3h7IwC18pqvmCXgQ9aDMHQ.png" /><figcaption>Source: 《原子習慣》(《Atomic Habit》/《掌控習慣》)</figcaption></figure><p><strong>第一個需要改變的是你的心態，很多人堅持不下去的一個重要原因就是現實與你的心理預期不符。</strong>我們總習慣性地覺得一分耕耘一分收穫，覺得今天做了運動，那麽今天體重應該有隨著掉一點吧。然後就站上體重計，發現體重可能毫無改變甚至變得更重了，你心裏就產生了失落感，不過這種與你心理預期的落差還比較小，畢竟只是一天，然而過了兩天，三天，甚至一周，這種落差累積得越來越多，最後你就在這種逐漸增加的失落中放棄了。</p><p><strong>這個問題的關鍵就在於，習慣的堅持和成果的展現往往不是一個綫性的關係，</strong>而是在經歷了一段 “停滯期” 后，在某一個時間點突然產生巨大的進步，隨後事情越做越順。如同上圖所示的一樣。就像很多人學英語，堅持背單詞，看美劇練聽力，在初期你可能都覺得自己還是老樣子，很多單詞背了就忘，練聽力的時候很多地方聼第二次還是沒能反應過來。可是隨著你堅持下去，在某一個時間點，你打開了一個YouTube上的英文影片，還沒有字幕，可是你卻突然發現自己毫無壓力地看完了這個影片，并且完全理解了它的意思，那一刻就是所有堅持真正展現成果的瞬間。而很多人等不到這個瞬間就放棄了，因爲他們從一開始對這件事情的發展就存在錯誤的認知，以至於給自己施加了很多額外的打擊。</p><p><strong>同樣的，我們可以用類似的心態去看待我們的壞習慣。</strong>你不會因爲吃一頓麥當勞就一個晚上胖20斤，所以你才會不斷地打破自己定下的規矩。直到你迎來了那個爆發點，你才猛然發現自己怎麽穿不下之前的褲子了。</p><p>所以改變自己的心態是很重要的第一步。如果你學過AI（人工智能），我覺得這個過程有點像換一個loss function哈哈。</p><h3>3. 目標制定也是需要技巧的</h3><p>調整好了自己的心態，那麽我們就可以開始制定一個目標啦。但是其實很多人制定目標的時候也會不斷給自己增加阻力，導致事情早早結束。</p><h4>3.1 目標時間跨度太大</h4><p>第一個問題就是很多人喜歡定一個長期的目標，<strong>可明明連handle短期目標的能力都還沒培養好。</strong>比如一些人過年的時候就説今年一定要每天都運動，這種目標最大的問題就在於一旦你一天沒有完成，那你所謂的今年目標就已經廢了，在這個基礎上，你也不會想要再去改動這個目標，因爲你已經有了挫敗感和那種反正定了也不會完成的心理預設。你可能會說，這個例子太少見了吧，你一定不會犯這種錯誤的。那可難説呢，你試著把一年改爲一周試試，或者一周6天，一周5天，假設你定了一周5天，當你連續3天沒運動的時候，這周就只剩下4天，對你來説這個目標已經廢了，所以其實道理是一樣的。</p><p><strong>看到這裏你應該明白，這裏說的太大，是相對於每個人而言的，如果你制定的目標對你來說跨度太大，那就是太大。</strong>不過問題就在於很多人不願意去面對這個事實，因爲制定目標的這個過程可以給你帶來滿足感，可以給你帶來一種，“我完成了點什麽”，“我往前進步了一點”的幻覺。而定一個跨度大的目標可以給你帶來更大的滿足感，甚至是一種感動自己的雄心壯志。這種滿足感甚至可以讓你產生你已經完成了目標的幻覺。什麽？你説這就太誇張了吧，那就想想那些你買了沒看的書吧。</p><h4>3.2 目標定得模糊不清</h4><p>“明天周六，我要做運動”，是的，<strong>這是一個非常不清晰的目標</strong>。有些人可能會説這也不清晰？都已經定到一天了，不就是有空的時候運動一下就完成了嗎。而關鍵就在於這個“有空”的定義非常模糊，我們要明白對於一個自律新手來講，可能會發生的事情是這樣的：早上明明有空，但是因爲晚起，起床的時候已經到了午飯時間，心裏想著那就吃完午飯開始吧，接著午飯因爲吃太飽了，改到晚飯前，晚飯前和朋友出去玩或者在家玩電腦，又改到了晚飯後，晚飯後又是好飽，說再等兩小時，接著刷刷手機覺得好睏好累，還是改到明天吧。</p><p>這整個過程有兩個關鍵的問題，<strong>一個是目標的可調整次數太多了</strong>，你總會覺得還有機會，總會完成的，直到你已經沒機會了。這其中你忽視掉了一個問題：瑣碎事情可以帶給你的影響是超乎你想象的。因此提前想一想自己會被什麽事情帶偏，而事先制定一個準確的時間點是非常重要的。</p><p><strong>另一個問題就在於你花了非常多的時間去重複思考</strong>說 “我現在要不要做這件事情”，這個過程本身也是耗費精力的，而且并不會對你完成任務有太大的幫助。你可以想想你上中學的時光，學校給了你清楚的課程表，你根本就不會思考說，“我現在要不要上這節語文課呢，要不待會再上？”這樣的問題，所以你按部就班地完成了學校安排的學習任務。當然這個例子還涉及到了環境的問題，這個之後會進行討論，不過你生活中總有些習慣是你不會去思考做不做，而是到點了直接開始，怎樣將這些思維應用到習慣培養中來，才是我們討論的關鍵。</p><h4>3.3 無限細分原則（兩分鐘規則）</h4><p>這個方法是我一直都有在實行的，也在書中看到了類似的想法，不過書中將其稱作兩分鐘規則。</p><p>我的想法是，<strong>對於每個你想培養的習慣，都要將其無限細分直到你認爲已經變成一個沒理由不做的程度。</strong>比如説你想培養自己的英語閲讀能力，你可能希望培養自己每天看一點英文的習慣，那麽這個一點是多少呢，假設你找了一本英文書，你就問自己，每天10頁可以嗎？還是三頁？一頁？一行?五個字？一個字？直到你覺得目標已經變得極易執行爲止，也就是假設你那天回到家累得要死，你想起執行這個習慣也不會覺得困難和感到抗拒為標準。</p><p><strong>你可能會説一天看一行字有啥用，可是關鍵就在於，這是在推你往前進的第一塊多米諾骨牌。</strong>你首先要感到這件事像喝水一樣簡單，你才會開始，當你開始了，就會出現兩種情況。<strong>一種是你真的讀了一行就停了。</strong>這種情況，好歹你真的學了一行英文，而且如果你真的每天都能堅持讀一行，一個月后你對自己可以產生不同的認知，你會覺得自己還是可以堅持得下來的，那種對自我身份的强化和因此產生的自信是非常寶貴的。這些身份强化和自信就會逐漸得讓你更有底氣去挑戰下一個目標。畢竟人是很需要成就感的。而那些鄙視這種讀一行讀一個字行爲的人，往往過了大半年也還是在這件事情上毫無進步。</p><p><strong>另一種情況是你覺得反正也讀一行了，那再看一點也無所謂。</strong>假設你每天雖然目標是一行，但其實你平均每天讀了五行，你可能會説那和每天定五行區別在哪呢？最大的區別就在於，后四行對於你來説是額外的工作，是你完成目標后空閑時間的努力，你在讀每一行的時候不會因爲要完成目標而總想著“還剩多少啊”，這樣消耗精力的問題。而這樣的心理狀態可以讓你對這件事情保持一個更好的態度和精力。堅持過一些習慣的人都知道，消極的態度和厭煩的心態能在一瞬間讓之前的堅持功虧一簣。</p><p>書中將這個方法定義為兩分鐘規則，也就是<strong>“當你開始培養一種新習慣時，它所用時間不應超過兩分鐘。” </strong>將這兩分鐘看作是啓動正式程序的儀式。海明威也針對所有類型的寫作提出：“最佳做法是一定要在你感覺還好時及時收手。” 我個人也認爲在事情感覺還好的時候停止是很重要的。如果硬要拖到累得不行再收手，你下次想要開始這件事情的時候就會帶有負面情緒，這其實涉及到另一套理論，以後有機會再談。</p><h3>4.習慣循環：提示 →渴求 →反應 →獎勵</h3><p>這是書中提到的用來描述習慣四個階段的反饋回路。所有的行爲都可以用這個回路來描述。比如下面這個書中的例子：</p><ol><li><strong>提示</strong>： 你的手機收到一條短信並發出鈴聲</li><li><strong>渴求</strong>：你想要知道消息的内容</li><li><strong>反應</strong>：你拿起電話，打開並閲讀那條信息</li><li><strong>獎勵</strong>：你滿足了想要閲讀這條信息的願望，抓起電話和你的電話鈴聲之間建立了關聯</li></ol><p>按照這四個階段，我們可以制定相應的策略來培養好習慣</p><ul><li><strong>提示</strong>：讓它顯而易見/特定的時間和地點</li><li><strong>渴求</strong>：讓它有吸引力</li><li><strong>反應</strong>：讓它簡便易行</li><li><strong>獎勵</strong>：讓它令人愉悅</li></ul><h4>4.1 讓它顯而易見</h4><p>如果你想要培養自己多喝水的習慣，那麽就應該買一個大一點的水壺，每天裝滿水然後將它放在你的辦公桌上。告訴自己每天的目標就是要喝完這瓶水。或者再想想那些令你變胖的壞習慣，是不是每天回家的路綫都會經過美味的小吃攤，還是辦公桌上總是放了些小零食呢？</p><h4>4.2 讓它有吸引力</h4><p>書中提到了讓習慣更有吸引力的一個方法是<strong>喜好綁定</strong>，將你想要實現的習慣與你喜歡的事情綁定，比如你喜歡看YouTube，那麽你可以規定自己每次打開YouTube之前先做五個俯臥撐，也就是將你運動的習慣和看YouTube這件事情綁定起來，以此來提高你的運動欲望。</p><h4>4.3 讓它簡便易行</h4><p>這一點其實跟我上面提到的無限細分原則（兩分鐘規則）很類似，不過這裏我想從另一個角度闡述這個問題。</p><p>大家可以觀察一下我們常用的社交媒體，想一想這些軟件是怎麽培養你的使用習慣的呢。比如爲什麽Facebook，Instagram相對以前寫blog的方式更受大衆歡迎呢。首先我們都明白每個人都有分享想法的需求，這些軟件就是讓這樣的需求變得更加簡便易行，你可以用手機拍下剛看到的風景然後馬上分享給朋友們，整個過程對使用者來説幾乎毫無成本而且時長很短。反觀以前得先拍照，回去用電腦上傳，再等待他人打開你網站的時間，每一步都足以讓人失去動力，也讓這樣的分享失去了即時性。</p><h4>4.4 讓它令人愉悅</h4><p>書中提到了肥皂和牙膏廠商的例子，通過在產品中加入令人喜愛的氣味，從而培養用戶對洗手和刷牙習慣的好感。如果你也想要讓習慣令人愉悅，要注意你加的必須是即時滿足的愉悅，因爲我們的大腦偏愛即時回報而不是長期回報。</p><blockquote>“ 就不良習慣而言，即時結果通常感覺良好，但最終結果卻不好。就好習慣而言，情況正好相反：即時結果令人不愉快，但是最終結果卻很好。”</blockquote><p>這也解釋了爲什麽培養好習慣那麽困難，但是壞習慣卻輕易習得，因爲我們的大腦天性就是即時享樂。<strong>反之，更加偏好延遲滿足的人往往也能更有成就。</strong></p><p>作者還提到了一個我很喜歡的例子，他說一個股票經紀人每天早上都會在辦公桌上放兩個罐子，其中一個裝滿了120個曲別針，另一個是空的。每當他打完一個推銷電話 ，他就拿出一個曲別針放到隔壁的空罐子裏，直到所有的曲別針都轉移到另一個罐子中才結束。這種將進度轉換為視覺衡量的即時滿足，可以很輕易地應用我們的習慣培養當中。</p><p>除此之外，切記不要讓即時滿足的獎勵，與你的目標發生衝突，比如說你健身后的獎勵是給自己吃一份冰淇淋，那只會讓你的努力失去效果，而如果是偶爾獎勵自己一次全身按摩，這就與你的長期願景相符合。</p><h3>結尾</h3><p>好啦，以上就是我根據個人經驗，以及對《原子習慣》(《Atomic Habit》/《掌控習慣》)的讀後感做出的總結。如果你有看過原書，你應該發現我有一些點沒有細講，比如環境設置和習慣追蹤，這些我覺得可以單開另一個章節來討論，比如習慣追蹤也會跟時間管理扯上關係，環境設置也可以基於以上提出的框架去進行拓展。</p><p>不過這篇文章主要討論的是剛開始自律時的心理準備，我個人認爲有這些理論作爲基礎支撐是非常重要的，因爲想要變得自律的初期會出現很多的小阻礙，這些細小的阻礙可以很容易地消磨你的意志力，還會讓你產生一種 “自己是不是太弱了” 的負面認同，讓習慣很容易在初期就草草結束了。</p><p>而如何去理解並正視這些困難，運用一定的框架去分析它，才會讓你在習慣培養的過程中保持一個健康的心態，讓一切問題都迎刃而解。最後，謝謝你讀到這裏！</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fbutton.like.co%2Fin%2Fembed%2Franblog%2Fbutton&amp;display_name=LikeCoin&amp;url=https%3A%2F%2Fbutton.like.co%2Fin%2Flike%2Franblog&amp;image=https%3A%2F%2Fstorage.googleapis.com%2Flikecoin-foundation.appspot.com%2Flikecoin_store_user_ranblog_main%3FGoogleAccessId%3Dfirebase-adminsdk-eyzut%2540likecoin-foundation.iam.gserviceaccount.com%26Expires%3D2430432000%26Signature%3DwwyukvidR7O6INMsyAIiaji1lBm8A%252BD0E1WYI9%252Fbi4q00HHh4y6JEbMMQIB1CFcoilMrEc5OQv288AeEzeVJDG5fYhLYrZWlKrF%252Fzn43uje94kyLn7tmcZ6DBLpAvEyvnWPNqq2RJ0D7lYbVeeiIMIH1Hw3W8Btl029%252FNoSf6TqMbjpxl7Mhdz5Mr%252BaB2gu51lZC%252B6D%252Bk8J6D0uOcxYXTz5dEne9Y0erk9tEgNiru%252FFtuRyXUNpQnvXWGR958fkDNCwQN6CXFdXxPFrlN38m9jbKHDOwHzXBtYuSROUiwHLAVw%252B7vvPSQGeHUN2GI8HAuBgR5Ee551E8W1Syidp%252BkQ%253D%253D&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=like" width="360" height="212" frameborder="0" scrolling="no"><a href="https://medium.com/media/530161b042dfd84e2d392f5b86fc87bc/href">https://medium.com/media/530161b042dfd84e2d392f5b86fc87bc/href</a></iframe><p><strong>如果喜歡的話，也可以</strong><a href="https://liker.land/ranblog/civic"><strong>請我喝杯咖啡</strong></a><strong>支持我噢！😊</strong></p><h4>書籍購買（聯盟鏈接 / Affiliate Link）</h4><p>我個人覺得《原子習慣》(《Atomic Habit》/《掌控習慣》) 這本書還是很值得買來一看的，書中也有些我沒提到的例子和觀點。如果你感興趣的話，可以使用我的聯盟鏈接，謝謝！</p><p><strong>京東：</strong></p><ul><li>【掌控习惯】（簡體中文）：<a href="https://union-click.jd.com/jdc?e=&amp;p=JF8BAL0JK1olXDYCV1lfCEsTAl9MRANLAjZbERscSkAJHTdNTwcKBlMdBgABFksUBG0IG18UQl9HCANtYCxuURgObCFwDmBBTjhdTytuSzdoXVcZbQcyVF9cCkseA2YNH2slXQEyAjBdCUoWAmkNHFwVbQcyVFleAE4RBmoAHlwQXDYFVFdtWhJUWzdKRBMlbTYBZG5tCHsUMy1mGF8cXgQCVl4OWEtABj0BE1MUDwEHVQ5cXU8VUTxdHVolXwcDUFc"><strong>鏈接</strong></a></li></ul><p><strong>亞馬遜（Amazon）：</strong></p><ul><li>【Atomic Habits】（英文版 / 有Kindle）：<a href="https://amzn.to/3gCqZxQ"><strong>鏈接</strong></a></li><li>【原子習慣】（繁體中文 / 有Kindle）：<a href="https://amzn.to/30xfKkC"><strong>鏈接</strong></a></li><li>【掌控习惯】（簡體中文）：<a href="https://amzn.to/31lIgEQ"><strong>鏈接</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1165425ffdda" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>