Pythonでの並行処理:マルチコアを活かす

IT・プログラミング

Pythonでの並行処理:マルチコアを活かす

  1. 並行処理の基礎:マルチコアを最大限に活かすために
    1. なぜ並行処理が重要なのか?
    2. 並行処理 vs 並列処理:違いを理解する
    3. マルチコアCPUのメリット
    4. Pythonで並行処理を学ぶ:本記事の構成
  2. threading:手軽な並行処理、GILの壁
    1. threadingの基本:スレッドの作成と実行
    2. GIL(Global Interpreter Lock)とは?
      1. なぜGILが存在するのか?
      2. GILの何が問題なのか?
    3. GILの回避策:マルチコアを活かす道
    4. threadingの適切な使い方:まとめ
  3. multiprocessing:真の並列処理、オーバーヘッド
    1. multiprocessingの基本:プロセスの生成と実行
    2. threadingとの違い:メモリ空間とGIL
    3. プロセス間通信(IPC)の方法:Queueを使ってデータを共有する
    4. オーバーヘッド:プロセスの生成とIPCのコスト
    5. Pool:プロセス管理を簡単にする
    6. multiprocessingの適切な使い方:まとめ
  4. asyncio:非同期処理、I/Oバウンドなタスクに最適
    1. asyncioの基本:シングルスレッドで並行処理を実現する
    2. async/await構文:非同期処理をシンプルに記述する
    3. I/Oバウンドなタスクにasyncioが最適な理由:オーバーヘッドの削減とCPU利用率の向上
    4. asyncioの適切な使い方:まとめ
  5. 実践:ケーススタディと最適な並行処理の選択
    1. ケーススタディ1:Webスクレイピング:asyncioとaiohttpの組み合わせ
    2. ケーススタディ2:画像処理:multiprocessingでCPUをフル活用
    3. ケーススタディ3:リアルタイムデータ処理:threadingとキューの連携
    4. 並行処理モデル選択の指針:タスクの特性を見極める
    5. パフォーマンス最大化のヒント:ボトルネックを解消する
    6. まとめ:最適な並行処理戦略を見つけよう

並行処理の基礎:マルチコアを最大限に活かすために

現代のコンピュータは、複数の処理コア(マルチコア)を搭載し、複雑なタスクを効率的にこなせるようになりました。しかし、その性能を最大限に引き出すには、並行処理の理解が不可欠です。本記事では、並行処理の基本概念から、PythonでマルチコアCPUの性能をフルに活用するための具体的な方法までを、徹底的に解説します。

なぜ並行処理が重要なのか?

シングルコアCPUの時代、プログラムはタスクを順番に処理していました。しかし、マルチコアCPUの登場により、複数のタスクを「同時に」実行できるようになりました。これにより、処理速度が飛躍的に向上し、より複雑な処理も現実的な時間で完了できるようになりました。

例えば、動画編集、科学計算、機械学習など、CPUに大きな負荷がかかる処理では、並行処理を活用することで、処理時間を大幅に短縮できます。Webサーバーであれば、多数の同時リクエストを効率的に処理し、Webサイトの応答速度を向上させることが可能です。

並行処理 vs 並列処理:違いを理解する

並行処理(Concurrency)とは、複数のタスクを「同時に進行しているように見せる」技術です。Webブラウザで複数のタブを開いて同時にWebサイトを閲覧したり、音楽を聴きながらドキュメントを作成したりするのも、並行処理の一例です。シングルコアCPUでも実現可能です。

一方、並列処理(Parallelism)とは、複数のタスクを「実際に同時に」実行する技術です。これは、マルチコアCPUのような複数の処理ユニットを持つ環境でのみ実現可能です。各コアが独立してタスクを実行するため、CPUの利用率が向上し、処理時間が大幅に短縮されます。

マルチコアCPUのメリット

マルチコアCPUを活用することで、以下のメリットが得られます。

  • 処理速度の向上: 複数のコアが並列にタスクを実行するため、処理時間が短縮されます。
  • 応答性の向上: バックグラウンドで重い処理を実行しても、UIの操作がスムーズに行えます。
  • リソースの有効活用: CPUの利用率が向上し、システム全体のパフォーマンスが向上します。

Pythonで並行処理を学ぶ:本記事の構成

本記事では、Pythonで並行処理を実現するための主要な3つの方法、threadingmultiprocessingasyncioについて、以下の構成で解説します。

  1. threading: 手軽に並行処理を始めるための基本モジュール。GIL(Global Interpreter Lock)の制約と、その回避策について解説します。
  2. multiprocessing: GILの制約を受けない、真の並列処理を実現するためのモジュール。プロセス間通信(IPC)の方法や、オーバーヘッドについても解説します。
  3. asyncio: シングルスレッドで効率的な並行処理を実現するためのライブラリ。I/Oバウンドなタスクに最適な理由を解説します。
  4. 実践:ケーススタディと最適な並行処理の選択: 具体的なケーススタディを通して、各手法の最適な選択肢を解説し、パフォーマンスを最大化する方法を提案します。

さあ、Pythonで並行処理の世界へ飛び込み、マルチコアCPUのパワーを最大限に引き出しましょう!

threading:手軽な並行処理、GILの壁

Pythonで並行処理を始めるなら、threadingモジュールが手軽な選択肢の一つです。threadingを使うと、あたかも複数のタスクが同時に実行されているかのように見せかけることができます。これは、プログラムの中で複数の「スレッド」を生成し、それぞれのスレッドに異なる処理を割り当てることで実現されます。

threadingの基本:スレッドの作成と実行

threadingモジュールを使うと、簡単にスレッドを作成し、実行することができます。以下は、threadingを使った簡単なコード例です。

“`python
import threading
import time

def task(name):
print(f”スレッド{name}: 開始”)
time.sleep(2) # 2秒間スリープ
print(f”スレッド{name}: 終了”)

# スレッドの作成と実行
thread1 = threading.Thread(target=task, args=(“A”,))
thread2 = threading.Thread(target=task, args=(“B”,))

thread1.start()
thread2.start()

thread1.join()
thread2.join()

print(“すべてのスレッドが終了しました”)
“`

この例では、task関数を2つのスレッドで実行しています。thread1.start()thread2.start()でスレッドを開始し、thread1.join()thread2.join()でスレッドの終了を待ちます。これにより、task関数が(見かけ上)並行に実行されます。

実行結果

“`
スレッドA: 開始
スレッドB: 開始
スレッドA: 終了
スレッドB: 終了
すべてのスレッドが終了しました
“`

GIL(Global Interpreter Lock)とは?

threadingモジュールは手軽で便利な反面、GIL(Global Interpreter Lock)という制約があります。GILとは、CPythonインタープリタ(標準的なPythonの実装)が持つ仕組みで、一度に一つのスレッドしかPythonバイトコードを実行できないようにするものです。

なぜGILが存在するのか?

GILは、CPythonのメモリ管理を簡素化し、スレッドセーフを確保するために導入されました。しかし、その代償として、CPUバウンドなタスクにおける並列処理の恩恵を受けられないというデメリットがあります。

GILの何が問題なのか?

GILの存在が、CPUバウンドなタスク(計算処理が中心のタスク)において、threadingを使った並行処理の効果を大きく制限します。例えば、画像を処理するようなCPUを酷使するタスクを複数のスレッドで実行しても、実際には一つのコアしか使用されないため、処理速度はほとんど向上しません。

GILの回避策:マルチコアを活かす道

GILの制約を回避し、マルチコアCPUの性能を最大限に引き出すためには、いくつかの方法があります。

  1. multiprocessingモジュールを使う: multiprocessingモジュールを使うと、複数のプロセスを生成し、各プロセスが独立したメモリ空間を持つため、GILの制約を受けずに真の並列処理を実現できます。CPUバウンドなタスクには、multiprocessingが適しています。
  2. I/Oバウンドなタスクにthreadingを使う: I/Oバウンドなタスク(ネットワーク通信、ファイルアクセスなど)では、スレッドがI/O待ちの間はGILが解放されるため、threadingでもある程度の並行性を実現できます。I/O待ちの間に別のスレッドが実行されるため、全体の処理時間を短縮できます。
  3. NumPyなどのC拡張ライブラリを使う: NumPyなどのCで記述された拡張ライブラリは、内部でGILを解放して並列処理を行うものがあります。これらのライブラリを使うことで、GILの制約を受けずに高速な処理が可能です。
  4. JythonやIronPythonなどのGILを持たないPython実装を使う: CPython以外のPython実装(Jython、IronPythonなど)は、GILを持たないため、CPUバウンドなタスクでも並列処理の効果を期待できます。

threadingの適切な使い方:まとめ

threadingモジュールは、手軽に並行処理を実装できる便利なツールですが、GILの制約があることを理解しておく必要があります。I/Oバウンドなタスクにはthreading、CPUバウンドなタスクにはmultiprocessingというように、タスクの特性に応じて適切なモジュールを選択することが、PythonでマルチコアCPUの性能を最大限に引き出すための鍵となります。

次のセクションでは、GILの制約を受けないmultiprocessingについて解説します。

multiprocessing:真の並列処理、オーバーヘッド

threadingで並行処理を試してみたけど、思ったより速くならない…」と感じたことはありませんか?それは、PythonのGIL(Global Interpreter Lock)という制約が原因かもしれません。GILは、一度に一つのスレッドしかPythonバイトコードを実行できないようにする仕組みです。そのため、CPUバウンドな処理では、threadingを使っても複数のコアをフルに活用できず、並列処理の効果を十分に得られないのです。

そこで登場するのがmultiprocessingモジュールです。multiprocessingは、複数のプロセスを生成することで、GILの制約を回避し、真の並列処理を実現します。各プロセスは独立したメモリ空間を持つため、複数のCPUコア上で同時にPythonコードを実行できます。

multiprocessingの基本:プロセスの生成と実行

multiprocessingモジュールを使うと、簡単にプロセスを生成し、実行することができます。以下は、multiprocessingを使った簡単なコード例です。

“`python
import multiprocessing

def worker(num):
“””各プロセスで実行される関数”””
print(f’Worker {num}: プロセスIDは {multiprocessing.current_process().pid}’)

if __name__ == ‘__main__’:
processes = []
for i in range(multiprocessing.cpu_count()): # CPUのコア数だけプロセスを生成
p = multiprocessing.Process(target=worker, args=(i,))
processes.append(p)
p.start()

for p in processes:
p.join()
“`

上記の例では、multiprocessing.cpu_count()でCPUのコア数を取得し、その数だけプロセスを生成しています。各プロセスはworker関数を実行し、自身のプロセスIDを表示します。

実行結果

“`
Worker 0: プロセスIDは 1234
Worker 1: プロセスIDは 1235
Worker 2: プロセスIDは 1236
Worker 3: プロセスIDは 1237
“`

threadingとの違い:メモリ空間とGIL

threadingmultiprocessingの主な違いは、以下の通りです。

  • 並列処理の実現方法: threadingは1つのプロセス内で複数のスレッドを管理しますが、multiprocessingは複数のプロセスを生成します。
  • GILの影響: threadingはGILの影響を受けますが、multiprocessingは受けません。
  • メモリ空間: threadingはメモリを共有しますが、multiprocessingは共有しません。
  • オーバーヘッド: プロセスの生成には、スレッドの生成よりも大きなオーバーヘッドがかかります。

これらの違いから、CPUバウンドなタスクにはmultiprocessing、I/Oバウンドなタスクにはthreadingまたはasyncioが適していると言えます。

プロセス間通信(IPC)の方法:Queueを使ってデータを共有する

multiprocessingでは、各プロセスが独立したメモリ空間を持つため、プロセス間でデータを共有するためには、特別な仕組みが必要です。これをプロセス間通信(IPC: Inter-Process Communication)と呼びます。

multiprocessingモジュールには、様々なIPCの手段が用意されています。ここでは、最も基本的なIPCの手段であるQueueを使った例を紹介します。

“`python
from multiprocessing import Process, Queue

def producer(queue):
“””データを生成してキューに入れる”””
for i in range(5):
queue.put(i)
print(f’Producer: {i}をキューに入れました’)

def consumer(queue):
“””キューからデータを取り出して処理する”””
while True:
item = queue.get()
if item is None:
break
print(f’Consumer: {item}をキューから取り出しました’)

if __name__ == ‘__main__’:
queue = Queue()
p = Process(target=producer, args=(queue,))
c = Process(target=consumer, args=(queue,))
p.start()
c.start()
p.join()
queue.put(None) # キューに終了の合図を送る
c.join()
“`

この例では、Queueを使って、producerプロセスが生成したデータをconsumerプロセスが処理しています。producerプロセスは、キューにデータを入れ終わったら、Noneをキューに入れて、consumerプロセスに終了を知らせます。

実行結果

“`
Producer: 0をキューに入れました
Producer: 1をキューに入れました
Producer: 2をキューに入れました
Producer: 3をキューに入れました
Producer: 4をキューに入れました
Consumer: 0をキューから取り出しました
Consumer: 1をキューから取り出しました
Consumer: 2をキューから取り出しました
Consumer: 3をキューから取り出しました
Consumer: 4をキューから取り出しました
“`

オーバーヘッド:プロセスの生成とIPCのコスト

multiprocessingは、GILの制約を回避できる強力なツールですが、オーバーヘッドも伴います。

  • プロセスの生成: プロセスの生成には、スレッドの生成よりも時間がかかります。
  • プロセス間通信: プロセス間通信には、データのシリアライズ・デシリアライズのオーバーヘッドがかかります。プロセス間でデータをやり取りする際には、データをネットワークを通じて送受信できる形式に変換する必要があります。この変換処理をシリアライズと呼び、受信側で元のデータ形式に戻す処理をデシリアライズと呼びます。

そのため、タスクの処理時間が短い場合や、プロセス間通信の頻度が高い場合は、multiprocessingのオーバーヘッドが無視できなくなる可能性があります。そのような場合は、threadingasyncioなど、他の並行処理モデルを検討する方が良いでしょう。

Pool:プロセス管理を簡単にする

Poolを使うことで、プロセス管理を簡単にすることができます。

“`python
from multiprocessing import Pool

def square(x):
“””引数の2乗を計算する”””
return x * x

if __name__ == ‘__main__’:
with Pool(processes=4) as pool:
numbers = [1, 2, 3, 4, 5]
results = pool.map(square, numbers)
print(f’Results: {results}’)
“`

この例では、Poolを使って4つのプロセスを生成し、numbersリストの各要素に対してsquare関数を並列に実行しています。pool.map()を使うことで、複数の引数を並列に処理し、結果をリストとして取得できます。

実行結果

“`
Results: [1, 4, 9, 16, 25]
“`

multiprocessingの適切な使い方:まとめ

multiprocessingは、CPUバウンドなタスクを並列化するための強力なツールです。しかし、オーバーヘッドも考慮して、適切な並行処理モデルを選択することが重要です。

次のセクションでは、I/Oバウンドなタスクに最適なasyncioについて解説します。

asyncio:非同期処理、I/Oバウンドなタスクに最適

Pythonで効率的な並行処理を実現するもう一つの強力な武器が、asyncioライブラリです。特に、ネットワーク通信やファイルアクセスなど、I/O待ち時間が長いタスク(I/Oバウンドなタスク)において、その真価を発揮します。

asyncioの基本:シングルスレッドで並行処理を実現する

asyncioは、シングルスレッドで複数のタスクをあたかも同時に実行しているかのように見せる仕組みを提供します。ここで重要なのは、スレッドやプロセスを新たに生成するのではなく、イベントループと呼ばれる機構がタスクの実行を効率的に管理する点です。

async/await構文:非同期処理をシンプルに記述する

