「Application」を含む日記 RSS

はてなキーワード: Applicationとは

2025-10-22

自分ホームページを作ったかどうかでWEBの見え方が180度以上違う話

以下ChatGPT

自分ホームページ(自前ドメイン+自前HTML)を一度でも作って運用すると、SNS中心の“受け手視点から仕様検索配信・所有・継続の“作り手”視点に脳が切り替わる。結果、情報リテラシーは跳ね上がり、ネットニュース流行の見え方が根本から変わる——しか想像以上に。

1. “タイムラインからアーキテクチャ”へ

Before(作る前): WebSNSタイムライン。良し悪しは「バズってるか」「見やすいか

After(作った後): WebプロトコルブラウザHTML/CSS/JSCDN検索エンジン。

ページは**文書(Document)**であり、配置(IA)、意味づけ(セマンティクス)、配信HTTP/HTTPS/HTTP/2/3)、キャッシュ戦略が気になりだす。

→ 同じ記事でも「タイトルの付け方」「hタグ構造」「画像最適化」「OGP」「サイトマップ」がまず目に入るようになる。

2. “アルゴリズム運”から“所有と積み上げ”へ

プラットフォーム依存の脆さを体感規約変更やシャドウバン露出が消える。

サイト資産化:ドメインに紐づくURLリンクされ、検索に積み上がり、10年後も生きる。

POSSE(Publish (on your) Own Site, Syndicate Elsewhere):まず自分サイトに出してから外部へ配信する習慣が身につく。

3. “好き/嫌い”から“なぜ速い・なぜ遅い”へ

Core Web Vitals(LCP/FID/CLS)や画像の遅延読み込み、フォント最適化重要性が腹落ちする。

広告・計測タグの重さに過敏になる。読者体験を壊さないためのパフォーマンス予算という概念生まれる。

4. “なんとなくSEOから情報設計×検索意図”へ

キーワード選定は“流入ゲーム”ではなく読者の課題コンテンツ設計帰着

内部リンクパンくず・スキーマ構造データ)・サイトマップ意味が実務として理解できる。

“書けば伸びる”ではなく“検索意図を満たす設計が伸びる”に目が覚める。

5. “見た目”から意味アクセシビリティ)”へ

alt見出し階層コントラスト比、キーボード操作、焦点管理など、見えない品質が最重要になる。

デザインは飾りではなく“読み・理解操作”のためのユーティリティだと分かる。

6. “PV至上”から継続コミュニティ”へ

たまたま当たる1記事より、更新継続アーカイブ性・RSSのほうが効くと実感。

コメント欄メールフォーム・X連携よりも、ニュースレターRSS購読者の質に価値を見出す。

7. “無料神話からコスト責任”へ

ドメインDNS証明書バックアップ法務特商法プライバシーポリシー)に“運用者の責任”が生まれる。

その重みが情報信頼性を引き上げる(=他人サイトの苦労も見えるようになる)。

8. “トレンド追従から自分OSを持つ”へ

サイト思想作品OS

トレンドは“輸入”ではなく選別になる。自分歴史に合うものだけを採用して積層していける。

9. まず一歩:最小スタックで“今夜リリース”する

Node.jsを避けたい人向けに、極小構成OK

A. 最小HTML(雛形)

<html lang="ja">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width,initial-scale=1" />

<title>あなた名前 | ホーム</title>

<meta name="description" content="自分ホームページ制作物・日記メモを置いていきます。">

<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed.xml">

<meta property="og:title" content="あなた名前 | ホーム">

<meta property="og:description" content="自分ホームページ制作物・日記メモ。">

<meta property="og:type" content="website">

</head>

<body>

<header>

<h1>あなた名前</h1>

<nav>Home / About / Posts</nav>

</header>

<main>

<article>

<h2>はじめまして</h2>

ここからすべてを自分URLに積み上げます

</article>

</main>

<footer>© 2025 あなた名前</footer>

</body>

</html>

B. ホスティング無料~低コスト

GitHub Pages(Jekyll標準。Rubyベース、Node不要

Cloudflare Pages(静的ファイルを置くだけで高速CDN

レンタルサーバー(静的HTML+SFTP/rsyncで十分)

C. ドメインの基本

覚えやすい短さ+ローマ字。将来10年使える名前に。

DNSA/AAAA/CAA/TXT最低限、HTTPS必須Let’s Encrypt無料化)。

D. “最低限の品質チェック”5点

タイトル・description見出し一貫性

画像は適切なサイズalt

モバイルでの可読性(文字サイズ行間

OGPが効いているか(XやLINEURLを貼って確認

RSS/更新履歴の有無(継続を前提に)

10. 一歩先へ:運用で差がつく“3つの習慣”

ログを読む:Search Consoleと簡易アクセスログで“本文よりメタ情報”を磨く。

アーカイブ主義記事追記更新URLは変えない。Versioningを意識

POSSE徹底:自サイトに公開→SNSには要約+リンク本体は常に自分土俵

2025-08-21

dorawii@執筆依頼募集中

自動ブクマするローカルサーバーとかの構成を作った。

ブクマには↓のサブアカ使用

https://profile.hatena.ne.jp/dorawii_bukuma/

はてなサイト側で読み込まれているはずのrksトークンを生成する関数を直接叩く方法がどうしても分からず結局request処理を自分で書く方法ではなく自動UI側の保存ボタンクリックするという無難な方向に落ち着いた。

最初から後者方法をとっていればもっと全然早く作れたのにというは所詮言い訳か。

とにかくスクリプトを公開しておく。

start-server.bat

@echo off
cd /d "C:\Users\user\Documents\jsscript"

:: Nodeサーバーを別ウィンドウで起動
start /min "" node run-batch-server.js

:: Pythonサーバーを別ウィンドウで起動(hatenaserver配下
start cmd /k "" python hatenaserver\server.py

以降はjsscript直下に配置

config.json

{
"username": "",
"password": ""
}
server.py

from flask import Flask, request, jsonify
import json
import os
from hatena_client import HatenaClient
from flask_cors import CORS

app = Flask(__name__)
CORS(app)

config_path = os.path.join(os.path.dirname(__file__), 'config.json')
with open(config_path, encoding='utf-8') as f:
config = json.load(f)

@app.route('/bookmark', methods=['POST'])
def handle_bookmark():
data = request.json
url = data.get("url")
if not url:
return jsonify({"error": "Missing URL"}), 400

client = HatenaClient(config["username"], config["password"])
client.start_browser()

if not client.login():
client.quit()
return jsonify({"error": "Login failed"}), 403

success = client.add_bookmark(url)
client.quit()

return jsonify({"status": "ok" if success else "fail"})

if __name__ == "__main__":
app.run(port=12347)

あとはグリモンユーザスクリプトとして書くやつ

// ==UserScript==
// @name 自動セルクマ送信
// @namespace tampermonkey.net/
// @version 2025-08-07
// @description try to take over the world!
// @author You
// @match anond.hatelabo.jp/*
// @grant none
// ==/UserScript==

(function () {
'use strict';

const url = location.href;
if (!/^https:\/\/anond\.hatelabo\.jp\/\d+$/.test(url)) return;
const editLink = document.querySelector('a.edit');
if (!editLink) {
// 既に編集ページなので処理をスキップ
console.log('編集リンク存在するため、スクリプトを終了します。');
return;
}

fetch('localhost:12347/bookmark', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: url })
}).then(r => console.log("通知成功")).catch(e => console.error("通知失敗", e));
})();
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

https://anond.hatelabo.jp/20250821192753# 
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQTEe8eLwpVRSViDKR5wMdsubs4+SAUCaKb0qwAKCRBwMdsubs4+
SHfiAQDcXmTHBaZ5Zzr1KI/OxZ0xl69oevOdy1FXJYwYvsmo5AD/ZPtZiO1JgTDj
m+27iymlkdzIXOIGWfC82UTr1mJ7EwU=
=YoV+
-----END PGP SIGNATURE-----

2025-08-18

anond:20250818015040

(以下の両トラバへの返信です)

https://anond.hatelabo.jp/20250818063524

https://anond.hatelabo.jp/20250818082015

トラバ両氏は、著者を信頼してか、または自身の知見から、示された年齢の偏りが統計に悪影響を及ぼすほどではないと捉えてるわけだよね。

私は著者への信頼もない(疑っているというわけではなく純粋に素性を知らない)し、自身の知見もないので、もう少し探ってみたい。

そもそも75歳以上の年齢比率にして10.5ポイントの差が、かなり大きいとは感じる。とりわけ、5%の統計有意に滑り込む可能性の大小を考慮する上では。

75歳以上の予後についてのさらに細かい年齢別の内訳は、膵臓癌においては見つけられなかった。しかし以下の年齢層別データから敷衍で、生存率がどんどん悪くなりそうだとは思える。また、元論文の全体の平均年齢に大差がない点(強いて言えばワクチン3回以上に不利)と、SDにも大差がない点(強いて言えばワクチン3回以上に有利)は、いずれもオモテに現れた10.5ポイントの差についての妥当性を高めてくれるとは言えそう。元データがあればもっとわかりやすいんだろうけど。

SEER*Explorer Application

https://seer.cancer.gov/statistics-network/explorer/application.html?site=96&data_type=4&graph_type=5&compareBy=age_range&chk_age_range_1=1&chk_age_range_16=16&chk_age_range_62=62&chk_age_range_122=122&chk_age_range_160=160&chk_age_range_166=166&series=9&sex=1&race=1&hdn_stage=101&advopt_precision=1&advopt_show_ci=on&hdn_view=1&advopt_show_apc=on&advopt_display=2

コロナについては、超高齢層のデータちゃんと細かく分かれていて、70代・80代・90代以上と、倍々で重症化率や致死率が高くなっているデータはある。(こちらは元々知っていたので、膵臓癌についても同様の傾向だろうと考えていました)

新型コロナ重症化率・致死率とその解釈に関する留意点について

https://www.mhlw.go.jp/content/10900000/001027743.pdf

2025-06-28

LLMはエンジニア仕事を奪うのか?否、仕事抽象度を「Why」の次元

序文コード蒸発する時代と、それでも残る「Why」という名の問い

2025年私たちソフトウェア開発の歴史的な転換点に立っている。大規模言語モデル(LLM)の進化は、GitHub Copilotのようなコード補完ツールに始まり、今や「何を作りたいか」を自然言語で伝えるだけで、アプリケーションの雛形が数分で生成される時代現実のものとしつつある。この光景を目の当たりにした多くのプログラマが、漠然とした、しかし確かな不安を抱いているだろう。「私たち仕事は、いずれAIに奪われるのではないか」と。

この問いに対する私の答えは、半分はYesであり、もう半分はNoだ。より正確に言えば、プログラマ仕事本質が、歴史上かつてないレベル抽象化され、その役割が再定義されるのだ。私たちは、コードを「書く」作業から解放される一方で、これまで以上に高度な思考要求されることになる。

本稿では、プログラミング歴史を「How(いかに作るか)」から「What(何を作るか)」への移行として捉え直し、LLMがこの流れをいかに加速させるかを論じる。そして、その先にある、AIには決して代替できない、人間ならではの競争優位性、すなわちWhy(なぜ作るのか)」を定義し、記述する能力重要性について深く考察していく。これは、単なる未来予測ではない。今を生きるすべてのソフトウェアエンジニアにとっての、生存戦略提示である

第1章:プログラミング歴史的変遷 ― HowからWhatへの長い道のり

LLMの登場を特異点として捉える前に、我々が立っている場所を正確に知る必要がある。ソフトウェア開発の歴史は、常に「抽象化」との戦いであった。そしてその歴史は、プログラマの関心が「How」から「What」へと徐々に移り変わっていくプロセスとして描くことができる。

1-1. 手続き時代:Howを記述することに終始した黎明期

コンピュータ黎明期プログラミングとは、計算機理解できる命令(How)を、一行一行、丹念に記述する作業のものであった。アセンブリ言語や初期のFORTRANCOBOLといった言語は、ハードウェアの制約を強く受けており、プログラマメモリ管理プロセッサ動作といった、極めて物理層に近いレベルでの「How」を意識する必要があった。

この時代テストもまた、「How」に強く束縛されていた。書かれた手続きが、意図した通りに順番に実行されるか、特定入力に対して期待された計算結果を返すか。テストの関心事は、あくまで「手続きの正しさ」の検証にあった。ビジネスロジック実装の詳細が密結合し、コード特定の処理手順を記述した、硬直的な塊となっていた。

1-2. テスト駆動した振る舞いへの注目:Whatへの小さな一歩

風向きが変わり始めたのは、ソフトウェアの規模が拡大し、その複雑性が人間認知能力を超え始めた頃だ。1990年代後半から2000年代にかけて提唱されたエクストリーム・プログラミングXP)の中で、テスト駆動開発(TDD)という考え方が登場する。

