<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AquaCat</title>
    <description>The latest articles on DEV Community by AquaCat (@aquacat).</description>
    <link>https://dev.to/aquacat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F971563%2F25d59121-669e-4bb9-80a5-9b4e05460297.jpg</url>
      <title>DEV Community: AquaCat</title>
      <link>https://dev.to/aquacat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aquacat"/>
    <language>en</language>
    <item>
      <title>【MySQL】When using "NULL" in WHERE CLAUSE</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Mon, 20 Mar 2023 06:59:59 +0000</pubDate>
      <link>https://dev.to/aquacat/mysql-when-using-null-in-where-clause-5chc</link>
      <guid>https://dev.to/aquacat/mysql-when-using-null-in-where-clause-5chc</guid>
      <description>&lt;p&gt;Do not write&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM [table_name] WHERE [column_name]=NULL;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use "IS" for &lt;strong&gt;NULL&lt;/strong&gt;!!!!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM [table_name] WHERE [column_name] IS NULL;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wasted 2hours for this...&lt;/p&gt;

</description>
      <category>mysql</category>
    </item>
    <item>
      <title>【Node.js】How to fix the error "fetch is not defined"</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Mon, 02 Jan 2023 17:49:36 +0000</pubDate>
      <link>https://dev.to/aquacat/nodejs-how-to-fix-the-error-fetch-is-not-defined-52f3</link>
      <guid>https://dev.to/aquacat/nodejs-how-to-fix-the-error-fetch-is-not-defined-52f3</guid>
      <description>&lt;p&gt;Version of node.js...v14.15.4&lt;/p&gt;

&lt;h2&gt;
  
  
  PROBLEM
&lt;/h2&gt;