asyncioの中核となるのが、asyncawaitという2つのキーワードです。

  • async def: async defで定義された関数はコルーチンと呼ばれ、非同期的に実行できる関数であることを示します。
  • await: awaitキーワードは、I/O処理などの完了を待つ際に使用します。awaitを実行すると、イベントループは一時的にコルーチンの実行を中断し、その間に他のタスクを実行します。I/O処理が完了すると、awaitで中断されたコルーチンが処理を再開します。

以下は、asyncioaiohttpライブラリを使って、非同期的にHTTPリクエストを送信する例です。

“`python
import asyncio
import aiohttp

async def fetch_url(session, url):
async with session.get(url) as response:
return await response.text()

async def main():
async with aiohttp.ClientSession() as session:
html = await fetch_url(session, ‘https://www.example.com’)
print(html[:50]) # 最初の50文字を表示

if __name__ == ‘__main__’:
asyncio.run(main())
“`

上記の例では、fetch_url関数がコルーチンとして定義され、aiohttpライブラリを使って非同期的にHTTPリクエストを送信しています。await response.text()の部分で、レスポンスの受信を待つ間、イベントループは他のタスクに処理を移譲できます。

実行結果

“`



Exa<br /> “`</p> <h3><span id="toc23">I/Oバウンドなタスクにasyncioが最適な理由:オーバーヘッドの削減とCPU利用率の向上</span></h3> <p><code>asyncio</code>がI/Oバウンドなタスクに最適なのは、以下の理由によります。</p> <ol> <li><b>オーバーヘッドの削減</b>: スレッドやプロセスを生成するオーバーヘッドがないため、多数のI/Oタスクを効率的に処理できます。</li> <li><b>CPU利用率の向上</b>: I/O待ち時間中にCPUを他のタスクに割り当てることで、CPUの利用率を最大限に高めます。スレッドのようにコンテキストスイッチのオーバーヘッドも少ないです。</li> </ol> <p>Webサーバー、APIクライアント、データベースアクセスなど、多数の同時接続を処理する必要がある場合に、<code>asyncio</code>は非常に有効な選択肢となります。</p> <h3><span id="toc24">asyncioの適切な使い方:まとめ</span></h3> <p><code>asyncio</code>は、シングルスレッドで効率的な並行処理を実現するための強力なツールです。<code>async</code> / <code>await</code>構文を理解し、イベントループの仕組みを把握することで、I/Oバウンドなタスクを劇的に高速化できます。ネットワークプログラミングの世界では必須の知識と言えるでしょう。</p> <p>次のセクションでは、具体的なケーススタディを通して、<code>threading</code>、<code>multiprocessing</code>、<code>asyncio</code>の最適な選択肢を解説します。</p> <h2><span id="toc25">実践:ケーススタディと最適な並行処理の選択</span></h2> <p>このセクションでは、具体的なケーススタディを通して、<code>threading</code>、<code>multiprocessing</code>、<code>asyncio</code> の最適な選択肢を解説し、Pythonにおける並行処理でパフォーマンスを最大化する方法を提案します。どの並行処理モデルが最も適しているかは、タスクの種類によって大きく異なります。それぞれの特性を理解し、適切な選択をすることで、プログラムの実行速度を飛躍的に向上させることが可能です。</p> <h3><span id="toc26">ケーススタディ1:Webスクレイピング:asyncioとaiohttpの組み合わせ</span></h3> <p>Webスクレイピングは、大量のWebページからデータを収集するタスクです。この処理はI/Oバウンドな性質を持つため、<code>asyncio</code> と <code>aiohttp</code> の組み合わせが非常に有効です。<code>asyncio</code> は非同期処理により、ネットワークI/O待ち時間を有効活用できます。<code>aiohttp</code> は <code>asyncio</code> に対応したHTTPクライアントライブラリであり、複数のリクエストを同時に処理するのに適しています。</p> <p><b>コード例</b></p> <p>“`python<br /> import asyncio<br /> import aiohttp</p> <p>async def fetch_url(session, url):<br /> async with session.get(url) as response:<br /> return await response.text()</p> <p>async def main():<br /> urls = [‘http://example.com’ for _ in range(100)]<br /> async with aiohttp.ClientSession() as session:<br /> tasks = [fetch_url(session, url) for url in urls]<br /> results = await asyncio.gather(*tasks)<br /> print(f’Fetched {len(results)} URLs’)</p> <p>if __name__ == ‘__main__’:<br /> asyncio.run(main())<br /> “`</p> <p><b>実行結果</b></p> <p>“`<br /> Fetched 100 URLs<br /> “`</p> <h3><span id="toc27">ケーススタディ2:画像処理:multiprocessingでCPUをフル活用</span></h3> <p>画像処理はCPUバウンドなタスクであり、特に大規模な画像の処理や複雑なフィルタ処理などでは、高い計算能力が求められます。このような場合、<code>multiprocessing</code> が最適です。<code>multiprocessing</code> モジュールを利用することで、複数のCPUコアを最大限に活用し、処理を並列化できます。NumPyなどのライブラリと組み合わせることで、さらに効率的な処理が可能です。</p> <p><b>コード例</b></p> <p>“`python<br /> import multiprocessing<br /> import numpy as np</p> <p>def process_image(image_data):<br /> # 画像処理のロジック<br /> processed_data = np.sqrt(image_data)<br /> return processed_data</p> <p>if __name__ == ‘__main__’:<br /> image_data = np.random.rand(1024, 1024)<br /> with multiprocessing.Pool(processes=4) as pool:<br /> results = pool.map(process_image, [image_data] * 4)<br /> print(‘Image processing complete’)<br /> “`</p> <p><b>実行結果</b></p> <p>“`<br /> Image processing complete<br /> “`</p> <h3><span id="toc28">ケーススタディ3:リアルタイムデータ処理:threadingとキューの連携</span></h3> <p>リアルタイムデータ処理では、連続的にデータを受け取り、処理する必要があります。この場合、<code>threading</code> とキューを組み合わせることで、データの受信と処理を並行して行うことができます。データの受信スレッドがキューにデータを追加し、処理スレッドがキューからデータを取り出して処理します。ただし、CPUバウンドな処理が多い場合は、<code>multiprocessing</code> の方が適している場合もあります。</p> <p><b>コード例</b></p> <p>“`python<br /> import threading<br /> import queue<br /> import time</p> <p>def data_receiver(queue):<br /> while True:<br /> data = “受信データ” # データ受信のロジック<br /> queue.put(data)<br /> time.sleep(0.1)</p> <p>def data_processor(queue):<br /> while True:<br /> data = queue.get()<br /> # データ処理のロジック<br /> print(f’Processed data: {data}’)<br /> queue.task_done()</p> <p>if __name__ == ‘__main__’:<br /> data_queue = queue.Queue()<br /> receiver_thread = threading.Thread(target=data_receiver, args=(data_queue,))<br /> processor_thread = threading.Thread(target=data_processor, args=(data_queue,))</p> <p> receiver_thread.daemon = True # スレッドをデーモン化<br /> processor_thread.daemon = True # スレッドをデーモン化</p> <p> receiver_thread.start()<br /> processor_thread.start()</p> <p> time.sleep(1) # 1秒間実行<br /> “`</p> <p><b>実行結果</b></p> <p>“`<br /> Processed data: 受信データ<br /> Processed data: 受信データ<br /> Processed data: 受信データ<br /> …<br /> “`</p> <h3><span id="toc29">並行処理モデル選択の指針:タスクの特性を見極める</span></h3> <table> <thead> <tr> <th>モデル</th> <th>特徴</th> <th>適切なタスク</th> </tr> </thead> <tbody> <tr> <td><code>threading</code></td> <td>複数のスレッドを生成し、並行処理を実現。I/Oバウンドなタスクに適しているが、GILの影響を受ける。</td> <td>I/Oバウンドなタスク(ネットワーク通信、ファイルアクセスなど)</td> </tr> <tr> <td><code>multiprocessing</code></td> <td>複数のプロセスを生成し、並列処理を実現。CPUバウンドなタスクに適している。</td> <td>CPUバウンドなタスク(数値計算、画像処理など)</td> </tr> <tr> <td><code>asyncio</code></td> <td>シングルスレッドで非同期処理を実現。I/Oバウンドなタスクで、タスク数が多い場合に特に有効。</td> <td>I/Oバウンドなタスク(ネットワーク通信、Webスクレイピングなど)</td> </tr> </tbody> </table> <h3><span id="toc30">パフォーマンス最大化のヒント:ボトルネックを解消する</span></h3> <ul> <li><b>タスクの特性を分析:</b> CPUバウンドかI/Oバウンドかを見極める。</li> <li><b>ボトルネックの特定:</b> プロファイラを使用して、プログラムのボトルネックを特定する。</li> <li><b>適切なライブラリの利用:</b> <code>asyncio</code> には <code>aiohttp</code>、数値計算には NumPy など、タスクに適したライブラリを使用する。</li> <li><b>パフォーマンス測定と改善:</b> 処理時間を測定し、改善を繰り返す。</li> </ul> <h3><span id="toc31">まとめ:最適な並行処理戦略を見つけよう</span></h3> <p>並行処理は、プログラムのパフォーマンスを向上させる強力な手段です。しかし、適切なモデルを選択し、注意深く実装する必要があります。本記事で紹介したケーススタディを参考に、自身のタスクに最適な並行処理戦略を見つけてください。そして、マルチコアCPUのパワーを最大限に引き出し、高速で効率的なプログラムを実現しましょう。</p> </div> <footer class="article-footer entry-footer"> <div class="entry-categories-tags ctdt-one-row"> <div class="entry-categories"><a class="cat-link cat-link-26" href="https://lifetechia.com/category/it-programming/"><span class="fa fa-folder cat-icon tax-icon" aria-hidden="true"></span>IT・プログラミング</a><a class="cat-link cat-link-94" href="https://lifetechia.com/category/it-programming/python-study/"><span class="fa fa-folder cat-icon tax-icon" aria-hidden="true"></span>Python学習</a></div> <div class="entry-tags"><a class="tag-link tag-link-227 border-element" href="https://lifetechia.com/tag/%e4%b8%a6%e8%a1%8c%e5%87%a6%e7%90%86/"><span class="fa fa-tag tag-icon tax-icon" aria-hidden="true"></span>並行処理</a><a class="tag-link tag-link-280 border-element" href="https://lifetechia.com/tag/threading/"><span class="fa fa-tag tag-icon tax-icon" aria-hidden="true"></span>threading</a><a class="tag-link tag-link-281 border-element" href="https://lifetechia.com/tag/multiprocessing/"><span class="fa fa-tag tag-icon tax-icon" aria-hidden="true"></span>multiprocessing</a><a class="tag-link tag-link-828 border-element" href="https://lifetechia.com/tag/%e3%83%9e%e3%83%ab%e3%83%81%e3%82%b3%e3%82%a2/"><span class="fa fa-tag tag-icon tax-icon" aria-hidden="true"></span>マルチコア</a><a class="tag-link tag-link-17 border-element" href="https://lifetechia.com/tag/python/"><span class="fa fa-tag tag-icon tax-icon" aria-hidden="true"></span>Python</a><a class="tag-link tag-link-166 border-element" href="https://lifetechia.com/tag/ai-gen/"><span class="fa fa-tag tag-icon tax-icon" aria-hidden="true"></span>AI生成</a><a class="tag-link tag-link-225 border-element" href="https://lifetechia.com/tag/asyncio/"><span class="fa fa-tag tag-icon tax-icon" aria-hidden="true"></span>Asyncio</a></div> </div> <div id="php_code_widget-5" class="widget widget-above-single-sns-buttons widget_php_code_widget"> <a href="https://lifetechia.com/python-ai/"> <img src="https://lifetechia.com/wp-content/uploads/python-ai-present-800x420.png" alt="" class="wp-image-235" style="width:828px;height:auto"/> </a> </div> <div class="sns-share ss-col-3 bc-brand-color sbc-hide ss-bottom"> <div class="sns-share-message">シェアする</div> <div class="sns-share-buttons sns-buttons"> <a href="https://twitter.com/intent/tweet?text=Python%E3%81%A7%E3%81%AE%E4%B8%A6%E8%A1%8C%E5%87%A6%E7%90%86%EF%BC%9A%E3%83%9E%E3%83%AB%E3%83%81%E3%82%B3%E3%82%A2%E3%82%92%E6%B4%BB%E3%81%8B%E3%81%99&url=https%3A%2F%2Flifetechia.com%2Fpython-concurrency-multicore%2F" class="sns-button share-button twitter-button twitter-share-button-sq x-corp-button x-corp-share-button-sq" target="_blank" title="Xでシェア" rel="nofollow noopener noreferrer" aria-label="Xでシェア"><span class="social-icon icon-x-corp"></span><span class="button-caption">X</span><span class="share-count twitter-share-count x-share-count"></span></a> <a href="//www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Flifetechia.com%2Fpython-concurrency-multicore%2F&t=Python%E3%81%A7%E3%81%AE%E4%B8%A6%E8%A1%8C%E5%87%A6%E7%90%86%EF%BC%9A%E3%83%9E%E3%83%AB%E3%83%81%E3%82%B3%E3%82%A2%E3%82%92%E6%B4%BB%E3%81%8B%E3%81%99" class="sns-button share-button facebook-button facebook-share-button-sq" target="_blank" title="Facebookでシェア" rel="nofollow noopener noreferrer" aria-label="Facebookでシェア"><span class="social-icon icon-facebook"></span><span class="button-caption">Facebook</span><span class="share-count facebook-share-count"></span></a> <a href="//b.hatena.ne.jp/entry/s/lifetechia.com/python-concurrency-multicore/" class="sns-button share-button hatebu-button hatena-bookmark-button hatebu-share-button-sq" data-hatena-bookmark-layout="simple" target="_blank" title="はてブでブックマーク" rel="nofollow noopener noreferrer" aria-label="はてブでブックマーク"><span class="social-icon icon-hatena"></span><span class="button-caption">はてブ</span><span class="share-count hatebu-share-count"></span></a> <a href="//getpocket.com/edit?url=https://lifetechia.com/python-concurrency-multicore/" class="sns-button share-button pocket-button pocket-share-button-sq" target="_blank" title="Pocketに保存" rel="nofollow noopener noreferrer" aria-label="Pocketに保存"><span class="social-icon icon-pocket"></span><span class="button-caption">Pocket</span><span class="share-count pocket-share-count"></span></a> <a href="//timeline.line.me/social-plugin/share?url=https%3A%2F%2Flifetechia.com%2Fpython-concurrency-multicore%2F" class="sns-button share-button line-button line-share-button-sq" target="_blank" title="LINEでシェア" rel="nofollow noopener noreferrer" aria-label="LINEでシェア"><span class="social-icon icon-line"></span><span class="button-caption">LINE</span><span class="share-count line-share-count"></span></a> <a role="button" tabindex="0" class="sns-button share-button copy-button copy-share-button-sq" data-clipboard-text="Pythonでの並行処理:マルチコアを活かす https://lifetechia.com/python-concurrency-multicore/" title="タイトルとURLをコピーする" aria-label="タイトルとURLをコピーする"><span class="social-icon icon-copy"></span><span class="button-caption">コピー</span><span class="share-count copy-share-count"></span></a> </div><!-- /.sns-share-buttons --> </div><!-- /.sns-share --> <!-- SNSページ --> <div class="sns-follow bc-brand-color fbc-hide sf-bottom"> <div class="sns-follow-message">あゆをフォローする</div> <div class="sns-follow-buttons sns-buttons"> <a href="//feedly.com/i/discover/sources/search/feed/https%3A%2F%2Flifetechia.com" class="sns-button follow-button feedly-button feedly-follow-button-sq" target="_blank" title="feedlyで更新情報を購読" rel="nofollow noopener noreferrer" aria-label="feedlyで更新情報を購読"><span class="icon-feedly-logo"></span><span class="follow-count feedly-follow-count"></span></a> <a href="https://lifetechia.com/feed/" class="sns-button follow-button rss-button rss-follow-button-sq" target="_blank" title="RSSで更新情報を購読" rel="nofollow noopener noreferrer" aria-label="RSSで更新情報を購読"><span class="icon-rss-logo"></span></a> </div><!-- /.sns-follow-buttons --> </div><!-- /.sns-follow --> <div class="footer-meta"> <div class="author-info"> <span class="fa fa-pencil" aria-hidden="true"></span> <a href="https://lifetechia.com/author/ayu/" class="author-link"> <span class="post-author vcard author" itemprop="editor author creator copyrightHolder" itemscope itemtype="https://schema.org/Person"> <meta itemprop="url" content="https://lifetechia.com/author/ayu/"> <span class="author-name fn" itemprop="name">あゆ</span> </span> </a> </div> </div> </footer> </article> <div class="under-entry-content"> <aside id="related-entries" class="related-entries rect-entry-card"> <h2 class="related-entry-heading"> <span class="related-entry-main-heading main-caption"> 関連記事 </span> </h2> <div class="related-list"> <a href="https://lifetechia.com/python-skill-map-career-guide/" class="related-entry-card-wrap a-wrap border-element cf" title="Pythonスキルマップでキャリアを築く!"> <article class="post-3594 related-entry-card e-card cf post type-post status-publish format-standard has-post-thumbnail hentry category-it-programming-post category-python-study-post tag-ai-gen-post tag-217-post tag-218-post tag-python-post tag-120-post tag-126-post"> <figure class="related-entry-card-thumb card-thumb e-card-thumb"> <img width="160" height="90" src="https://lifetechia.com/wp-content/uploads/python-skill-map-career-guide-160x90.png" class="related-entry-card-thumb-image card-thumb-image wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://lifetechia.com/wp-content/uploads/python-skill-map-career-guide-160x90.png 160w, https://lifetechia.com/wp-content/uploads/python-skill-map-career-guide-120x68.png 120w, https://lifetechia.com/wp-content/uploads/python-skill-map-career-guide-320x180.png 320w" sizes="auto, (max-width: 160px) 100vw, 160px" /> <span class="cat-label cat-label-26">IT・プログラミング</span> </figure><!-- /.related-entry-thumb --> <div class="related-entry-card-content card-content e-card-content"> <h3 class="related-entry-card-title card-title e-card-title"> Pythonスキルマップでキャリアを築く! </h3> <div class="related-entry-card-snippet card-snippet e-card-snippet"> Pythonスキルマップでキャリアを築く! はじめに:Pythonスキルマップでキャリアを成功させる! なぜ今、Pythonのスキルマップが重要なのでしょうか?それは、Pythonがあらゆる産業でデジタルトランスフォーメーション(DX)を推... </div> </div><!-- /.related-entry-card-content --> </article><!-- /.related-entry-card --> </a><!-- /.related-entry-card-wrap --> <a href="https://lifetechia.com/python-streamlit-interactive-data-analysis/" class="related-entry-card-wrap a-wrap border-element cf" title="StreamlitでPythonデータ分析を劇的効率化"> <article class="post-4678 related-entry-card e-card cf post type-post status-publish format-standard has-post-thumbnail hentry category-it-programming-post category-python-study-post tag-ai-gen-post tag-python-post tag-streamlit-post tag-58-post tag-95-post tag-97-post"> <figure class="related-entry-card-thumb card-thumb e-card-thumb"> <img width="160" height="90" src="https://lifetechia.com/wp-content/uploads/python-streamlit-interactive-data-analysis-160x90.png" class="related-entry-card-thumb-image card-thumb-image wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://lifetechia.com/wp-content/uploads/python-streamlit-interactive-data-analysis-160x90.png 160w, https://lifetechia.com/wp-content/uploads/python-streamlit-interactive-data-analysis-120x68.png 120w, https://lifetechia.com/wp-content/uploads/python-streamlit-interactive-data-analysis-320x180.png 320w" sizes="auto, (max-width: 160px) 100vw, 160px" /> <span class="cat-label cat-label-26">IT・プログラミング</span> </figure><!-- /.related-entry-thumb --> <div class="related-entry-card-content card-content e-card-content"> <h3 class="related-entry-card-title card-title e-card-title"> StreamlitでPythonデータ分析を劇的効率化 </h3> <div class="related-entry-card-snippet card-snippet e-card-snippet"> StreamlitでPythonデータ分析を劇的効率化 イントロダクション:インタラクティブなデータ分析が不可欠な理由 現代のデータ分析において、インタラクティブ性は単なる付加価値ではなく、必要不可欠な要素へと進化しました。静的なレポートや... </div> </div><!-- /.related-entry-card-content --> </article><!-- /.related-entry-card --> </a><!-- /.related-entry-card-wrap --> <a href="https://lifetechia.com/python-coding-ai-qa/" class="related-entry-card-wrap a-wrap border-element cf" title="Python爆速コーディング!AI質問術"> <article class="post-3807 related-entry-card e-card cf post type-post status-publish format-standard has-post-thumbnail hentry category-it-programming-post category-python-study-post tag-python-post tag-127-post tag-ai-gen-post tag-179-post tag-200-post tag-ai-post"> <figure class="related-entry-card-thumb card-thumb e-card-thumb"> <img width="160" height="90" src="https://lifetechia.com/wp-content/uploads/python-coding-ai-qa-160x90.png" class="related-entry-card-thumb-image card-thumb-image wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://lifetechia.com/wp-content/uploads/python-coding-ai-qa-160x90.png 160w, https://lifetechia.com/wp-content/uploads/python-coding-ai-qa-120x68.png 120w, https://lifetechia.com/wp-content/uploads/python-coding-ai-qa-320x180.png 320w" sizes="auto, (max-width: 160px) 100vw, 160px" /> <span class="cat-label cat-label-26">IT・プログラミング</span> </figure><!-- /.related-entry-thumb --> <div class="related-entry-card-content card-content e-card-content"> <h3 class="related-entry-card-title card-title e-card-title"> Python爆速コーディング!AI質問術 </h3> <div class="related-entry-card-snippet card-snippet e-card-snippet"> Python爆速コーディング!AI質問術:AI時代の学習を成功に導く革新的な方法 AI質問術とは?コーディング学習の新潮流 「エラーが出たけど、どこが悪いかわからない…」「このコード、もっと効率的に書けないかな?」 プログラミング学習で誰も... </div> </div><!-- /.related-entry-card-content --> </article><!-- /.related-entry-card --> </a><!-- /.related-entry-card-wrap --> <a href="https://lifetechia.com/cline-gemini/" class="related-entry-card-wrap a-wrap border-element cf" title="AIコード支援ツールClineでGeminiを無料で使う方法"> <article class="post-2909 related-entry-card e-card cf post type-post status-publish format-standard has-post-thumbnail hentry category-it-programming-post category-machine-learning-post"> <figure class="related-entry-card-thumb card-thumb e-card-thumb"> <img width="160" height="90" src="https://lifetechia.com/wp-content/uploads/cline-gemini_thum-160x90.png" class="related-entry-card-thumb-image card-thumb-image wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://lifetechia.com/wp-content/uploads/cline-gemini_thum-160x90.png 160w, https://lifetechia.com/wp-content/uploads/cline-gemini_thum-120x68.png 120w, https://lifetechia.com/wp-content/uploads/cline-gemini_thum-320x180.png 320w" sizes="auto, (max-width: 160px) 100vw, 160px" /> <span class="cat-label cat-label-26">IT・プログラミング</span> </figure><!-- /.related-entry-thumb --> <div class="related-entry-card-content card-content e-card-content"> <h3 class="related-entry-card-title card-title e-card-title"> AIコード支援ツールClineでGeminiを無料で使う方法 </h3> <div class="related-entry-card-snippet card-snippet e-card-snippet"> この記事では、VS Codeの拡張機能であるClineを使ってGemini APIを利用する方法を解説します。 準備するもの Visual Studio Code: インストールされていない場合は、公式サイトからダウンロードしてインストール... </div> </div><!-- /.related-entry-card-content --> </article><!-- /.related-entry-card --> </a><!-- /.related-entry-card-wrap --> <a href="https://lifetechia.com/cross-cultural-politeness-gap/" class="related-entry-card-wrap a-wrap border-element cf" title="異文化コミュニケーションの落とし穴?ポライトネス・ギャップを徹底解説"> <article class="post-4021 related-entry-card e-card cf post type-post status-publish format-standard has-post-thumbnail hentry category-138-post category-it-programming-post tag-372-post tag-373-post tag-374-post tag-375-post"> <figure class="related-entry-card-thumb card-thumb e-card-thumb"> <img width="160" height="90" src="https://lifetechia.com/wp-content/uploads/cross-cultural-politeness-gap-160x90.png" class="related-entry-card-thumb-image card-thumb-image wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://lifetechia.com/wp-content/uploads/cross-cultural-politeness-gap-160x90.png 160w, https://lifetechia.com/wp-content/uploads/cross-cultural-politeness-gap-120x68.png 120w, https://lifetechia.com/wp-content/uploads/cross-cultural-politeness-gap-320x180.png 320w" sizes="auto, (max-width: 160px) 100vw, 160px" /> <span class="cat-label cat-label-138">論文要約</span> </figure><!-- /.related-entry-thumb --> <div class="related-entry-card-content card-content e-card-content"> <h3 class="related-entry-card-title card-title e-card-title"> 異文化コミュニケーションの落とし穴?ポライトネス・ギャップを徹底解説 </h3> <div class="related-entry-card-snippet card-snippet e-card-snippet"> 紹介論文今回紹介する論文はMinding the Politeness Gap in Cross-cultural Communicationという論文です。 この論文を一言でまとめると異文化コミュニケーションにおけるポライトネスの誤解はな... </div> </div><!-- /.related-entry-card-content --> </article><!-- /.related-entry-card --> </a><!-- /.related-entry-card-wrap --> <a href="https://lifetechia.com/metaclip2-worldwide-scaling/" class="related-entry-card-wrap a-wrap border-element cf" title="MetaCLIP 2解説:世界規模の多言語CLIPモデルの全貌"> <article class="post-4646 related-entry-card e-card cf post type-post status-publish format-standard has-post-thumbnail hentry category-138-post category-it-programming-post tag-425-post tag-435-post tag-clip-post tag-141-post tag-ai-post tag-284-post"> <figure class="related-entry-card-thumb card-thumb e-card-thumb"> <img width="160" height="90" src="https://lifetechia.com/wp-content/uploads/metaclip2-worldwide-scaling-160x90.png" class="related-entry-card-thumb-image card-thumb-image wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://lifetechia.com/wp-content/uploads/metaclip2-worldwide-scaling-160x90.png 160w, https://lifetechia.com/wp-content/uploads/metaclip2-worldwide-scaling-120x68.png 120w, https://lifetechia.com/wp-content/uploads/metaclip2-worldwide-scaling-320x180.png 320w" sizes="auto, (max-width: 160px) 100vw, 160px" /> <span class="cat-label cat-label-138">論文要約</span> </figure><!-- /.related-entry-thumb --> <div class="related-entry-card-content card-content e-card-content"> <h3 class="related-entry-card-title card-title e-card-title"> MetaCLIP 2解説:世界規模の多言語CLIPモデルの全貌 </h3> <div class="related-entry-card-snippet card-snippet e-card-snippet"> 紹介論文今回紹介する論文はMetaCLIP 2: A Worldwide Scaling Recipeという論文です。 この論文を一言でまとめるとMetaCLIP 2は、世界中の画像とテキストデータを用いて学習された初のCLIPモデルです。... </div> </div><!-- /.related-entry-card-content --> </article><!-- /.related-entry-card --> </a><!-- /.related-entry-card-wrap --> </div> </aside> <div id="pager-post-navi" class="pager-post-navi post-navi-default cf"> <a href="https://lifetechia.com/smart-fine-tuning-llm/" title="LLMファインチューニングを効率化!タスク干渉を解消するCPI-FTとは?" class="prev-post a-wrap border-element cf"> <div class="fa fa-chevron-left iconfont" aria-hidden="true"></div> <figure class="prev-post-thumb card-thumb"><img width="120" height="68" src="https://lifetechia.com/wp-content/uploads/smart-fine-tuning-llm-120x68.png" class="attachment-thumb120 size-thumb120 wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://lifetechia.com/wp-content/uploads/smart-fine-tuning-llm-120x68.png 120w, https://lifetechia.com/wp-content/uploads/smart-fine-tuning-llm-160x90.png 160w, https://lifetechia.com/wp-content/uploads/smart-fine-tuning-llm-320x180.png 320w" sizes="auto, (max-width: 120px) 100vw, 120px" /></figure> <div class="prev-post-title">LLMファインチューニングを効率化!タスク干渉を解消するCPI-FTとは?</div></a><a href="https://lifetechia.com/line-level-ocr-better-accuracy-efficiency/" title="OCRの進化形! ラインレベルで精度爆上げ" class="next-post a-wrap cf"> <div class="fa fa-chevron-right iconfont" aria-hidden="true"></div> <figure class="next-post-thumb card-thumb"> <img width="120" height="68" src="https://lifetechia.com/wp-content/uploads/line-level-ocr-better-accuracy-efficiency-120x68.png" class="attachment-thumb120 size-thumb120 wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://lifetechia.com/wp-content/uploads/line-level-ocr-better-accuracy-efficiency-120x68.png 120w, https://lifetechia.com/wp-content/uploads/line-level-ocr-better-accuracy-efficiency-160x90.png 160w, https://lifetechia.com/wp-content/uploads/line-level-ocr-better-accuracy-efficiency-320x180.png 320w" sizes="auto, (max-width: 120px) 100vw, 120px" /></figure> <div class="next-post-title">OCRの進化形! ラインレベルで精度爆上げ</div></a> </div><!-- /.pager-post-navi --> <!-- comment area --> <div id="comment-area" class="comment-area"> <section class="comment-list"> <h2 id="comments" class="comment-title"> コメント </h2> </section> <aside class="comment-form"> <button type="button" id="comment-reply-btn" class="comment-btn key-btn">コメントを書き込む</button> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title">コメントをどうぞ <small><a rel="nofollow" id="cancel-comment-reply-link" href="/python-concurrency-multicore/#respond" style="display:none;">コメントをキャンセル</a></small></h3><form action="https://lifetechia.com/wp-comments-post.php" method="post" id="commentform" class="comment-form"><p class="comment-notes"><span id="email-notes">メールアドレスが公開されることはありません。</span> <span class="required">*</span> が付いている欄は必須項目です</p><p class="comment-form-comment"><label for="comment">コメント <span class="required">※</span></label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p><p class="comment-form-author"><label for="author">名前 <span class="required">※</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" autocomplete="name" required="required" /></p> <p class="comment-form-email"><label for="email">メール <span class="required">※</span></label> <input id="email" name="email" type="text" value="" size="30" maxlength="100" aria-describedby="email-notes" autocomplete="email" required="required" /></p> <p class="comment-form-url"><label for="url">サイト</label> <input id="url" name="url" type="text" value="" size="30" maxlength="200" autocomplete="url" /></p> <p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" /> <label for="wp-comment-cookies-consent">次回のコメントで使用するためブラウザーに自分の名前、メールアドレス、サイトを保存する。</label></p> <p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="コメントを送信" /> <input type='hidden' name='comment_post_ID' value='5106' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </p></form> </div><!-- #respond --> </aside></div><!-- /.comment area --> </div> <div id="breadcrumb" class="breadcrumb breadcrumb-category sbp-main-bottom" itemscope itemtype="https://schema.org/BreadcrumbList"><div class="breadcrumb-home" itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span class="fa fa-home fa-fw" aria-hidden="true"></span><a href="https://lifetechia.com" itemprop="item"><span itemprop="name" class="breadcrumb-caption">ホーム</span></a><meta itemprop="position" content="1" /><span class="sp"><span class="fa fa-angle-right" aria-hidden="true"></span></span></div><div class="breadcrumb-item" itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span class="fa fa-folder fa-fw" aria-hidden="true"></span><a href="https://lifetechia.com/category/it-programming/" itemprop="item"><span itemprop="name" class="breadcrumb-caption">IT・プログラミング</span></a><meta itemprop="position" content="2" /></div></div><!-- /#breadcrumb --> </main> <div id="sidebar" class="sidebar nwa cf" role="complementary"> <aside id="author_box-2" class="widget widget-sidebar widget-sidebar-standard widget_author_box"> <div class="author-box border-element no-icon cf"> <figure class="author-thumb circle-image"> <img alt='あゆ' src='https://lifetechia.com/wp-content/uploads/icon.jpg' class='avatar avatar-200 photo' height='200' width='200' /> </figure> <div class="author-content"> <div class="author-name"> <a rel="author" href="https://lifetechia.com/author/ayu/" title="あゆ の投稿">あゆ</a> </div> <div class="author-description"> <p>Pythonを中心にプログラミング、開発を行っています。<br /> IT、金融、ビジネスに関する情報を発信していきます!</p> </div> <div class="profile-follows author-follows"> <!-- SNSページ --> <div class="sns-follow bc-brand-color fbc-hide sf-profile"> <div class="sns-follow-message">あゆをフォローする</div> <div class="sns-follow-buttons sns-buttons"> <a href="//feedly.com/i/discover/sources/search/feed/https%3A%2F%2Flifetechia.com" class="sns-button follow-button feedly-button feedly-follow-button-sq" target="_blank" title="feedlyで更新情報を購読" rel="nofollow noopener noreferrer" aria-label="feedlyで更新情報を購読"><span class="icon-feedly-logo"></span><span class="follow-count feedly-follow-count"></span></a> <a href="https://lifetechia.com/feed/" class="sns-button follow-button rss-button rss-follow-button-sq" target="_blank" title="RSSで更新情報を購読" rel="nofollow noopener noreferrer" aria-label="RSSで更新情報を購読"><span class="icon-rss-logo"></span></a> </div><!-- /.sns-follow-buttons --> </div><!-- /.sns-follow --> </div> </div> </div> </aside><aside id="block-2" class="widget widget-sidebar widget-sidebar-standard widget_block widget_search"><form role="search" method="get" action="https://lifetechia.com/" class="wp-block-search__button-outside wp-block-search__text-button wp-block-search" ><label class="wp-block-search__label" for="wp-block-search__input-1" >検索</label><div class="wp-block-search__inside-wrapper " ><input class="wp-block-search__input" id="wp-block-search__input-1" placeholder="" value="" type="search" name="s" required /><button aria-label="検索" class="wp-block-search__button wp-element-button" type="submit" >検索</button></div></form></aside><aside id="categories-2" class="widget widget-sidebar widget-sidebar-standard widget_categories"><h3 class="widget-sidebar-title widget-title">カテゴリー</h3> <ul> <li class="cat-item cat-item-138"><a href="https://lifetechia.com/category/%e8%ab%96%e6%96%87%e8%a6%81%e7%b4%84/"><span class="list-item-caption">論文要約</span><span class="post-count">310</span></a> </li> <li class="cat-item cat-item-26"><a href="https://lifetechia.com/category/it-programming/"><span class="list-item-caption">IT・プログラミング</span><span class="post-count">1,012</span></a> <ul class='children'> <li class="cat-item cat-item-94"><a href="https://lifetechia.com/category/it-programming/python-study/"><span class="list-item-caption">Python学習</span><span class="post-count">520</span></a> </li> <li class="cat-item cat-item-27"><a href="https://lifetechia.com/category/it-programming/python/"><span class="list-item-caption">Python</span><span class="post-count">52</span></a> </li> <li class="cat-item cat-item-81"><a href="https://lifetechia.com/category/it-programming/machine-learning/"><span class="list-item-caption">AI・機械学習</span><span class="post-count">32</span></a> </li> <li class="cat-item cat-item-86"><a href="https://lifetechia.com/category/it-programming/gas/"><span class="list-item-caption">GAS</span><span class="post-count">6</span></a> </li> <li class="cat-item cat-item-62"><a href="https://lifetechia.com/category/it-programming/vscode/"><span class="list-item-caption">VSCode</span><span class="post-count">22</span></a> </li> <li class="cat-item cat-item-61"><a href="https://lifetechia.com/category/it-programming/docker/"><span class="list-item-caption">Docker</span><span class="post-count">24</span></a> </li> <li class="cat-item cat-item-76"><a href="https://lifetechia.com/category/it-programming/mobile-app-dev/"><span class="list-item-caption">モバイルアプリ開発</span><span class="post-count">6</span></a> </li> <li class="cat-item cat-item-78"><a href="https://lifetechia.com/category/it-programming/it-basic/"><span class="list-item-caption">基本情報</span><span class="post-count">4</span></a> </li> </ul> </li> <li class="cat-item cat-item-28"><a href="https://lifetechia.com/category/investment/"><span class="list-item-caption">投資・ファイナンス</span><span class="post-count">87</span></a> <ul class='children'> <li class="cat-item cat-item-91"><a href="https://lifetechia.com/category/investment/lib/"><span class="list-item-caption">ライブラリ</span><span class="post-count">5</span></a> </li> <li class="cat-item cat-item-30"><a href="https://lifetechia.com/category/investment/finance-theory/"><span class="list-item-caption">ファイナンス理論</span><span class="post-count">30</span></a> </li> <li class="cat-item cat-item-38"><a href="https://lifetechia.com/category/investment/finance-data/"><span class="list-item-caption">金融データ</span><span class="post-count">28</span></a> </li> <li class="cat-item cat-item-31"><a href="https://lifetechia.com/category/investment/simulation/"><span class="list-item-caption">シミュレーション</span><span class="post-count">10</span></a> </li> <li class="cat-item cat-item-82"><a href="https://lifetechia.com/category/investment/bot/"><span class="list-item-caption">bot</span><span class="post-count">1</span></a> </li> </ul> </li> <li class="cat-item cat-item-29"><a href="https://lifetechia.com/category/business/"><span class="list-item-caption">ビジネス</span><span class="post-count">147</span></a> <ul class='children'> <li class="cat-item cat-item-33"><a href="https://lifetechia.com/category/business/blog/"><span class="list-item-caption">ブログ</span><span class="post-count">144</span></a> <ul class='children'> <li class="cat-item cat-item-35"><a href="https://lifetechia.com/category/business/blog/wordpress/"><span class="list-item-caption">WordPress</span><span class="post-count">117</span></a> </li> <li class="cat-item cat-item-36"><a href="https://lifetechia.com/category/business/blog/blogger/"><span class="list-item-caption">Blogger</span><span class="post-count">16</span></a> </li> </ul> </li> <li class="cat-item cat-item-63"><a href="https://lifetechia.com/category/business/sns/"><span class="list-item-caption">SNS運用</span><span class="post-count">3</span></a> <ul class='children'> <li class="cat-item cat-item-87"><a href="https://lifetechia.com/category/business/sns/instagram/"><span class="list-item-caption">Instagram</span><span class="post-count">1</span></a> </li> </ul> </li> </ul> </li> <li class="cat-item cat-item-88"><a href="https://lifetechia.com/category/%e5%a4%96%e5%9b%bd%e8%aa%9e%e5%ad%a6%e7%bf%92/"><span class="list-item-caption">外国語学習</span><span class="post-count">23</span></a> <ul class='children'> <li class="cat-item cat-item-89"><a href="https://lifetechia.com/category/%e5%a4%96%e5%9b%bd%e8%aa%9e%e5%ad%a6%e7%bf%92/french/"><span class="list-item-caption">フランス語</span><span class="post-count">11</span></a> </li> <li class="cat-item cat-item-90"><a href="https://lifetechia.com/category/%e5%a4%96%e5%9b%bd%e8%aa%9e%e5%ad%a6%e7%bf%92/chinese/"><span class="list-item-caption">中国語</span><span class="post-count">12</span></a> </li> </ul> </li> <li class="cat-item cat-item-83"><a href="https://lifetechia.com/category/%e4%ba%ba%e7%94%9f/"><span class="list-item-caption">人生</span><span class="post-count">15</span></a> <ul class='children'> <li class="cat-item cat-item-84"><a href="https://lifetechia.com/category/%e4%ba%ba%e7%94%9f/books/"><span class="list-item-caption">読書メモ</span><span class="post-count">12</span></a> </li> <li class="cat-item cat-item-85"><a href="https://lifetechia.com/category/%e4%ba%ba%e7%94%9f/health/"><span class="list-item-caption">健康</span><span class="post-count">1</span></a> </li> </ul> </li> </ul> </aside> <div id="sidebar-scroll" class="sidebar-scroll"> <aside id="php_code_widget-4" class="widget widget-sidebar widget-sidebar-scroll widget_php_code_widget"> <a href="https://lifetechia.com/python-ai/"> <img src="https://lifetechia.com/wp-content/uploads/python-ai-present-side.png" alt="" class="wp-image-236"/> </a> </aside> </div> </div> </div> </div> <footer id="footer" class="footer footer-container nwa" itemscope itemtype="https://schema.org/WPFooter"> <div id="footer-in" class="footer-in wrap cf"> <div class="footer-bottom fdt-logo fnm-text-width cf"> <div class="footer-bottom-logo"> <div class="logo logo-footer logo-image"><a href="https://lifetechia.com/" class="site-name site-name-text-link" itemprop="url"><span class="site-name-text"><img class="site-logo-image footer-site-logo-image" src="https://lifetechia.com/wp-content/uploads/Lifetechia-logo.png" alt="lifetechia"><meta itemprop="name about" content="lifetechia"></span></a></div> </div> <div class="footer-bottom-content"> <nav id="navi-footer" class="navi-footer"> <div id="navi-footer-in" class="navi-footer-in"> </div> </nav> <div class="source-org copyright">© 2024 lifetechia.</div> </div> </div> </div> </footer> <ul class="mobile-footer-menu-buttons mobile-menu-buttons"> <!-- メニューボタン --> <li class="navi-menu-button menu-button"> <input autocomplete="off" id="navi-menu-input" type="checkbox" class="display-none"> <label id="navi-menu-open" class="menu-open menu-button-in" for="navi-menu-input"> <span class="navi-menu-icon menu-icon"> <span class="fa fa-bars" aria-hidden="true"></span> </span> <span class="navi-menu-caption menu-caption">メニュー</span> </label> <label class="display-none" id="navi-menu-close" for="navi-menu-input"></label> <div id="navi-menu-content" class="navi-menu-content menu-content"> <label class="navi-menu-close-button menu-close-button" for="navi-menu-input"><span class="fa fa-close" aria-hidden="true"></span></label> <ul class="menu-drawer"><li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home menu-item-2387"><a href="https://lifetechia.com/">ホーム</a></li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-2369"><a href="https://lifetechia.com/how-to-use-financial-data-app/">財務データアプリ</a> <ul class="sub-menu"> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1836"><a href="https://lifetechia.com/financial-db-dl/">日本株データ</a> <ul class="sub-menu"> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2375"><a href="https://lifetechia.com/financial-db-dl/">主要データダウンロード</a></li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1837"><a href="https://lifetechia.com/financial-data-search/">詳細検索</a></li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2370"><a href="https://lifetechia.com/edinet-factor/">ファクターデータ</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-2372"><a href="https://lifetechia.com/edga-main-data/">米国株データ</a> <ul class="sub-menu"> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2374"><a href="https://lifetechia.com/edga-main-data/">主要データダウンロード</a></li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2373"><a href="https://lifetechia.com/edgar-cik-search/">詳細検索</a></li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2371"><a href="https://lifetechia.com/edgar-factor/">ファクターデータ</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2376"><a href="https://lifetechia.com/how-to-use-financial-data-app/">使い方</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1843"><a href="https://lifetechia.com/free-present/">無料プレゼント</a> <ul class="sub-menu"> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1838"><a href="https://lifetechia.com/python-study/">最強のPython学習法</a></li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1839"><a href="https://lifetechia.com/algorithm-trade/">アルゴリズムトレード入門</a></li> <li class="menu-item menu-item-type-post_type menu-item-object-post menu-item-2279"><a href="https://lifetechia.com/wp-autopost-from-csv/">WordPress自動投稿</a></li> </ul> </li> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-has-children menu-item-2893"><a href="https://lifetechia.com">依頼・問い合わせ</a> <ul class="sub-menu"> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2892"><a href="https://lifetechia.com/%e3%81%8a%e4%bb%95%e4%ba%8b%e3%81%ae%e4%be%9d%e9%a0%bc/">お仕事の依頼</a></li> <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2396"><a href="https://lifetechia.com/%e3%81%8a%e5%95%8f%e3%81%84%e5%90%88%e3%82%8f%e3%81%9b/">お問い合わせ</a></li> </ul> </li> <li class="menu-item menu-item-has-children"> <a href="#">ログイン・サインイン</a> <ul class="sub-menu"> <li class="menu-item"><a href="https://lifetechia.com/login/">ログイン</a></li> <li class="menu-item"><a href="https://lifetechia.com/register/">サインイン</a></li> </ul> </li></ul> </div> </li> <!-- ホームボタン --> <li class="home-menu-button menu-button"> <a href="https://lifetechia.com" class="menu-button-in"> <span class="home-menu-icon menu-icon"> <span class="fa fa-home" aria-hidden="true"></span> </span> <span class="home-menu-caption menu-caption">ホーム</span> </a> </li> <!-- 検索ボタン --> <!-- 検索ボタン --> <li class="search-menu-button menu-button"> <input autocomplete="off" id="search-menu-input" type="checkbox" class="display-none"> <label id="search-menu-open" class="menu-open menu-button-in" for="search-menu-input"> <span class="search-menu-icon menu-icon"> <span class="fa fa-search" aria-hidden="true"></span> </span> <span class="search-menu-caption menu-caption">検索</span> </label> <label class="display-none" id="search-menu-close" for="search-menu-input"></label> <div id="search-menu-content" class="search-menu-content"> <form class="search-box input-box" method="get" action="https://lifetechia.com/"> <input type="text" placeholder="サイト内を検索" name="s" class="search-edit" aria-label="input" value=""> <button type="submit" class="search-submit" aria-label="button"><span class="fa fa-search" aria-hidden="true"></span></button> </form> </div> </li> <!-- トップボタン --> <li class="top-menu-button menu-button"> <a href="#" class="go-to-top-common top-menu-a menu-button-in"> <span class="top-menu-icon menu-icon"> <span class="fa fa-arrow-up" aria-hidden="true"></span> </span> <span class="top-menu-caption menu-caption">トップ</span> </a> </li> <!-- サイドバーボタン --> <li class="sidebar-menu-button menu-button"> <input autocomplete="off" id="sidebar-menu-input" type="checkbox" class="display-none"> <label id="sidebar-menu-open" class="menu-open menu-button-in" for="sidebar-menu-input"> <span class="sidebar-menu-icon menu-icon"> <span class="fa fa-outdent" aria-hidden="true"></span> </span> <span class="sidebar-menu-caption menu-caption">サイドバー</span> </label> <label class="display-none" id="sidebar-menu-close" for="sidebar-menu-input"></label> <div id="sidebar-menu-content" class="sidebar-menu-content menu-content"> <label class="sidebar-menu-close-button menu-close-button" for="sidebar-menu-input"><span class="fa fa-close" aria-hidden="true"></span></label> </div> </li> </ul> <div id="go-to-top" class="go-to-top"> <button class="go-to-top-button go-to-top-common go-to-top-hide go-to-top-button-icon-font" aria-label="トップへ戻る"><span class="fa fa-angle-double-up"></span></button> </div> <script src="https://lifetechia.com/wp-includes/js/dist/hooks.min.js?ver=4d63a3d491d11ffd8ac6&fver=20241114120140" id="wp-hooks-js"></script> <script src="https://lifetechia.com/wp-includes/js/dist/i18n.min.js?ver=5e580eb46a90c2b997e6&fver=20240625051207" id="wp-i18n-js"></script> <script id="wp-i18n-js-after">wp.i18n.setLocaleData({'text direction\u0004ltr':['ltr']})</script> <script>(()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){if(this.formData={},this.tree={},!(t instanceof FormData))return this;this.formData=t;const e=()=>{const t=new Map;return t.largestIndex=0,t.set=function(e,i){""===e?e=t.largestIndex++:/^[0-9]+$/.test(e)&&(e=parseInt(e),t.largestIndex<=e&&(t.largestIndex=e+1)),Map.prototype.set.call(t,e,i)},t};this.tree=e();const i=/^(?<name>[a-z][-a-z0-9_:]*)(?<array>(?:\[(?:[a-z][-a-z0-9_:]*|[0-9]*)\])*)/i;for(const[t,s]of this.formData){const o=t.match(i);if(o)if(""===o.groups.array)this.tree.set(o.groups.name,s);else{const t=[...o.groups.array.matchAll(/\[([a-z][-a-z0-9_:]*|[0-9]*)\]/gi)].map((([t,e])=>e));t.unshift(o.groups.name);const i=t.pop();t.reduce(((t,i)=>{if(/^[0-9]+$/.test(i)&&(i=parseInt(i)),t.get(i)instanceof Map)return t.get(i);const s=e();return t.set(i,s),s}),this.tree).set(i,s)}}}t.r(e),t.d(e,{all:()=>D,any:()=>M,date:()=>f,dayofweek:()=>u,email:()=>r,enum:()=>h,file:()=>m,maxdate:()=>z,maxfilesize:()=>$,maxitems:()=>v,maxlength:()=>x,maxnumber:()=>b,mindate:()=>A,minfilesize:()=>j,minitems:()=>w,minlength:()=>g,minnumber:()=>y,number:()=>c,required:()=>n,requiredfile:()=>a,tel:()=>l,time:()=>d,url:()=>p}),i.prototype.entries=function(){return this.tree.entries()},i.prototype.get=function(t){return this.tree.get(t)},i.prototype.getAll=function(t){if(!this.has(t))return[];const e=t=>{const i=[];if(t instanceof Map)for(const[s,o]of t)i.push(...e(o));else""!==t&&i.push(t);return i};return e(this.get(t))},i.prototype.has=function(t){return this.tree.has(t)},i.prototype.keys=function(){return this.tree.keys()},i.prototype.values=function(){return this.tree.values()};const s=i;function o({rule:t,field:e,error:i,...s}){this.rule=t,this.field=e,this.error=i,this.properties=s}const n=function(t){if(0===t.getAll(this.field).length)throw new o(this)},a=function(t){if(0===t.getAll(this.field).length)throw new o(this)},r=function(t){if(!t.getAll(this.field).every((t=>{if((t=t.trim()).length<6)return!1;if(-1===t.indexOf("@",1))return!1;if(t.indexOf("@")!==t.lastIndexOf("@"))return!1;const[e,i]=t.split("@",2);if(!/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/.test(e))return!1;if(/\.{2,}/.test(i))return!1;if(/(?:^[ \t\n\r\0\x0B.]|[ \t\n\r\0\x0B.]$)/.test(i))return!1;const s=i.split(".");if(s.length<2)return!1;for(const t of s){if(/(?:^[ \t\n\r\0\x0B-]|[ \t\n\r\0\x0B-]$)/.test(t))return!1;if(!/^[a-z0-9-]+$/i.test(t))return!1}return!0})))throw new o(this)},p=function(t){const e=t.getAll(this.field);if(!e.every((t=>{if(""===(t=t.trim()))return!1;try{return(t=>-1!==["http","https","ftp","ftps","mailto","news","irc","irc6","ircs","gopher","nntp","feed","telnet","mms","rtsp","sms","svn","tel","fax","xmpp","webcal","urn"].indexOf(t))(new URL(t).protocol.replace(/:$/,""))}catch{return!1}})))throw new o(this)},l=function(t){if(!t.getAll(this.field).every((t=>(t=(t=t.trim()).replaceAll(/[()/.*#\s-]+/g,""),/^[+]?[0-9]+$/.test(t)))))throw new o(this)},c=function(t){if(!t.getAll(this.field).every((t=>(t=t.trim(),!!/^[-]?[0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)||!!/^[-]?(?:[0-9]+)?[.][0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)))))throw new o(this)},f=function(t){if(!t.getAll(this.field).every((t=>{if(t=t.trim(),!/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t))return!1;const e=new Date(t);return!Number.isNaN(e.valueOf())})))throw new o(this)},d=function(t){if(!t.getAll(this.field).every((t=>{const e=t.trim().match(/^([0-9]{2})\:([0-9]{2})(?:\:([0-9]{2}))?$/);if(!e)return!1;const i=parseInt(e[1]),s=parseInt(e[2]),o=e[3]?parseInt(e[3]):0;return 0<=i&&i<=23&&0<=s&&s<=59&&0<=o&&o<=59})))throw new o(this)},m=function(t){if(!t.getAll(this.field).every((t=>t instanceof File&&this.accept?.some((e=>/^\.[a-z0-9]+$/i.test(e)?t.name.toLowerCase().endsWith(e.toLowerCase()):(t=>{const e=[],i=t.match(/^(?<toplevel>[a-z]+)\/(?<sub>[*]|[a-z0-9.+-]+)$/i);if(i){const t=i.groups.toplevel.toLowerCase(),s=i.groups.sub.toLowerCase();for(const[o,n]of(()=>{const t=new Map;return t.set("jpg|jpeg|jpe","image/jpeg"),t.set("gif","image/gif"),t.set("png","image/png"),t.set("bmp","image/bmp"),t.set("tiff|tif","image/tiff"),t.set("webp","image/webp"),t.set("ico","image/x-icon"),t.set("heic","image/heic"),t.set("asf|asx","video/x-ms-asf"),t.set("wmv","video/x-ms-wmv"),t.set("wmx","video/x-ms-wmx"),t.set("wm","video/x-ms-wm"),t.set("avi","video/avi"),t.set("divx","video/divx"),t.set("flv","video/x-flv"),t.set("mov|qt","video/quicktime"),t.set("mpeg|mpg|mpe","video/mpeg"),t.set("mp4|m4v","video/mp4"),t.set("ogv","video/ogg"),t.set("webm","video/webm"),t.set("mkv","video/x-matroska"),t.set("3gp|3gpp","video/3gpp"),t.set("3g2|3gp2","video/3gpp2"),t.set("txt|asc|c|cc|h|srt","text/plain"),t.set("csv","text/csv"),t.set("tsv","text/tab-separated-values"),t.set("ics","text/calendar"),t.set("rtx","text/richtext"),t.set("css","text/css"),t.set("htm|html","text/html"),t.set("vtt","text/vtt"),t.set("dfxp","application/ttaf+xml"),t.set("mp3|m4a|m4b","audio/mpeg"),t.set("aac","audio/aac"),t.set("ra|ram","audio/x-realaudio"),t.set("wav","audio/wav"),t.set("ogg|oga","audio/ogg"),t.set("flac","audio/flac"),t.set("mid|midi","audio/midi"),t.set("wma","audio/x-ms-wma"),t.set("wax","audio/x-ms-wax"),t.set("mka","audio/x-matroska"),t.set("rtf","application/rtf"),t.set("js","application/javascript"),t.set("pdf","application/pdf"),t.set("swf","application/x-shockwave-flash"),t.set("class","application/java"),t.set("tar","application/x-tar"),t.set("zip","application/zip"),t.set("gz|gzip","application/x-gzip"),t.set("rar","application/rar"),t.set("7z","application/x-7z-compressed"),t.set("exe","application/x-msdownload"),t.set("psd","application/octet-stream"),t.set("xcf","application/octet-stream"),t.set("doc","application/msword"),t.set("pot|pps|ppt","application/vnd.ms-powerpoint"),t.set("wri","application/vnd.ms-write"),t.set("xla|xls|xlt|xlw","application/vnd.ms-excel"),t.set("mdb","application/vnd.ms-access"),t.set("mpp","application/vnd.ms-project"),t.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),t.set("docm","application/vnd.ms-word.document.macroEnabled.12"),t.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),t.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),t.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),t.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),t.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),t.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),t.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),t.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),t.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),t.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),t.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),t.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),t.set("potm","application/vnd.ms-powerpoint.template.macroEnabled.12"),t.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),t.set("sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"),t.set("sldm","application/vnd.ms-powerpoint.slide.macroEnabled.12"),t.set("onetoc|onetoc2|onetmp|onepkg","application/onenote"),t.set("oxps","application/oxps"),t.set("xps","application/vnd.ms-xpsdocument"),t.set("odt","application/vnd.oasis.opendocument.text"),t.set("odp","application/vnd.oasis.opendocument.presentation"),t.set("ods","application/vnd.oasis.opendocument.spreadsheet"),t.set("odg","application/vnd.oasis.opendocument.graphics"),t.set("odc","application/vnd.oasis.opendocument.chart"),t.set("odb","application/vnd.oasis.opendocument.database"),t.set("odf","application/vnd.oasis.opendocument.formula"),t.set("wp|wpd","application/wordperfect"),t.set("key","application/vnd.apple.keynote"),t.set("numbers","application/vnd.apple.numbers"),t.set("pages","application/vnd.apple.pages"),t})())("*"===s&&n.startsWith(t+"/")||n===i[0])&&e.push(...o.split("|"))}return e})(e).some((e=>(e="."+e.trim(),t.name.toLowerCase().endsWith(e.toLowerCase())))))))))throw new o(this)},h=function(t){if(!t.getAll(this.field).every((t=>this.accept?.some((e=>t===String(e))))))throw new o(this)},u=function(t){if(!t.getAll(this.field).every((t=>{const e=0===(i=new Date(t).getDay())?7:i;var i;return this.accept?.some((t=>e===parseInt(t)))})))throw new o(this)},w=function(t){if(t.getAll(this.field).length<parseInt(this.threshold))throw new o(this)},v=function(t){const e=t.getAll(this.field);if(parseInt(this.threshold)<e.length)throw new o(this)},g=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),0!==i&&i<parseInt(this.threshold))throw new o(this)},x=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),parseInt(this.threshold)<i)throw new o(this)},y=function(t){if(!t.getAll(this.field).every((t=>!(parseFloat(t)<parseFloat(this.threshold)))))throw new o(this)},b=function(t){if(!t.getAll(this.field).every((t=>!(parseFloat(this.threshold)<parseFloat(t)))))throw new o(this)},A=function(t){if(!t.getAll(this.field).every((t=>(t=t.trim(),!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&t<this.threshold)))))throw new o(this)},z=function(t){if(!t.getAll(this.field).every((t=>(t=t.trim(),!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&this.threshold<t)))))throw new o(this)},j=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{t instanceof File&&(i+=t.size)})),i<parseInt(this.threshold))throw new o(this)},$=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{t instanceof File&&(i+=t.size)})),parseInt(this.threshold)<i)throw new o(this)},I=({ruleObj:t,options:i})=>{const{rule:s,...o}=t;return"function"==typeof e[s]&&("function"!=typeof e[s].matches||e[s].matches(o,i))},O=({ruleObj:t,formDataTree:i,options:s})=>{const{rule:o}=t;e[o].call(t,i,s)},E=[],k=t=>[...E].reduce(((t,e)=>i=>e(i,t)),t),D=function(t,e={}){const i=(this.rules??[]).filter((t=>I({ruleObj:t,options:e}))),s=k(O);if(!i.every((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;if(void 0!==t.error)throw t;return!1}return!0})))throw new o(this)},M=function(t,e={}){const i=(this.rules??[]).filter((t=>I({ruleObj:t,options:e}))),s=k(O);if(!i.some((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;return!1}return!0})))throw new o(this)};var F;window.swv={validators:e,validate:(t,e,i={})=>{const n=(t.rules??[]).filter((t=>I({ruleObj:t,options:i})));if(!n.length)return new Map;const a=k(O),r=new s(e),p=n.reduce(((t,e)=>{try{a({ruleObj:e,formDataTree:r,options:i})}catch(e){if(!(e instanceof o))throw e;if(void 0!==e.field&&!t.has(e.field)&&void 0!==e.error)return t.set(e.field,e)}return t}),new Map);for(const t of r.keys())p.has(t)||p.set(t,{validInputs:r.getAll(t)});return p},use:t=>{E.push(t)},...null!==(F=window.swv)&&void 0!==F?F:{}}})()</script> <script id="contact-form-7-js-extra">var wpcf7={"api":{"root":"https:\/\/lifetechia.com\/wp-json\/","namespace":"contact-form-7\/v1"}}</script> <script id="contact-form-7-js-translations">(function(domain,translations){var localeData=translations.locale_data[domain]||translations.locale_data.messages;localeData[""].domain=domain;wp.i18n.setLocaleData(localeData,domain)})("contact-form-7",{"translation-revision-date":"2024-07-17 08:16:16+0000","generator":"GlotPress\/4.0.1","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"ja_JP"},"This contact form is placed in the wrong place.":["\u3053\u306e\u30b3\u30f3\u30bf\u30af\u30c8\u30d5\u30a9\u30fc\u30e0\u306f\u9593\u9055\u3063\u305f\u4f4d\u7f6e\u306b\u7f6e\u304b\u308c\u3066\u3044\u307e\u3059\u3002"],"Error:":["\u30a8\u30e9\u30fc:"]}},"comment":{"reference":"includes\/js\/index.js"}})</script> <script>(()=>{"use strict";const e=window.wp.i18n,t=e=>Math.abs(parseInt(e,10)),a=(e,t,a)=>{const n=new CustomEvent(`wpcf7${t}`,{bubbles:!0,detail:a});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(n)},n=(e,t)=>{const n=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["validating","validating"],["payment_required","payment-required"]]);n.has(t)&&(t=n.get(t)),Array.from(n.values()).includes(t)||(t=`custom-${t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")}`);const r=e.getAttribute("data-status");if(e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t){e.classList.remove(r);const t={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,prevStatus:r};a(e,"statuschanged",t)}return t},r=e=>{const{root:t,namespace:a="contact-form-7/v1"}=wpcf7.api;return o.reduceRight(((e,t)=>a=>t(a,e)),(e=>{let n,r,{url:o,path:c,endpoint:s,headers:i,body:l,data:p,...d}=e;"string"==typeof s&&(n=a.replace(/^\/|\/$/g,""),r=s.replace(/^\//,""),c=r?n+"/"+r:n),"string"==typeof c&&(-1!==t.indexOf("?")&&(c=c.replace("?","&")),c=c.replace(/^\//,""),o=t+c),i={Accept:"application/json, */*;q=0.1",...i},delete i["X-WP-Nonce"],p&&(l=JSON.stringify(p),i["Content-Type"]="application/json");const f={code:"fetch_error",message:"You are probably offline."},u={code:"invalid_json",message:"The response is not a valid JSON response."};return window.fetch(o||c||window.location.href,{...d,headers:i,body:l}).then((e=>Promise.resolve(e).then((e=>{if(e.status>=200&&e.status<300)return e;throw e})).then((e=>{if(204===e.status)return null;if(e&&e.json)return e.json().catch((()=>{throw u}));throw u}))),(()=>{throw f}))}))(e)},o=[];function c(e,t={}){const{target:a,scope:r=e,...o}=t;if(void 0===e.wpcf7?.schema)return;const c={...e.wpcf7.schema};if(void 0!==a){if(!e.contains(a))return;if(!a.closest(".wpcf7-form-control-wrap[data-name]"))return;if(a.closest(".novalidate"))return}const p=r.querySelectorAll(".wpcf7-form-control-wrap"),d=Array.from(p).reduce(((e,t)=>(t.closest(".novalidate")||t.querySelectorAll(":where( input, textarea, select ):enabled").forEach((t=>{if(t.name)switch(t.type){case"button":case"image":case"reset":case"submit":break;case"checkbox":case"radio":t.checked&&e.append(t.name,t.value);break;case"select-multiple":for(const a of t.selectedOptions)e.append(t.name,a.value);break;case"file":for(const a of t.files)e.append(t.name,a);break;default:e.append(t.name,t.value)}})),e)),new FormData),f=e.getAttribute("data-status");Promise.resolve(n(e,"validating")).then((n=>{if(void 0!==swv){const n=swv.validate(c,d,t);for(const t of p){if(void 0===t.dataset.name)continue;const o=t.dataset.name;if(n.has(o)){const{error:t,validInputs:a}=n.get(o);i(e,o),void 0!==t&&s(e,o,t,{scope:r}),l(e,o,null!=a?a:[])}if(t.contains(a))break}}})).finally((()=>{n(e,f)}))}r.use=e=>{o.unshift(e)};const s=(e,t,a,n)=>{const{scope:r=e,...o}=null!=n?n:{},c=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,""),s=e.querySelector(`.wpcf7-form-control-wrap[data-name="${t}"] .wpcf7-form-control`);(()=>{const t=document.createElement("li");t.setAttribute("id",c),s&&s.id?t.insertAdjacentHTML("beforeend",`<a href="#${s.id}">${a}</a>`):t.insertAdjacentText("beforeend",a),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(t)})(),r.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{const t=document.createElement("span");t.classList.add("wpcf7-not-valid-tip"),t.setAttribute("aria-hidden","true"),t.insertAdjacentText("beforeend",a),e.appendChild(t),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.classList.add("wpcf7-not-valid"),e.setAttribute("aria-describedby",c),"function"==typeof e.setCustomValidity&&e.setCustomValidity(a),e.closest(".use-floating-validation-tip")&&(e.addEventListener("focus",(e=>{t.setAttribute("style","display: none")})),t.addEventListener("click",(e=>{t.setAttribute("style","display: none")})))}))}))},i=(e,t)=>{const a=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,"");e.wpcf7.parent.querySelector(`.screen-reader-response ul li#${a}`)?.remove(),e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{e.querySelector(".wpcf7-not-valid-tip")?.remove(),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid"),"function"==typeof e.setCustomValidity&&e.setCustomValidity("")}))}))},l=(e,t,a)=>{e.querySelectorAll(`[data-reflection-of="${t}"]`).forEach((e=>{if("output"===e.tagName.toLowerCase()){const t=e;0===a.length&&a.push(t.dataset.default),a.slice(0,1).forEach((e=>{e instanceof File&&(e=e.name),t.textContent=e}))}else e.querySelectorAll("output").forEach((e=>{e.hasAttribute("data-default")?0===a.length?e.removeAttribute("hidden"):e.setAttribute("hidden","hidden"):e.remove()})),a.forEach((a=>{a instanceof File&&(a=a.name);const n=document.createElement("output");n.setAttribute("name",t),n.textContent=a,e.appendChild(n)}))}))};function p(e,t={}){if(wpcf7.blocked)return d(e),void n(e,"submitting");const o=new FormData(e);t.submitter&&t.submitter.name&&o.append(t.submitter.name,t.submitter.value);const c={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(o,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:o};r({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:o,wpcf7:{endpoint:"feedback",form:e,detail:c}}).then((t=>{const r=n(e,t.status);return c.status=t.status,c.apiResponse=t,["invalid","unaccepted","spam","aborted"].includes(r)?a(e,r,c):["sent","failed"].includes(r)&&a(e,`mail${r}`,c),a(e,"submit",c),t})).then((t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&t.invalid_fields.forEach((t=>{s(e,t.field,t.message)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=t.message}))})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:t,detail:r}=e.wpcf7;d(t),a(t,"beforesubmit",r),n(t,"submitting")}return t(e)}));const d=e=>{e.querySelectorAll(".wpcf7-form-control-wrap").forEach((t=>{t.dataset.name&&i(e,t.dataset.name)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=""}))};function f(e){const t=new FormData(e),o={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(t,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:t};r({endpoint:`contact-forms/${e.wpcf7.id}/refill`,method:"GET",wpcf7:{endpoint:"refill",form:e,detail:o}}).then((t=>{e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,n(e,"mail_sent")):n(e,"init"),o.apiResponse=t,a(e,"reset",o)})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"refill"===e.wpcf7.endpoint){const{form:t,detail:a}=e.wpcf7;d(t),n(t,"resetting")}return t(e)}));const u=(e,t)=>{for(const a in t){const n=t[a];e.querySelectorAll(`input[name="${a}"]`).forEach((e=>{e.value=""})),e.querySelectorAll(`img.wpcf7-captcha-${a.replaceAll(":","")}`).forEach((e=>{e.setAttribute("src",n)}));const r=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);r&&e.querySelectorAll(`input[name="_wpcf7_captcha_challenge_${a}"]`).forEach((e=>{e.value=r[1]}))}},m=(e,t)=>{for(const a in t){const n=t[a][0],r=t[a][1];e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${a}"]`).forEach((e=>{e.querySelector(`input[name="${a}"]`).value="",e.querySelector(".wpcf7-quiz-label").textContent=n,e.querySelector(`input[name="_wpcf7_quiz_answer_${a}"]`).value=r}))}};function w(e){const a=new FormData(e);e.wpcf7={id:t(a.get("_wpcf7")),status:e.getAttribute("data-status"),pluginVersion:a.get("_wpcf7_version"),locale:a.get("_wpcf7_locale"),unitTag:a.get("_wpcf7_unit_tag"),containerPost:t(a.get("_wpcf7_container_post")),parent:e.closest(".wpcf7"),get schema(){return wpcf7.schemas.get(this.id)}},wpcf7.schemas.set(e.wpcf7.id,void 0),e.querySelectorAll(".has-spinner").forEach((e=>{e.insertAdjacentHTML("afterend",'<span class="wpcf7-spinner"></span>')})),(e=>{e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((t=>{t.addEventListener("change",(t=>{const a=t.target.getAttribute("name");e.querySelectorAll(`input[type="checkbox"][name="${a}"]`).forEach((e=>{e!==t.target&&(e.checked=!1)}))}))}))})(e),(e=>{e.querySelectorAll(".has-free-text").forEach((t=>{const a=t.querySelector("input.wpcf7-free-text"),n=t.querySelector('input[type="checkbox"], input[type="radio"]');a.disabled=!n.checked,e.addEventListener("change",(e=>{a.disabled=!n.checked,e.target===n&&n.checked&&a.focus()}))}))})(e),(e=>{e.querySelectorAll(".wpcf7-validates-as-url").forEach((e=>{e.addEventListener("change",(t=>{let a=e.value.trim();a&&!a.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==a.indexOf(".")&&(a=a.replace(/^\/+/,""),a="http://"+a),e.value=a}))}))})(e),(e=>{if(!e.querySelector(".wpcf7-acceptance")||e.classList.contains("wpcf7-acceptance-as-validation"))return;const t=()=>{let t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((e=>{if(!t||e.classList.contains("optional"))return;const a=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&a.checked||!e.classList.contains("invert")&&!a.checked)&&(t=!1)})),e.querySelectorAll(".wpcf7-submit").forEach((e=>{e.disabled=!t}))};t(),e.addEventListener("change",(e=>{t()})),e.addEventListener("wpcf7reset",(e=>{t()}))})(e),(e=>{const a=(e,a)=>{const n=t(e.getAttribute("data-starting-value")),r=t(e.getAttribute("data-maximum-value")),o=t(e.getAttribute("data-minimum-value")),c=e.classList.contains("down")?n-a.value.length:a.value.length;e.setAttribute("data-current-value",c),e.innerText=c,r&&r<a.value.length?e.classList.add("too-long"):e.classList.remove("too-long"),o&&a.value.length<o?e.classList.add("too-short"):e.classList.remove("too-short")},n=t=>{t={init:!1,...t},e.querySelectorAll(".wpcf7-character-count").forEach((n=>{const r=n.getAttribute("data-target-name"),o=e.querySelector(`[name="${r}"]`);o&&(o.value=o.defaultValue,a(n,o),t.init&&o.addEventListener("keyup",(e=>{a(n,o)})))}))};n({init:!0}),e.addEventListener("wpcf7reset",(e=>{n()}))})(e),window.addEventListener("load",(t=>{wpcf7.cached&&e.reset()})),e.addEventListener("reset",(t=>{wpcf7.reset(e)})),e.addEventListener("submit",(t=>{wpcf7.submit(e,{submitter:t.submitter}),t.preventDefault()})),e.addEventListener("wpcf7submit",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("wpcf7reset",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("change",(t=>{t.target.closest(".wpcf7-form-control")&&wpcf7.validate(e,{target:t.target})})),e.addEventListener("wpcf7statuschanged",(t=>{const a=t.detail.status;e.querySelectorAll(".active-on-any").forEach((e=>{e.removeAttribute("inert"),e.classList.remove("active-on-any")})),e.querySelectorAll(`.inert-on-${a}`).forEach((e=>{e.setAttribute("inert","inert"),e.classList.add("active-on-any")}))}))}document.addEventListener("DOMContentLoaded",(t=>{var a;if("undefined"!=typeof wpcf7)if(void 0!==wpcf7.api)if("function"==typeof window.fetch)if("function"==typeof window.FormData)if("function"==typeof NodeList.prototype.forEach)if("function"==typeof String.prototype.replaceAll){wpcf7={init:w,submit:p,reset:f,validate:c,schemas:new Map,...null!==(a=wpcf7)&&void 0!==a?a:{}},document.querySelectorAll("form .wpcf7").forEach((t=>{const a=document.createElement("p");a.setAttribute("class","wpcf7-form-in-wrong-place");const n=document.createElement("strong");n.append((0,e.__)("Error:","contact-form-7"));const r=(0,e.__)("This contact form is placed in the wrong place.","contact-form-7");a.append(n," ",r),t.replaceWith(a)})),document.querySelectorAll(".wpcf7 > form").forEach((e=>{wpcf7.init(e),e.closest(".wpcf7").classList.replace("no-js","js")}));for(const e of wpcf7.schemas.keys())r({endpoint:`contact-forms/${e}/feedback/schema`,method:"GET"}).then((t=>{wpcf7.schemas.set(e,t)}))}else console.error("Your browser does not support String.replaceAll().");else console.error("Your browser does not support NodeList.forEach().");else console.error("Your browser does not support window.FormData().");else console.error("Your browser does not support window.fetch().");else console.error("wpcf7.api is not defined.");else console.error("wpcf7 is not defined.")}))})()</script> <script>document.addEventListener('DOMContentLoaded',function(){document.querySelectorAll('pre').forEach(function(pre){const code=pre.querySelector('code');if(code){const button=document.createElement('button');button.textContent='Copy';button.className='code-copy-button';button.addEventListener('click',function(){navigator.clipboard.writeText(code.textContent).then(()=>{button.textContent='Copied';setTimeout(()=>button.textContent='Copy',2000)}).catch(err=>console.error('Error copying text: ',err))});pre.insertBefore(button,code)}})})</script> <script src="https://lifetechia.com/wp-content/themes/cocoon-master/plugins/highlight-js/highlight.min.js?ver=6.7.2&fver=20240719115028" id="code-highlight-js-js"></script> <script id="code-highlight-js-js-after">(function($){$(".entry-content pre").each(function(i,block){hljs.highlightBlock(block)})})(jQuery)</script> <script>!function(e,t){"use strict";"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.baguetteBox=t()}(this,function(){"use strict";var r,l,u,c,d,f='<svg width="44" height="60"><polyline points="30 10 10 30 30 50" stroke="rgba(255,255,255,0.5)" stroke-width="4"stroke-linecap="butt" fill="none" stroke-linejoin="round"/></svg>',g='<svg width="44" height="60"><polyline points="14 10 34 30 14 50" stroke="rgba(255,255,255,0.5)" stroke-width="4"stroke-linecap="butt" fill="none" stroke-linejoin="round"/></svg>',p='<svg width="30" height="30"><g stroke="rgb(160,160,160)" stroke-width="4"><line x1="5" y1="5" x2="25" y2="25"/><line x1="5" y1="25" x2="25" y2="5"/></g></svg>',b={},v={captions:!0,buttons:"auto",fullScreen:!1,noScrollbars:!1,bodyClass:"baguetteBox-open",titleTag:!1,async:!1,preload:2,animation:"slideIn",afterShow:null,afterHide:null,onChange:null,overlayBackgroundColor:"rgba(0,0,0,.8)"},m={},h=[],o=0,n=!1,i={},a=!1,y=/.+\.(gif|jpe?g|png|webp|avif)$/i,w={},k=[],s=null,x=function(e){-1!==e.target.id.indexOf("baguette-img")&&j()},E=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,D()},C=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,X()},B=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,j()},T=function(e){i.count++,1<i.count&&(i.multitouch=!0),i.startX=e.changedTouches[0].pageX,i.startY=e.changedTouches[0].pageY},N=function(e){if(!a&&!i.multitouch){e.preventDefault?e.preventDefault():e.returnValue=!1;var t=e.touches[0]||e.changedTouches[0];40<t.pageX-i.startX?(a=!0,D()):t.pageX-i.startX<-40?(a=!0,X()):100<i.startY-t.pageY&&j()}},L=function(){i.count--,i.count<=0&&(i.multitouch=!1),a=!1},A=function(){L()},P=function(e){"block"===r.style.display&&r.contains&&!r.contains(e.target)&&(e.stopPropagation(),Y())};function S(e){if(w.hasOwnProperty(e)){var t=w[e].galleries;[].forEach.call(t,function(e){[].forEach.call(e,function(e){W(e.imageElement,"click",e.eventHandler)}),h===e&&(h=[])}),delete w[e]}}function F(e){switch(e.keyCode){case 37:D();break;case 39:X();break;case 27:j();break;case 36:!function t(e){e&&e.preventDefault();return M(0)}(e);break;case 35:!function n(e){e&&e.preventDefault();return M(h.length-1)}(e)}}function H(e,t){if(h!==e){for(h=e,function s(e){e=e||{};for(var t in v)b[t]=v[t],"undefined"!=typeof e[t]&&(b[t]=e[t]);l.style.transition=l.style.webkitTransition="fadeIn"===b.animation?"opacity .4s ease":"slideIn"===b.animation?"":"none","auto"===b.buttons&&("ontouchstart"in window||1===h.length)&&(b.buttons=!1);u.style.display=c.style.display=b.buttons?"":"none";try{r.style.backgroundColor=b.overlayBackgroundColor}catch(n){}}(t);l.firstChild;)l.removeChild(l.firstChild);for(var n,o=[],i=[],a=k.length=0;a<e.length;a++)(n=J("div")).className="full-image",n.id="baguette-img-"+a,k.push(n),o.push("baguetteBox-figure-"+a),i.push("baguetteBox-figcaption-"+a),l.appendChild(k[a]);r.setAttribute("aria-labelledby",o.join(" ")),r.setAttribute("aria-describedby",i.join(" "))}}function I(e){b.noScrollbars&&(document.documentElement.style.overflowY="hidden",document.body.style.overflowY="scroll"),"block"!==r.style.display&&(U(document,"keydown",F),i={count:0,startX:null,startY:null},q(o=e,function(){z(o),V(o)}),R(),r.style.display="block",b.fullScreen&&function t(){r.requestFullscreen?r.requestFullscreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.mozRequestFullScreen&&r.mozRequestFullScreen()}(),setTimeout(function(){r.className="visible",b.bodyClass&&document.body.classList&&document.body.classList.add(b.bodyClass),b.afterShow&&b.afterShow()},50),b.onChange&&b.onChange(o,k.length),s=document.activeElement,Y(),n=!0)}function Y(){b.buttons?u.focus():d.focus()}function j(){b.noScrollbars&&(document.documentElement.style.overflowY="auto",document.body.style.overflowY="auto"),"none"!==r.style.display&&(W(document,"keydown",F),r.className="",setTimeout(function(){r.style.display="none",document.fullscreen&&function e(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}(),b.bodyClass&&document.body.classList&&document.body.classList.remove(b.bodyClass),b.afterHide&&b.afterHide(),s&&s.focus(),n=!1},500))}function q(t,n){var e=k[t],o=h[t];if(void 0!==e&&void 0!==o)if(e.getElementsByTagName("img")[0])n&&n();else{var i=o.imageElement,a=i.getElementsByTagName("img")[0],s="function"==typeof b.captions?b.captions.call(h,i):i.getAttribute("data-caption")||i.title,r=function d(e){var t=e.href;if(e.dataset){var n=[];for(var o in e.dataset)"at-"!==o.substring(0,3)||isNaN(o.substring(3))||(n[o.replace("at-","")]=e.dataset[o]);for(var i=Object.keys(n).sort(function(e,t){return parseInt(e,10)<parseInt(t,10)?-1:1}),a=window.innerWidth*window.devicePixelRatio,s=0;s<i.length-1&&i[s]<a;)s++;t=n[i[s]]||t}return t}(i),l=J("figure");if(l.id="baguetteBox-figure-"+t,l.innerHTML='<div class="baguetteBox-spinner"><div class="baguetteBox-double-bounce1"></div><div class="baguetteBox-double-bounce2"></div></div>',b.captions&&s){var u=J("figcaption");u.id="baguetteBox-figcaption-"+t,u.innerHTML=s,l.appendChild(u)}e.appendChild(l);var c=J("img");c.onload=function(){var e=document.querySelector("#baguette-img-"+t+" .baguetteBox-spinner");l.removeChild(e),!b.async&&n&&n()},c.setAttribute("src",r),c.alt=a&&a.alt||"",b.titleTag&&s&&(c.title=s),l.appendChild(c),b.async&&n&&n()}}function X(){return M(o+1)}function D(){return M(o-1)}function M(e,t){return!n&&0<=e&&e<t.length?(H(t,b),I(e),!0):e<0?(b.animation&&O("left"),!1):e>=k.length?(b.animation&&O("right"),!1):(q(o=e,function(){z(o),V(o)}),R(),b.onChange&&b.onChange(o,k.length),!0)}function O(e){l.className="bounce-from-"+e,setTimeout(function(){l.className=""},400)}function R(){var e=100*-o+"%";"fadeIn"===b.animation?(l.style.opacity=0,setTimeout(function(){m.transforms?l.style.transform=l.style.webkitTransform="translate3d("+e+",0,0)":l.style.left=e,l.style.opacity=1},400)):m.transforms?l.style.transform=l.style.webkitTransform="translate3d("+e+",0,0)":l.style.left=e}function z(e){e-o>=b.preload||q(e+1,function(){z(e+1)})}function V(e){o-e>=b.preload||q(e-1,function(){V(e-1)})}function U(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent("on"+t,function(e){(e=e||window.event).target=e.target||e.srcElement,n(e)})}function W(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent("on"+t,n)}function G(e){return document.getElementById(e)}function J(e){return document.createElement(e)}return[].forEach||(Array.prototype.forEach=function(e,t){for(var n=0;n<this.length;n++)e.call(t,this[n],n,this)}),[].filter||(Array.prototype.filter=function(e,t,n,o,i){for(n=this,o=[],i=0;i<n.length;i++)e.call(t,n[i],i,n)&&o.push(n[i]);return o}),{run:function K(e,t){return m.transforms=function n(){var e=J("div");return"undefined"!=typeof e.style.perspective||"undefined"!=typeof e.style.webkitPerspective}(),m.svg=function o(){var e=J("div");return e.innerHTML="<svg/"+">","http://www.w3.org/2000/svg"===(e.firstChild&&e.firstChild.namespaceURI)}(),m.passiveEvents=function i(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(n){}return e}(),function a(){if(r=G("baguetteBox-overlay"))return l=G("baguetteBox-slider"),u=G("previous-button"),c=G("next-button"),void(d=G("close-button"));(r=J("div")).setAttribute("role","dialog"),r.id="baguetteBox-overlay",document.getElementsByTagName("body")[0].appendChild(r),(l=J("div")).id="baguetteBox-slider",r.appendChild(l),(u=J("button")).setAttribute("type","button"),u.id="previous-button",u.setAttribute("aria-label","Previous"),u.innerHTML=m.svg?f:"<",r.appendChild(u),(c=J("button")).setAttribute("type","button"),c.id="next-button",c.setAttribute("aria-label","Next"),c.innerHTML=m.svg?g:">",r.appendChild(c),(d=J("button")).setAttribute("type","button"),d.id="close-button",d.setAttribute("aria-label","Close"),d.innerHTML=m.svg?p:"×",r.appendChild(d),u.className=c.className=d.className="baguetteBox-button",function n(){var e=m.passiveEvents?{passive:!1}:null,t=m.passiveEvents?{passive:!0}:null;U(r,"click",x),U(u,"click",E),U(c,"click",C),U(d,"click",B),U(l,"contextmenu",A),U(r,"touchstart",T,t),U(r,"touchmove",N,e),U(r,"touchend",L),U(document,"focus",P,!0)}()}(),S(e),function s(e,a){var t=document.querySelectorAll(e),n={galleries:[],nodeList:t};return w[e]=n,[].forEach.call(t,function(e){a&&a.filter&&(y=a.filter);var t=[];if(t="A"===e.tagName?[e]:e.getElementsByTagName("a"),0!==(t=[].filter.call(t,function(e){if(-1===e.className.indexOf(a&&a.ignoreClass))return y.test(e.href)})).length){var i=[];[].forEach.call(t,function(e,t){var n=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,H(i,a),I(t)},o={eventHandler:n,imageElement:e};U(e,"click",n),i.push(o)}),n.galleries.push(i)}}),n.galleries}(e,t)},show:M,showNext:X,showPrevious:D,hide:j,destroy:function e(){!function n(){var e=m.passiveEvents?{passive:!1}:null,t=m.passiveEvents?{passive:!0}:null;W(r,"click",x),W(u,"click",E),W(c,"click",C),W(d,"click",B),W(l,"contextmenu",A),W(r,"touchstart",T,t),W(r,"touchmove",N,e),W(r,"touchend",L),W(document,"focus",P,!0)}(),function t(){for(var e in w)w.hasOwnProperty(e)&&S(e)}(),W(document,"keydown",F),document.getElementsByTagName("body")[0].removeChild(document.getElementById("baguetteBox-overlay")),w={},h=[],o=0}}})</script> <script id="baguettebox-js-js-after">(function($){baguetteBox.run(".entry-content")})(jQuery)</script> <script>!function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function e(a){return parseFloat(a)||0}function f(a){for(var b=0;a;)b+=a.offsetTop,a=a.offsetParent;return b}function g(){function c(){a.pageXOffset!=k.left?(k.top=a.pageYOffset,k.left=a.pageXOffset,n.refreshAll()):a.pageYOffset!=k.top&&(k.top=a.pageYOffset,k.left=a.pageXOffset,l.forEach(function(a){return a._recalcPosition()}))}function d(){f=setInterval(function(){l.forEach(function(a){return a._fastCheck()})},500)}function e(){clearInterval(f)}c(),a.addEventListener("scroll",c),a.addEventListener("resize",n.refreshAll),a.addEventListener("orientationchange",n.refreshAll);var f=void 0,g=void 0,h=void 0;"hidden"in b?(g="hidden",h="visibilitychange"):"webkitHidden"in b&&(g="webkitHidden",h="webkitvisibilitychange"),h?(b[g]||d(),b.addEventListener(h,function(){b[g]?e():d()})):d()}var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=!1;a.getComputedStyle?!function(){var a=b.createElement("div");["","-webkit-","-moz-","-ms-"].some(function(b){try{a.style.position=b+"sticky"}catch(a){}return""!=a.style.position})&&(i=!0)}():i=!0;var j="undefined"!=typeof ShadowRoot,k={top:null,left:null},l=[],m=function(){function g(a){if(c(this,g),!(a instanceof HTMLElement))throw new Error("First argument must be HTMLElement");if(l.some(function(b){return b._node===a}))throw new Error("Stickyfill is already applied to this node");this._node=a,this._stickyMode=null,this._active=!1,l.push(this),this.refresh()}return h(g,[{key:"refresh",value:function(){if(!i&&!this._removed){this._active&&this._deactivate();var c=this._node,g=getComputedStyle(c);if(!isNaN(parseFloat(g.top))&&"table-cell"!=g.display&&"none"!=g.display){this._active=!0;var h=c.parentNode,k=j&&h instanceof ShadowRoot?h.host:h,l=c.getBoundingClientRect(),m=k.getBoundingClientRect(),n=getComputedStyle(k);this._parent={node:k,styles:{position:k.style.position},offsetHeight:k.offsetHeight},this._offsetToWindow={left:l.left,right:b.documentElement.clientWidth-l.right},this._offsetToParent={top:l.top-m.top-e(n.borderTopWidth),left:l.left-m.left-e(n.borderLeftWidth),right:-l.right+m.right-e(n.borderRightWidth)},this._styles={position:c.style.position,top:c.style.top,bottom:c.style.bottom,left:c.style.left,right:c.style.right,width:c.style.width,marginTop:c.style.marginTop,marginLeft:c.style.marginLeft,marginRight:c.style.marginRight};var o=e(g.top);this._limits={start:l.top+a.pageYOffset-o,end:m.top+a.pageYOffset+k.offsetHeight-e(n.borderBottomWidth)-c.offsetHeight-o-e(g.marginBottom)};var p=n.position;"absolute"!=p&&"relative"!=p&&(k.style.position="relative");var q=this._clone={};q.node=b.createElement("div"),d(q.node.style,{width:l.right-l.left+"px",height:l.bottom-l.top+"px",marginTop:g.marginTop,marginBottom:g.marginBottom,marginLeft:g.marginLeft,marginRight:g.marginRight,cssFloat:g.cssFloat,padding:0,border:0,borderSpacing:0,fontSize:"1em",position:"static"}),h.insertBefore(q.node,c),q.docOffsetTop=f(q.node),this._recalcPosition()}}}},{key:"_recalcPosition",value:function(){if(this._active&&!this._removed){var a=k.top<=this._limits.start?"start":k.top>=this._limits.end?"end":"middle";if(this._stickyMode!=a){switch(a){case"start":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:this._offsetToParent.top+"px",bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"middle":d(this._node.style,{position:"fixed",left:this._offsetToWindow.left+"px",right:this._offsetToWindow.right+"px",top:this._styles.top,bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"end":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:"auto",bottom:0,width:"auto",marginLeft:0,marginRight:0})}this._stickyMode=a}}}},{key:"_fastCheck",value:function(){this._active&&!this._removed&&(Math.abs(f(this._clone.node)-this._clone.docOffsetTop)>1||Math.abs(this._parent.node.offsetHeight-this._parent.offsetHeight)>1)&&this.refresh()}},{key:"_deactivate",value:function(){var a=this;this._active&&!this._removed&&(this._clone.node.parentNode.removeChild(this._clone.node),delete this._clone,d(this._node.style,this._styles),delete this._styles,l.some(function(b){return b!==a&&b._parent&&b._parent.node===a._parent.node})||d(this._parent.node.style,this._parent.styles),delete this._parent,this._stickyMode=null,this._active=!1,delete this._offsetToWindow,delete this._offsetToParent,delete this._limits)}},{key:"remove",value:function(){var a=this;this._deactivate(),l.some(function(b,c){if(b._node===a._node)return l.splice(c,1),!0}),this._removed=!0}}]),g}(),n={stickies:l,Sticky:m,addOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}for(var b=0;b<l.length;b++)if(l[b]._node===a)return l[b];return new m(a)},add:function(a){if(a instanceof HTMLElement&&(a=[a]),a.length){for(var b=[],c=function(c){var d=a[c];return d instanceof HTMLElement?l.some(function(a){if(a._node===d)return b.push(a),!0})?"continue":void b.push(new m(d)):(b.push(void 0),"continue")},d=0;d<a.length;d++){c(d)}return b}},refreshAll:function(){l.forEach(function(a){return a.refresh()})},removeOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}l.some(function(b){if(b._node===a)return b.remove(),!0})},remove:function(a){if(a instanceof HTMLElement&&(a=[a]),a.length)for(var b=function(b){var c=a[b];l.some(function(a){if(a._node===c)return a.remove(),!0})},c=0;c<a.length;c++)b(c)},removeAll:function(){for(;l.length;)l[0].remove()}};i||g(),"undefined"!=typeof module&&module.exports?module.exports=n:a.Stickyfill=n}(window,document)</script> <script>(function(window,document){'use strict';if('IntersectionObserver' in window&&'IntersectionObserverEntry' in window&&'intersectionRatio' in window.IntersectionObserverEntry.prototype){if(!('isIntersecting' in window.IntersectionObserverEntry.prototype)){Object.defineProperty(window.IntersectionObserverEntry.prototype,'isIntersecting',{get:function(){return this.intersectionRatio>0}})} return} var registry=[];function IntersectionObserverEntry(entry){this.time=entry.time;this.target=entry.target;this.rootBounds=entry.rootBounds;this.boundingClientRect=entry.boundingClientRect;this.intersectionRect=entry.intersectionRect||getEmptyRect();this.isIntersecting=!!entry.intersectionRect;var targetRect=this.boundingClientRect;var targetArea=targetRect.width*targetRect.height;var intersectionRect=this.intersectionRect;var intersectionArea=intersectionRect.width*intersectionRect.height;if(targetArea){this.intersectionRatio=Number((intersectionArea/targetArea).toFixed(4))}else{this.intersectionRatio=this.isIntersecting?1:0}} function IntersectionObserver(callback,opt_options){var options=opt_options||{};if(typeof callback!='function'){throw new Error('callback must be a function')} if(options.root&&options.root.nodeType!=1){throw new Error('root must be an Element')} this._checkForIntersections=throttle(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT);this._callback=callback;this._observationTargets=[];this._queuedEntries=[];this._rootMarginValues=this._parseRootMargin(options.rootMargin);this.thresholds=this._initThresholds(options.threshold);this.root=options.root||null;this.rootMargin=this._rootMarginValues.map(function(margin){return margin.value+margin.unit}).join(' ')} IntersectionObserver.prototype.THROTTLE_TIMEOUT=100;IntersectionObserver.prototype.POLL_INTERVAL=null;IntersectionObserver.prototype.USE_MUTATION_OBSERVER=!0;IntersectionObserver.prototype.observe=function(target){var isTargetAlreadyObserved=this._observationTargets.some(function(item){return item.element==target});if(isTargetAlreadyObserved){return} if(!(target&&target.nodeType==1)){throw new Error('target must be an Element')} this._registerInstance();this._observationTargets.push({element:target,entry:null});this._monitorIntersections();this._checkForIntersections()};IntersectionObserver.prototype.unobserve=function(target){this._observationTargets=this._observationTargets.filter(function(item){return item.element!=target});if(!this._observationTargets.length){this._unmonitorIntersections();this._unregisterInstance()}};IntersectionObserver.prototype.disconnect=function(){this._observationTargets=[];this._unmonitorIntersections();this._unregisterInstance()};IntersectionObserver.prototype.takeRecords=function(){var records=this._queuedEntries.slice();this._queuedEntries=[];return records};IntersectionObserver.prototype._initThresholds=function(opt_threshold){var threshold=opt_threshold||[0];if(!Array.isArray(threshold))threshold=[threshold];return threshold.sort().filter(function(t,i,a){if(typeof t!='number'||isNaN(t)||t<0||t>1){throw new Error('threshold must be a number between 0 and 1 inclusively')} return t!==a[i-1]})};IntersectionObserver.prototype._parseRootMargin=function(opt_rootMargin){var marginString=opt_rootMargin||'0px';var margins=marginString.split(/\s+/).map(function(margin){var parts=/^(-?\d*\.?\d+)(px|%)$/.exec(margin);if(!parts){throw new Error('rootMargin must be specified in pixels or percent')} return{value:parseFloat(parts[1]),unit:parts[2]}});margins[1]=margins[1]||margins[0];margins[2]=margins[2]||margins[0];margins[3]=margins[3]||margins[1];return margins};IntersectionObserver.prototype._monitorIntersections=function(){if(!this._monitoringIntersections){this._monitoringIntersections=!0;if(this.POLL_INTERVAL){this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL)}else{addEvent(window,'resize',this._checkForIntersections,!0);addEvent(document,'scroll',this._checkForIntersections,!0);if(this.USE_MUTATION_OBSERVER&&'MutationObserver' in window){this._domObserver=new MutationObserver(this._checkForIntersections);this._domObserver.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}}}};IntersectionObserver.prototype._unmonitorIntersections=function(){if(this._monitoringIntersections){this._monitoringIntersections=!1;clearInterval(this._monitoringInterval);this._monitoringInterval=null;removeEvent(window,'resize',this._checkForIntersections,!0);removeEvent(document,'scroll',this._checkForIntersections,!0);if(this._domObserver){this._domObserver.disconnect();this._domObserver=null}}};IntersectionObserver.prototype._checkForIntersections=function(){var rootIsInDom=this._rootIsInDom();var rootRect=rootIsInDom?this._getRootRect():getEmptyRect();this._observationTargets.forEach(function(item){var target=item.element;var targetRect=getBoundingClientRect(target);var rootContainsTarget=this._rootContainsTarget(target);var oldEntry=item.entry;var intersectionRect=rootIsInDom&&rootContainsTarget&&this._computeTargetAndRootIntersection(target,rootRect);var newEntry=item.entry=new IntersectionObserverEntry({time:now(),target:target,boundingClientRect:targetRect,rootBounds:rootRect,intersectionRect:intersectionRect});if(!oldEntry){this._queuedEntries.push(newEntry)}else if(rootIsInDom&&rootContainsTarget){if(this._hasCrossedThreshold(oldEntry,newEntry)){this._queuedEntries.push(newEntry)}}else{if(oldEntry&&oldEntry.isIntersecting){this._queuedEntries.push(newEntry)}}},this);if(this._queuedEntries.length){this._callback(this.takeRecords(),this)}};IntersectionObserver.prototype._computeTargetAndRootIntersection=function(target,rootRect){if(window.getComputedStyle(target).display=='none')return;var targetRect=getBoundingClientRect(target);var intersectionRect=targetRect;var parent=getParentNode(target);var atRoot=!1;while(!atRoot){var parentRect=null;var parentComputedStyle=parent.nodeType==1?window.getComputedStyle(parent):{};if(parentComputedStyle.display=='none')return;if(parent==this.root||parent==document){atRoot=!0;parentRect=rootRect}else{if(parent!=document.body&&parent!=document.documentElement&&parentComputedStyle.overflow!='visible'){parentRect=getBoundingClientRect(parent)}} if(parentRect){intersectionRect=computeRectIntersection(parentRect,intersectionRect);if(!intersectionRect)break} parent=getParentNode(parent)} return intersectionRect};IntersectionObserver.prototype._getRootRect=function(){var rootRect;if(this.root){rootRect=getBoundingClientRect(this.root)}else{var html=document.documentElement;var body=document.body;rootRect={top:0,left:0,right:html.clientWidth||body.clientWidth,width:html.clientWidth||body.clientWidth,bottom:html.clientHeight||body.clientHeight,height:html.clientHeight||body.clientHeight}} return this._expandRectByRootMargin(rootRect)};IntersectionObserver.prototype._expandRectByRootMargin=function(rect){var margins=this._rootMarginValues.map(function(margin,i){return margin.unit=='px'?margin.value:margin.value*(i%2?rect.width:rect.height)/100});var newRect={top:rect.top-margins[0],right:rect.right+margins[1],bottom:rect.bottom+margins[2],left:rect.left-margins[3]};newRect.width=newRect.right-newRect.left;newRect.height=newRect.bottom-newRect.top;return newRect};IntersectionObserver.prototype._hasCrossedThreshold=function(oldEntry,newEntry){var oldRatio=oldEntry&&oldEntry.isIntersecting?oldEntry.intersectionRatio||0:-1;var newRatio=newEntry.isIntersecting?newEntry.intersectionRatio||0:-1;if(oldRatio===newRatio)return;for(var i=0;i<this.thresholds.length;i++){var threshold=this.thresholds[i];if(threshold==oldRatio||threshold==newRatio||threshold<oldRatio!==threshold<newRatio){return!0}}};IntersectionObserver.prototype._rootIsInDom=function(){return!this.root||containsDeep(document,this.root)};IntersectionObserver.prototype._rootContainsTarget=function(target){return containsDeep(this.root||document,target)};IntersectionObserver.prototype._registerInstance=function(){if(registry.indexOf(this)<0){registry.push(this)}};IntersectionObserver.prototype._unregisterInstance=function(){var index=registry.indexOf(this);if(index!=-1)registry.splice(index,1);};function now(){return window.performance&&performance.now&&performance.now()} function throttle(fn,timeout){var timer=null;return function(){if(!timer){timer=setTimeout(function(){fn();timer=null},timeout)}}} function addEvent(node,event,fn,opt_useCapture){if(typeof node.addEventListener=='function'){node.addEventListener(event,fn,opt_useCapture||!1)}else if(typeof node.attachEvent=='function'){node.attachEvent('on'+event,fn)}} function removeEvent(node,event,fn,opt_useCapture){if(typeof node.removeEventListener=='function'){node.removeEventListener(event,fn,opt_useCapture||!1)}else if(typeof node.detatchEvent=='function'){node.detatchEvent('on'+event,fn)}} function computeRectIntersection(rect1,rect2){var top=Math.max(rect1.top,rect2.top);var bottom=Math.min(rect1.bottom,rect2.bottom);var left=Math.max(rect1.left,rect2.left);var right=Math.min(rect1.right,rect2.right);var width=right-left;var height=bottom-top;return(width>=0&&height>=0)&&{top:top,bottom:bottom,left:left,right:right,width:width,height:height}} function getBoundingClientRect(el){var rect;try{rect=el.getBoundingClientRect()}catch(err){} if(!rect)return getEmptyRect();if(!(rect.width&&rect.height)){rect={top:rect.top,right:rect.right,bottom:rect.bottom,left:rect.left,width:rect.right-rect.left,height:rect.bottom-rect.top}} return rect} function getEmptyRect(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}} function containsDeep(parent,child){var node=child;while(node){if(node==parent)return!0;node=getParentNode(node)} return!1} function getParentNode(node){var parent=node.parentNode;if(parent&&parent.nodeType==11&&parent.host){return parent.host} if(parent&&parent.assignedSlot){return parent.assignedSlot.parentNode} return parent} window.IntersectionObserver=IntersectionObserver;window.IntersectionObserverEntry=IntersectionObserverEntry}(window,document))</script> <script>!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict";var g=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},r="undefined"!=typeof document&&document.documentMode,l={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var e=document.createElement("img");r&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),t.appendChild(e)}t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset")),t.getAttribute("data-background-image")&&(t.style.backgroundImage="url('"+t.getAttribute("data-background-image")+"')"),t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function f(t){t.setAttribute("data-loaded",!0)}var b=function(t){return"true"===t.getAttribute("data-loaded")};return function(){var r,o,a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=g({},l,t),n=e.root,i=e.rootMargin,d=e.threshold,u=e.load,c=e.loaded,s=void 0;return window.IntersectionObserver&&(s=new IntersectionObserver((r=u,o=c,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),b(t.target)||(r(t.target),f(t.target),o(t.target)))})}),{root:n,rootMargin:i,threshold:d})),{observe:function(){for(var t=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)}(a,n),e=0;e<t.length;e++)b(t[e])||(s?s.observe(t[e]):(u(t[e]),f(t[e]),c(t[e])))},triggerLoad:function(t){b(t)||(u(t),f(t),c(t))},observer:s}}})</script> <script id="lazy-load-js-js-after">const observer=lozad(".lozad",{rootMargin:"0px 500px 500px"});observer.observe()</script> <script>window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window)</script> <script id="cocoon-js-js-extra">var cocoon_localize_script_options={"is_lazy_load_enable":"1","is_fixed_mobile_buttons_enable":"","is_google_font_lazy_load_enable":"1"}</script> <script>(function($){var prevScrollTop=-1;var $window=$(window);$window.scroll(function(){var scrollTop=$window.scrollTop();var threashold=600;var s1=(prevScrollTop>threashold);var s2=(scrollTop>threashold);if(s1^s2){if(s2){$('.go-to-top').fadeIn('slow')}else{$('.go-to-top').fadeOut('slow')}} prevScrollTop=scrollTop});$('.go-to-top-common').click(function(){$('body,html').animate({scrollTop:1},800)});$('.go-to-toc-common').click(function(){$('body,html').animate({scrollTop:$('.entry-content .toc').offset().top},800)});$('#search-menu-input').change(function(e){var searchEdit=$('#search-menu-content .search-edit').first();if(e.target.checked){searchEdit.focus()}else{searchEdit.blur()}});var adminMenu=$("#admin-panel");var adminHeight=adminMenu.outerHeight();var adminStartPos=0;$(window).scroll(function(){var adminCurrentPos=$(this).scrollTop();if(adminCurrentPos>adminStartPos){if(adminCurrentPos>=200){adminMenu.css("bottom","-"+adminHeight+"px")}}else{adminMenu.css("bottom",0)} adminStartPos=adminCurrentPos});if(cocoon_localize_script_options.is_fixed_mobile_buttons_enable!=1){var headerMenu=$('.mobile-header-menu-buttons');var headerHight=headerMenu.outerHeight();var headerStartPos=0;$(window).scroll(function(){var headerCurrentPos=$(this).scrollTop();if(headerCurrentPos>headerStartPos){if(headerCurrentPos>=100){headerMenu.css('top','-'+headerHight+'px')}}else{headerMenu.css('top',0)} headerStartPos=headerCurrentPos});var footerMenu=$(".mobile-footer-menu-buttons");var footerHeight=footerMenu.outerHeight();var footerStartPos=0;$(window).scroll(function(){var footerCurrentPos=$(this).scrollTop();if(footerCurrentPos>footerStartPos){if(footerCurrentPos>=100){footerMenu.css("bottom","calc( -1 * (env(safe-area-inset-bottom) + "+footerHeight+"px) )")}}else if(footerCurrentPos-footerStartPos<-8){footerMenu.css("bottom",0)} footerStartPos=footerCurrentPos});var headerButtons=$(".mobile-header-menu-buttons");var footerButtons=$(".mobile-footer-menu-buttons");headerButtons.click(function(){headerButtons.css("z-index","3");footerButtons.css("z-index","2")});footerButtons.click(function(){headerButtons.css("z-index","2");footerButtons.css("z-index","3")})} const clickEventType=((window.ontouchstart!==null)?'click':'touchend');$(document).on(clickEventType,'#comment-reply-btn, .comment-reply-link',function(){$('#comment-reply-btn').slideUp();const respond=document.getElementById('respond');const styles={inset:'auto',position:'static',visibility:'visible'};Object.entries(styles).forEach(([key,value])=>{respond.style[key]=value});$('#respond').slideDown()});$('.sbtn').click(function(){var w=$(this).prev('.sform').text();if(w)window.open('https://www.google.co.jp/search?q='+encodeURIComponent(w),'_blank');});$('.sidebar-menu-content .widget_archive select').change(function(){document.location.href=this.options[this.selectedIndex].value});$('.sidebar-menu-content .widget_categories select').change(function(){if(this.options[this.selectedIndex].value>0){this.parentNode.submit()}});function drawerCloser(selecter,checkbox){$(selecter).click(function(){$(checkbox).prop('checked',!1)})} drawerCloser('.menu-drawer .menu-item a','#navi-menu-input');drawerCloser('#slide-in-sidebar a','#sidebar-menu-input');$('.mobile-menu-buttons').each(function(){if($(this).has('.logo-menu-button').length){$(this).addClass('has-logo-button')}});$(window).on('load',function(){$('#carousel').addClass('loaded')});$('.is-style-accordion > .faq > .faq-answer').hide();$('.is-style-accordion > .faq > .faq-question').click(function(){$(this).next('.is-style-accordion .faq-answer').slideToggle();$(this).toggleClass('active')});$('#sidebar-menu-input').change(function(){if($(this).prop('checked')){$('#sidebar').appendTo('#sidebar-menu-content');$('#sidebar').attr('id','slide-in-sidebar');$('#sidebar').addClass('slide-in-sidebar');drawerCloser('#slide-in-sidebar a','#sidebar-menu-input')}else{$('#sidebar').removeClass('slide-in-sidebar');$('#slide-in-sidebar').attr('id','sidebar');$('#sidebar').insertAfter('#main')}});var vw=window.innerWidth;$(window).resize(function(){if(vw!=window.innerWidth){$('#sidebar-menu-input').prop('checked',!1).change()} vw=window.innerWidth})})(jQuery);(function(){var f=document.querySelectorAll(".video-click");for(var i=0;i<f.length;++i){f[i].onclick=function(){var iframe=this.getAttribute("data-iframe");this.parentElement.innerHTML='<div class="video"'+'>'+iframe+'</div'+'>'}}})()</script> <script>document.addEventListener('DOMContentLoaded',function(){document.querySelectorAll('pre').forEach(function(pre){const code=pre.querySelector('code');if(code){const button=document.createElement('button');button.textContent='Copy';button.className='code-copy-button';button.addEventListener('click',function(){navigator.clipboard.writeText(code.textContent).then(()=>{button.textContent='Copied';setTimeout(()=>button.textContent='Copy',2000)}).catch(err=>console.error('Error copying text: ',err))});pre.insertBefore(button,code)}})})</script> <div class="copy-info">タイトルとURLをコピーしました</div> <script>(function($){const selector='.copy-button';$(selector).click(function(event){event.preventDefault();navigator.clipboard.writeText($(selector).attr('data-clipboard-text')).then(()=>{$('.copy-info').fadeIn(500).delay(1000).fadeOut(500)})})})(jQuery)</script> </div><!-- #container --> </body> </html>