TDD本質は、単なるテスト手法改善ではない。それは、プログラミングパラダイム根底から覆す思想だった。TDDは、「まずテストを書く」ことを強制することで、プログラマ意識を「これから実装するコード(How)」から「そのコードが満たすべき振る舞い(What)」へと強制的に転換させたのだ。

テストはもはや、書かれたコードの後追いで正しさを検証する作業ではない。それは、これから作られるべきソフトウェアの「仕様書」であり、「振る舞いの宣言」となった。例えば、「ユーザーログインボタンクリックしたら、ダッシュボード画面に遷移する」というテストコードは、具体的な実装方法(`onClick`イベントハンドラの中で`window.location.href`を書き換える、など)には一切言及しない。それはただ、達成されるべき「What」を記述しているだけだ。

この思想は、ビヘイビア駆動開発(BDD)へと発展し、`Given-When-Then`といった、より自然言語に近い形式ソフトウェアの振る舞いを記述するスタイルを生み出した。プログラマだけでなく、プロダクトマネージャービジネスアナリストといった非技術者をも巻き込み、「What」を共通言語として定義する試みが本格化したのである

1-3. 宣言プログラミングの台頭とフレームワーク役割

TDD/BDDによってプログラマ意識が「What」に向かい始めると、コードのものもまた、宣言的なスタイルへと進化していく。この変化を劇的に加速させたのが、モダンフレームワーク存在だ。

Reactを例に考えてみよう。Reactが登場する前、フロントエンド開発はjQuery代表されるように、DOMを直接操作する命令的なコード(How)の連続だった。「このボタンクリックされたら、この要素のテキストを書き換え、あちらの要素を非表示にする」といった具合だ。

しかし、Reactは「UIとは、ある状態state)に対する純粋写像である」という宣言的なモデル提示した。プログラマがやるべきことは、UI状態(`state`)と、その状態がどのように見えるか(JSXによるコンポーネント)を宣言することだけだ。状態が変更された際に、DOMをどのように効率的更新するかという面倒な「How」の部分は、Reactの仮想DOM差分検出アルゴリズムがすべて隠蔽してくれる。プログラマは「What(UIのあるべき姿)」を記述するだけでよくなったのだ。

この「WhatからHowへの変換」は、様々な領域で見られる。

これらのフレームワークツールは、いわば特定の制約下における、WhatからHowへの高性能な変換器」として機能してきた。プログラマは、フレームワークが課す「お作法」や「制約」を受け入れることで、退屈で間違いの多い「How」の記述から解放され、より本質的な「What」の定義に集中できるようになった。我々が「生産性が高い」と感じる開発体験は、この優れた変換器の恩恵に他ならない。

現状は、この歴史的変遷の延長線上にある。プログラマ仕事は、手続き記述する職人から、振る舞いを定義し、それを実現するための最適な「変換器(フレームワーク)」を選択・設定するアーキテクトへと、その重心を移してきたのだ。

第2章:LLMがもたらす究極のパラダイムシフト ― 汎用変換器の誕生

フレームワークがもたらした「WhatからHowへ」の潮流は、LLMの登場によって、未曾有のスケールで加速されようとしている。フレームワークが「特定領域に特化した変換器」であったのに対し、LLMは「あらゆる領域対応可能な、究極の汎用変換器」としてのポテンシャルを秘めているからだ。

2-1. フレームワークの制約を超えて

前章で述べたように、ReactやTerraformといったフレームワークは、その恩恵と引き換えに、私たち特定の「制約」を課してきた。Reactを使うならコンポーネントベース思考し、状態管理作法に従う必要がある。Terraformを使うなら、そのエコシステムとHCLの流儀を受け入れなければならない。これらの制約は、WhatからHowへの変換を自動化するための「レール」であり、私たちはそのレールの上を走ることで効率を得てきた。

しかし、LLMはこの前提を覆す。LLMは、特定フレームワーク言語知識を事前に学習しているが、その利用において絶対的な制約を課すわけではない。私たちは、より自由形式で「What」を伝えることができる。

例えば、こうだ。

ユーザー認証機能付きのシンプルブログアプリを作ってほしい。フロントエンドはReactとTypeScriptUIコンポーネントはMUIを使う。バックエンドNode.jsExpressで、データベースPostgreSQLユーザーGoogleアカウントログインでき、新しい記事作成編集、削除できる。記事にはマークダウン記法が使えて、画像アップロードできるようにしてほしい。

この要求(What)は、特定フレームワーク流儀に則ったものではない。複数技術スタックを横断し、機能要求自然言語で並べただけのものであるしかし、現在のLLM、特にGPT-4oやそれに類するモデルは、このレベル要求からディレクトリ構造設定ファイルAPIエンドポイントフロントエンドコンポーネントに至るまで、驚くほど具体的なコード(How)を生成することができる。

これは、フレームワークが担ってきた「WhatからHowへの変換」が、特定のレールから解き放たれ、より広範で柔軟な領域へと拡張されたことを意味する。これまで自動化が難しかった、あるいは特定フレームワーク存在しなかったニッチ領域や、複数技術を組み合わせる複雑なシステム構築においても、AIによる宣言プログラミング恩恵を受けられる時代が始まろうとしているのだ。

2-2. 「What」の解像度がすべてを決める世界

LLMという汎用変換器の登場により、プログラマ生産性は、いかに質の高いWhatをLLMに伝えられるか」に直結するようになる。これは、俗に「プロンプトエンジニアリング」と呼ばれるスキルだが、その本質は、ソフトウェア開発における「要求定義」そのものである

質の高い「What」とは何か。それは、曖昧性がなく、網羅的で、矛盾のない要求である

これらは、優秀なソフトウェアエンジニアが、プロダクトマネージャーデザイナーとの対話を通じて、日常的に行ってきた思考プロセスのものではないだろうか。LLMの登場は、この思考プロセスを、より明確に、よりテキストベースで「記述」する能力を求める。私たちの頭の中にあった暗黙的な仕様が、LLMへの入力プロンプト)という形で、明示的に言語化されることを要求するのだ。

やがて、ほとんどのプログラミング作業は、この「Whatの記述」に収束していくだろう。TDDテストコードという形式で「What」を記述したように、私たち自然言語や、より構造化された要求記述言語を用いて、AIに対して「What」を宣言することになる。コード(How)は、その宣言から自動生成される中間生成物に過ぎなくなる。まさに、コード蒸発していく未来である

第3章:それでもAIには決められない ― 「Why」の不在という致命的な欠陥

「What」を伝えれば「How」が手に入る。この魔法のような世界の到来を前に、私たちは一つの重大な問いに直面する。それは、「そのWhatからHowへの変換は、本当に一意に決まるのか?」という問いだ。

答えは、明確にNoである

ある「What(要求)」を実現するための「How(実装)」は、無数に存在する。そして、どの「How」を選択すべきかを決定するためには、単純な機能要求(What)だけでは情報が全く足りない。そこには、必ずWhy(なぜそう作るのか)」という、背景、文脈、そしてトレードオフ考慮必要不可欠となる。

3-1. トレードオフの海に溺れるLLM

簡単な例を考えてみよう。「1億件のユーザーデータを格納し、ユーザーIDで高速に検索できるシステム」という「What」をLLMに与えたとする。LLMは、どのような「How」を提案するだろうか。

これらの選択肢は、どれも「What」を満たしている。しかし、その特性は全く異なる。案Aは多くのエンジニアにとって馴染み深く開発が容易だが、10億、100億件へのスケールは難しいかもしれない。案Bはスケール性に優れるが、厳密なトランザクション管理は苦手だ。案Cは高速だが、運用コストシステムの複雑性が増す。案Dは安価だが、検索速度は他に劣る。

LLMは、これらの選択肢をリストアップすることはできるだろう。しかし、このプロジェクトにとって最適な選択肢はどれかを、自信を持って決定することはできない。なぜなら、その決定には、LLMが与えられていない「Why」の情報必要からだ。

