<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>2017 on Simplestory</title><link>https://simplestory.github.io/en/categories/2017/</link><description>Recent content in 2017 on Simplestory</description><generator>Hugo</generator><language>en-us</language><copyright>Simplestory</copyright><lastBuildDate>Fri, 01 Dec 2017 00:00:00 +0000</lastBuildDate><atom:link href="https://simplestory.github.io/en/categories/2017/index.xml" rel="self" type="application/rss+xml"/><item><title>MySQL Data File Paths on Linux</title><link>https://simplestory.github.io/en/posts/20171201_7eec743fae4833726b0d923cf6db1da6/</link><pubDate>Fri, 01 Dec 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20171201_7eec743fae4833726b0d923cf6db1da6/</guid><description>&lt;p&gt;&lt;strong&gt;Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After logging into MySQL, you can use the following command to query where the related files are stored:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;show&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;like&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%dir%&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The output is shown below:&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://simplestory-blog-img.oss-cn-guangzhou.aliyuncs.com/in_posts/20171201/mysql.png" title="mysql"&gt;&lt;/p&gt;
&lt;p&gt;Usually these are:&lt;/p&gt;
&lt;p&gt;The default location of the database files is: &lt;code&gt;/usr/share/mysql/&lt;/code&gt;
Configuration file: &lt;code&gt;/etc/mysql/my.cnf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Database directory: &lt;code&gt;/var/lib/mysql&lt;/code&gt;
Configuration directory: &lt;code&gt;/etc/share/mysql&lt;/code&gt; (mysql.server command and configuration files)
MySQL related commands: &lt;code&gt;/usr/bin&lt;/code&gt;
Startup scripts: &lt;code&gt;/etc/init.d/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;One way to start mysql safely: /usr/bin/mysqld_safe-user=root&amp;amp;&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Some Linux Commands</title><link>https://simplestory.github.io/en/posts/20171107_619e2d5ba49593e40e16667bafdcf2c1/</link><pubDate>Tue, 07 Nov 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20171107_619e2d5ba49593e40e16667bafdcf2c1/</guid><description>Some little-known Linux commands</description></item><item><title>Detecting Traffic Violations with Opencv</title><link>https://simplestory.github.io/en/posts/20171104_bb6e9cb8623b3bf044c62bbbca472d53/</link><pubDate>Sun, 05 Nov 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20171104_bb6e9cb8623b3bf044c62bbbca472d53/</guid><description>&lt;blockquote&gt;
&lt;p&gt;Opencv contains more than 2500 functions, and almost any mature algorithm you can think of can be implemented by calling Opencv&amp;rsquo;s functions, which is super convenient. This post combines Python and Opencv to detect cars in surveillance video and check whether they commit a violation (crossing the double yellow line).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;System environment: Ubuntu16.04LTS+OpenCV3.3.0+Python2.7.12&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="background-extraction"&gt;Background extraction&lt;/h2&gt;
&lt;p&gt;For surveillance the position is relatively fixed, so the background will not change considerably over a long period of time. We can therefore consider using background subtraction to roughly extract the background.&lt;/p&gt;</description></item><item><title>Installing OpenCV on Linux</title><link>https://simplestory.github.io/en/posts/20171020_df3860e05b3ca04bdc2f774c5c1914fd/</link><pubDate>Fri, 20 Oct 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20171020_df3860e05b3ca04bdc2f774c5c1914fd/</guid><description>&lt;blockquote&gt;
&lt;p&gt;Recently, because a project needed computer vision recognition, I started tinkering with OpenCV. Although the installation process was long and winding, the experience of using it together with Python is actually quite good. Here I record the OpenCV installation and compilation process.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;System environment: Ubuntu16.04&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Software installed: OpenCV3.3.0+Python2.7.12&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="updating-the-system-packages"&gt;Updating the system packages:&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ sudo apt update
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ sudo apt upgrade
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="installing-some-developer-tools"&gt;Installing some developer tools:&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ sudo apt-get install build-essential cmake pkg-config
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The pkg-config package is very likely already installed by default, but just in case, add it in as well. The cmake program is used later to compile OpenCV.&lt;/p&gt;</description></item><item><title>Compiling C/C++ under Vscode</title><link>https://simplestory.github.io/en/posts/20171001_f9fd02f8e181115a55cec2936857675c/</link><pubDate>Sun, 01 Oct 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20171001_f9fd02f8e181115a55cec2936857675c/</guid><description>&lt;blockquote&gt;
&lt;p&gt;Visual Studio Code is a lightweight editor released by Microsoft; by installing various plugins it can be turned into a powerful multi-language, cross-platform compiler. Recently, because of practical needs, I had to debug some C/C++ code, so I started tinkering with Vscode. Below is a record of the problems that troubled me during the process.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;The system used in this post is ubuntu16.04LTS&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I will not go into the details of installing Vscode on linux, as Baidu has plenty of resources on that.&lt;/p&gt;</description></item><item><title>Python Classes</title><link>https://simplestory.github.io/en/posts/20170820_7cb802827b60ef8c770d824ec28a65a0/</link><pubDate>Sun, 20 Aug 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20170820_7cb802827b60ef8c770d824ec28a65a0/</guid><description>Life is short, I use Python</description></item><item><title>Python, Object Oriented</title><link>https://simplestory.github.io/en/posts/20170810_3193456a2ce85ef1e01f5a219b37cebd/</link><pubDate>Thu, 10 Aug 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20170810_3193456a2ce85ef1e01f5a219b37cebd/</guid><description>Life is short, I use Python</description></item><item><title>A Basic Git Tutorial</title><link>https://simplestory.github.io/en/posts/20170704_497c40137cedefb55b1afe3bd1e6b13f/</link><pubDate>Tue, 04 Jul 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20170704_497c40137cedefb55b1afe3bd1e6b13f/</guid><description>Some basic Git operations</description></item></channel></rss>