CINXE.COM
Tech カテゴリー - 氾濫原
<!DOCTYPE html> <html data-auth="" data-permalink="" itemscope itemtype="http://schema.org/Blog" lang=ja> <head> <meta charset=utf-8> <title>Tech カテゴリー - 氾濫原</title> <meta content="width=device-width,initial-scale=1,maximum-scale=2,user-scalable=yes" name=viewport> <meta content=#000000 name=theme-color> <link href=/feed rel=alternate title=Feed type=application/atom+xml> <meta content=unsafe-url name=referrer> <meta content="Tech カテゴリー - 氾濫原" itemprop=name> <meta content=写真・文章による、ある普通の人間の人生の記録 itemprop=description> <meta content="Tech カテゴリー - 氾濫原" property=og:title> <meta content="blog" property=og:type> <meta content="https://lowreal.net/" property=og:url> <meta content=cho45@lowreal.net property=og:email> <meta content=cho45 property=fb:admins> <link href="/css/style.css" rel=stylesheet> <link href="/css/github.css" rel=stylesheet> <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap" rel=stylesheet> <link href="/api/similar?id=21969&id=21963&id=21962&" rel=preload as=fetch crossorigin id=preload-similar-entries> <link href="/api/exif?id=21969&id=21963&id=21962&" rel=preload as=fetch crossorigin id=preload-exif-entries> <!-- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <rdf:Description rdf:about="https://lowreal.net/"> <foaf:maker rdf:parseType="Resource"> <foaf:holdsAccount> <foaf:OnlineAccount foaf:accountName="cho45"> <foaf:accountServiceHomepage rdf:resource="http://www.hatena.ne.jp/"/> </foaf:OnlineAccount> </foaf:holdsAccount> </foaf:maker> </rdf:Description> </rdf:RDF> --> <!--[if lt IE 9]><script src=https://html5shiv.googlecode.com/svn/trunk/html5.js></script><![endif]--> <script defer src="/js/daterelative.js"></script> <script defer src="/js/balancetext/tinysegmenter.js"></script> <script defer src="/js/balancetext/balance.js"></script> <script defer src="/js/abcjs_basic_5.1.1-min.js"></script> <script defer src="/js/nogag.js"></script> </head> <body> <header id=global-header> <h1 id=header> <a href=/ > <img alt="Tech カテゴリー - 氾濫原" height=50 src=/images/hanrangen.svg width=60 style=margin:auto;display:block> </a> </h1> </header> <nav id=global-navigation> <ul> <li><a href=/ >最新</a></li> <li><a href=/photo/ >写真</a></li> <li><a href=https://www.lowreal.net/ >誰?</a></li> </ul> </nav> <div id=content> <header id=category-header> <h2>Category tech. </h2> </header> <div class=entries> <div class=date><a href="/2025/01/24/">2025年 01月 24日</a></div> <article class="tech status-public" data-id="21969" id="post-1737716501" itemprop=blogPosts itemscope itemtype=http://schema.org/BlogPosting> <header> <h2 itemprop=name><a href="/2025/01/24/1" class=bookmark rel=bookmark itemprop=url>Google Spreadsheet で配列リテラルに QUERY() したときのカラム名</a></h2> <div class=metadata> <a href="/tech/"><span itemprop=keywords>tech</span></a> | <time datetime="2025-01-24T11:01:41Z" data-epoch="1737716501" itemprop=datePublished> 20:01 </time> | <div style=display:none> <meta content="/2025/01/24/1" itemprop=mainEntityOfPage itemscope itemtype=https://schema.org/WebPage> <span itemprop=headline>Google Spreadsheet は {A:A, C:C, R:R} みたいに式を書くと、横方向に結合して新しいテーブルとして評価…</span> <span itemprop=author itemscope itemtype=https://schema.org/Person> <a href=http://www.lowreal.net/ itemprop=url> <span itemprop=name>cho45</span> </a> </span> <div itemprop=publisher itemscope itemtype=https://schema.org/Organization> <div itemprop=logo itemscope itemtype=https://schema.org/ImageObject> <meta content=https://www.lowreal.net/images/logo.png itemprop=url> <meta content=189 itemprop=width> <meta content=105 itemprop=height> </div> <meta content=cho45 itemprop=name> </div> <meta content="2025-01-24T11:01:41Z" itemprop=datePublished> <meta content="2025-01-24T11:02:15Z" itemprop=dateModified> <div itemprop=image itemscope itemtype=https://schema.org/ImageObject> <meta content=https://www.lowreal.net/images/logo.png itemprop=url> <meta content=189 itemprop=width> <meta content=105 itemprop=height> </div> </div> </div> </header> <div class=content itemprop=articleBody> <p>Google Spreadsheet は <code>{A:A, C:C, R:R}</code> みたいに式を書くと、横方向に結合して新しいテーブルとして評価することができる (縦に連結する場合はセミコロン)。これは「配列」と呼ばれている。<a href="https://support.google.com/docs/answer/6208276?hl=ja">配列</a></p> <figure class=quote> <blockquote> <p>配列とは、値を含む行と列からなるテーブルのことです</p> </blockquote> </figure><p>このテーブルに対して QUERY する場合、カラム名は Col1 Col2 ... となるらしい。<p>例えばこのように</p> <pre class=code>QUERY({SheetA!$C:$C,INDEX(IFERROR(VALUE(SheetA!O:O), 0))}, "SELECT SUM(Col2) WHERE Col1 = '"&$C6&"' LABEL SUM(Col2)''", 1)</pre> <section class=level-1> <h3>QUERY の結果からカラム名を消したい場合</h3> <p>LABEL Col1 "" のように SELECT したカラムに対してラベルを空にすると消えてくれる。</p> </section> <ol itemscope itemtype=http://schema.org/BreadcrumbList><li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem><a href=/ itemprop=item><span itemprop=name>トップ</span></a> <meta content=1 itemprop=position> </li> <li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem> <a href="/tech/" itemprop=item><span itemprop=name>tech</span></a> <meta content=2 itemprop=position> </li> <li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem> <a href="https://lowreal.net/2025/01/24/1" itemprop=item><span itemprop=name>Google Spreadsheet で配列リテラルに QUERY() したときのカラム名</span></a> <meta content=3 itemprop=position> </li> </ol> </div> <div class="content similar-entries"> </div> <div class=social> <span class=hatena-star></span> <p class=share-buttons> <a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Flowreal.net%2F2025%2F01%2F24%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Facebook","Share","https://lowreal.net/2025/01/24/1")' style=background:#3b5998 target=_blank> <img alt=Facebook height=18 src=/images/sharebuttons/FB-f-Logo__white_50.png width=18> </a> <a href="https://bsky.app/intent/compose?text=Google%20Spreadsheet%20%E3%81%A7%E9%85%8D%E5%88%97%E3%83%AA%E3%83%86%E3%83%A9%E3%83%AB%E3%81%AB%20QUERY%28%29%20%E3%81%97%E3%81%9F%E3%81%A8%E3%81%8D%E3%81%AE%E3%82%AB%E3%83%A9%E3%83%A0%E5%90%8D%20https%3A%2F%2Flowreal.net%2F2025%2F01%2F24%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Bluesky","Share","https://lowreal.net/2025/01/24/1")' style=background:#efefef target=_blank> <img alt=Bluesky height=40 src=/images/bluesky_media_kit_logo_svgs.svg width=40> </a> <a href="http://b.hatena.ne.jp/add?url=https%3A%2F%2Flowreal.net%2F2025%2F01%2F24%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Hatena::Bookmark","Share","https://lowreal.net/2025/01/24/1")' style=background:#00a4de target=_blank> <img alt=はてなブックマーク height=40 src=/images/sharebuttons/hatenabookmark-logomark.svg width=40> </a> </p> </div> </article> <div class=date><a href="/2024/12/15/">2024年 12月 15日</a></div> <article class="tech status-public" data-id="21963" id="post-1734234965" itemprop=blogPosts itemscope itemtype=http://schema.org/BlogPosting> <header> <h2 itemprop=name><a href="/2024/12/15/1" class=bookmark rel=bookmark itemprop=url>この日記上の Twitter 関係のボタンを削除した</a></h2> <div class=metadata> <a href="/tech/"><span itemprop=keywords>tech</span></a> | <time datetime="2024-12-15T03:56:05Z" data-epoch="1734234965" itemprop=datePublished> 12:56 </time> | <div style=display:none> <meta content="/2024/12/15/1" itemprop=mainEntityOfPage itemscope itemtype=https://schema.org/WebPage> <span itemprop=headline>Bluesky に置き換えた。Bluesky の共有は以下のようにすればいいみたい https://bsky.app/intent/compose?…</span> <span itemprop=author itemscope itemtype=https://schema.org/Person> <a href=http://www.lowreal.net/ itemprop=url> <span itemprop=name>cho45</span> </a> </span> <div itemprop=publisher itemscope itemtype=https://schema.org/Organization> <div itemprop=logo itemscope itemtype=https://schema.org/ImageObject> <meta content=https://www.lowreal.net/images/logo.png itemprop=url> <meta content=189 itemprop=width> <meta content=105 itemprop=height> </div> <meta content=cho45 itemprop=name> </div> <meta content="2024-12-15T03:56:05Z" itemprop=datePublished> <meta content="2024-12-15T03:57:02Z" itemprop=dateModified> <div itemprop=image itemscope itemtype=https://schema.org/ImageObject> <meta content="/images/entry/20241215125556-_2024-12-15_12.55.35.png" itemprop=url> <meta content=800 itemprop=width> <meta content=800 itemprop=height> </div> </div> </div> </header> <div class=content itemprop=articleBody> <p> <span data-key=undefined itemscope itemtype=http://schema.org/Photograph> <a class=picasa href=/images/entry/20241215125556-_2024-12-15_12.55.35.png itemprop=url><img alt=photo itemprop=image src=/images/entry/20241215125556-_2024-12-15_12.55.35.png></a> </span> <p>Bluesky に置き換えた。Bluesky の共有は以下のようにすればいいみたい</p> <pre class=code>https://bsky.app/intent/compose?text=...</pre> <ol itemscope itemtype=http://schema.org/BreadcrumbList><li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem><a href=/ itemprop=item><span itemprop=name>トップ</span></a> <meta content=1 itemprop=position> </li> <li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem> <a href="/tech/" itemprop=item><span itemprop=name>tech</span></a> <meta content=2 itemprop=position> </li> <li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem> <a href="https://lowreal.net/2024/12/15/1" itemprop=item><span itemprop=name>この日記上の Twitter 関係のボタンを削除した</span></a> <meta content=3 itemprop=position> </li> </ol> </div> <div class="content similar-entries"> </div> <div class=social> <span class=hatena-star></span> <p class=share-buttons> <a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Flowreal.net%2F2024%2F12%2F15%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Facebook","Share","https://lowreal.net/2024/12/15/1")' style=background:#3b5998 target=_blank> <img alt=Facebook height=18 src=/images/sharebuttons/FB-f-Logo__white_50.png width=18> </a> <a href="https://bsky.app/intent/compose?text=%E3%81%93%E3%81%AE%E6%97%A5%E8%A8%98%E4%B8%8A%E3%81%AE%20Twitter%20%E9%96%A2%E4%BF%82%E3%81%AE%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E5%89%8A%E9%99%A4%E3%81%97%E3%81%9F%20https%3A%2F%2Flowreal.net%2F2024%2F12%2F15%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Bluesky","Share","https://lowreal.net/2024/12/15/1")' style=background:#efefef target=_blank> <img alt=Bluesky height=40 src=/images/bluesky_media_kit_logo_svgs.svg width=40> </a> <a href="http://b.hatena.ne.jp/add?url=https%3A%2F%2Flowreal.net%2F2024%2F12%2F15%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Hatena::Bookmark","Share","https://lowreal.net/2024/12/15/1")' style=background:#00a4de target=_blank> <img alt=はてなブックマーク height=40 src=/images/sharebuttons/hatenabookmark-logomark.svg width=40> </a> </p> </div> </article> <div class=date><a href="/2024/12/05/">2024年 12月 05日</a></div> <article class="tech status-public" data-id="21962" id="post-1733335047" itemprop=blogPosts itemscope itemtype=http://schema.org/BlogPosting> <header> <h2 itemprop=name><a href="/2024/12/05/1" class=bookmark rel=bookmark itemprop=url>FNIRSI DPS-150 安定化電源のUSBプロトコルを解析してアプリ実装した</a></h2> <div class=metadata> <a href="/tech/"><span itemprop=keywords>tech</span></a> | <time datetime="2024-12-04T17:57:27Z" data-epoch="1733335047" itemprop=datePublished> 02:57 </time> | <div style=display:none> <meta content="/2024/12/05/1" itemprop=mainEntityOfPage itemscope itemtype=https://schema.org/WebPage> <span itemprop=headline>FNIRSI DPS-150 直流安定化電源 0~30V 0~5A電圧電流調整 CNC プログラマブルスイッチング電源 4桁 IPSディ…</span> <span itemprop=author itemscope itemtype=https://schema.org/Person> <a href=http://www.lowreal.net/ itemprop=url> <span itemprop=name>cho45</span> </a> </span> <div itemprop=publisher itemscope itemtype=https://schema.org/Organization> <div itemprop=logo itemscope itemtype=https://schema.org/ImageObject> <meta content=https://www.lowreal.net/images/logo.png itemprop=url> <meta content=189 itemprop=width> <meta content=105 itemprop=height> </div> <meta content=cho45 itemprop=name> </div> <meta content="2024-12-04T17:57:27Z" itemprop=datePublished> <meta content="2024-12-04T17:59:31Z" itemprop=dateModified> <div itemprop=image itemscope itemtype=https://schema.org/ImageObject> <meta content="https://m.media-amazon.com/images/I/51+2px7gbsL._SL500_.jpg" itemprop=url> <meta content=800 itemprop=width> <meta content=800 itemprop=height> </div> </div> </div> </header> <div class=content itemprop=articleBody> <p><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen frameborder=0 height=315 referrerpolicy=strict-origin-when-cross-origin src="https://www.youtube.com/embed/_RqsPEhD9YM?si=J-HKRHcDk6CvCf_M" title="YouTube video player" width=560></iframe></p><br> <p> </p> <figure class=amazon itemscope itemtype=http://schema.org/Review> <div class=image> <a href="https://www.amazon.co.jp/dp/B0DJ94NJC9?tag=nuso-22&linkCode=ogi&th=1&psc=1"><img alt="FNIRSI DPS-150 直流安定化電源 0~30V 0~5A電圧電流調整 CNC プログラマブルスイッチング電源 4桁 IPSディスプレイ 150W低雑音 高精度 研究実験室用 テスト修理 バッテリー充電 電気のメンテナンス - FNIRSI" height=500 itemprop=image src=https://m.media-amazon.com/images/I/51+2px7gbsL._SL500_.jpg width=500></a> </div> <figcaption class=detail> <p class=title itemprop=itemReviewed itemscope itemtype=http://schema.org/Product> <a href="https://www.amazon.co.jp/dp/B0DJ94NJC9?tag=nuso-22&linkCode=ogi&th=1&psc=1" itemprop=url><span itemprop=name>FNIRSI DPS-150 直流安定化電源 0~30V 0~5A電圧電流調整 CNC プログラマブルスイッチング電源 4桁 IPSディスプレイ 150W低雑音 高精度 研究実験室用 テスト修理 バッテリー充電 電気のメンテナンス</span></a> <span itemprop=review itemscope itemtype=http://schema.org/Review> <span itemprop=author itemscope itemtype=https://schema.org/Person> <span itemprop=name>cho45</span> </span> </span> </p> <p class=author>FNIRSI</p> <div class=rating data-rating=5.0 itemprop=reviewRating itemscope itemtype=http://schema.org/Rating> ★ <meta content=1.0 itemprop=worstRating> <span itemprop=ratingValue>5.0</span> / <span itemprop=bestRating>5.0</span> </div> <span itemprop=author itemscope itemtype=https://schema.org/Person style=display:none> <a href=http://www.lowreal.net/ itemprop=url> <span itemprop=name>cho45</span> </a> </span> </figcaption> </figure> <p> <p>FNIRSI DPS-150 という実験用の直流安定化電源を買ってみた。USB-PD から電源をひっぱってこれるという最近の流行りというか ALIENTEK DP100 とかの系統の製品<p>特別悪いところは今のところ感じてない。50mV以下の電圧にはならないぐらい。画面が大きくてみやすい。<p>FNIRSI というと<a href=https://lowreal.net/2021/01/19/1>あやしいオシロスコープを買ったことがある</a>のでスペック表記はあんまり信用できない。</p> <section class=level-1> <h3>USBのプロトコル解析とウェブアプリ化</h3> <p>冒頭の動画で説明してるけどUSBプロトコル(シリアルポート)を解析してウェブアプリとして再実装した。JSでプログラマブルに制御を書けるようになった。</p> <ul> <li><a href=https://github.com/cho45/fnirsi-dps-150>https://github.com/cho45/fnirsi-dps-150</a></li> </ul> <section class=level-2> <h4>ウェブアプリの細かい話1: タイムアウト付きのJS実行</h4> <p>プログラマブルにするにあたって、うっかり無限ループを書いたときのためにスクリプトの実行時間にタイムアウトをつけたいなと思った。<p>かつてはそんなこと実現できなかったけど、今は Worker#terminate() があるので、Worker 化できる関数なら実現できるみたいだった。functionWithTimeout() みたいな関数を作ってみたけど動いてる。<p><a href=https://gist.github.com/cho45/cda6bb74d3d82790663762da43298538>https://gist.github.com/cho45/cda6bb74d3d82790663762da43298538</a></p> </section> <section class=level-2> <h4>ウェブアプリの細かい話1: シリアルポート通信のWorker化</h4> <p>ブラウザのコンテキストだと、タブが非アクティブになったときなどに、 setTimeout() の時間がとんでもないことになるとか、いろいろ制限がある。<p>面倒くさくても定期的に処理を行いたい通信プロセスは Worker に逃がすほうが良い。Comlink を使っている。</p><br> <p></p> </section> </section> <section class=level-1> <h3>ref</h3> <ul> <li><a href=https://lowreal.net/2021/01/19/1>FNIRSI-1013D オシロというやつを買ってみたが帯域は怪しい | tech - 氾濫原</a></li> </ul> </section> <ol itemscope itemtype=http://schema.org/BreadcrumbList><li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem><a href=/ itemprop=item><span itemprop=name>トップ</span></a> <meta content=1 itemprop=position> </li> <li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem> <a href="/tech/" itemprop=item><span itemprop=name>tech</span></a> <meta content=2 itemprop=position> </li> <li itemprop=itemListElement itemscope itemtype=http://schema.org/ListItem> <a href="https://lowreal.net/2024/12/05/1" itemprop=item><span itemprop=name>FNIRSI DPS-150 安定化電源のUSBプロトコルを解析してアプリ実装した</span></a> <meta content=3 itemprop=position> </li> </ol> </div> <div class="content similar-entries"> </div> <div class=social> <span class=hatena-star></span> <p class=share-buttons> <a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Flowreal.net%2F2024%2F12%2F05%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Facebook","Share","https://lowreal.net/2024/12/05/1")' style=background:#3b5998 target=_blank> <img alt=Facebook height=18 src=/images/sharebuttons/FB-f-Logo__white_50.png width=18> </a> <a href="https://bsky.app/intent/compose?text=FNIRSI%20DPS-150%20%E5%AE%89%E5%AE%9A%E5%8C%96%E9%9B%BB%E6%BA%90%E3%81%AEUSB%E3%83%97%E3%83%AD%E3%83%88%E3%82%B3%E3%83%AB%E3%82%92%E8%A7%A3%E6%9E%90%E3%81%97%E3%81%A6%E3%82%A2%E3%83%97%E3%83%AA%E5%AE%9F%E8%A3%85%E3%81%97%E3%81%9F%20https%3A%2F%2Flowreal.net%2F2024%2F12%2F05%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Bluesky","Share","https://lowreal.net/2024/12/05/1")' style=background:#efefef target=_blank> <img alt=Bluesky height=40 src=/images/bluesky_media_kit_logo_svgs.svg width=40> </a> <a href="http://b.hatena.ne.jp/add?url=https%3A%2F%2Flowreal.net%2F2024%2F12%2F05%2F1" class=share-button rel="noopener nofollow" onclick='ga("send","social","Hatena::Bookmark","Share","https://lowreal.net/2024/12/05/1")' style=background:#00a4de target=_blank> <img alt=はてなブックマーク height=40 src=/images/sharebuttons/hatenabookmark-logomark.svg width=40> </a> </p> </div> </article> </div> <div class=pager> <a href="/tech/.page/20241007234759/3" rel=next>▼ もっと古いエントリ</a> </div> </div> <footer id=global-footer> <h2>書いている人</h2> <div class=author> <div class=image> <img alt=Photo height=160 src=/images/profile.jpg width=160 loading=lazy> </div> <div class=desc> <p> cho45 (<a href=https://www.lowreal.net/ rel=author>www.lowreal.net</a>) <<a href=mailto:cho45@lowreal.net>cho45@lowreal.net</a>> </p> <p> JavaScript, Perl, Ruby, HTML, CSS, Web etc </p> <p> <a href=https://github.com/cho45 rel=nofollow class="button github-button" onclick='ga("send","social","GitHub","Follow","cho45")'><i></i> <span class=label> Follow <b>@cho45</b> </span> </a> </p> <p> <a href=/archive>アーカイブ</a> 9184 </p> </div> </div> </footer>