これらの「Why」こそが、無数に存在する「How」の中から、ただ一つの「正解」を選び出すための羅針盤なのである。そしてこの「Why」は、ビジネス目標組織文化ユーザーの期待、技術的な制約といった、極めて人間的で、文脈依存的な情報の中にしか存在しない。

3-2. エンジニアが暗黙的に行ってきた「Why」に基づく意思決定

ここで重要なのはこれまでもエンジニアは、この「Why」に基づく意思決定を、意識的あるいは無意識的に行ってきたという事実だ。

私たち技術選定を行うとき、単に「流行っているから」という理由だけでReactを選ぶわけではない。「SPA(Single Page Application)にすることでユーザー体験を向上させたい(Why)」、「コンポーネント指向の開発によって長期的な保守性を確保したい(Why)」、「Reactエンジニア採用市場が活発だからWhy)」といった、様々な「 Permalink | 記事への反応(0) | 17:09

LLMはエンジニア仕事を奪うのか?否、仕事抽象度を「Why」の次元

序文コード蒸発する時代と、それでも残る「Why」という名の問い

2025年私たちソフトウェア開発の歴史的な転換点に立っている。大規模言語モデル(LLM)の進化は、GitHub Copilotのようなコード補完ツールに始まり、今や「何を作りたいか」を自然言語で伝えるだけで、アプリケーションの雛形が数分で生成される時代現実のものとしつつある。この光景を目の当たりにした多くのプログラマが、漠然とした、しかし確かな不安を抱いているだろう。「私たち仕事は、いずれAIに奪われるのではないか」と。

この問いに対する私の答えは、半分はYesであり、もう半分はNoだ。より正確に言えば、プログラマ仕事本質が、歴史上かつてないレベル抽象化され、その役割が再定義されるのだ。私たちは、コードを「書く」作業から解放される一方で、これまで以上に高度な思考要求されることになる。

本稿では、プログラミング歴史を「How(いかに作るか)」から「What(何を作るか)」への移行として捉え直し、LLMがこの流れをいかに加速させるかを論じる。そして、その先にある、AIには決して代替できない、人間ならではの競争優位性、すなわちWhy(なぜ作るのか)」を定義し、記述する能力重要性について深く考察していく。これは、単なる未来予測ではない。今を生きるすべてのソフトウェアエンジニアにとっての、生存戦略提示である

第1章:プログラミング歴史的変遷 ― HowからWhatへの長い道のり

LLMの登場を特異点として捉える前に、我々が立っている場所を正確に知る必要がある。ソフトウェア開発の歴史は、常に「抽象化」との戦いであった。そしてその歴史は、プログラマの関心が「How」から「What」へと徐々に移り変わっていくプロセスとして描くことができる。

1-1. 手続き時代:Howを記述することに終始した黎明期

コンピュータ黎明期プログラミングとは、計算機理解できる命令(How)を、一行一行、丹念に記述する作業のものであった。アセンブリ言語や初期のFORTRANCOBOLといった言語は、ハードウェアの制約を強く受けており、プログラマメモリ管理プロセッサ動作といった、極めて物理層に近いレベルでの「How」を意識する必要があった。

この時代テストもまた、「How」に強く束縛されていた。書かれた手続きが、意図した通りに順番に実行されるか、特定入力に対して期待された計算結果を返すか。テストの関心事は、あくまで「手続きの正しさ」の検証にあった。ビジネスロジック実装の詳細が密結合し、コード特定の処理手順を記述した、硬直的な塊となっていた。

1-2. テスト駆動した振る舞いへの注目:Whatへの小さな一歩

風向きが変わり始めたのは、ソフトウェアの規模が拡大し、その複雑性が人間認知能力を超え始めた頃だ。1990年代後半から2000年代にかけて提唱されたエクストリーム・プログラミングXP)の中で、テスト駆動開発(TDD)という考え方が登場する。

TDD本質は、単なるテスト手法改善ではない。それは、プログラミングパラダイム根底から覆す思想だった。TDDは、「まずテストを書く」ことを強制することで、プログラマ意識を「これから実装するコード(How)」から「そのコードが満たすべき振る舞い(What)」へと強制的に転換させたのだ。

テストはもはや、書かれたコードの後追いで正しさを検証する作業ではない。それは、これから作られるべきソフトウェアの「仕様書」であり、「振る舞いの宣言」となった。例えば、「ユーザーログインボタンクリックしたら、ダッシュボード画面に遷移する」というテストコードは、具体的な実装方法(`onClick`イベントハンドラの中で`window.location.href`を書き換える、など)には一切言及しない。それはただ、達成されるべき「What」を記述しているだけだ。

この思想は、ビヘイビア駆動開発(BDD)へと発展し、`Given-When-Then`といった、より自然言語に近い形式ソフトウェアの振る舞いを記述するスタイルを生み出した。プログラマだけでなく、プロダクトマネージャービジネスアナリストといった非技術者をも巻き込み、「What」を共通言語として定義する試みが本格化したのである

1-3. 宣言プログラミングの台頭とフレームワーク役割

TDD/BDDによってプログラマ意識が「What」に向かい始めると、コードのものもまた、宣言的なスタイルへと進化していく。この変化を劇的に加速させたのが、モダンフレームワーク存在だ。

Reactを例に考えてみよう。Reactが登場する前、フロントエンド開発はjQuery代表されるように、DOMを直接操作する命令的なコード(How)の連続だった。「このボタンクリックされたら、この要素のテキストを書き換え、あちらの要素を非表示にする」といった具合だ。

しかし、Reactは「UIとは、ある状態state)に対する純粋写像である」という宣言的なモデル提示した。プログラマがやるべきことは、UI状態(`state`)と、その状態がどのように見えるか(JSXによるコンポーネント)を宣言することだけだ。状態が変更された際に、DOMをどのように効率的更新するかという面倒な「How」の部分は、Reactの仮想DOM差分検出アルゴリズムがすべて隠蔽してくれる。プログラマは「What(UIのあるべき姿)」を記述するだけでよくなったのだ。

この「WhatからHowへの変換」は、様々な領域で見られる。

これらのフレームワークツールは、いわば特定の制約下における、WhatからHowへの高性能な変換器」として機能してきた。プログラマは、フレームワークが課す「お作法」や「制約」を受け入れることで、退屈で間違いの多い「How」の記述から解放され、より本質的な「What」の定義に集中できるようになった。我々が「生産性が高い」と感じる開発体験は、この優れた変換器の恩恵に他ならない。

現状は、この歴史的変遷の延長線上にある。プログラマ仕事は、手続き記述する職人から、振る舞いを定義し、それを実現するための最適な「変換器(フレームワーク)」を選択・設定するアーキテクトへと、その重心を移してきたのだ。

第2章:LLMがもたらす究極のパラダイムシフト ― 汎用変換器の誕生

フレームワークがもたらした「WhatからHowへ」の潮流は、LLMの登場によって、未曾有のスケールで加速されようとしている。フレームワークが「特定領域に特化した変換器」であったのに対し、LLMは「あらゆる領域対応可能な、究極の汎用変換器」としてのポテンシャルを秘めているからだ。

2-1. フレームワークの制約を超えて

前章で述べたように、ReactやTerraformといったフレームワークは、その恩恵と引き換えに、私たち特定の「制約」を課してきた。Reactを使うならコンポーネントベース思考し、状態管理作法に従う必要がある。Terraformを使うなら、そのエコシステムとHCLの流儀を受け入れなければならない。これらの制約は、WhatからHowへの変換を自動化するための「レール」であり、私たちはそのレールの上を走ることで効率を得てきた。

しかし、LLMはこの前提を覆す。LLMは、特定フレームワーク言語知識を事前に学習しているが、その利用において絶対的な制約を課すわけではない。私たちは、より自由形式で「What」を伝えることができる。

例えば、こうだ。

ユーザー認証機能付きのシンプルブログアプリを作ってほしい。フロントエンドはReactとTypeScriptUIコンポーネントはMUIを使う。バックエンドNode.jsExpressで、データベースPostgreSQLユーザーGoogleアカウントログインでき、新しい記事作成編集、削除できる。記事にはマークダウン記法が使えて、画像アップロードできるようにしてほしい。

この要求(What)は、特定フレームワーク流儀に則ったものではない。複数技術スタックを横断し、機能要求自然言語で並べただけのものであるしかし、現在のLLM、特にGPT-4oやそれに類するモデルは、このレベル要求からディレクトリ構造設定ファイルAPIエンドポイントフロントエンドコンポーネントに至るまで、驚くほど具体的なコード(How)を生成することができる。

これは、フレームワークが担ってきた「WhatからHowへの変換」が、特定のレールから解き放たれ、より広範で柔軟な領域へと拡張されたことを意味する。これまで自動化が難しかった、あるいは特定フレームワーク存在しなかったニッチ領域や、複数技術を組み合わせる複雑なシステム構築においても、AIによる宣言プログラミング恩恵を受けられる時代が始まろうとしているのだ。

2-2. 「What」の解像度がすべてを決める世界

LLMという汎用変換器の登場により、プログラマ生産性は、いかに質の高いWhatをLLMに伝えられるか」に直結するようになる。これは、俗に「プロンプトエンジニアリング」と呼ばれるスキルだが、その本質は、ソフトウェア開発における「要求定義」そのものである

質の高い「What」とは何か。それは、曖昧性がなく、網羅的で、矛盾のない要求である

これらは、優秀なソフトウェアエンジニアが、プロダクトマネージャーデザイナーとの対話を通じて、日常的に行ってきた思考プロセスのものではないだろうか。LLMの登場は、この思考プロセスを、より明確に、よりテキストベースで「記述」する能力を求める。私たちの頭の中にあった暗黙的な仕様が、LLMへの入力プロンプト)という形で、明示的に言語化されることを要求するのだ。

やがて、ほとんどのプログラミング作業は、この「Whatの記述」に収束していくだろう。TDDテストコードという形式で「What」を記述したように、私たち自然言語や、より構造化された要求記述言語を用いて、AIに対して「What」を宣言することになる。コード(How)は、その宣言から自動生成される中間生成物に過ぎなくなる。まさに、コード蒸発していく未来である

第3章:それでもAIには決められない ― 「Why」の不在という致命的な欠陥

「What」を伝えれば「How」が手に入る。この魔法のような世界の到来を前に、私たちは一つの重大な問いに直面する。それは、「そのWhatからHowへの変換は、本当に一意に決まるのか?」という問いだ。