&lt;p&gt;When I executed query in Apollo Server, I encountered this error message from the server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"errors": [
    {
      "message": "fetch is not defined",
      "locations": [
        {
          "line": 3,
          "column": 1
        }........
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What does this mean? "fetch" is a method that handles request and response in asynchronous communication. Looks like this method is causing this error message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const resolvers = {
    Query: {
        singlePokemon:async(parent, args) =&amp;gt; {
      let res = await fetch(`https://pokeapi.co/api/v2/pokemon/${args.id}`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  SOLUTION
&lt;/h2&gt;

&lt;p&gt;The version of Node before 18 does not have the fetch API. So, you need to install an external module.&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/node-fetch"&gt;https://www.npmjs.com/package/node-fetch&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install node-fetch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>node</category>
      <category>apolloserver</category>
    </item>
    <item>
      <title>【Next.js】How to apply .scss to Next.js project</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Sat, 31 Dec 2022 16:33:35 +0000</pubDate>
      <link>https://dev.to/aquacat/nextjs-how-to-apply-scss-to-nextjs-project-260</link>
      <guid>https://dev.to/aquacat/nextjs-how-to-apply-scss-to-nextjs-project-260</guid>
      <description>&lt;p&gt;Version of Next.js....13.1.1&lt;/p&gt;

&lt;p&gt;I made an app with React.js before and remade it with Next.js. I reused the .scss files that were used for my React.js project. This is how to apply a set of .scss files to Next.js project.&lt;/p&gt;

&lt;h2&gt;
  
  
  1.Install scss into your project directory.
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install sass --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2.Make "scss" directory in "styles" directory and place .scss files in it.
&lt;/h2&gt;

&lt;p&gt;Make sure make the root .scss file that imports the rest of .scss files. (In my project, I named "index.scss.")&lt;/p&gt;

&lt;h2&gt;
  
  
  3.In _app.tsx file, import the root .scss file.
&lt;/h2&gt;

&lt;p&gt;Then, your .scss files are applied.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import '../styles/scss/index.scss';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Where to place images that are used for .scss files
&lt;/h2&gt;

&lt;p&gt;Place the image files in "public" directory. In your .scss files, you can write a path to the image files with a relative path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// styles/scss/index.scss
background-image:url("./../../public/img/earth.jpg");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>nextjs</category>
    </item>
    <item>
      <title>【Node.js】How to manage Node.js of different versions</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Fri, 30 Dec 2022 05:25:35 +0000</pubDate>
      <link>https://dev.to/aquacat/nodejs-how-to-update-nodejs-j53</link>
      <guid>https://dev.to/aquacat/nodejs-how-to-update-nodejs-j53</guid>
      <description>&lt;p&gt;OS...Windows 10&lt;/p&gt;

&lt;p&gt;Here is what I did to manage different versions of node in my PC. You can switch different versions of node depending on your project directories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install "volta" to switch different version of node!"
&lt;/h2&gt;

&lt;p&gt;1.Go to [(&lt;a href="https://docs.volta.sh/guide/getting-started)"&gt;https://docs.volta.sh/guide/getting-started)&lt;/a&gt;].&lt;br&gt;
2.Click "download and run the Windows installer" to download the installer.&lt;br&gt;
3.Click the installer to install volta.&lt;br&gt;
4.Go to your project directory to check your node version.&lt;br&gt;
My node version is v14.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
v14.15.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.Install node of whatever version you like.&lt;br&gt;
I installed the latest one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volta install node @latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.Make sure your desired version of node was installed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volta list node
⚡️ Node runtimes in your toolchain:
    v19.3.0 (default)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks like my original version of node is not on the list, so I added one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volta install node@14.15.4
success: installed and set node@14.15.4 (with npm@6.14.10) as default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I got v14 as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volta list node
⚡️ Node runtimes in your toolchain:

    v14.15.4 (default)
    v19.3.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.You can pin the node in your project directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volta pin node@19.3.0
success: pinned node@19.3.0 (with npm@9.2.0) in package.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this project directory, v19.3.0 is used. On the other hand, in other project directories, v14.15.4 is used.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>【Laravel Sanctum】How to fix an error "BadMethodCallException: Method Illuminate\Auth\RequestGuard::logout does not exist. "</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Sat, 17 Dec 2022 06:04:30 +0000</pubDate>
      <link>https://dev.to/aquacat/laravel-sanctum-how-to-fix-an-error-badmethodcallexception-method-illuminateauthrequestguardlogout-does-not-exist--1oh1</link>
      <guid>https://dev.to/aquacat/laravel-sanctum-how-to-fix-an-error-badmethodcallexception-method-illuminateauthrequestguardlogout-does-not-exist--1oh1</guid>
      <description>&lt;p&gt;Version...&lt;br&gt;
Laravel Framework 8.83.26&lt;br&gt;
Laravel Sanctum 2.11&lt;/p&gt;

&lt;p&gt;An error message below showed up when logging out.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;BadMethodCallException: Method Illuminate\Auth\RequestGuard::logout does not exist. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It says "logout does not exist." Looks like the code "Auth::logout();" has a problem.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Change "Auth::logout();" to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Auth::guard('web')-&amp;gt;logout();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are using API tokens, try code below. (I have not tried this yet!)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Auth::guard('sanctum')-&amp;gt;user()-&amp;gt;tokens()-&amp;gt;delete();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>laravel</category>
      <category>laravelsanctum</category>
    </item>
    <item>
      <title>【XAMPP】How to fix "Error: MySQL shutdown unexpectedly. "</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Sat, 10 Dec 2022 23:58:13 +0000</pubDate>
      <link>https://dev.to/aquacat/xampp-how-to-fix-error-mysql-shutdown-unexpectedly--2afi</link>
      <guid>https://dev.to/aquacat/xampp-how-to-fix-error-mysql-shutdown-unexpectedly--2afi</guid>
      <description>&lt;p&gt;This error happens often in my PC and once it happens your MySQL never starts again.&lt;/p&gt;

&lt;h2&gt;
  
  
  1.Check the error log.
&lt;/h2&gt;

&lt;p&gt;Click [logs] of MySQL in XAMPP control panel and select [mysql_error.log] to check the error messages.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.Check if the port "3306" is used.
&lt;/h2&gt;

&lt;p&gt;Click [Netstat] in XAMPP control panel to check "3306" is already used.&lt;/p&gt;

&lt;h2&gt;
  
  
  3.Restore data in MySQL.
&lt;/h2&gt;

&lt;p&gt;If you can not get any hints to solve the problem, try this step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1&lt;/strong&gt;. Find "mysql"&amp;gt;"data" folder in XAMPP and copy and paste it somewhere to back it up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2&lt;/strong&gt;. Delete files/folders from "mysql"&amp;gt;"data" folder.&lt;br&gt;
&lt;strong&gt;ATTENTION&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;KEEP&lt;/strong&gt; the folders with names of DB that you created from "data" folder. Delete everything else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3&lt;/strong&gt;. Find "mysql"&amp;gt;"backup" folder to copy everything in it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4&lt;/strong&gt;. Paste them in "mysql"&amp;gt;"data".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5&lt;/strong&gt;. Copy "ibdata1" file in "data" folder you backed up in step1,and paste it in "mysql"&amp;gt;"data" folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6&lt;/strong&gt;. Start MySQL in XAMPP control panel.&lt;/p&gt;
&lt;h2&gt;
  
  
  4.Set user password for MySQL.
&lt;/h2&gt;

&lt;p&gt;Once the data is restored, your user password for MySQL is reset. You need to set it again.&lt;br&gt;
First, login to MySQL with no password.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysql -u root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, set the user password.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALTER user 'root'@'localhost' identified by XXXX
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then, you can log in MySQL with your password.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concluion
&lt;/h2&gt;

&lt;p&gt;Good Luck!!&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>【Laravel】How to fix error "file_put_contents: Failed to open stream: No such file or directory"</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Sat, 10 Dec 2022 02:56:35 +0000</pubDate>
      <link>https://dev.to/aquacat/laravel-how-to-fix-error-fileputcontents-failed-to-open-stream-no-such-file-or-directory-4f04</link>
      <guid>https://dev.to/aquacat/laravel-how-to-fix-error-fileputcontents-failed-to-open-stream-no-such-file-or-directory-4f04</guid>
      <description>&lt;p&gt;If you encounter a error message that says "file_put_contents: Failed to open stream: No such file or directory" in Laravel, here is what you should do.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened to my Laravel project
&lt;/h2&gt;

&lt;p&gt;My XAMPP had a problem and never started again. So, I installed a new XAMPP into my PC and moved my Laravel project directory from my old XAMPP to a new one. Then I saw this error message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this error message is shown?
&lt;/h2&gt;

&lt;p&gt;This error message is shown when directories/files/classes are missing in the paths where they were supposed to be by moving directories, changing file names or deleting class names.&lt;/p&gt;

&lt;h2&gt;
  
  
  Execute these commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. php artisan cache:config
&lt;/h3&gt;

&lt;p&gt;In order to speed up processing, Laravel creates cache files according to the settings in .env or files in the config directory. Therefore, as long as Laravel has these cache files, the .env or files in the config directory are not loaded.&lt;br&gt;
Laravel starts creating cache files by executing this command.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.php artisan cache:clear
&lt;/h3&gt;

&lt;p&gt;Laravel deletes the cache files.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.composer dump-autoload -o
&lt;/h3&gt;

&lt;p&gt;Laravel loads the libraries in vendor directory automatically. It makes Laravel reload the classes (defined with namespace).&lt;/p&gt;

&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;My error message has gone!! Yay!!&lt;/p&gt;

</description>
      <category>career</category>
      <category>softwaredevelopment</category>
      <category>discuss</category>
    </item>
    <item>
      <title>【MySQL】How to fix garbled text in command prompt (1)</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Mon, 05 Dec 2022 04:02:23 +0000</pubDate>
      <link>https://dev.to/aquacat/mysql-how-to-fix-garbled-text-in-command-prompt-1-135o</link>
      <guid>https://dev.to/aquacat/mysql-how-to-fix-garbled-text-in-command-prompt-1-135o</guid>
      <description>&lt;p&gt;xampp for Windows...7.4.30&lt;br&gt;
mysql  Ver 15.1&lt;br&gt;
OS...Windows10&lt;/p&gt;

&lt;p&gt;When you need to use special characters (such as Japanese) other than English, the strings might be garbled.&lt;/p&gt;
&lt;h2&gt;
  
  
  What causes text garbling?
&lt;/h2&gt;

&lt;p&gt;There possibly are 2 reasons.&lt;br&gt;
1.Despite that your DB is sending you the data with UTF8, your command prompt is displaying it with encoding cp932.&lt;br&gt;
2.Despite that your DB does not accept two byte characters, you insert(or update) data with two byte character language.&lt;/p&gt;
&lt;h2&gt;
  
  
  Let's check the settings related encoding of your DB.
&lt;/h2&gt;

&lt;p&gt;You can check the encoding for your DB from your command prompt.&lt;br&gt;
1.Log into MySQL.&lt;br&gt;
2.Hit "show variables like 'char%'."&lt;br&gt;
Then you will get the following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MariaDB [(none)]&amp;gt; show variables like 'chara%';
+--------------------------+-------------------------------------+
| Variable_name            | Value                               |
+--------------------------+-------------------------------------+
| character_set_client     | cp932                               |
| character_set_connection | cp932                               |
| character_set_database   | utf8mb4                             |
| character_set_filesystem | binary                              |
| character_set_results    | cp932                               |
| character_set_server     | utf8mb4                             |
| character_set_system     | utf8                                |
| character_sets_dir       | C:\xampp_mama\mysql\share\charsets\ |
+--------------------------+-------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;character_set_client ...The character set for statements that arrive from the client.&lt;/li&gt;
&lt;li&gt;character_set_connection...The server convert the data in the request from the client to this encoding.&lt;/li&gt;
&lt;li&gt;character_set_results...The server sends the results or error messages with this encoding.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*For the details of these variables, see &lt;a href="https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_character_set_server" rel="noopener noreferrer"&gt;https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_character_set_server&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's check the encoding for your command prompt.
&lt;/h2&gt;

&lt;p&gt;1.Open the command prompt.&lt;br&gt;
2.Hit "chcp."&lt;br&gt;
Then you will get the encoding of your command prompt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Active code page: 932 //932 is cp932(Japanese).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For "code page," refer &lt;a href="https://en.wikipedia.org/wiki/Code_page" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Code_page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Or, hit "show character set" to find the encoding that is available for setting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;show character set;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  SOLUTION
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1 Change the encoding settings of your command prompt
&lt;/h3&gt;

&lt;p&gt;If the encoding of your command prompt is cp932 and your DB is sending the results in UTF8, you will see garbled results in your command prompt.&lt;br&gt;
In that case, you need to set the encoding of your command prompt to the same as the one of the DB.&lt;br&gt;
1.Exit MySQL if you are logged in.&lt;br&gt;
2.Hit "chcp 65001". *65001 is utf8.&lt;/p&gt;
&lt;h2&gt;
  
  
  2 Change the encoding settings of your DB from your command prompt
&lt;/h2&gt;

&lt;p&gt;The encoding of my command prompt is cp932. So, I need the DB to send the data in the same encoding (cp932).&lt;br&gt;
1.Log into MySQL.&lt;br&gt;
2.Hit "set names cp932" to change the encoding for&lt;br&gt;
character_set_client,character_set_connection and character_set_results.&lt;br&gt;
Then, you will get following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+--------------------------+-------------------------------------+
| Variable_name            | Value                               |
+--------------------------+-------------------------------------+
| character_set_client     | cp932                               |
| character_set_connection | cp932                               |
| character_set_database   | utf8mb4                             |
| character_set_filesystem | binary                              |
| character_set_results    | cp932                               |
| character_set_server     | utf8mb4                             |
| character_set_system     | utf8                                |
| character_sets_dir       | C:\xampp_mama\mysql\share\charsets\ |
+--------------------------+-------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3 Change "my.ini"
&lt;/h3&gt;

&lt;p&gt;You can also set the encoding for client/server using "my.ini" in MySQL.&lt;br&gt;
To be continued to "【MySQL】How to fix garbled text in command prompt(2) "!!&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>resources</category>
    </item>
    <item>
      <title>【Windows】Difference between User Environment Variables and System Environment Variables</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Fri, 02 Dec 2022 22:53:51 +0000</pubDate>
      <link>https://dev.to/aquacat/windows-difference-between-user-environment-variables-and-system-environment-variables-1fo4</link>
      <guid>https://dev.to/aquacat/windows-difference-between-user-environment-variables-and-system-environment-variables-1fo4</guid>
      <description>&lt;p&gt;When you install new language into your PC (e.g. PHP) , you need to register the path to its directory to set an environment variable for it.&lt;/p&gt;

&lt;p&gt;If you set this variable, you will be able to use the command (such as "php") in your command prompt to order to your program. Otherwise, you will get the message that says "XXX is not recognized as an internal or external command."&lt;/p&gt;

&lt;p&gt;There are 2 types of environment variables.&lt;/p&gt;

&lt;h2&gt;
  
  
  1.User Environment Variables
&lt;/h2&gt;

&lt;p&gt;This is user-specific. It works only for the account that set this variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.System Environment Variables
&lt;/h2&gt;

&lt;p&gt;This is available for all users.&lt;/p&gt;

</description>
      <category>windows</category>
    </item>
    <item>
      <title>【Docker】How to enter container</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Fri, 02 Dec 2022 01:32:40 +0000</pubDate>
      <link>https://dev.to/aquacat/docker-how-to-enter-container-366b</link>
      <guid>https://dev.to/aquacat/docker-how-to-enter-container-366b</guid>
      <description>&lt;p&gt;Docker Desktop Version 4.7.0 (77141)&lt;br&gt;
Engine: 20.10.14 &lt;/p&gt;
&lt;h3&gt;
  
  
  1.Go to the directory where .yml file is.
&lt;/h3&gt;
&lt;h3&gt;
  
  
  2.Hit "docker compose up -d" to start container.
&lt;/h3&gt;
&lt;h3&gt;
  
  
  3.Hit "docker ps" to find ID of the container that you want to enter.
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker ps 
CONTAINER ID   IMAGE                     COMMAND                  CREATED          STATUS          PORTS                    NAMES
f83475cb310e   frontend-project_node     "docker-entrypoint.s…"   39 minutes ago   Up 38 minutes   0.0.0.0:3000-&amp;gt;3000/tcp   frontend-project_node_1
4e1de9c894af   backend-project_backend   "python3 manage.py r…"   56 minutes ago   Up 56 minutes   0.0.0.0:8000-&amp;gt;8000/tcp   backend-project_backend_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  4.Then, hit "docker exec -it  sh."
&lt;/h3&gt;

&lt;p&gt;*"sh" could be replaced by "/bin/bash."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec -it f83475cb310e sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5.Yay!! Entered Docker!!
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/src/app # 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>【Laravel】How to allow cross-origin in Laravel</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Tue, 29 Nov 2022 06:36:34 +0000</pubDate>
      <link>https://dev.to/aquacat/laravel-how-to-allow-cross-origin-in-laravel-373k</link>
      <guid>https://dev.to/aquacat/laravel-how-to-allow-cross-origin-in-laravel-373k</guid>
      <description>&lt;p&gt;*Laravel version...8.75&lt;/p&gt;

&lt;h2&gt;
  
  
  What is cross-origin
&lt;/h2&gt;

&lt;p&gt;"Origin" a combination of "scheme", "hostname" and "port."&lt;br&gt;
If a request is from the same origin as the web server, the server enables web clients to access to it (process their requests). If not, the web server reject the access from them.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to allow cross-origin in Laravel
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1.Install "fruitcake/laravel-cors"
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require fruitcake/laravel-cors
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.Add "laravel-cors" to the global middleware.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//app/Http/Kernel.php
 protected $middleware = [
        \Fruitcake\Cors\HandleCors::class,//&amp;lt;---add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.Create a file to set CORS.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan vendor:publish --tag="cors"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4.Set "allowed_origins_patterns" to "[]" in cors config.
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//config&amp;gt;cors.php
&amp;lt;?php
return [
    'paths' =&amp;gt; ['api/*', 'sanctum/csrf-cookie'],
    'allowed_methods' =&amp;gt; ['*'],
    'allowed_origins' =&amp;gt; ['*'],
     //↓Added
    'allowed_origins_patterns' =&amp;gt; [],
    'allowed_headers' =&amp;gt; ['*'],
    'exposed_headers' =&amp;gt; [],
    'max_age' =&amp;gt; 0,
    'supports_credentials' =&amp;gt; false,
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5.Then your Laravel server allows CORS!!
&lt;/h2&gt;

</description>
      <category>laravel</category>
    </item>
    <item>
      <title>【Java】Notes when you download JDBC driver from MySQL website</title>
      <dc:creator>AquaCat</dc:creator>
      <pubDate>Sun, 27 Nov 2022 06:01:04 +0000</pubDate>
      <link>https://dev.to/aquacat/java-notes-when-you-download-jdbc-driver-from-mysql-website-1gpb</link>
      <guid>https://dev.to/aquacat/java-notes-when-you-download-jdbc-driver-from-mysql-website-1gpb</guid>
      <description>&lt;p&gt;*OS...Windows&lt;/p&gt;

&lt;p&gt;If you are coding with Java for backend, and want to use database, you need to download "JDBC" driver from MySQL website.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is JDBC?
&lt;/h2&gt;

&lt;p&gt;JDBC is an API(Application Programming Interface)that allows Java program access to database (such as Oracle, MySQL ,etc.) &lt;/p&gt;

&lt;h2&gt;
  
  
  What is JDBC driver?
&lt;/h2&gt;

&lt;p&gt;JDBC driver is a collection of classes that includes interfaces (that are defined in JDBC API) and their methods get called when &lt;br&gt;
Java program accesses to database. It makes the program to connect to the database, execute the queries and process the result data.&lt;/p&gt;

&lt;p&gt;You need to use the JDBC driver that corresponds to your database. (Each vendor supplies its JDBC driver.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Download MySQL JDBC driver
&lt;/h2&gt;

&lt;p&gt;1.Go to &lt;a href="https://www.mysql.com/products/connector/"&gt;https://www.mysql.com/products/connector/&lt;/a&gt;.&lt;br&gt;
2.Find "JDBC Driver for MySQL (Connector/J)" and click "Download."&lt;br&gt;
3.Select "&lt;strong&gt;Platform Independent&lt;/strong&gt;." (&amp;lt;---IMPORTANT!!)&lt;br&gt;
4.Click "Download" of whatever file you need.&lt;br&gt;
5.Login/sign up in MySQL (if you have not logged in yet).&lt;br&gt;
6.Starts downloading.&lt;/p&gt;

&lt;p&gt;*If you select "Windows" on step 3, you will find "mysql-installer-web-community". Looks like you can install JDBC driver ("Connector/J") through it. (I have not tried!!)&lt;/p&gt;

</description>
      <category>java</category>
    </item>
  </channel>
</rss>
