<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>未分類 | Men of Letters（メン・オブ・レターズ） &#8211; 論理的思考/業務改善/プログラミング</title>
	<atom:link href="https://laboratory.kazuuu.net/category/%E6%9C%AA%E5%88%86%E9%A1%9E/feed/" rel="self" type="application/rss+xml" />
	<link>https://laboratory.kazuuu.net</link>
	<description></description>
	<lastBuildDate>Thu, 28 Mar 2024 20:41:00 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://laboratory.kazuuu.net/wp-content/uploads/2021/02/cropped-L-32x32.png</url>
	<title>未分類 | Men of Letters（メン・オブ・レターズ） &#8211; 論理的思考/業務改善/プログラミング</title>
	<link>https://laboratory.kazuuu.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>Amazon開発者ポータルへの登録（アカウント作成）</title>
		<link>https://laboratory.kazuuu.net/register-for-the-amazon-developer-portal-create-an-account/</link>
					<comments>https://laboratory.kazuuu.net/register-for-the-amazon-developer-portal-create-an-account/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Thu, 28 Mar 2024 20:41:00 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=16349</guid>

					<description><![CDATA[Amazon開発者ポータルへの登録（アカウント作成）について解説します。 Amazon開発者ポータルへの登録はまず、AVS Dashboard（https://developer.amazon.com/alexa/con [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Amazon開発者ポータルへの登録（アカウント作成）について解説します。</p>
<p>Amazon開発者ポータルへの登録はまず、AVS Dashboard（<a href="https://developer.amazon.com/alexa/console/avs">https://developer.amazon.com/alexa/console/avs</a>）にアクセスします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.10.13.png"><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-16350" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.10.13-276x300.png" alt="" width="276" height="300" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.10.13-276x300.png 276w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.10.13-942x1024.png 942w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.10.13-768x835.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.10.13.png 1250w" sizes="(max-width: 276px) 100vw, 276px" /></a></p>
<p>アクセスするとログイン画面が表示されます。今回は事前に作成しておいたAmazonアカウント情報（Eメールまたは携帯電話番号、パスワード）を入力し「ログイン」ボタンをクリックします。</p>
<p>クリックするとAmazonアカウントの登録したEメールに「amazon.com, action needed: Sign-in attempt」というメールが届きますので、本文に表示されたverification codeを、ログイン後の画面に入力し認証を行います。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.16.40.png"><img decoding="async" class="alignnone size-medium wp-image-16351" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.16.40-219x300.png" alt="" width="219" height="300" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.16.40-219x300.png 219w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.16.40.png 552w" sizes="(max-width: 219px) 100vw, 219px" /></a></p>
<p>認証を行うと、Amazon開発者ポータルが表示されます。ページ内で開発者情報を入力します。まずは「名前」と「姓名」を入力します。入力後、「国／地域」で「↓」ボタンをクリックします。クリックすると、国と地域が表示されますので、この中から「日本」を選択します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.20.51.png"><img decoding="async" class="alignnone size-medium wp-image-16352" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.20.51-300x283.png" alt="" width="300" height="283" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.20.51-300x283.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.20.51.png 542w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>選択後、「開発者名」を入力します。入力後、「開発者名（ふりがな）」を入力します。入力後、「電話番号」を入力します。まずは「↓」をクリックするとプルダウンメニューで国番号が一覧で表示されますので「JP（+81）」を選択後、右側の入力欄に電話番号を入力します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.25.01.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16353" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.25.01-300x120.png" alt="" width="300" height="120" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.25.01-300x120.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.25.01-1024x410.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.25.01-768x308.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.25.01.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>入力後、「Eメールアドレス」を入力します。入力後、カスタマーサポート用Eメールアドレスを入力しますが、「Eメールアドレス」で入力したものと同じに設定する場合は、「上記の [Eメールアドレス] を使用する」にチェックを入れます。今回はこれを適用します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.29.19.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16355" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.29.19-300x199.png" alt="" width="300" height="199" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.29.19-300x199.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.29.19-1024x681.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.29.19-768x511.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.29.19.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>その後、「連絡先情報」の項目へ移動し、「番地」、「市区町村」、「都道府県」、「郵便番号」を入力します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.32.32.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16356" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.32.32-300x59.png" alt="" width="300" height="59" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.32.32-300x59.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.32.32-1024x200.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.32.32-768x150.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.32.32.png 1248w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>入力後、「Amazon Developer Services Agreement」の項目へ移動し、「Amazon Developer Services Agreement」のリンクをクリックします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.34.14.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16357" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.34.14-300x141.png" alt="" width="300" height="141" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.34.14-300x141.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.34.14-1024x483.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.34.14-768x362.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.34.14.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>クリックすると「Amazon Developer Services Agreement（Amazonデベロッパーサービス契約）」の内容が表示されますので、翻訳ツールなどを用いて内容を確認し、「同意」ボタンをクリックします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.35.54.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16358" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.35.54-300x73.png" alt="" width="300" height="73" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.35.54-300x73.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.35.54-768x186.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.35.54.png 896w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>クリックすると、「次の内容を確認し、同意しました： Amazon Developer Services Agreement」にチェックが入ります。チェック後、「送信」ボタンをクリックします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.39.43.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16359" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.39.43-300x258.png" alt="" width="300" height="258" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.39.43-300x258.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.39.43-768x662.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.39.43.png 889w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>クリックすると、「Amazon開発者ポータルへようこそ」と表示されますので、ページ内の「コンソールの利用を開始」ボタンをクリックします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.47.05.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16360" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.47.05-300x195.png" alt="" width="300" height="195" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.47.05-300x195.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.47.05-1024x665.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.47.05-768x498.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-15-14.47.05.png 1476w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>クリックすると、Amazon開発者ポータルのダッシュボードが表示されます。これでAmazon開発者ポータルへの登録（アカウント作成）が完了となります。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/register-for-the-amazon-developer-portal-create-an-account/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>関数アノテーション（Function Annotation）の構文</title>
		<link>https://laboratory.kazuuu.net/function-annotation-syntax/</link>
					<comments>https://laboratory.kazuuu.net/function-annotation-syntax/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Sat, 04 Nov 2023 20:41:05 +0000</pubDate>
				<category><![CDATA[Python【初歩から現場実務的なもの】]]></category>
		<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=14846</guid>

					<description><![CDATA[関数アノテーション（Function Annotation）の構文について解説します。 目次 ■関数アノテーション（Function Annotation）の構文■構文の例■構文の例（その2） ■関数アノテーション（Fu [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>関数アノテーション（Function Annotation）の構文について解説します。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-4" checked><label class="toc-title" for="toc-checkbox-4">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■関数アノテーション（Function Annotation）の構文</a><ol><li><a href="#toc2" tabindex="0">■構文の例</a></li><li><a href="#toc3" tabindex="0">■構文の例（その2）</a></li></ol></li></ol>
    </div>
  </div>

<h2><span id="toc1">■関数アノテーション（Function Annotation）の構文</span></h2>
<p>まずは、関数アノテーション（Function Annotation）の構文の例を書きます。</p>
<h3><span id="toc2">■構文の例</span></h3>
<pre>def func(a:＜expression＞, b:＜expression＞ ) -&gt; ＜expression＞:
     pass</pre>
<p>今回はdef文を用いてfunctという関数を定義します。括弧内にはaとbという引数,パラメータを設定しますが、この際に関数アノテーション（Function Annotation）を用いて引数,パラメータの説明をすることができます。今回は説明として「＜expression＞」と記述してあります。</p>
<p>そして、関数の戻り値の型は、今回「-&gt; ＜expression＞」と記述してあります。「＜expression＞」は、データ型などを記述し説明することもできます。多くの場合では、関数アノテーション（Function Annotation）は、関数の引数,パラメータのデータ型と、関数の戻り値の型を示すために使用されます。</p>
<h3><span id="toc3">■構文の例（その2）</span></h3>
<pre>def func_add(num1: int, num2: int=1) -&gt; int :
    return num1 + num2</pre>
<p>なお、構文の例（その2）のように、デフォルト値（今回の場合は「1」）を持つ引数,パラメータを記述する場合は、引数,パラメータのデフォルト値の前に必ず関数アノテーション（Function Annotation）を記述しなければいけない。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/function-annotation-syntax/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ネストされたデータ構造に対するパスベースの操作などができる「glom」のインストール</title>
		<link>https://laboratory.kazuuu.net/installation-of-glom-for-path-based-operations-on-nested-data-structures-etc/</link>
					<comments>https://laboratory.kazuuu.net/installation-of-glom-for-path-based-operations-on-nested-data-structures-etc/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 20:37:03 +0000</pubDate>
				<category><![CDATA[Python【初歩から現場実務的なもの】]]></category>
		<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=14815</guid>

					<description><![CDATA[Pythonでネストされたデータ構造に対するパスベースの操作などができるライブラリ「glom」のインストールについて解説しています。 「glom（https://github.com/mahmoud/glom,https [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Pythonでネストされたデータ構造に対するパスベースの操作などができるライブラリ「glom」のインストールについて解説しています。</p>
<p>「glom（<a href="https://github.com/mahmoud/glom">https://github.com/mahmoud/glom</a>,<a href="https://github.com/mahmoud/glom">https://glom.readthedocs.io/en/latest/index.html</a>）」は、Python 用に設計されたデータ変換ライブラリで、軽量な宣言型データの変換などが行える。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-6" checked><label class="toc-title" for="toc-checkbox-6">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■Python</a></li><li><a href="#toc2" tabindex="0">■glomをインストールする</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■Python</span></h2>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-8343" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949-300x197.png" alt="" width="300" height="197" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949-300x197.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949-1024x671.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949-768x503.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回のPythonのバージョンは、「3.8.5」を使用しています。（Windows10）（pythonランチャーでの確認）</p>
<h2><span id="toc2">■glomをインストールする</span></h2>
<p>glomをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。</p>
<pre>pip install glom</pre>
<p>起動後、上記のコマンドを入力し、Enterキーを押します。</p>
<p>なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、バージョンの切り替えを行います。</p>
<pre>py -3.8 -m pip install glom</pre>
<p>切り替えるために、上記のコマンドを入力し、Enterキーを押します。</p>
<pre>Defaulting to user installation because normal site-packages is not writeable
Collecting glom
Downloading glom-23.1.1-py2.py3-none-any.whl (102 kB)
---------------------------------------- 102.6/102.6 kB 982.6 kB/s eta 0:00:00
Collecting boltons&gt;=19.3.0
Using cached boltons-21.0.0-py2.py3-none-any.whl (193 kB)
Requirement already satisfied: attrs in c:\users\user_\appdata\roaming\python\python38\site-packages (from glom) (22.2.0)
Collecting face==20.1.1
Downloading face-20.1.1-py3-none-any.whl (51 kB)
---------------------------------------- 51.1/51.1 kB ? eta 0:00:00
Installing collected packages: boltons, face, glom
Successfully installed boltons-21.0.0 face-20.1.1 glom-23.1.1</pre>
<p>Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、glomが正常にインストールされたことになります。</p>
<p>なお、今回はglomのバージョン23.1.1をインストールしました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/installation-of-glom-for-path-based-operations-on-nested-data-structures-etc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pipedreamの登録と無料アカウントを作成する</title>
		<link>https://laboratory.kazuuu.net/register-with-pipedream-and-create-a-free-account/</link>
					<comments>https://laboratory.kazuuu.net/register-with-pipedream-and-create-a-free-account/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Wed, 10 May 2023 03:27:49 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=16214</guid>

					<description><![CDATA[「Pipedream」のアカウント登録を行ってみます。「Pipedream」は、APIを驚くほど高速に接続できる開発者向けのローコード統合プラットフォームである。 まずはWebブラウザで「Pipedream（https: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>「Pipedream」のアカウント登録を行ってみます。「Pipedream」は、APIを驚くほど高速に接続できる開発者向けのローコード統合プラットフォームである。</p>
<p>まずはWebブラウザで「Pipedream（<a href="https://pipedream.com/">https://pipedream.com/</a>）」にアクセスします。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16215" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-11.58.53-300x123.png" alt="" width="300" height="123" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-11.58.53-300x123.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-11.58.53-1024x419.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-11.58.53-768x315.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-11.58.53.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>アクセスすると、Webサイト上に「Try Pipedream For Free」、もしくは「Sign Up Free!」のボタンがありますので、いずれかをクリックします。</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-16216 size-medium" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.01.49-250x300.png" alt="" width="250" height="300" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.01.49-250x300.png 250w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.01.49-854x1024.png 854w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.01.49-768x920.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.01.49.png 1250w" sizes="(max-width: 250px) 100vw, 250px" /></p>
<p>クリックすると、「Sign Up（<a href="https://pipedream.com/auth/signup">https://pipedream.com/auth/signup</a>）」のページへ移動します。ページ内には「Create your free account（無料アカウントを作成する）」と書かれており、「Sign up with Google（Googleアカウントを用いて作成する）」、「Sign up with GitHub（GitHubアカウントを用いて作成する）」、またはお持ちのEmail（メールアドレス）とPassword（パスワード）を入力し登録する方法があります。なお、アカウントの作成する際は、「By signing up, you agree to Pipedream&#8217;s Terms of Service and Privacy Policy.（登録することで、Pipedreamの利用規約とプライバシーポリシーに同意したことになります。）」と表記されているので、利用規約とプライバシーポリシーを翻訳ツールを用いて確認することを推奨します。</p>
<p>今回は「Sign up with Google（Googleアカウントを用いて作成する）」をクリックし、アカウントの作成を行います。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16217" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.06.10-189x300.png" alt="" width="189" height="300" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.06.10-189x300.png 189w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.06.10-646x1024.png 646w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.06.10-768x1218.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.06.10-969x1536.png 969w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.06.10.png 1250w" sizes="(max-width: 189px) 100vw, 189px" /></p>
<p>クリックすると、「Googleにログイン」というフォームが表示され「アカウントの選択」でお持ちのアカウントが表示されますので、アカウントを選択します。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16218" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.09.38-300x129.png" alt="" width="300" height="129" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.09.38-300x129.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.09.38-1024x441.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.09.38-768x331.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.09.38.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>選択すると、Confirm Workspace（<a href="https://pipedream.com/auth/confirm-workspace">https://pipedream.com/auth/confirm-workspace</a>）へ移動します。ページ内では「Create a Workspace」と書かれており、「Workspace Name」にワークスペースの名前を入力します。入力後、「Continue」ボタンをクリックします。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16219" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.15.11-1-267x300.png" alt="" width="267" height="300" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.15.11-1-267x300.png 267w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.15.11-1-910x1024.png 910w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.15.11-1-768x864.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.15.11-1.png 1250w" sizes="(max-width: 267px) 100vw, 267px" /></p>
<p>クリックすると、「Invite members」のページへ移動します。このページでは「Invite members to your workspace（ワークスペースにメンバーを招待する）」と書かれており、グループメールやチャットで招待リンクを共有したり、個々のユーザーをメールで招待できますが、今回は「Skip」ボタンをクリックし、スキップします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.18.36.png"><img loading="lazy" decoding="async" class="alignnone wp-image-16221 size-large" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.18.36-1024x474.png" alt="" width="1024" height="474" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.18.36-1024x474.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.18.36-300x139.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.18.36-768x355.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.18.36-1536x711.png 1536w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.18.36.png 1543w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></p>
<p>クリックすると、「Untitled Workflow」のページへ移動します。これでアカウントの作成は完了となり、Workflowを作成することができます。なお、アカウントの作成の際に登録したメールアドレスには「Confirm your email address」というメールが届いており、「Please verify your email by clicking this link:」で記載されているURLをクリックすると、下記のページが表示されます。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16222" src="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.23.51-300x168.png" alt="" width="300" height="168" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.23.51-300x168.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.23.51-1024x572.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.23.51-768x429.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.23.51-120x68.png 120w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.23.51-160x90.png 160w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.23.51-320x180.png 320w, https://laboratory.kazuuu.net/wp-content/uploads/2023/05/スクリーンショット-2023-05-10-12.23.51.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>「Your email has been verified!（あなたのメールアドレスが確認されました!）」と表示されています。これでメールでの認証が完了となります。完了後、「Continue」ボタンをクリックして、Workflowなどの作成を行います。</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/register-with-pipedream-and-create-a-free-account/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PythonでJs2Pyを使用しJavascriptを実行する</title>
		<link>https://laboratory.kazuuu.net/using-js2py-in-python-to-execute-javascript/</link>
					<comments>https://laboratory.kazuuu.net/using-js2py-in-python-to-execute-javascript/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Wed, 08 Sep 2021 21:47:58 +0000</pubDate>
				<category><![CDATA[Python【初歩から現場実務的なもの】]]></category>
		<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=10432</guid>

					<description><![CDATA[PythonでJs2Pyを使用しJavascriptを実行してみます。 Js2Pyは、Pythonの標準ライブラリではありませんので、事前にインストールする必要があります。 目次 ■Python■Js2Pyを使用しJav [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>PythonでJs2Pyを使用しJavascriptを実行してみます。</p>
<p>Js2Pyは、Pythonの標準ライブラリではありませんので、<a href="https://laboratory.kazuuu.net/install-js2py-library-that-can-convert-javascript-to-python-code">事前にインストールする必要</a>があります。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-10" checked><label class="toc-title" for="toc-checkbox-10">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■Python</a></li><li><a href="#toc2" tabindex="0">■Js2Pyを使用しJavascriptを実行する</a><ol><li><a href="#toc3" tabindex="0">■コード</a></li></ol></li><li><a href="#toc4" tabindex="0">■実行・検証</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■Python</span></h2>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-8343" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949-300x197.png" alt="" width="300" height="197" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949-300x197.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949-1024x671.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949-768x503.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-15-072949.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回のPythonのバージョンは、「3.8.5」を使用しています。（Windows10）（pythonランチャーでの確認）</p>
<h2><span id="toc2">■Js2Pyを使用しJavascriptを実行する</span></h2>
<p>では、早速Js2Pyを使用しJavascriptを実行するスクリプトを書いていきます。</p>
<h3><span id="toc3">■コード</span></h3>
<pre>import js2py

code_1 = "function f(x) {return x*x;}"
request_1 = js2py.eval_js(code_1)

print(request_1(2))</pre>
<p>Js2Pyを使用しJavascriptを実行するためには、importでjs2pyを呼び出します。その後に、code_1という変数を定義します。変数内にJavaScriptの関数を定義します。今回はfという関数（function）を定義し、関数の引数,パラメータをxとします。関数を呼び出した際に実行する処理を中括弧”{}”の中に記述します。実行する処理は引数,パラメータとして渡した値を、算術演算子を使用し、”*（乗算・掛け算）”します。乗算・掛け算した結果をreturnを用いて値を返します。</p>
<p>code_1変数にJavaScriptの関数を定義し格納後、request_1という変数を定義します。変数内では、js2py.eval_js()関数を使用し、括弧内には引数,パラメーターとしてcode_1を渡します。これでPythonでJavaScriptを変換、実行することができます。</p>
<p>最後に、今回定義したJavaScriptの関数を呼び出すために、request_1変数に対してprint()関数を使用します。呼び出す際に、request_1の括弧内に、引数,パラメータとして数値を渡します。定義したJavaScriptの関数の処理が実行され、実行された結果を出力することができます。</p>
<h2><span id="toc4">■実行・検証</span></h2>
<p>このスクリプトを「py_js.py」という名前で、Pythonが実行されている作業ディレクトリ（カレントディレクトリ）に保存し、コマンドプロンプトから実行してみます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/08/スクリーンショット-2021-08-23-140458-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-10434" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/08/スクリーンショット-2021-08-23-140458-1-300x202.png" alt="" width="300" height="202" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/08/スクリーンショット-2021-08-23-140458-1-300x202.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/08/スクリーンショット-2021-08-23-140458-1-1024x688.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/08/スクリーンショット-2021-08-23-140458-1-768x516.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/08/スクリーンショット-2021-08-23-140458-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>実行してみると、Js2Pyを使用したことで、今回定義したJavaScriptの関数を呼び出され、関数内に記述した処理が実行され、実行された処理の結果をprint()関数で出力させることができました</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/using-js2py-in-python-to-execute-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHPのarray_key_exists()関数を使用し指定されたキーが配列に存在するか確認する</title>
		<link>https://laboratory.kazuuu.net/using-phps-array_key_exists-function-to-check-if-a-given-key-exists-in-an-array/</link>
					<comments>https://laboratory.kazuuu.net/using-phps-array_key_exists-function-to-check-if-a-given-key-exists-in-an-array/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Sat, 19 Jun 2021 22:28:10 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=9243</guid>

					<description><![CDATA[PHPのarray_key_exists()関数を使用し指定されたキーが配列に存在するか確認してみます。 array_key_exists()関数は、指定されたキーが配列に存在するかチェックすることができます。キーが存在 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>PHPのarray_key_exists()関数を使用し指定されたキーが配列に存在するか確認してみます。</p>
<p>array_key_exists()関数は、指定されたキーが配列に存在するかチェックすることができます。キーが存在する場合はTRUE（真）を返し、キーが存在しない場合はFALSE（偽）を返します。</p>
<p>配列を指定するときにキーをセットしないと、「0」から始まり、値ごとに1ずつ増加する整数キーが生成され、整数キーと値がセットになります。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-12" checked><label class="toc-title" for="toc-checkbox-12">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■基本的な構文</a></li><li><a href="#toc2" tabindex="0">■環境</a></li><li><a href="#toc3" tabindex="0">■PHPのarray_key_exists()関数を使用し指定されたキーが配列に存在するか確認する</a><ol><li><a href="#toc4" tabindex="0">■コード</a></li><li><a href="#toc5" tabindex="0">■実行</a></li><li><a href="#toc6" tabindex="0">■日本語の場合</a></li><li><a href="#toc7" tabindex="0">■コード（check_if_key_exists_array_2.php）</a></li><li><a href="#toc8" tabindex="0">■コード（check_if_key_exists_array_3.php）</a></li><li><a href="#toc9" tabindex="0">■実行</a></li></ol></li></ol>
    </div>
  </div>

<h2><span id="toc1">■基本的な構文</span></h2>
<pre>array_key_exists(key, array)</pre>
<p>keyは、配列内のキーを指定します。</p>
<p>arrayは、指定されたキーが存在するか確認するために、配列を指定します。</p>
<h2><span id="toc2">■環境</span></h2>
<p>・Windows10</p>
<p>・XAMPP 8.0.6</p>
<p>・PHP Version 8.0.6</p>
<h2><span id="toc3">■PHPのarray_key_exists()関数を使用し指定されたキーが配列に存在するか確認する</span></h2>
<p>では、PHPのarray_key_exists()関数を使用し指定されたキーが配列に存在するか確認するスクリプトを書いていきます。</p>
<h3><span id="toc4">■コード</span></h3>
<pre><code>&lt;html lang="ja"&gt; 
&lt;head&gt; 
&lt;title&gt;array_key_exists()関数を使用し指定されたキーが配列に存在するか確認する&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
$str = array("a"=&gt; "apple", "b"=&gt;"banana","c"=&gt;"lemon");
if(array_key_exists("b",$str)){
    echo "キーが存在します。";
}else {
    echo "キーが存在しません。";
}
?&gt;
&lt;/html&gt;</code></pre>
<p>今回は、strという変数を宣言し、その中でarray()関数を使用します。array()関数内の引数,パラメーターとして、キーと値（文字列）をセットにして渡します。これで配列が作成されます。</p>
<p>作成後、if文を使用し、括弧内にarray_key_exists()関数を使用します。array_key_exists()関数の括弧内の第1引数,パラメーターとして、配列内で存在を確認するキーを渡します。第2引数,パラメーターとして、str変数を渡します。これで指定されたキーが配列に存在するかの確認が行われます。array_key_exists()関数でTRUE（真）,条件を満たす場合は、echo文による文字列（キーが存在します）が出力されます。</p>
<p>一方で、array_key_exists()関数でFALSE（偽）,条件を満たさない場合は、echo文による文字列（キーが存在しません）が出力されます。</p>
<h3><span id="toc5">■実行</span></h3>
<p>では、このスクリプトを「check_if_key_exists_array.php」という名前で保存し、実行させてみます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-071752-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-9244" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-071752-1-300x125.png" alt="" width="300" height="125" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-071752-1-300x125.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-071752-1-1024x428.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-071752-1-768x321.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-071752-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>実行してみると、array_key_exists()関数を使用したことで、配列内で指定されたキーが存在するかの確認が行われ、今回のスクリプトの場合は、TRUE（真）,条件を満たすので、echo文による文字列（キーが存在します）が出力されました。</p>
<h3><span id="toc6">■日本語の場合</span></h3>
<p>次に、キーと値（文字列）が日本語の場合に、array_key_exists()関数を使用してみます。</p>
<h3><span id="toc7">■コード（check_if_key_exists_array_2.php）</span></h3>
<pre><code>&lt;html lang="ja"&gt; 
&lt;head&gt; 
&lt;title&gt;array_key_exists()関数を使用し指定されたキーが配列に存在するか確認する&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
$str = array("た"=&gt; "田中", "お"=&gt;"岡本","す"=&gt;"鈴木");
if(array_key_exists("た",$str)){
    echo "キーが存在します。";
}else {
    echo "キーが存在しません。";
}
?&gt;
&lt;/html&gt;</code></pre>
<h3><span id="toc8">■コード（check_if_key_exists_array_3.php）</span></h3>
<pre><code>&lt;html lang="ja"&gt; 
&lt;head&gt; 
&lt;title&gt;array_key_exists()関数を使用し指定されたキーが配列に存在するか確認する&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
$str = array("山"=&gt; "山梨", "大"=&gt;"大阪","東"=&gt;"東京");
if(array_key_exists("東",$str)){
    echo "キーが存在します。";
}else {
    echo "キーが存在しません。";
}
?&gt;
&lt;/html&gt;</code></pre>
<h3><span id="toc9">■実行</span></h3>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072458-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-9245" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072458-1-300x112.png" alt="" width="300" height="112" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072458-1-300x112.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072458-1-1024x383.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072458-1-768x287.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072458-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>「check_if_key_exists_array_2.php」を実行してみると、指定されたキーがひらがなであっても、配列に存在するか確認できました。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072705-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-9246" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072705-1-300x132.png" alt="" width="300" height="132" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072705-1-300x132.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072705-1-1024x449.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072705-1-768x337.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/06/スクリーンショット-2021-06-20-072705-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>「check_if_key_exists_array_3.php」を実行してみると、指定されたキーが漢字であっても、配列に存在するか確認できました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/using-phps-array_key_exists-function-to-check-if-a-given-key-exists-in-an-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pythonを使用しマークダウンをHTMLに変換する</title>
		<link>https://laboratory.kazuuu.net/converting-markdown-to-html-using-python/</link>
					<comments>https://laboratory.kazuuu.net/converting-markdown-to-html-using-python/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Wed, 26 May 2021 21:55:58 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=8278</guid>

					<description><![CDATA[Pythonを使用しマークダウンをHTMLに変換してみます。 目次 ■Python■サードパーティ製のライブラリ「gh-md-to-html」を使用する■gh-md-to-htmlをインストールする■マークダウンをHTM [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Pythonを使用しマークダウンをHTMLに変換してみます。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-14" checked><label class="toc-title" for="toc-checkbox-14">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■Python</a></li><li><a href="#toc2" tabindex="0">■サードパーティ製のライブラリ「gh-md-to-html」を使用する</a><ol><li><a href="#toc3" tabindex="0">■gh-md-to-htmlをインストールする</a></li></ol></li><li><a href="#toc4" tabindex="0">■マークダウンをHTMLに変換する</a><ol><li><a href="#toc5" tabindex="0">■コード</a></li><li><a href="#toc6" tabindex="0">■実行</a></li></ol></li></ol>
    </div>
  </div>

<h2><span id="toc1">■Python</span></h2>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-072454-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-8279" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-072454-1-300x64.png" alt="" width="300" height="64" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-072454-1-300x64.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-072454-1-1024x220.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-072454-1-768x165.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-072454-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回のPythonのバージョンは、「3.6.8」を使用しています。（Windows10）（pythonランチャーでの確認）</p>
<pre>ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
instagram-private-api-extensions 0.3.8 requires moviepy==0.2.3.2, but you have moviepy 1.0.3 which is incompatible.
instabot 0.117.0 requires requests&gt;=2.22.0, but you have requests 2.21.0 which is incompatible.
instabot 0.117.0 requires six&gt;=1.14.0, but you have six 1.12.0 which is incompatible.
instabot 0.117.0 requires urllib3&gt;=1.25.7, but you have urllib3 1.24.3 which is incompatible</pre>
<p>バージョン「3.8.5」だと、上記のエラーが発生したので、「3.6.8」でインストールを行う。「gh-md-to-html」を使用するには、Python3.6が良い。</p>
<h2><span id="toc2">■サードパーティ製のライブラリ「gh-md-to-html」を使用する</span></h2>
<p>今回、Pythonを使用しマークダウンをHTMLに変換を行いますが、変換する際にサードパーティ製のライブラリ「gh-md-to-html」（<a href="https://github.com/phseiff/github-flavored-markdown-to-html">https://github.com/phseiff/github-flavored-markdown-to-html</a>）を使用します。</p>
<h3><span id="toc3">■gh-md-to-htmlをインストールする</span></h3>
<p>gh-md-to-htmlをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。</p>
<pre>pip install gh-md-to-html</pre>
<p>起動後、上記のコマンドを入力し、Enterキーを押します。</p>
<p>なお、今回は、pythonランチャーを使用しており、Python Version 3.6.8にインストールを行うために、pipを使う場合にはコマンドでの切り替えを行います。</p>
<pre>py -3.6 -m pip install gh-md-to-html</pre>
<p>切り替えるために、上記のコマンドを入力し、Enterキーを押します。</p>
<pre>Collecting gh-md-to-html
  Downloading https://files.pythonhosted.org/packages/f6/40/d56acfcdd20d2e7195701a1b9e52d414ad3fdf57a4aaa935769346dae9ef/gh_md_to_html-1.11.10-py3-none-any.whl (59kB)
    100% |████████████████████████████████| 61kB 952kB/s
Collecting beautifulsoup4 (from gh-md-to-html)
  Using cached https://files.pythonhosted.org/packages/d1/41/e6495bd7d3781cee623ce23ea6ac73282a373088fcd0ddc809a047b18eae/beautifulsoup4-4.9.3-py3-none-any.whl
Requirement already satisfied: requests in c:\users\user\appdata\roaming\python\python36\site-packages (from gh-md-to-html) (2.21.0)
Collecting shellescape (from gh-md-to-html)
  Downloading https://files.pythonhosted.org/packages/d0/f4/0081137fceff5779cd4205c1e96657e41cc2d2d56c940dc8eeb6111780f7/shellescape-3.8.1-py2.py3-none-any.whl
Collecting Pillow&gt;=8.0.1 (from gh-md-to-html)
  Downloading https://files.pythonhosted.org/packages/cf/f7/124c119cf1d4a95dd15913038aba427ab30b7220ec47d2c5617cf56db7cb/Pillow-8.2.0-cp36-cp36m-win_amd64.whl (2.2MB)
    100% |████████████████████████████████| 2.2MB 2.6MB/s
Collecting webcolors (from gh-md-to-html)
  Downloading https://files.pythonhosted.org/packages/12/05/3350559de9714b202e443a9e6312937341bd5f79f4e4f625744295e7dd17/webcolors-1.11.1-py3-none-any.whl
Collecting soupsieve&gt;1.2; python_version &gt;= "3.0" (from beautifulsoup4-&gt;gh-md-to-html)
  Downloading https://files.pythonhosted.org/packages/36/69/d82d04022f02733bf9a72bc3b96332d360c0c5307096d76f6bb7489f7e57/soupsieve-2.2.1-py3-none-any.whl
Requirement already satisfied: idna&lt;2.9,&gt;=2.5 in c:\users\user\appdata\roaming\python\python36\site-packages (from requests-&gt;gh-md-to-html) (2.8)
Requirement already satisfied: chardet&lt;3.1.0,&gt;=3.0.2 in c:\users\user\appdata\roaming\python\python36\site-packages (from requests-&gt;gh-md-to-html) (3.0.4)
Requirement already satisfied: certifi&gt;=2017.4.17 in c:\users\user\appdata\roaming\python\python36\site-packages (from requests-&gt;gh-md-to-html) (2020.12.5)
Requirement already satisfied: urllib3&lt;1.25,&gt;=1.21.1 in c:\users\user\appdata\roaming\python\python36\site-packages (from requests-&gt;gh-md-to-html) (1.24.3)
Installing collected packages: soupsieve, beautifulsoup4, shellescape, Pillow, webcolors, gh-md-to-html
Could not install packages due to an EnvironmentError: [WinError 5] アクセスが拒否されました。: 'C:\\Program Files\\Python36\\Lib\\site-packages\\soupsieve'
Consider using the `--user` option or check the permissions.</pre>
<p>Enterキーを押すと、インストールが開始され、「Could not install packages due to an EnvironmentError: [WinError 5] アクセスが拒否されました。」というエラーが表示されました。</p>
<pre>py -3.6 -m pip install gh-md-to-html --user</pre>
<p>エラーの問題を解決するために、上記のコマンドを入力し、Enterキーを押す。</p>
<pre>Collecting gh-md-to-html
Using cached https://files.pythonhosted.org/packages/f6/40/d56acfcdd20d2e7195701a1b9e52d414ad3fdf57a4aaa935769346dae9ef/gh_md_to_html-1.11.10-py3-none-any.whl
Collecting webcolors (from gh-md-to-html)
Using cached https://files.pythonhosted.org/packages/12/05/3350559de9714b202e443a9e6312937341bd5f79f4e4f625744295e7dd17/webcolors-1.11.1-py3-none-any.whl
Collecting beautifulsoup4 (from gh-md-to-html)
Using cached https://files.pythonhosted.org/packages/d1/41/e6495bd7d3781cee623ce23ea6ac73282a373088fcd0ddc809a047b18eae/beautifulsoup4-4.9.3-py3-none-any.whl
Collecting shellescape (from gh-md-to-html)
Using cached https://files.pythonhosted.org/packages/d0/f4/0081137fceff5779cd4205c1e96657e41cc2d2d56c940dc8eeb6111780f7/shellescape-3.8.1-py2.py3-none-any.whl
Requirement already satisfied: requests in c:\users\user\appdata\roaming\python\python36\site-packages (from gh-md-to-html) (2.21.0)
Collecting Pillow&gt;=8.0.1 (from gh-md-to-html)
Using cached https://files.pythonhosted.org/packages/cf/f7/124c119cf1d4a95dd15913038aba427ab30b7220ec47d2c5617cf56db7cb/Pillow-8.2.0-cp36-cp36m-win_amd64.whl
Collecting soupsieve&gt;1.2; python_version &gt;= "3.0" (from beautifulsoup4-&gt;gh-md-to-html)
Using cached https://files.pythonhosted.org/packages/36/69/d82d04022f02733bf9a72bc3b96332d360c0c5307096d76f6bb7489f7e57/soupsieve-2.2.1-py3-none-any.whl
Requirement already satisfied: urllib3&lt;1.25,&gt;=1.21.1 in c:\users\user\appdata\roaming\python\python36\site-packages (from requests-&gt;gh-md-to-html) (1.24.3)
Requirement already satisfied: certifi&gt;=2017.4.17 in c:\users\user\appdata\roaming\python\python36\site-packages (from requests-&gt;gh-md-to-html) (2020.12.5)
Requirement already satisfied: idna&lt;2.9,&gt;=2.5 in c:\users\user\appdata\roaming\python\python36\site-packages (from requests-&gt;gh-md-to-html) (2.8)
Requirement already satisfied: chardet&lt;3.1.0,&gt;=3.0.2 in c:\users\user\appdata\roaming\python\python36\site-packages (from requests-&gt;gh-md-to-html) (3.0.4)
Installing collected packages: webcolors, soupsieve, beautifulsoup4, shellescape, Pillow, gh-md-to-html
Successfully installed Pillow-8.2.0 beautifulsoup4-4.9.3 gh-md-to-html-1.11.10 shellescape-3.8.1 soupsieve-2.2.1 webcolors-1.11.1</pre>
<p>Enterキーを押すと、インストールが開始され、「Successfully installed」と表示されました。エラーは表示されなかったので、正常にインストールが完了する。</p>
<h2><span id="toc4">■マークダウンをHTMLに変換する</span></h2>
<p>完了後、gh-md-to-htmlを使用しマークダウンをHTMLに変換するスクリプトを書いていきます。</p>
<h3><span id="toc5">■コード</span></h3>
<pre>import gh_md_to_html

html = gh_md_to_html.main(r'C:\Users\user\test\test.txt')

print(html)</pre>
<p>インポートでgh-md-to-htmlモジュールを呼び出します。その後にhtmlという変数を作成し、その中でgh_md_to_html.main()関数を使用します。括弧内にはマークダウンファイルを指定します。指定後、格納。</p>
<p>格納後、HTMLに変換されたマークダウンをprint関数で出力します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-073811-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-8281" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-073811-1-300x245.png" alt="" width="300" height="245" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-073811-1-300x245.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-073811-1-1024x835.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-073811-1-768x627.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-073811-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>なお、今回は「test.txt」というテキストファイル内に上記のコードを記述し、保存しています。フォルダパスは「C:\Users\user\test」です。ちなみにファイルは、.mdファイルも使用することができます。</p>
<h3><span id="toc6">■実行</span></h3>
<p>このスクリプトを「markdown_conversion.py」という名前で保存し、コマンドプロンプトから実行してみます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-074325-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-8282" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-074325-1-300x158.png" alt="" width="300" height="158" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-074325-1-300x158.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-074325-1-1024x541.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-074325-1-768x406.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-12-074325-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>実行してみると、今回指定したマークダウンファイル（テキストファイル）がHTMLに変換されて出力されることを確認できました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/converting-markdown-to-html-using-python/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHPのfilemtime()関数を使用しファイルの最終変更時刻を取得する</title>
		<link>https://laboratory.kazuuu.net/obtaining-the-last-modification-time-of-a-file-using-phps-filemtime-function/</link>
					<comments>https://laboratory.kazuuu.net/obtaining-the-last-modification-time-of-a-file-using-phps-filemtime-function/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Thu, 20 May 2021 22:23:26 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=8488</guid>

					<description><![CDATA[PHPのfilemtime()関数を使用しファイルの最終変更時刻を取得してみます。 filemtime()関数は、ファイルの内容が最後に変更された時刻を取得することができます。 なお、ファイルの内容が最後に変更された時刻 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>PHPのfilemtime()関数を使用しファイルの最終変更時刻を取得してみます。</p>
<p>filemtime()関数は、ファイルの内容が最後に変更された時刻を取得することができます。</p>
<p>なお、ファイルの内容が最後に変更された時刻はUnix タイムスタンプで返され、失敗した場合は FALSE（偽）を返します。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-16" checked><label class="toc-title" for="toc-checkbox-16">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■基本的な構文</a></li><li><a href="#toc2" tabindex="0">■環境</a></li><li><a href="#toc3" tabindex="0">■PHPのfilemtime()関数を使用しファイルの最終変更時刻を取得する</a><ol><li><a href="#toc4" tabindex="0">■コード</a></li><li><a href="#toc5" tabindex="0">■実行</a></li></ol></li></ol>
    </div>
  </div>

<h2><span id="toc1">■基本的な構文</span></h2>
<pre>filemtime(filename)</pre>
<p>filenameは、最終変更時刻を確認するファイルのパスを指定します。</p>
<h2><span id="toc2">■環境</span></h2>
<p>・Windows10</p>
<p>・XAMPP 8.0.6</p>
<p>・PHP Version 8.0.6</p>
<h2><span id="toc3">■PHPのfilemtime()関数を使用しファイルの最終変更時刻を取得する</span></h2>
<p>では、早速PHPのfilemtime()関数を使用しファイルの最終変更時刻を取得してみます。</p>
<h3><span id="toc4">■コード</span></h3>
<pre><code>&lt;html lang="ja"&gt; 
&lt;head&gt; 
&lt;title&gt;filemtime()関数を使用しファイルの最終変更時刻を取得する&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
echo filemtime("test.txt");
echo "&lt;br&gt;";
echo "ファイルの最終変更時刻 :".date("y-m-d h:m:s",filemtime("test.txt"));

?&gt;
&lt;/html&gt;</code></pre>
<p>今回は、filemtime()関数を使用し、人間が読めない形であるUnixタイムスタンプをecho文を使用し出力してみます。</p>
<p>その後、date()関数を使用し、指定した日時（y-m-d h:m:s）に変換し、人間が読める形で日時を、echo文を使用し出力してみます。date()関数では、第1の引数,パラメーターに日時（y-m-d h:m:s）を渡し、第2の引数,パラメーターにfilemtime()関数を渡します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071802-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-8489" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071802-1-300x242.png" alt="" width="300" height="242" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071802-1-300x242.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071802-1-1024x827.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071802-1-768x620.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071802-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>なお、filemtime()関数で、最終変更時刻を取得するファイルは「test.txt」というテキストファイルをあらかじめ用意しました。ファイルの中身は空となっています。</p>
<h3><span id="toc5">■実行</span></h3>
<p>では、このスクリプトを「lastmodifiedtime_file.php」という名前で保存し、実行させてみます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071909-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-8490" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071909-1-300x147.png" alt="" width="300" height="147" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071909-1-300x147.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071909-1-1024x501.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071909-1-768x375.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/05/スクリーンショット-2021-05-21-071909-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>実行してみると、まずはfilemtime()関数を使用したことで、ファイルの最終変更時刻が取得され「1621291482」というUnixタイムスタンプという形で最終変更時刻が出力されました。</p>
<p>このUnixタイムスタンプを、date()関数を使用することで、人間が読める形に変換し、最終変更時刻を出力させることができました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/obtaining-the-last-modification-time-of-a-file-using-phps-filemtime-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHPのコードを別のPHPファイルに含めinclude_once()関数を使用しファイルを呼び出す</title>
		<link>https://laboratory.kazuuu.net/include-php-code-in-another-php-file-and-use-the-include_once-function-to-call-the-file/</link>
					<comments>https://laboratory.kazuuu.net/include-php-code-in-another-php-file-and-use-the-include_once-function-to-call-the-file/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Tue, 27 Apr 2021 23:41:34 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=7956</guid>

					<description><![CDATA[PHPのコードを別のPHPファイルに含めinclude_once()関数を使用しファイルを呼び出してみます。 include_once()関数は、include()と同じですが、唯一の変更点は、他のファイルからのスクリプ [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>PHPのコードを別のPHPファイルに含めinclude_once()関数を使用しファイルを呼び出してみます。</p>
<p>include_once()関数は、<a href="https://laboratory.kazuuu.net/include-php-code-in-another-php-file-and-use-include-to-call-the-file">include()</a>と同じですが、唯一の変更点は、他のファイルからのスクリプトが既に存在する場合、それを再度含めることはなく、ファイルは一度だけ取り込まれます。</p>
<p>誤って同じファイル（関数やクラスのファイル）を<a href="https://laboratory.kazuuu.net/include-php-code-in-another-php-file-and-use-include-to-call-the-file">include()</a>や<a href="https://laboratory.kazuuu.net/include-php-code-in-another-php-file-and-use-require-to-call-the-file">require()</a>を、コード内に複数回含め取り込む場合、競合やエラーが発生する可能性があります。このような状況を防ぐために、include_once()関数を使用します。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-18" checked><label class="toc-title" for="toc-checkbox-18">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■環境</a></li><li><a href="#toc2" tabindex="0">■PHPでinclude_once()関数を使用し別のPHPファイルを呼び出す</a><ol><li><a href="#toc3" tabindex="0">■コード（script_1.php）</a></li><li><a href="#toc4" tabindex="0">■コード（script_2.php）</a></li><li><a href="#toc5" tabindex="0">■実行</a></li><li><a href="#toc6" tabindex="0">■include()を複数回使用した場合</a></li><li><a href="#toc7" tabindex="0">■コード（script_3.php）</a></li><li><a href="#toc8" tabindex="0">■コード（script_2.php）</a></li><li><a href="#toc9" tabindex="0">■実行</a></li></ol></li></ol>
    </div>
  </div>

<h2><span id="toc1">■環境</span></h2>
<p>・Windows10</p>
<p>・WampServer Version 3.2.3 64bit</p>
<p>・PHP Version 7.3.21</p>
<h2><span id="toc2">■PHPでinclude_once()関数を使用し別のPHPファイルを呼び出す</span></h2>
<p>では、PHPでinclude_once()関数を使用し別のPHPファイルを呼び出してみます。</p>
<h3><span id="toc3">■コード（script_1.php）</span></h3>
<pre><code>&lt;?php
include_once("C:/wamp64/www/project/script_2.php");
include_once("C:/wamp64/www/project/script_2.php");
?&gt;</code></pre>
<h3><span id="toc4">■コード（script_2.php）</span></h3>
<pre><code>&lt;?php
echo "こんにちは"."&lt;br&gt;";
echo "よい天気ですね"."&lt;br&gt;";
?&gt;</code></pre>
<p>今回は、script_2.phpというファイルを作成し、include_once()関数を使用し、このファイルを別のPHP（script_1.php）から呼び出してみます。</p>
<p>なお、script_2.phpというファイルの中身には、echo文で文字列を出力するという処理を記述しています。</p>
<h3><span id="toc5">■実行</span></h3>
<p>では、このスクリプトを「script_1.php」という名前で保存し、実行させてみます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-075636-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-7957" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-075636-1-300x157.png" alt="" width="300" height="157" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-075636-1-300x157.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-075636-1-1024x535.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-075636-1-768x401.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-075636-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>実行させてみると、script_2.phpというファイルの中身が取り込まれ、echo文で文字列を出力されました。</p>
<blockquote><p>こんにちは</p>
<p>よい天気ですね</p>
<p>こんにちは</p>
<p>よい天気ですね</p></blockquote>
<p>出力されましたが、本来であればinclude_once()関数を2回使用しているので、上記のようにscript_2.phpというファイルの中身が2回取り込まれ、echo文で出力される文字列は4回になるはずですが、2番目は取り込まれず無視され、echo文で出力される文字列は2回のみとなります。</p>
<h3><span id="toc6">■include()を複数回使用した場合</span></h3>
<p>では、次にinclude()とinclude_once()関数の違いを理解するために、include()を複数回使用してみます。</p>
<h3><span id="toc7">■コード（script_3.php）</span></h3>
<pre><code>&lt;?php
include("C:/wamp64/www/project/script_2.php");
include("C:/wamp64/www/project/script_2.php");
?&gt;</code></pre>
<h3><span id="toc8">■コード（script_2.php）</span></h3>
<pre><code>&lt;?php
echo "こんにちは"."&lt;br&gt;";
echo "よい天気ですね"."&lt;br&gt;";
?&gt;</code></pre>
<p>先ほどのコード（script_1.php）のinclude_once()関数の部分をinclude()に変更します。</p>
<h3><span id="toc9">■実行</span></h3>
<p>では、このスクリプトを「script_3.php」という名前で保存し、実行させてみます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-082807-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-7958" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-082807-1-300x145.png" alt="" width="300" height="145" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-082807-1-300x145.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-082807-1-1024x496.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-082807-1-768x372.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-28-082807-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>実行させてみると、include()関数を使用したことで、include_once()関数とは異なり、script_2.phpというファイルが2回取り込まれ、echo文での文字列の出力も4回となりました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/include-php-code-in-another-php-file-and-use-the-include_once-function-to-call-the-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Webブラウザで「マイナポータルAPが無効になりました」というエラーが表示された場合の対処</title>
		<link>https://laboratory.kazuuu.net/what-to-do-when-the-error-message-myna-portal-ap-has-been-disabled-is-displayed-in-the-web-browser/</link>
					<comments>https://laboratory.kazuuu.net/what-to-do-when-the-error-message-myna-portal-ap-has-been-disabled-is-displayed-in-the-web-browser/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Fri, 23 Apr 2021 23:10:53 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=7849</guid>

					<description><![CDATA[Webブラウザで「マイナポータルAPが無効になりました」というエラーが表示された場合の対処について解説しています。 目次 ■PC環境■「マイナポータルAPが無効になりました」というエラーが表示される■対処方法■マイナポー [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Webブラウザで「マイナポータルAPが無効になりました」というエラーが表示された場合の対処について解説しています。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-20" checked><label class="toc-title" for="toc-checkbox-20">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■PC環境</a></li><li><a href="#toc2" tabindex="0">■「マイナポータルAPが無効になりました」というエラーが表示される</a></li><li><a href="#toc3" tabindex="0">■対処方法</a></li><li><a href="#toc4" tabindex="0">■マイナポータルAPの確認</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>・Windows10</p>
<p>・GoogleChrome</p>
<h2><span id="toc2">■「マイナポータルAPが無効になりました」というエラーが表示される</span></h2>
<pre>マイナポータルAP が無効になりました 再度有効にするには次の新しい権限を許可してください。
• mp-oss-application-02.herokuapp.com, mp-ossapplication-03.herokuapp.com 上にある自分のデータの読み取りと変更</pre>
<p>GoogleChrome（Webブラウザ）で、「マイナポータルAPが無効になりました」というポップアップが表示されました。</p>
<p>ポップアップの内容を確認すると、「herokuapp.com」のサブドメインのURLが表記されています。</p>
<p>表記されている「herokuapp.com」の名前を確認すると、聞いたこともない名前で、不安になる方もいますが、Heroku（herokuapp.com）とは、アプリケーションの開発から実行、運用までのすべてをクラウドで完結できる PaaS（プラットフォーム）で、<span style="background-color: #ff99cc;">Heroku（herokuapp.com）を使用し、マイナポータルを実行、運用しているので、怪しいサイトではありません。</span>なお、Herokuは2007年にアメリカ合衆国で創業した企業で、2010年にセールスフォース・ドットコム（Salesforce.com）に買収されています。（<a href="https://ja.wikipedia.org/wiki/Heroku">https://ja.wikipedia.org/wiki/Heroku</a>）</p>
<p>なお、セールスフォース・ドットコム（Salesforce.com）は、内閣府「マイナポータル」の電子申請機能「ぴったりサービス」の基盤をSalesforceで構築したことを発表しています。（<a href="https://www.salesforce.com/jp/customer-success-stories/naikaku-kanbou/">https://www.salesforce.com/jp/customer-success-stories/naikaku-kanbou/</a>）</p>
<h2><span id="toc3">■対処方法</span></h2>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075257-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-7850" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075257-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075257-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075257-1-1024x962.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075257-1-768x721.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075257-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>対処方法についてですが、ポップアップ内の「権限を許可」ボタンをクリックします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075457-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-7851" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075457-1-300x245.png" alt="" width="300" height="245" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075457-1-300x245.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075457-1-1024x837.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075457-1-768x628.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075457-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>クリックすると、「権限を許可」したため、GoogleChrome上からポップアップの表示が消えます。これで対処については完了となります。</p>
<h2><span id="toc4">■マイナポータルAPの確認</span></h2>
<p>対処は完了しましたが、権限の許可を行ったため、マイナポータルAPが有効になっているか確認してみます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075857-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-7852" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075857-1-300x295.png" alt="" width="300" height="295" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075857-1-300x295.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075857-1-1024x1008.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075857-1-768x756.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-075857-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>GoogleChrome画面の右上にある「縦に点が3つある箇所」をクリックします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080110-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-7853" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080110-1-300x280.png" alt="" width="300" height="280" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080110-1-300x280.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080110-1-1024x957.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080110-1-768x718.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080110-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>クリックすると、メニューが表示されますので、「その他のツール」をクリックします。続けて、「拡張機能」をクリックします。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080328.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-7854" src="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080328-300x153.png" alt="" width="300" height="153" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080328-300x153.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080328-1024x521.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080328-768x391.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2021/04/スクリーンショット-2021-04-24-080328.png 1362w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>クリックすると、「拡張機能」画面が表示されます。この中に「マイナポータルAP」がありますので、確認します。確認すると、「有効/無効の切り替え」ボタンがありますので、これが青色で表示（有効化）されています。</p>
<p>これでマイナポータルAPが有効になっているかの確認は完了となります。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/what-to-do-when-the-error-message-myna-portal-ap-has-been-disabled-is-displayed-in-the-web-browser/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