答えは、明確にNoである

ある「What(要求)」を実現するための「How(実装)」は、無数に存在する。そして、どの「How」を選択すべきかを決定するためには、単純な機能要求(What)だけでは情報が全く足りない。そこには、必ずWhy(なぜそう作るのか)」という、背景、文脈、そしてトレードオフ考慮必要不可欠となる。

3-1. トレードオフの海に溺れるLLM

簡単な例を考えてみよう。「1億件のユーザーデータを格納し、ユーザーIDで高速に検索できるシステム」という「What」をLLMに与えたとする。LLMは、どのような「How」を提案するだろうか。

これらの選択肢は、どれも「What」を満たしている。しかし、その特性は全く異なる。案Aは多くのエンジニアにとって馴染み深く開発が容易だが、10億、100億件へのスケールは難しいかもしれない。案Bはスケール性に優れるが、厳密なトランザクション管理は苦手だ。案Cは高速だが、運用コストシステムの複雑性が増す。案Dは安価だが、検索速度は他に劣る。

LLMは、これらの選択肢をリストアップすることはできるだろう。しかし、このプロジェクトにとって最適な選択肢はどれかを、自信を持って決定することはできない。なぜなら、その決定には、LLMが与えられていない「Why」の情報必要からだ。

これらの「Why」こそが、無数に存在する「How」の中から、ただ一つの「正解」を選び出すための羅針盤なのである。そしてこの「Why」は、ビジネス目標組織文化ユーザーの期待、技術的な制約といった、極めて人間的で、文脈依存的な情報の中にしか存在しない。

3-2. エンジニアが暗黙的に行ってきた「Why」に基づく意思決定

ここで重要なのはこれまでもエンジニアは、この「Why」に基づく意思決定を、意識的あるいは無意識的に行ってきたという事実だ。

私たち技術選定を行うとき、単に「流行っているから」という理由だけでReactを選ぶわけではない。「SPA(Single Page Application)にすることでユーザー体験を向上させたい(Why)」、「コンポーネント指向の開発によって長期的な保守性を確保したい(Why)」、「Reactエンジニア採用市場が活発だからWhy)」といった、様々な「 Permalink | 記事への反応(0) | 17:09

2025-06-20

派遣社員おっさん仕事しないんだが

俺(35)が所属するウチ課の派遣社員おっさん(33)が「暇で疲れます」「ネットサーフィンも疲れました」「やることなくて」って周囲に愚痴ってる。

完全に仕事を与えられないうちの会社が悪いんだろうけど、本来おっさん仕事を教える&一部業務引き継ぐ筈の女性社員(29)が

「あの人に教えたく無い」って言い出して放置、他の社員も俺含め皆忙しいので結果的放置してる状況になってしまっている。※女性社員は人の好き嫌いがハッキリ強い子です

なのは分かるが、業務中に言われると忙しい人の士気が下がるから、味でやめてほしい。


でも前任者はバリバリ働いてたので、とても不思議だった。

電話対応以外の簡単仕事をお願いしたら、Application LanguageもPower BIもロクにできなくて困った。

なんでそんな低スキルをうちの会社に入れたのか…


後輩の若手社員(31)に話を聞くと、前任に比べて全てに受け身姿勢で困ってるとのことだった。

とりあえず電話番させてるけど、これじゃ電話取る以外の仕事は振れないよ…トホホ

これから繁忙期なので、今の所は居てもらう方針らしいけど、士気も下がるし、教える暇も無いし、早く辞めて欲しいわ。 ※そもそも教える気もない低スキルなんだが?

2025-06-13

我が名はサイボーグdorawii

パーマリンク署名対象にするより堅牢自動化を作れた。

一度投稿したうえで別タブを開いてプログラム的(fetch)に送信してその別タブが閉じられる仕組み。

改めてスクリプト配布しちゃる

最初投稿してエントリページに移動した親タブ側のjsコード
// ==UserScript==
      // @name         PGP署名検出と別タブ自動編集
      // @namespace    http://tampermonkey.net/
      // @version      1.0
      // @description  PGP署名がない投稿自動編集ページへ誘導
      // @match        https://anond.hatelabo.jp/*
      // @grant        GM_setValue
      // @grant        GM_getValue
      // @grant        GM.openInTab
      // ==/UserScript==

      (function () {
        'use strict';

        const body = document.getElementById('entry-page');
        if (!body) return;

        const titleText = document.title;
        if (!titleText.includes('dorawii')) return;

        const pgpRegex = /BEGIN.*PGP(?: SIGNED MESSAGE| SIGNATURE)?/;
        const preElements = document.querySelectorAll('div.body pre');
        let hasPgpSignature = false;

        for (const pre of preElements) {
          if (pgpRegex.test(pre.textContent)) {
            hasPgpSignature = true;
            break;
          }
        }

        if (hasPgpSignature) return;

        const editLink = document.querySelector('a.edit');
        const childTab = GM.openInTab(editLink.href, { active: false, insert: true, setParent: true });

      })();
親タブから開かれる編集ページの子タブのjsコード
 // ==UserScript==
      // @name         編集ページ処理と自動送信・閉じ
      // @namespace    http://tampermonkey.net/
      // @version      1.0
      // @description  編集ページで署名処理と送信、タブ自動閉じ
      // @match        https://anond.hatelabo.jp/dorawii_31/edit?id=*
      // @grant        GM_getValue
      // @grant        GM_xmlhttpRequest
      // @grant        GM_setClipboard
      // @grant        GM_notification
      // @connect      localhost
      // ==/UserScript==

      (async function () {
        'use strict';

        const shouldRun = await GM_getValue('open-tab-for-edit', '0');

        const textareaId = 'text-body';
        const textarea = document.getElementById(textareaId);

        if (!textarea) return;

        const content = textarea.value;

        const pgpSignatureRegex = /-----BEGIN PGP SIGNED MESSAGE-----[\s\S]+?-----BEGIN PGP SIGNATURE-----[\s\S]+?-----END PGP SIGNATURE-----/;
        if (pgpSignatureRegex.test(content)) {
          console.log('[PGPスクリプト] 署名が検出されたためそのまま送信します');
          return;
        }

        const httpRequest = (url, data) => {
          return new Promise((resolve, reject) => {
            GM_xmlhttpRequest({
              method: 'POST',
              url: url,
              headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
              data: `value=${encodeURIComponent(data)}`,
              onload: function (response) {
                resolve(response.responseText);
              },
              onerror: function (error) {
                reject(error);
              }
            });
          });
        };


        // textarea の値を取得
        // 1. 現在のページのURLからURLオブジェクト作成
        const currentUrl = new URL(window.location.href);

        // 2. ベースとなる部分 (例: "https://anond.hatelabo.jp") を取得
        const origin = currentUrl.origin;

        // 3. 'id' パラメータの値 (例: "20250610184705") を取得
        const idValue = currentUrl.searchParams.get('id');

        // 4. ベース部分とIDを結合して、目的URL文字列を生成
        //    idValueが取得できた場合のみ実行する
        let newUrl = null;
        if (idValue) {
          newUrl = `${origin}/${idValue}`;
        }

        // 5. 生成されたURL変数に代入し、コンソールに出力して確認
        console.log(newUrl);
        const valueToSend = newUrl;

        try {
          const signatureText = await httpRequest('http://localhost:12345/run-batch', valueToSend);
          console.log('バッチ応答:', signatureText);
          if (!signatureText.includes('BEGIN PGP SIGNED MESSAGE')) {
            alert('PGP署名クリップボードに見つかりませんでした。');
            return;
          }

          const newText = content.replace(/\s*$/, '') + '\n' + signatureText + '\n';
          textarea.value = newText;

          console.log('[PGPスクリプト] 署名を貼り付けました。送信を再開します。');


          const form = document.forms.edit;

          const newForm = form.cloneNode(true);
          form.replaceWith(newForm);

          newForm.addEventListener('submit', async (e) => {
            e.preventDefault(); // HTML標準のsubmitをキャンセル
            const bodyText = textarea?.value || '';

            // reCAPTCHA トークンの取得
            const recaptchaToken = await new Promise((resolve) => {
              grecaptcha.enterprise.ready(() => {
                grecaptcha.enterprise.execute('hoge', { action: 'EDIT' })
                  .then(resolve);
              });
            });

            // POSTするデータの構築
            const formData = new FormData(newForm);
            formData.set('body', bodyText);
            formData.set('recaptcha_token', recaptchaToken);
            formData.set('edit', '1');
            try {
              const response = await fetch(newForm.action, {
                method: 'POST',
                body: formData,
                credentials: 'same-origin'
              });


              if (response.ok) {
                console.log('送信成功');
                window.close();


              } else {
                console.error('送信失敗', response.status);
              }
            } catch (err) {
              console.error('送信中にエラーが発生', err);
            }

          });

          // プログラム的に送信トリガー
          newForm.dispatchEvent(new Event('submit', { bubbles: true }));

        } catch (e) {
          console.error('バッチ呼び出し失敗:', e);
        }

      })();
node.jsで動かすローカルサーバーコード
const http = require('http');
const { exec } = require('child_process');
const querystring = require('querystring');

const server = http.createServer((req, res) => {
  if (req.method === 'GET' && req.url === '/ping') {
    res.writeHead(200);
    res.end('pong');
  } else if (req.method === 'POST' && req.url === '/run-batch') {
    let body = '';

    req.on('data', chunk => {
      body += chunk.toString();
    });

    req.on('end', () => {
      const parsed = querystring.parse(body);
      const value = parsed.value || 'default';

      // 値を引数としてバッチに渡す
      exec(`C:\\Users\\hoge\\Desktop\\makesign.bat "${value}"`, { encoding: 'utf8' }, (err, stdout, stderr) => {
        if (err) {
          res.writeHead(500);
          res.end('Error executing batch: ' + stderr);
        } else {
          res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
          res.end(stdout.trim());
        }
      });
    });

  } else {
    res.writeHead(404);
    res.end('Not found');
  }
});

server.listen(12345, () => {
  console.log('Batch server running at http://localhost:12345/');
});
@echo off
setlocal enabledelayedexpansion


:: 署名するファイルset "infile=%~1"
set outfile=%TEMP%\pgp_output.asc

:: 以前の出力があれば削除
if exist "%outfile%" del "%outfile%"


