2023/02/24 おうどん
Mijikko.icon
code:rmv.ts
/** コードブロックタイトルに追加したボタンを削除する */
function removeButton(buttons: Button[], buttonArea: Element) {
const childs = buttonArea.children;
for (const child of childs) {
if (!(child instanceof HTMLSpanElement)) continue;
for (const button of buttons) {
if (child.title == button.title) child.remove();
}
}
}
上のコードはbuttonArea: ElementのElement.childrenに含まれる削除対象のDOMを全て削除するものだが、削除対象が3個中2個だった場合、必ず1個消しそびれる そんなこと起きるのかなあtakker.icon
でもそうなってるのか
remove()するのを後回しにしなければいけない
修正
code:fixed_rmv.ts
function removeButton(buttons: Button[], buttonArea: Element) {
const childs = buttonArea.children;
const removeTargets: HTMLSpanElement[] = [];
for (const child of childs) {
if (!(child instanceof HTMLSpanElement)) continue;
for (const button of buttons) {
if (child.title != button.title) continue;
removeTargets.push(child);
}
}
removeTargets.forEach((e) => e.remove());
}
childs自体をforEachで回して中でchildをremove()するのも試したけれど、削除自体が何故かできなかった
code:bad_fix_rmv.ts
function removeButton(buttons: Button[], buttonArea: Element) {
const childs = Array(buttonArea.children);
childs.forEach((child) => {
if (!(child instanceof HTMLSpanElement)) return;
for (const button of buttons) {
if (child.title == button.title) child.remove();
}
});
}
一行で書くと[...buttonArea.children].filter((child) => child instanceof HTMLSpanElement && buttons.some((button) => child.title === button.title)).forEach((child) => child.remove())かなtakker.icon
cFQ2f7LRuLYP.icon
そばよりもうどん派
おもしろさがわからん
同時代人にはそれはもう高い評価を受けているのだが…
「心なき身にもあはれは知られけり鴫立つ沢の秋の夕暮れ」をかろうじて知ってる
920番くらいにいい感じのうたがあった
書いてないので忘れた
970番でした
出典不明のうどん歌一首
mtane0412.icon
maichan.icon
わかるyosider.icon
基素.icon
全部VRにしたら「過去の30秒を録画して」で瞬間を切り取って保存できそう
現実はちゃんと撮影しておく必要がある
これは多少背景知識が必要
The images themselves, however, “are not the product of human authorship,” and the registration originally granted for them has been canceled. To justify the decision, the Copyright Office cites previous cases where people weren’t able to copyright words or songs that listed “non-human spiritual beings” or the Holy Spirit as the author — as well as the infamous incident where a selfie was taken by a monkey. Holy spritのほうは文脈がさっぱりわからない
猿のセルフィーは猿が作ってるけど画像はプロンプトを考えて作って取捨選択もしてるから全然違うのでは?
詳しくはPDFを読まないとわからない
inajob.icon
この画像をサーバで作って、端末側はそれを表示するだけ、、という仕組みなので割となんでもできる
https://gyazo.com/b954771ca981999a3ff60e40024db780
卓上に置いて、今日の予定とかを表示するデバイスを試作している
もともとリビングのディスプレイに表示していたのだが、模様替えに伴い撤去されてしまった・・
なんでうどん?粉ものつながり?
筋トレ
腹筋20、腕立て伏せ20、背筋20
mgn901.icon
学内で展示会があるが、それに向けて書体を用意してポスターなどをつくりたくなった。
https://gyazo.com/c7593ff373d2adcae34c6bd4e7684606https://gyazo.com/8555e7855427955d3cf177881d16741d
自作書体、濃さがどうしてもバラバラしているように見える。
春休みにやりたいことが多すぎる。
10個やりたいことがあって、あと50日くらいあるとすると、1つのことに5日しかかけられないことになる。
優先順位をつけるべき。
nomadoor.icon
わかるmaichan.icon
hatori.icon
カーペット床に落ちたうどんがくっついて簡単に取れなかったことで閃いたという。[4]