:signloop
:: AutoHotkeyパスフレーズ入力(gpgがパスワード要求するダイアログが出た場合に備える)
start "" /b "C:\Users\hoge\Documents\AutoHotkey\autopass.ahk"

:: PGPクリア署名作成
echo %infile% | gpg --yes --clearsign --output "%outfile%"


:: 署名成功していればループを抜ける
if exist "%outfile%" (

    goto postprocess
) else (

    timeout /t 1 > nul
    goto signloop
)
:postprocess

powershell -nologo -command ^
  "$header = '>|'; $footer = '|<'; $body = Get-Content '%outfile%' -Raw; Write-Output ($header + \"`r`n\" + $body + $footer)"

powershell -nologo -command ^
  "$header = '>|'; $footer = '|<'; $body = Get-Content 'signed.asc' -Raw; Set-Clipboard -Value ($header + \"`r`n\" + $body + $footer)"

endlocal
exit /b
AutoHotkey(以前と同じ)
#Persistent
#SingleInstance ignore
SetTitleMatchMode, 2
WinWaitActive, pinentry
SendInput password
Sleep 100
SendInput {Enter}
ExitApp

動けばいいという考えで作っているので余分なコードも含んでいるかもしれない。

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

https://anond.hatelabo.jp/20250613185036 
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQTEe8eLwpVRSViDKR5wMdsubs4+SAUCaEv1FQAKCRBwMdsubs4+
SHHkAQDUOLgBcdji2T6MJ7h/vlMdFfGlWAzNdXijjE1gIuEPywEAiMNMZqhrMmtl
c7UqRuggNJ/UTa5xTIcKp622+7jJQQg=
=Lgkl
-----END PGP SIGNATURE-----

2025-04-29

Why Choose Next.js Over React.js for Website Development in 2025?

Speed, SEO, scalability, and developer productivity are more critical than ever. While React.js remains a powerhouse for building interactive user interfaces, many businesses and developers are now leaning toward Next.js for complete, production-ready solutions. So what exactly makes Next.js a more favorable choice over React.js in 2025? Let’s explore the reasons in detail.

🧱 React.js vs Next.js: Core Distinction

React.js is a JavaScript library focused solely on building UI components.

Next.js is a full-fledged framework built on top of React that includes everything you need for production — routing, SSR, SEO optimization, static site generation, and more.

In essence, React gives you the tools to build an interface, while Next.js gives you the structure to build, deploy, and scale a complete web application.

🚀 Key Advantages of Choosing Next.js in 2025

1. Built-in Server-Side Rendering (SSR)

2. Improved SEO Out of the Box

3. Hybrid Rendering Capabilities

4. Full Routing System

5. Image & Font Optimization

This aligns perfectly with Google’s performance guidelines in 2025. React.js doesn’t offer this natively.

6. API Routes Without a Backend

7. Enhanced Developer Experience

Next.js has evolved into one of the most developer-friendly frameworks in 2025, backed by the Vercel ecosystem.In 2025, Next.js stands out as the smarter, faster, and more scalable solution for building modern websites and web applications. It inherits everything great about React — and adds structure, optimization, and production-readiness. If you’re planning to build a website that demands speed, SEO, and a seamless development process, Next.js is the clear choice.

For more details read this informative article: https://www.nimblechapps.com/blog/choosing-nextjs-over-reactjs-for-website-development

2025-04-05

Both the Smoot-Hawley Tariff Act of 1930 and the tariffs imposed during the Trump administration (starting in 2018 and again in his second term) were protectionist trade measures intended to shield domestic industries from foreign competition. However, they differ in several key aspects:  

Smoot-Hawley Tariff Act (1930):

Timing: Enacted during the onset of the Great Depression.  

Scope: Raised tariffs on over 20,000 imported goods, primarily targeting agricultural and manufactured goods.  

Average Increase: Increased existing import duties by an average of about 20%. Some sources state the average increase on dutiable goods was higher.  

Motivation: Primarily aimed at protecting American farmers and industries struggling with overproduction and decreased demand.  

Congressional Role: Tariff rates were set by the U.S. Congress.

Economic Context: The U.S. was running a trade surplus at the time, although imports of manufactured goods were increasing.

Impact: Widely blamed for exacerbating the Great Depression by triggering retaliatory tariffs from other countries, leading to a sharp decline in global trade and U.S. exports.  

Trump Tariffs (2018-2020 & 2025):

Timing: Implemented during a period of relative economic stability in the first term, and again in a context where Trump declared a "national emergency" regarding foreign trade in his second term.

Scope: Targeted specific countries (e.g., China, EU, Canada, Mexico) and specific industries (e.g., steel, aluminum) initially. The second term actions propose broader tariffs on all countries and potentially higher reciprocal tariffs on those with large trade deficits with the U.S.  

Average Increase: The average increase varied depending on the targeted goods and countries. Some reports indicate that Trump's proposed tariffs in his second term could result in an average duty surpassing the levels of Smoot-Hawley.  

Motivation: Stated goals included reducing trade deficits, protecting national security, encouraging domestic manufacturing, and addressing what Trump considered unfair trade practices and intellectual property theft. His second term rhetoric emphasizes "reciprocity" and addressing non-tariff barriers.  

Presidential Authority: Implemented through presidential executive orders, leveraging national security clauses and other trade laws, granting the President more direct control.  

Economic Context: The U.S. had significant trade deficits. Trade as a percentage of GDP was also much larger than in 1930.  

Impact: Led to retaliatory tariffs from affected countries, impacting U.S. exports and increasing costs for some American businesses and consumers. The broader potential impact of the second term tariffs is still unfolding, but experts predict higher prices for consumers and negative effects on the U.S. and global economies, with the possibility of a significant reduction in U.S. GDP.  

Similarities:

Protectionist Intent: Both aimed to protect domestic industries from foreign competition through the imposition of tariffs.  

Unilateral Actions: Both involved significant unilateral actions by the U.S., potentially disrupting established trade relationships.

Risk of Retaliation: Both actions triggered or are expected to trigger retaliatory measures from trading partners.

Key Differences:

Economic Climate: Smoot-Hawley was enacted during a severe economic downturn, while Trump's tariffs were initiated in a more stable (initially) economy.

Target and Scope: Smoot-Hawley was a broadside across many imports, while Trump's tariffs were more targeted initially, with the potential for broader application in his second term with a focus on "reciprocity."

Tariff Levels: While both increased tariffs, the average level and the specific rates on certain goods differed. Some analyses suggest Trump's second-term proposals could exceed the average levels of Smoot-Hawley.

Authority: Smoot-Hawley was a result of Congressional action, while Trump's tariffs were largely driven by presidential authority.  

Global Trade Landscape: The global economy and the interconnectedness of trade were vastly different in 1930 compared to the periods of Trump's tariffs.

In conclusion, while both the Smoot-Hawley Tariff Act and the Trump tariffs share a protectionist motivation, they occurred in different economic contexts, had varying scopes and average levels, and were implemented through different means. The potential for negative economic consequences, including trade wars and harm to the global economy, is a significant concern associated with both historical and contemporary tariff actions.  

2025-03-23

はてな匿名ダイアリーを非公開でブクマするbot作成方法

はてなブックマークAPIを利用して 非公開 でブックマークする方法をご説明します。

1. はてなAPI認証情報を取得

1. はてな開発者向けページ で APIキーを取得。

2. OAuthトークンを発行する。(個人用のスクリプトなら「パーソナルアクセストークン」推奨)

2. APIリクエストパラメータ

ブックマークを 非公開 にするには、APIリクエストボディに private フィールドを 1 に設定します。

エンドポイント:

POST https://bookmark.hatenaapis.com/rest/1/my/bookmark


リクエストボディ(JSON): 
{
    "url": "https://anond.hatelabo.jp/xxxxxxx",
    "comment": "自動ブックマーク",
    "private": 1
}

これで 非公開のブックマーク になります

3. Pythonスクリプト

以下のコードを実行すれば、10分以内の匿名ダイアリー記事ランダムに 非公開 でブックマークできます


import feedparser
import requests
import random
import time
from datetime import datetime, timezone, timedelta

# はてなAPI認証情報
HATENA_API_KEY = "あなたAPIキー"
HATENA_USERNAME = "あなたはてなID"

# はてな匿名ダイアリーRSS URL
RSS_URL = "https://anond.hatelabo.jp/rss"

# 10分以内の投稿を取得
def get_recent_entries():
    feed = feedparser.parse(RSS_URL)
    recent_entries = []
    now = datetime.now(timezone.utc)
    for entry in feed.entries:
        published_time = datetime(*entry.published_parsed[:6], tzinfo=timezone.utc)
        if (now - published_time) < timedelta(minutes=10):
            recent_entries.append(entry.link)
    return recent_entries

# はてなブックマークに非公開で追加
def bookmark_entry(entry_url):
    url = "https://bookmark.hatenaapis.com/rest/1/my/bookmark"
    headers = {
        "Authorization": f"Bearer {HATENA_API_KEY}",
        "Content-Type": "application/json"
    }
    payload = {
        "url": entry_url,
        "comment": "自動ブックマーク",
        "private": 1  # 非公開設定
    }
    response = requests.post(url, json=payload, headers=headers)
    return response.status_code

# メイン処理
while True:
    entries = get_recent_entries()
    if entries:
        entry = random.choice(entries)
        status = bookmark_entry(entry)
        print(f"非公開ブックマーク: {entry}, ステータス: {status}")
    time.sleep(600)  # 10分ごとに実行

4. 注意点

• 実行環境: Python 3.x が必要。requests と feedparser をインストール (pip install requests feedparser)

• 実行間隔: time.sleep(600) で10分ごとに実行

API制限: はてなAPIにはリクエスト制限があるため、短時間で大量に実行しないように注意

OAuth認証: APIキーだけでなく、OAuthトークンを使うほうがより安全

このスクリプトを実行すれば、最新の匿名ダイアリー投稿10分以内のものからランダムに選び、非公開でブックマークする ことができます

はてな匿名ダイアリーbotブクマするのは運営も認めてる行為なので、みんなでbotを使ってブクマしよう!

2025-03-22

anond:20250322220222

id を手動でコピーしてくるのが面倒だったから、削除ボタンが画面に出るようにした

押すと即削除

const rkm = "(トークン的なもの)"
const user = "(ユーザ名)"

const delmasda = (id) =>
    fetch(`https://anond.hatelabo.jp/${user}/edit`, {
        "headers": {
            "content-type": "application/x-www-form-urlencoded",
        },
        "referrer": "https://anond.hatelabo.jp/",
        "referrerPolicy": "origin",
        "body": new URLSearchParams({
            "rkm": rkm,
            "mode": "confirm",
            "id": id,
            "delete": "削除する"
        }).toString(),
        "method": "POST",
    })

for (const sec of document.querySelectorAll(".section")) {
    const id = sec.querySelector("a").href.match(/92;/(92;d{14})/)[1]
    const delbtn = document.createElement("button")
    delbtn.textContent = "削除"
    delbtn.onclick = async () => {
        await delmasda(id)
        sec.remove()
    }
    sec.querySelector(".edit").after(delbtn)
}

増田の削除をひとつひとつ詳細画面開いてするのが面倒だからまとめて消すスクリプトやで

 

const rkm = "(トークン的なもの)"
const ids = ["(削除する増田ID)"]
const user = "(ユーザー名)"

for (const id of ids)
    fetch(`https://anond.hatelabo.jp/${user}/edit`, {
        "headers": {
            "content-type": "application/x-www-form-urlencoded",
        },
        "referrer": "https://anond.hatelabo.jp/",
        "referrerPolicy": "origin",
        "body": new URLSearchParams({
            "rkm": rkm,
            "mode": "confirm",
            "id": id,
            "delete": "削除する"
        }).toString(),
        "method": "POST",
    })

2025-03-07

anond:20250307112031

MicroSoftASPじゃなくApplication Service ProviderのASP楽天とかYahooとかFutureShopとか。

2025-01-16

[] The Dichotomy of Intellectual Engagement in Digital Media Consumption: A Profound Exegesis

In the labyrinthine realm of digital content dissemination, an enigmatic phenomenon has surfaced, challenging our axioms regarding the nexus between content ubiquity and viewer cognitive acumen. This disquisition endeavors to elucidate the paradoxical inverse correlation between video viewership metrics and the intellectual quotient of the audience, propounding that audiovisual content amassing prodigious view counts tends to captivate viewers with a mean Intelligence Quotient (IQ) of 100, while their more esoteric counterparts allure a demographic boasting an average IQ of 120.

Epistemological Framework and Methodological Paradigms

To fathom this counterintuitive paradigm, one must first grapple with the multifarious nature of human cognition and the intricate interplay between intellectual capacity and media predilections. This hypothesis, positing an inverse relationship between a video's popularity and the mean IQ of its viewership, necessitates a rigorous examination of the underlying psycho-sociological and neurocognitive factors that may engender such a paradoxical outcome.

The application of Cognitive Load Theory to media consumption habits provides a plausible explication for this phenomenon. Videos achieving viral status often employ reductionist narratives and readily assimilable information, minimizing cognitive strain. Conversely, less ubiquitous videos may delve into more abstruse subject matter, demanding heightened cognitive engagement and a more sophisticated intellectual framework for comprehensive assimilation.

Algorithmic Hegemony and Epistemic Bubbles

The pervasive influence of recommendation algorithms in content distribution platforms cannot be discounted in this analysis. These algorithmic arbiters, designed to maximize user engagement, may inadvertently engender epistemic bubbles that reinforce existing cognitive predispositions. Individuals with superior IQs may actively seek out more intellectually challenging or esoteric content, thereby circumventing the algorithmic propensity towards homogenization and cognitive stasis.

Socioeconomic Stratification and Information Asymmetry

It is imperative to consider the socioeconomic dimensions that may influence both IQ development and media consumption patterns. Higher IQ individuals often correlate with elevated socioeconomic status, potentially affording them greater access to diverse epistemological resources and fostering a predilection for more intellectually stimulating content. This demographic may be less susceptible to the allure of mainstream, highly-viewed videos that cater to a broader, less discerning audience.

Implications for Content Creators and Platform Architects

The ramifications of this inverse relationship between viewership and viewer IQ are profound for content creators and platform developers alike. It challenges the prevailing paradigm that equates popularity with quality or intellectual value. Content creators targeting a more intellectually discerning audience may need to recalibrate their expectations regarding view counts and engagement metrics, focusing instead on cultivating a dedicated niche audience that values cognitive stimulation over mass appeal.

Conclusion: Navigating the Intellectual Chasm in Digital Media

In summation, the observed dichotomy between high-viewership videos attracting an audience with an average IQ of 100 and their less popular counterparts appealing to viewers with a mean IQ of 120 underscores the complex relationship between intellectual capacity and media consumption in the digital age. This phenomenon necessitates a reevaluation of how we measure content value and success in the online sphere, prompting a more nuanced approach to content creation, curation, and consumption that acknowledges the diverse cognitive needs of the audience spectrum. The implications of this paradigm shift extend far beyond mere metrics, touching upon fundamental questions of epistemology, cognitive diversity, and the very nature of intellectual engagement in the digital era.

2024-11-25

文章どころか動画理解できない人たちについて教えてください

AIちゃんに聞いて見た

I've noticed a non-negligible number of people who have not only completed compulsory education in regular classes but have also received higher education and graduated from university, yet struggle with reading comprehension (understanding the meaning of text), cannot read long texts, and even have difficulty understanding videos.

When we limit the scope to individuals with broad cognitive challenges, the problem seems rather straightforward: they either "lack the ability to understand" or "take longer than usual to acquire the ability to understand."

Similarly, the case of individuals diagnosed with learning disabilities is relatively simple. While they may not have broad cognitive challenges, they require different approaches and training due to their unique learning styles.

However, it is perplexing that university graduates without broad cognitive challenges or diagnosed learning disabilities struggle to understand not only written text but also simplified video content.

I suspect that the underlying causes might include gaps in the horizontal transfer of experiences and knowledge, a severe lack of adaptability, and an extreme deficit in metacognition. Has there been any research on these issues? Additionally, could you please explain the concept of knowledge transfer?

 

(正規の学級で義務教育を修了し、さら高等教育を受けて大学卒業したにもかかわらず、読解力(文章意味理解する能力)に苦しみ、長文を読むことができず、さらには動画理解にも困難を感じる人が少なくないことに気づきました。

 

認知能力に広範な課題を抱える個人範囲限定すると、問題比較的単純です。「理解する能力がない」か、「理解する能力を獲得するのに通常よりも時間がかかる」かのいずれかです。

 

同様に、学習障害と診断された個人場合比較的単純です。彼らは広範な認知能力課題を抱えていないかもしれませんが、独自学習スタイルのために異なるアプローチトレーニング必要となります

 

しかし、広範な認知能力課題学習障害を持たない大学卒者が、書かれたテキストだけでなく、簡略化されたビデオコンテンツ理解にも苦労していることは不可解です。

 

私は、その根本的な原因として、経験知識の水平的転移の欠如、メタ認知の極端な欠如などが考えられるのではないかと疑っています。これらの問題に関する研究はありますか?また、知識転移概念について説明していただけますか?)

 

 

Chat GPTちゃんの回答

Yes, research and analysis exist around the issues you described, particularly in the domains of education, psychology, and cognitive science. Let’s break down your observations and questions step by step:

 

Key Issues with Reading and Comprehension

 

1. Reading Comprehension Among Educated Individuals

• This phenomenon—educated individuals struggling with comprehensionis indeed perplexing, especially given their presumed exposure to a variety of learning materials. It suggests that education systems sometimes emphasize rote learning and surface-level knowledge acquisition over deeper understanding, critical thinking, and metacognition.

2. Possible Underlying Causes

• Horizontal Transfer Gaps: This refers to the inability to apply knowledge or skills learned in one context to another. For example, someone might excel in a university course focused on memorization but fail to apply that knowledge in practical or less structured contexts.

• Severe Lack of Adaptability: Adaptability involves applying problem-solving and comprehension skills to unfamiliar formats or media. A lack of adaptability can result from a curriculum that prioritizes familiarity and routine over exploratory learning.

• Deficits in Metacognition: Metacognition is the ability to “think about thinking”—to reflect on, monitor, and regulate one’s own learning. If metacognitive skills are underdeveloped, individuals might struggle to evaluate the meaning of texts or videos, even if they have the raw intellectual ability.

 

Research Insights

 

1. Knowledge Transfer

The concept of knowledge transfer involves applying skills, knowledge, or strategies learned in one context to another. It is often classified into:

• Horizontal Transfer: Applying knowledge across similar contexts (e.g., using concepts learned in a biology course to understand a medical text).

• Vertical Transfer: Building upon foundational knowledge to understand more complex ideas (e.g., using basic algebra to solve advanced calculus problems).

Studies suggest that transfer is more likely to occur when:

• Learners deeply understand underlying principles, not just surface details.

Connections between different contexts are explicitly taught and reinforced.

2. Factors Limiting Transfer

• Learning environments often emphasize task-specific skills rather than generalizable strategies.

• Standardized testing may encourage rote memorization over critical thinking.

• Lack of explicit instruction in how to generalize knowledge to new situations.

3. Metacognitive Deficits

Research highlights the importance of metacognition in learning. Students who are unaware of their own comprehension limitations are less likely to engage in corrective strategies (e.g., rereading, seeking clarification). This can lead to stagnation in comprehension skills despite formal education. Effective interventions include:

• Teaching self-monitoring techniques.

• Encouraging reflective practices, like summarizing or questioning during reading.

4. Cognitive Overload in Multimedia

Even videos, if not designed properly, can overwhelm learners. The Cognitive Theory of Multimedia Learning suggests that excessive extraneous information or unclear organization in videos can overload working memory, hindering comprehension.

 

Strategies and Research-Based Solutions

 

1. Improving Knowledge Transfer

Active Learning: Techniques such as problem-based learning or case studies can improve transfer by encouraging the application of knowledge to new situations.

• Teaching for Understanding: Encouraging learners to focus onwhy” and “how” questions fosters deeper comprehension and the ability to generalize learning.

2. Fostering Adaptability

• Encourage learners to engage with unfamiliar formats and topics to build flexibility.

• Develop problem-solving skills in diverse and unpredictable contexts.

3. Developing Metacognitive Skills

• Self-Regulated Learning Training: Programs that teach students to plan, monitor, and evaluate their learning have shown success in improving comprehension.

Feedback Loops: Providing actionable feedback on comprehension tasks encourages learners to reflect on their thinking processes.

 

Conclusion

 

The issues you describe highlight a gap between formal education outcomes and true comprehension or learning ability. Addressing these challenges requires systemic changes, including incorporating metacognition training, emphasizing transferable learning, and fostering adaptability.

 

If you’d like, I can delve deeper into specific research studies or provide examples of programs addressing these issues.

 

 

Claudeちゃんの回答

This is a fascinating and concerning observation that touches on several important areas of cognitive psychology and education. Let me address this systematically.

 

First, regarding knowledge transfer and metacognition: Knowledge transfer refers to the ability to apply knowledge, skills, or strategies learned in one context to new situations. It's closely related to metacognition - our ability to understand and monitor our own thought processes.

 

Research in this area has revealed several key findings:

 

David Perkins and Gavriel Salomon's work in the late 1980s and early 1990s identified two types of transfer:

 

A significant study by Brown, Collins, and Duguid (1989) in "Situated Cognition and the Culture of Learning" highlighted how knowledge often remains "inert" - students can pass tests but fail to apply knowledge in real-world contexts.

 

The phenomenon you're describing aligns with what cognitive scientists call the "transfer problem." Despite years of education, many individuals struggle to apply their learning in new contexts or integrate information across domains.

 

Some relevant research directions:

 

1. Cognitive Load Theory (Sweller et al.)

Shows how working memory limitations affect learning and transfer. Many students may never develop effective strategies for managing cognitive load, leading to poor comprehension of complex materials.

 

2. Reading Comprehension Studies

Work by Pressley and Afflerbach on "verbal protocols" revealed that skilled readers use multiple strategies simultaneously, while poor readers often lack these metacognitive tools.

 

3. Domain Integration Research

Studies by Susan Goldman and others have shown that even advanced students often fail to connect knowledge across domains, treating each subject as an isolated "silo."

 

Your observation about university graduates struggling with comprehension despite no apparent cognitive disabilities might be explained by several factors identified in research:

 

1. Surface-level Learning: Many educational systems reward memorization over deep understanding

2. Limited Strategy Instruction: Students often aren't explicitly taught comprehension strategies

3. Fragmented Knowledge: Information is typically taught in isolation without emphasis on connections

4. Weak Metacognitive Skills: Students may never develop the ability to monitor and regulate their own understanding

 

Some promising approaches to address these issues include:

 

1. Strategy Instruction Models

Teaching explicit strategies for comprehension, integration, and transfer. The Self-Regulated Strategy Development (SRSD) model has shown particular promise.

 

2. Knowledge Integration Frameworks

Approaches like Knowledge Integration Environment (KIE) help students connect ideas across domains.

 

3. Metacognitive Training Programs

Programs focusing on developing metacognitive awareness and self-regulation skills.

 

Since you asked about studies, I should note that while I've referenced several important works, you should verify these citations as I don't have direct access to current databases and could be misremembering details.

 

Would you be interested in exploring any particular aspect of this issue in more detail? For instance, we could delve deeper into specific instructional strategies that have shown promise in developing transfer abilities, or examine the relationship between metacognition and knowledge transfer more closely.

2024-11-07

anond:20241107003405

いや誰がしらんの?

SWEにすうじなんかつかない!タイトルなんかいったらばれる!ってひとが知らんのかな?

そりゃ働いてないんだから知らんわな

一般的にはどこの企業でもSoftware EngineerにSeniorがついたりPrincipalとかStaffがついたり、DeveloperになったりApplicationがついたりArchitectがいたりでどこもおんなじだよ

俺は全部なったことある

英語圏はそれより職掌で完全にちがう

コンサルタントだとかシステムエンジニアだとかインフラエンジニアだとかはまるで違う話

2024-07-07

ベンダーロックって言ってもな

要件満たすため・社内政治的な理由ピンポイントで別のところ使う+併用はあっても、

ネットワーク製品以外はほぼ選択肢無くね?感

 

AIちゃんゼロトラストセキュリティについて答えてくれました

ゼロトラストセキュリティは、「信頼せず、常に検証する」という原則に基づいています。主な特徴として、常時の認証承認、最小権限アクセスアクセス継続的監視があります。以下の技術ソリューションを組み合わせることで、包括的ゼロトラストセキュリティモデルを構築できます

 

 

ID管理アクセス制御

1. Microsoft Entra ID(旧Azure AD):

 

2. Microsoft Entra 条件付きアクセス

 

3. 多要素認証(MFA):

 

 

ネットワークセキュリティ

1. マイクロセグメンテーション:

  

2. ゼロトラストネットワークアクセス(ZTNA):

 

3. ソフトウェア定義ネットワークSDN):

 

 

エンドポイントセキュリティ

1. デバイス管理

 

2. エンドポイント検出と対応EDR):

 

 

データ保護

1. 暗号化

 

2. データ漏洩防止(DLP):

 

 

セキュリティ監視分析

1. セキュリティ情報およびイベント管理SIEM):

 

2. ID保護

2024-03-30

1週間前に再起不能になったEdgeを、今日復旧させた

問題の再発に備えて書いた日記備忘録

ブログIT技術者向けSNS等は利用しておらず、はてブTwitterでやるにはやや長いので、増田投稿

発端

Windows 10 (22H2 19045.4170) 上のEdgeを、数十のタブを開いたまま新バージョン (123.0.2420.53) に更新したらハングアップしたため、タスクマネージャー強制終了させた

その後Edgeを起動させようとすると、更新時に閉じたセッションを復帰させる段階で強制終了するようになり、使用不能になった

Edgeに導入していた拡張機能には、Session Budy (4.0.2。GoogleのManifest V3対応するため、最近大規模改修を実施(1。増田の最終節の同番号を参照。以下同)) やuBlock Origin (1.56.0。新規のマイフィルターを多数追加中だった) 等があった

最初の試み

Edgeが起動しない」と直截な語句検索していくつかの解説ページにたどり着いた

いくつかの解決策(2・3)を実行したところ、有効ではなかったが次の知見が得られた


数日程度では修復できないだろうと判断し、別のChromiumブラウザを使いつつ、片手間で修復方法を調べることにした

Windowsの設定画面等にあるリンク有効になるよう、デフォルトwebブラウザEdgeから変更した

パスワードは別ツール管理してたため無くてもそんなに困らなかったが、uBlockの設定とSession Budyで雑に保存してた閲覧履歴必要だったので、Chrome拡張の復旧作業をした

"Default\Local Extension Settings"以下のフォルダと、念のために"Default\IndexedDB""Default\Local Storage\leveldb"の中身を移植(8)して作業完了

翌日以降

アイテム履歴データ破損が問題の原因ではと考えてその修復や初期化方法検索したが、これは徒労に終わった(ただし、このアプローチが完全に無効だとは言い切れない。参考ページ5は、復旧作業完了後に見つけた情報で、今回の問題活用できずに終わった)

Edge挙動を変更した(9・10)が、これも無駄だった

コントロールパネルシステムセキュリティセキュリティメンテナンス信頼性履歴の表示→問題レポートをすべて表示」で確認できた、Edge問題の要約やイベント名等で検索したところ、再インストールを勧めるページが数点引っかかった

既に何日も経ちWindowsの再インストールユーザーアカウントの作り直しをしようかと考えかけていたが、もう少し努力してみることにした

結末

Edgeを (アプリファイルを手動で削除したりするのではなく) なるべく安全アンインストールすれば、正常に再インストールできるのではと考え、検索結果通り(1112)に作業してみた

それでも「アプリ」のアンインストールメニュー無効なままで操作できなかったが、他に事例が無いか、"IntegratedServicesRegionPolicySet.json"等の関連語句で再検索した

コマンドラインアンインストールを試みた事例(13)が見つかり、実行したらEdgeが削除された (ただし、コマンドプロンプトでもポップアップウィンドウでも実行結果の表示がされなかった)

そして参考ページ4のインストーラを実行し、念のために修復とOS再起動をかけ、Edgeの起動を確認した

Microsoftアカウントログインしていたため、パスワード簡単に復旧できた

拡張機能は全て死んでいたが、仮に使っていたChromiumブラウザからコピペしたりエクスポートしたりして終了

利用していた拡張が少なかったので、プロファイルフォルダの内容の移植よりもその方が簡単だった

参考ページ

1. SESSION BUDDY V3 END OF LIFE | Google グループ

https://groups.google.com/g/sessionbuddy-discuss/c/HQPcLOq3-Ik

2. Microsoft Edgeが直ぐ閉じてしまう。 | Microsoft コミュニティ

https://answers.microsoft.com/ja-jp/microsoftedge/forum/all/microsoft/c414d2f9-b685-471c-8e78-2054c2e26c6c

3. ある日突然「Microsoft Edge」が開かなくなった、さあどうしましょう:山市良のうぃんどうず日記(224) | @IT

https://atmarkit.itmedia.co.jp/ait/articles/2202/02/news009.html

4. Microsoft Edgeダウンロード

https://www.microsoft.com/ja-jp/edge/download?form=MA13FJ

5. Windows10の「タスクバーにピン留めしているアプリ」の、「最近使ったもの」と「固定済み(いつも表示)」の設定ファイルレジストリはここにある #Windows10 | Qiita

https://qiita.com/RyoIchimura/items/7e33980358f07e57a715

6. msconfigシステム構成)で解除してよいのは?使用場面と起動方法 | ドスパラ通販公式

https://www.dospara.co.jp/5info/cts_str_pc_msconfig.html

7. Windows Hello概要セットアップ | Microsoft サポート

https://support.microsoft.com/ja-jp/windows/windows-hello-%E3%81%AE%E6%A6%82%E8%A6%81%E3%81%A8%E3%82%BB%E3%83%83%E3%83%88%E3%82%A2%E3%83%83%E3%83%97-dae28983-8242-bb2a-d3d1-87c9d265a5f0

8. chrome.storageの実体場所 #Chrome | Qiita

https://qiita.com/k7a/items/cf644471d34d31f398e9

9. 第2回 グループポリシーとは何か:グループポリシーのしくみ(3/5 ページ) | @IT

https://atmarkit.itmedia.co.jp/ait/articles/0602/23/news119_3.html

10. Microsoft Edge ブラウザポリシーに関するドキュメント | Microsoft Learn

https://learn.microsoft.com/ja-jp/deployedge/microsoft-edge-policies

11. Windows 11/10からMicrosoft Edgeアンインストールするシンプル方法が見つかる | ソフトアンテナ

https://softantenna.com/blog/windows-11-10-uninstall-edge/

12. Releases · thebookisclosed/ViVe | GitHub

https://github.com/thebookisclosed/ViVe/releases

13. 各チャネルごとの Edge 削除状況 | 内気なもんた君

https://coolvitto.hateblo.jp/entry/2023/12/17/231027

2024-03-02

anond:20240302043100

Application.WorksheetFunction. て何度もコードに書いてると、じゃあ直接シートでやるか…って気持ちになるのだ

2023-08-25

test

https://chat.openai.com/share/c80d83ea-752b-4561-a162-7ea0bd116d56

CSVVBAエクセル

Option Explicit

Dim objExcel, objWorkbook, objWorksheet

Dim strFolderPath, strSourceFile, strTargetFile, strSearchString, strReplaceString

Dim intLastRow, intRow, intColumn

' Excelオブジェクト作成

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

' フォルダパスファイル名の設定

strFolderPath = ".\" ' スクリプトと同じフォルダにあることを仮定

strSourceFile = "変更一覧.xlsx"

strTargetFile = "変更一覧.xlsx"

' Excelファイルを開く

Set objWorkbook = objExcel.Workbooks.Open(strFolderPath & strSourceFile)

' シートのコピー名前の変更

objWorkbook.Sheets("1月").Copy , objWorkbook.Sheets("1月").Index

objWorkbook.Sheets("1月 (2)").Name = "2月"

' セルの値の置換

Set objWorksheet = objWorkbook.Sheets("2月")

objWorksheet.Cells(1, 1).Value = Replace(objWorksheet.Cells(1, 1).Value, "1月", "2月")

objWorksheet.Cells(2, 7).Value = Replace(objWorksheet.Cells(2, 7).Value, "2023/2/14", "2023/3/14")

' 最終行の取得

intLastRow = objWorksheet.Cells(objWorksheet.Rows.Count, 1).End(-4162).Row ' xlUp

' 値のクリア

For intRow = 8 To intLastRow

For intColumn = 1 To 6

objWorksheet.Cells(intRow, intColumn).ClearContents

Next

Next

' テキストファイルの読み込み

Dim objFSO, objTextFile, strContents, arrLines, arrFields, strNewContents

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objTextFile = objFSO.OpenTextFile(strFolderPath & "変更一覧.txt", 1)

strContents = objTextFile.ReadAll

objTextFile.Close

' フィールド区切り文字カンマに設定してデータを分割

arrLines = Split(strContents, vbNewLine)

For Each strContents In arrLines

arrFields = Split(strContents, ",")

For Each strContents In arrFields

If IsNumeric(strContents) Then

strNewContents = strNewContents & "'" & strContents & ","

Else

strNewContents = strNewContents & strContents & ","

End If

Next

strNewContents = Left(strNewContents, Len(strNewContents) - 1) & vbNewLine

Next

' データをシートに貼り付け

Set objWorksheet = objWorkbook.Sheets("2月")

objWorksheet.Cells(1, 8).Value = strNewContents

' セルの値の置換

objWorksheet.Cells(123, 1).Value = Replace(objWorksheet.Cells(123, 1).Value, "F", "FH")

' Excelファイルを保存して閉じる

objWorkbook.Save

objWorkbook.Close

objExcel.Quit

' オブジェクト解放

Set objWorksheet = Nothing

Set objWorkbook = Nothing

Set objExcel = Nothing

Set objFSO = Nothing

Set objTextFile = Nothing

WScript.Echo "スクリプトの実行が完了しました。"

2023-06-26

[]

ごめんね。内部ストレージもいっぱいですってエラーがでるのでなんとかしてほしいといわれて、ストレージにある動画とか画像とか逃がしてるうちに

強制プリインストールされているキャリアアプリ系の謎のエラーメッセージに気づく。これはアレをすれば解決するか(・・?そうおもった。削除したいアプリ一覧とかいうのを 参考にして、ドコモ電話

DOCOMO Initialization

docomo Application Manager

dアカウント設定

dマーケット

dメニュー

my daiz

などを削除したら、泣かれた。電話もできなくなったっていわれた。ごめんなさい。なぜだろう(・・?けっこう騒がれてつらみしかない。今朝はあそこに立寄ってから出社したいから、お小言にずっと耐え忍ぶのか?

2023-05-19

Omnivore便利だけどエラー多い。ブラウザコンソールエラーだらけだし、画面にこんなユーザー向けじゃないメッセージ出すし。

Application error: a client-side exception has occurred (see the browser console for more information).

2023-04-26

TBSニュースサイトヤバない?(追記)

はてぶの上位にちょいちょい載ってるTBS系のニュースサイト、newsdig.tbs.co.jpについて。

https://b.hatena.ne.jp/site/newsdig.tbs.co.jp/


何がヤバいかって、くっそ巨大なCookie(LocalStorageとかも含むのか知らんけど)をしこたま保存してんのよ。

気付いた時点では640MB占有してた。別に巡回チェックしてるわけでもなく、話題に挙がってたら見てみることもある程度のアクセス頻度なのだが。

Chromeユーザーアドレスバーに↓コピペして確認してみてくれ。

chrome://settings/content/all?searchSubpage=tbs.co.jp&search=cookie


試しにCookie消去してから、ただ開いただけでサイト上で何の遷移もしてないのに279MBも保存された。


次点ではpresident.jpが553MB消費してた。(こっちも話題に挙がってたら見てみることもある程度。)

(その次にはGoogleが数百MBオーダーで消費してたけど、これはGoogleドライブのオフラインキャッシュとか考えれば妥当。他に数百MBオーダーで消費してるサイトは無かった。)


多くのサイトは数バイトKBオーダーなのに、こいつら何保存してんのか不気味すぎる。


(追記)

各自環境消費量を教えてくれた方々や有意義コメントを下さった方々ありがとうございます

始めにお断りしておくべきだったかもしれませんが、自分ソフトウェア系ではありますが、Webエンジニアではありません。認識が浅かったり、古かったり、そもそも間違ってる可能性もあります

CookieじゃなくてCacheStorageやんけと突っ込みもいただいていますが、「LocalStorageとかも含むのか知らんけど」と書いておいた意図は(どのような技術要素かはどうでもよくて)ユーザー端末に保存されるデータボリュームについての話を意図していますChromeCookie絡みの設定画面での表示なのでこのような書き方をしましたが、解り難かったのならごめんなさいね冗長ながらも認識齟齬を招かないように平易な表現で書くと、「ユーザの明示的な承諾なくユーザー端末に保存されるデータデカイんだが」って話です。


で、各自環境で「ユーザの明示的な承諾なくユーザー端末に保存されるデータ」が数GBオーダーにも及ぶという事例が少なからず報告されて、自分環境だけではない事象だということが判りました。

さらtbspresident以外にもいくつかのサイトが同様に肥大化していることも知れました。


結果的にはid:hinaloeさんの解説が解りやすかったです。ありがとうございます

https://blog.hinaloe.net/2023/04/27/chrome-too-large-cache-storage/

CacheStorageがChromeの表示と、実際のディスク消費量と一致していないことが原因である理解しました。

追試してみたところ私の環境ではChrome開発者ツールでの表示が74MBで実際のWindowsファイルシステム上は33.9MB消費されました。

実際のストレージの消費は表示値の半分程度ということになり、id:hinaloeさんの1.4GBに対して5MBのように実際の約0.3%という結果とは大きく乖離がありますので、各環境で大きく違いそうな気がします。

気になる方は↓を各自確認いただくとよいかと思います

%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Service Worker\CacheStorage

配下のどのディレクトリ対象サイトのものなのか一意に特定する情報が無さそうなので、Chrome開発者ツールApplicationタブの左上の方にあるService Workersを選択すると、右側にReceived YYYY/M/D HH:MM:SSみたいな表記が有るので当該時刻に変更されたタイムスタンプを持つディレクトリ特定するような感じになるかと思います


ついでに開発者ツールを触っていて気付いたベースで書いておくと、

といった感じで、ユーザが見たものキャッシュしているのではなくて、先読みしてるような挙動に思えます

ロード時間短縮でUX改善を狙ったものかもしれませんが、個人的にはそれを1か月も保持し続けるのは過剰な感じがしますが世の中的にはどうなんでしょうね?

あと、スマホ場合挙動どうなってんすかね?


(追記2)

hinaloe氏の投稿で紹介されているStackOverflowの投稿やそのリンク先のChromiumバグレポートのやり取りまで目を通してみると、特に理由説明なく平均7MBがパディングされると書かれた投稿があります

https://stackoverflow.com/questions/39109789/what-limitations-apply-to-opaque-responses

https://bugs.chromium.org/p/chromium/issues/detail?id=796060


該当するソースコードは↓のようです。

https://source.chromium.org/chromium/chromium/src/+/main:content/browser/cache_storage/cache_storage_cache.cc

この中で、ComputeRandomResponsePadding()という関数を呼び出しておりその実体は↓のようです。

https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:storage/common/quota/padding_key.cc;drc=332f92aab4a32607f7813ac1a824f6ff0d86c369;l=47


この関数符号無し64bit整数乱数(つまり、0~18446744073709551615のいずれか)を14431 * 1024 = 14777344で割った剰余(つまり、0~14777343≒約14MiB)を返却します。

これがパディング値として採用されることになりますが、乱数正規分布している前提で、平均すると(最大値14MiBの半分で)約7MBになるよねってことだと思われます


故にChromeの設定画面から確認できるCookie等(LocalStorageとかCacheStorageとか諸々含む)のサイズは、概算してCacheStorageに存在するファイル数×平均7MBが過大計上されていることになりそうです。

これでChromeの設定画面から確認できるサイズと、実際のファイルシステム上で消費されているサイズの違いは合理的説明できますが、TBS等の特定サイトだけデカみえ理由説明にはならないのです。

まり、以下のような可能性がありそうです。

  1. Chromeの設定画面から確認できるサイズほど巨大ではないが(他のサイト比較して)相対的デカイ?
  2. ComputeRandomResponsePadding()の結果が顕著にデカくなる乱数が生成される個別要因がある?
  3. それ以外

なんなんすかね?

2023-03-03

Application error: a client-side exception has occurred (see the browser console for more information).

メルカリしっかりして!

client-sideやしワイが悪いんやろけど

ログイン ユーザー登録
ようこそ ゲスト さん