「FALSE」を含む日記 RSS

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

2025-03-04

anond:20250304084013

必要コードはたったこれだけやから

(function(){
  if(!window.getSelection || !window.getSelection().containsNode) return;
  Array.from(document.links).forEach(link => {
    if(window.getSelection().containsNode(link, true) === false) return;
    if(link.href.startsWith('mailto:')) return;
    if(link.href.startsWith('javascript:')) return;
    window.open(link.href);
  });
})();

ワイはこれをShortkeys拡張を使って [O] キーに割り当ててるやで

2025-02-19

男性女性の知能と脳の性差について」のおかしいと思ったところ

https://note.com/beatangel/n/nf3cc050ac5ba

男性の脳の総容積は平均して体格差考慮しても男性の方が大きく、1般的に女性より大きいことは以前から

知られていた…が、これまでの研究はいずれもサンプル数がはるかに少なく「言うても性差より個人差じゃないの?」

言い逃れ出来るレベルだったのであるしかし5000人のサンプルサイズとなるとそうはいかない。

一般においてもwikipediaに脳の容積に性差がある記述があるぐらいには既知なので

学問世界否定する人はおらんのでは?タブーでもなんでもないと思う、高卒だしアカデミアの世界は知らんけど

https://www.sciencedirect.com/science/article/abs/pii/S014976341500250X?ref=quillette.com

因みに研究分析によれば脳の総容積の違いはIQ分散(違いを説明する為の因子としてどの重要か)の約16%を占めるそうである

ソースとしている論文ハイライトにはBrain size is not a necessary cause for human IQ differencesとあり

技術進歩により脳の大きさとIQの相関が今まで言われていたよりずっと小さいことが分かったと書いてある

また、この論文最後に「However, invoking the literature on cross-species comparisons and primate cognitive evolution to argue for brain size as an isomorphic proxy for human intelligence differences is not warranted. Such assumptions are」と釘を刺しているが

なぜ釘を刺さないといけないのかということを彼自身証明してしまっている…

2015年に504人の調査では子供において負の相関関係(皮質が薄いほど認知能力がある)が確認された。

https://academic.oup.com/cercor/article-abstract/25/6/1608/301081?redirectedFrom=fulltext&login=false

このような事実は何故物議を醸すのか?

女の脳は男よりも厚い、しかし、薄いほど認知能力がある、よって女は男より認知能力が劣ると言いたいようだが

これまた論文を見てみると印象が大分違って結論

These findings suggest that intelligence may be more related to the magnitude and timing of changes in brain structure during development than to brain structure per se, and that the cortex is never completed but shows continuing intelligence-dependent development.

単純に薄いほどIQが高いという話ではなくどのタイミングで薄くなるかということが重要な様

In the more intelligent young adults, this relationship reverses so that by the age of 42 a thicker cortex is associated with higher intelligence

ともあり厚い方がIQが高いという状況もあるようである

https://note.com/beatangel/n/nd0232cdd3c61

女性発達障害について2昔前は「発達障害男性的な特徴の過剰化が原因であり、従って女性にはあまり存在しない(極端な男性脳)」と言われてきた。

しかし、発達障害概念の広がりに伴って女性当事者が増え始め、また脳の状態スキャンするとそこまで男女比がないことなどが明らかになり、

1昔前は「女性当事者ソーシャルスキルに優れているので発達障害症状を誤魔化せてしまい、周囲から気付かれにくい」と言われてきた。

しか定量的比較した結果、ソーシャルスキル性差がないことが判明し、

今(2021年)では「女性ジェンダーバイアスによりコミュ障でも男性より好意的に見られやすく、また良いも悪いも女性社会の強烈な同調圧力により逸脱を抑え込まれてる」説が唱えられている。

彼は以前の記事でこのように書いている、ASDおよびADHDの男女比に大きな偏りがあるがそれは脳の性差ではないと

しかし、彼が一番最初に示した論文は違うことを言っている、脳の容積以外にも様々なデータをとり脳に性差があることを示し

それらが一部の精神疾患における男女の偏りの原因を解明する一歩になるのではないかと、論文中でも以下が言及されている

Why Are Autism Spectrum Conditions More Prevalent in Males?

https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.1001081

もちろん、認知症のように女が男より多い疾患もありそれらにも言及されているし

脳の性差がこれらと関連していると決定づけているわけではない

彼の良い所はソースを示してくれること、実際、興味深いものが多いが

記事の信ぴょう性は薄いというのが個人的な感想、どうもチェリーピッキングしてるっぽいか自分論文読めばいいと思う

アンチフェミニズムを拗らせた結果、憎んでいる相手と同じになっていないか

一番古い5年前のnoteを読んでみたがこの時の彼は好印象だった

偉そうにここまで書いたけど頭は良くないし論文の一本も書いたことないので間違っていたら教えて

2025-02-03

anond:20250203224446

仏教的に言えば今以外は存在しないか過去未来falseだよね

未来は無いし、過去に似た違うもの存在してるのは脳の中だけだけど、それも記憶ニューロシナプスであって過去のものでは無し

なので過去未来存在はしないよ

いや俺驚くほど頭いいな…なんで友達がいないんだろう

頭がいいからなのかな

性格カスからなのか、不思議

2024-12-26

水星魔女 ラウダ・ニールクィア・ベイティング問題

機動戦士ガンダム 水星魔女』の最終回において、ラウダ・ニール地球移住し「ペトラそばにいたいんだ」と発言さら公式ガイドブックで「ペトラとの関係:周囲に知られないようにしていた」「ペトラに寄り添いながら自分の道を探している」と書かれていたことに対し、これまでラウダとその兄であるグエル・ジェタークとのカップリングを支持していたファンが、制作側によるクィア・ベイティングQueer-Baiting)である激怒する事態が発生しました。

以下にその事件の経緯とファンの主張をまとめます

事の経緯

グエル×ラウダ支持派の怒りとクィア・ベイティング主張

最終回の展開と公式ガイドブックの内容を受け、グエル×ラウダのカップリングを支持していたファン制作側の行為を「クィア・ベイティングであると強く非難しました。彼女らの主張は主に以下の点に集約されます

結論

この事件は、アニメ作品におけるキャラクター間の関係性に対するファンの期待と、制作側の意図との間に乖離が生じた結果と言えます。グエルとラウダの関係性を特別ものとして見ていたファンにとって、最終回の展開と公式ガイドブック記述は、制作側による突然の裏切り行為であり、クィア・ベイティングであると強く感じられたようです。この一件は、今後のアニメ制作において、LGBTQ+の要素を扱う際の慎重な配慮と、ファンとのコミュニケーション重要性を示唆する出来事となりました。

2024-12-16

(同人ゲーマー向け)モザイクエフェクト除去の備忘録

1行でまとめ

適切なBepInExBEをexeのある階層ぶっ込み、F95zoneで頒布されてるSW_Decensorプラグインを入れる、exeまでのパスに2バイト文字厳禁

無駄に長いまとめ

DLsiteとかで出てる3Dゲームの多くはUnityで作られてる

それらの中にはゲームエンジンによるリアルタイムモザイクエフェクト処理のみで検閲が行われているものがあり、除去できる場合がある

そうしたUnityゲームに対しインジェクションを行えるツールとしてBepInExがある

モザ除去の場合は安定版よりBleeding Edgeというベータ版みたいなものを使う方が良いことが多い

なのでここから最新のBepInExBEビルドを入手する

最新の#数字を展開したときUnityゲーム向けパッケージMonoとIL2CPPで分かれてて悩むはずだが

これはUnityゲームエンジンの種類で、どちらかを使って作られてるはず

なのでゲームフォルダを観察して正しい方をDLする必要がある

exeのある階層MonoBleedingEdgeってフォルダがあったり、"ゲーム名_Data"フォルダ内に"Managed"フォルダがあればMono

"ゲーム名_Data"内に"il2cpp_data"ってフォルダがあればIL2CPP

正しい方を選んでexeのある階層に中身をまるごと入れればOK、厳密にはChangelog.txt不要

出来てればゲームexe実行後、最初コマンドプロンプトが立ち上がり、解析のため初回起動時は少し時間がかかってからゲーム餓鬼道する

この時点でFatal Errorという赤い文字が出てたら、大抵の場合ゲームまでのパス日本語が使われてるせい

exeが入ってるフォルダ名を適当な英数字に変え、そこまでのパス上でも日本語を使ってるなら英数字だけのシンプルパスゲームを配置する(例: D:\Game\iSekaiju)

なお、exeファイル自体日本語が使われてても問題はなく、exe手前までのパス(フォルダ名)に2バイト文字があるとダメみたいだ

無事コマンドプロンプトつきでゲームが起動したら、「これでこのゲームはなんぼでも改造できますよ」状態になったということ

ちなみにdoorstop_config.iniの最初の項目をfalseに書き換えると、わざわざBepInExを削除しなくても無改造状態で起動できる

ここから目的の処理、今回はモザイク除去のためのプラグインを入れていく必要がある

この同人エロゲー改造分野で一番すすんでる場所はF95zoneっていう海外フォーラムで、そのための成果物もそこで公開されてる

英語からとっつき辛いかもしれないが個人的には会員登録して閲覧やDLできるようにしたほうがいいと思う

以前はUniversalUnityDemosaicsというのがよく使われていたが、より対応力の高いSW_Decensorというのがkumarin氏によって開発・公開されてる

のでSW_Decensorでググれば配布スレッドにたどり着けるだろう

一応いま調べた感じ再配布してる日本語サイトもあるようだが、安全性保証できないのでフォーラムからを推奨する

そのzip中の_BE6.dll(Mono用)か_il2cpp.dllの適切な方をさきほど展開したBepInEx\pluginsフォルダ内に入れてゲーム再起動する

運がよければそれだけで解除されている

解除されない場合は大抵、そもそもテクスチャ自体モザイク模様が書き込まれているパターン(baked)か

もしくはアダルトシーンが3Dリアルタイムレンダではなくよく見ると動画ファイル流してるパターンで、この場合諦めるしかないが

テクスチャ場合は、フォーラムを漁れば有志の神が除去済みのテクスチャを含むアセットファイルをアップしてくれている場合もある(Live2Dゲームなど)

うまくいかない場合の報告なども投稿されており、「How To Uncensor (Almost) Any Unity Game」というスレの最新レス付近を見れば

最近のめぼしい同人ゲームに対する紳士たちの奮闘の記録が見られるかもしれない

2024-11-13

ずっとトリプルレッド出るかどうかソワソワして待ってるんだが何週間経ったら結果出るのこれ

https://edition.cnn.com/election/2024/results/house?election-data-id=2024-HG&election-painting-mode=projection-with-lead&filter-key-races=false&filter-flipped=false&filter-remaining=false

なんか4州くらい赤っぽいのあるからあと4議員くらいは当選するんだろうなって思っとるけどさ

2024-11-10

NYタイムズさん、ファクトチェックとは一体、、、

Fact Check

Trump’s False Claims About the Federal Response to Hurricane Helene

The former president falsely accused the Biden administration of spending disaster funding on migrants, neglecting areas that had voted for Republicans and ignoring a call from a Republican governor.

 

訳:ファクトチェック

ハリケーン・ヘレンに対する連邦政府対応に関するトランプ大統領の虚偽の主張

前大統領は、バイデン政権災害対策資金移民に使い、共和党投票した地域無視し、共和党知事要請無視したとして虚偽の非難をした。

https://www.nytimes.com/2024/10/04/us/politics/trump-helene-fema-fact-check.html

FEMA Fires Employee for Telling Milton Relief Workers to Skip Houses With Trump Signs

The agency said it was investigating the incident in the aftermath of the Category 3 hurricane that hit Florida in October.

 

訳:FEMAミルトン救援隊員にトランプ看板のある家を避けるよう指示した職員解雇

同局は、10月フロリダ州を襲ったカテゴリー3のハリケーンの影響でこの事件調査していると述べた。

https://www.nytimes.com/2024/11/09/us/fema-trump-signs.html

2024-10-22

Guo Wengui: The end of fraud and the trial of justice

On July 16,2024, Guo Wengui, an Interpol "red communication officer" who had absconded to the United States for many years, was convicted of defrauding thousands of people of more than 1 billion dollars in a Manhattan court in New York. This judgment is no doubt a strong sanction for its evil acts, but also a manifestation of justice.

Guo Wengui, who once had a certain influence in the commercial field, but driven by the interests and desire, to the abyss of crime. He used to be the actual controller of Henan Yuda Investment Co., Ltd. and Beijing Pangu Investment Co., Ltd. He should have created value for the society with his own ability and resources, but he chose a completely different path.

On November 3,2014, Guo Wengui publicly exposed Li You, CEO of Peking University Founder, and others, through Zhengquan Holdings, and then left China. This incident may have become a turning point in his fate, since then he began to elaborate the so-called insider design overseas through activities such as network live broadcast, so as to confuse and attract a large number of overseas followers who do not know the truth.

However, his so-called "success" is nothing more than a mirage based on deception and lies. Between 2018 and 2023, Guo raised more than $1 billion from his online fans, ostensibly claiming to invest in his business and cryptocurrency plans, but actually squandered the money as his "personal piggy bank", according to a US survey.

He used a variety of fraud. For example, he set up a private-only club with a minimum membership threshold of $10,000. Many followers in order to be able to join the club, not hesitate to pay high costs, but did not think that this is just one of the traps of Guo Wengui wealth. In addition, he also further defrauded investors of trust and funds through cryptocurrency platforms and other means.

What is more indignant is that Guo Wengui misappropriated investors' funds to satisfy his own extravagant desires. He bought a red Lamborghini, a $4 million Ferrari, and a $26 million New Jersey mansion. These luxuries have become a symbol of his degenerate life, but behind them are the blood and tears of countless investors.

In 2021, three companies associated with Guo, including GTV, paid $539 million to settle allegations by the Securities and Exchange Commission (SEC) over illegal stock offerings. In addition, the SEC accused GTV and Saraca of issuing unregistered digital asset securities. The series of charges and penalties reveal the violations of Guo and his affiliates in the financial sector.

Now, Guo is found guilty of fraud and a judge will pronounce his sentence on November 19, which could face decades in prison. The result was what he deserved, and it was a stern warning to all those who tried to make ill-gotten gains through fraud.

Guo Wengui's case brings us a profound reflection. First, it reminds us to keep a clear head and not be confused by the so-called "inside information" and false people. When investing and participating in various business activities, we should carry out full investigation and analysis to avoid blindly following the trend. Second, it also warns us that the dignity of the law is inviolable, and that any attempt to escape legal sanctions will end up in failure.

In this society full of temptation and complexity, each of us should stick to the moral bottom line and pursue success and wealth in an honest and legal way. Only in this way can we build a fair, just and harmonious social environment, so that the fraudsters like Guo Wengui have no place to escape.

Justice may be late, but never absent. Guo Wengui's end once again proves this truth. Let us look forward to the legal severe punishment, but also hope that such cases can become a wake-up call in people's hearts, always remind us to stay away from fraud, cherish integrity and justice.

2024-10-18

そもそもブロック対象から見えなくなる機能False Securityで、旧Twitter時代にやめようとしたらやっぱり馬鹿が大騒ぎしてミュー機能が追加された。そして、イーロンは馬鹿が嫌いなので再導入されたという経緯

2024-10-12

清原ネットキャッシュ比率決算短信からpython自動で求めるソフト

気が付くと朝4時になっていた。

なんか動くところまで出来たので貼っておく。

NYSLなので、バグがあったら治しといて。

import pdfplumber
import re

#クリーンアップ
def cleanuptext(text):
    #決算書の合計値を太字にしたことpdfplumberが暴走するケースへの対処
    #例 流動資産 -> 流流流流流動動動動動資資資資資産産産産産
    #誤爆が怖いので、これが起きている時だけ補正します
    if "流流流流流動動動動動資資資資資産産産産産" in text:
        text = re.sub(r'(.)\1{4,}', r'\1', text)

    #△をマイナスに。 数字中のカンマを消して結合する
    text = re.sub(r'△([0-9])', r'-\1', text)
    text = re.sub(r'▲([0-9])', r'-\1', text)
    text = re.sub(r'([0-9]),([0-9])', r'\1\2', text)
    
    #たまに、煽り屋みたいに文字の後にスペースが入る嫌がらせ修正する
    #例: 投 資 有 価 証 券 -> 投資有価証券
    text = re.sub(r'(?<=[\u4E00-\u9FFF\u3040-\u30FF])\s(?=[\u4E00-\u9FFF\u3040-\u30FF])', '', text)

    return text

#今期の勘定科目数字を取得
def get_AccountName(text, need):
    pattern = rf'^{need} -?[0-9]+ (-?[0-9]+)'
    r = re.search(pattern, text, re.MULTILINE)
    if r is not None:
        return float(r[1])

    return 0

#清原ネットキャッシュ計算する。
def calc_KiyoharaNetCash(text):
    total_current_assets = get_AccountName(text,'流動資産合計')
    if total_current_assets == 0:
        #要約財政状態計算書しか公開していない、楽天のような素敵な会社様への対処
        total_assets = get_AccountName(text,'資産合計')
        if total_assets != 0:
            #とりあえず、資産の部の6割を流動資産とみなす
            total_current_assets = total_assets * 0.6

        else:
            #流動資産合計ではなく、流動資産という単語を使っている我が道を行く東北電力への対処
            total_current_assets = get_AccountName(text,'流動資産')
            if total_current_assets == 0:
                raise Exception("流動資産合計の勘定科目が見つかりませんでした。"+text)


    total_liabilities = get_AccountName(text,'負債合計')
    if total_liabilities == 0:

        #負債合計ではなく、負債の部合計に拘るオムロンの嬉しい決算書への対策。なんでや・・・
        total_liabilities = get_AccountName(text,'負債の部合計')
        if total_liabilities == 0:
            raise Exception("負債合計の勘定科目が見つかりませんでした。"+text)

    #負債をご丁寧にマイナス表記で書いてくれる中外製薬の親切な決算書への対策。いい加減にしろ・・・
    if total_liabilities < 0:
        total_liabilities = total_liabilities * -1

    #投資有価証券はないこともあるので、0を容認する
    marketable_securities = get_AccountName(text,'投資有価証券')

    #print(total_current_assets,marketable_securities,total_liabilities)
    netcash = total_current_assets + (marketable_securities*0.7) - total_liabilities

    #たまに単位を1000円にしている銘柄があるので補正する
    if is_tanni_senyen(text):
        netcash = netcash / 1000
    return netcash

# "流動資産合計" と "負債合計" の間に "単位:千円" があるかをチェック
def is_tanni_senyen(text):
    if "単位:千円" in text:
        return True

    if "単位: 千円" in text:
        return True

    if "単位 : 千円" in text:
        return True

    if "単位 :千円" in text:
        return True

    return False

def pdf_to_kiyohara_netcash(pdfpath):
    with pdfplumber.open(pdfpath) as pdf:
        text = ''.join(page.extract_text() for page in pdf.pages)

    text = cleanuptext(text)
    #print(text)
    kiyohara_netcash = calc_KiyoharaNetCash(text)
    #print(kiyohara_netcash)
    return kiyohara_netcash

def mymain():
    import sys
    args = sys.argv
    argc = len(args)
    if argc <= 1:
       print('''
これは、清原達郎氏のネットキャッシュ比率(以下、清原ネットキャッシュ比率)を決算短信pdfから求めるソフトです。
清原ネットキャッシュ=流動資産合計+(投資有価証券*0.7)-負債合計
清原ネットキャッシュ比率=清原ネットキャッシュ/時価総額*100

遊び方

1. 決算短信pdfから清原ネットキャッシュを求める
python calc_kiyohara_netcash.py 140120240514594985.pdf

結果: 30757.0
決算書には、100万円単位数字が書かれているはずなので、この数字単位は100万円です。
つまり、3075700万円。

2. 時価総額を億円単位で追加することで、清原ネットキャッシュ比率を求める
時価総額が146億円なら146と書いてください。
python calc_kiyohara_netcash.py 140120240514594985.pdf 146

結果: 210.66%

このコードNYSLライセンスです。無保証自己責任ですが、ご自由に。
かぶ探とかとつなげるといいかもね。
       ''')
       return
    if argc <= 2:
       kiyohara_netcash = pdf_to_kiyohara_netcash(args[1])
       print(kiyohara_netcash)
       return
    if argc <= 3:
       market_cap=float(args[2])*100 #億円から百万円表記に
       kiyohara_netcash = pdf_to_kiyohara_netcash(args[1])
       ratio = round(kiyohara_netcash/market_cap*100,2)
       print(f"{ratio}%")
       return

if __name__ == '__main__':
    mymain()

2024-10-06

ワイ:

x = torch.tensor([

[1.0,2.0,3.0],

[4.0,5.0,6.0]

])

最終次元が channel とし、この x を channel-wise 正規化してください。

Claude3.5 Sonnet:

はい、channel-wise 正規化チャネル方向の正規化)を行います。この場合、最終次元(dim=-1)がチャネルとなります。channel-wise 正規化では、各チャネルの平均を0、分散を1に正規化します。

PyTorchを使用して、以下のように実装できます

import torch

x = torch.tensor([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0]
])

# チャネル方向(最終次元)の平均と標準偏差計算
mean = x.mean(dim=-1, keepdim=True)
std = x.std(dim=-1, keepdim=True)

# Epsilon を追加して、ゼロ除算を防ぐ
epsilon = 1e-5

# 正規化を実行
x_normalized = (x - mean) / (std + epsilon)

print("元のテンソル:")
print(x)
print("\n正規化後のテンソル:")
print(x_normalized)

このコードを実行すると、以下のような結果が得られます

元のテンソル:
tensor([[1., 2., 3.],
        [4., 5., 6.]])

正規化後のテンソル:
tensor([[-1.2247,  0.0000,  1.2247],
        [-1.2247,  0.0000,  1.2247]])

ワイ:

x = torch.tensor([

[1.0,2.0,3.0],

[4.0,5.0,6.0]

])

最終次元が channel とし、この x を channel-wise 正規化してください。

ChatGPT o1-preview

import torch

x = torch.tensor([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0]
])

# Compute mean and standard deviation along the batch dimension (dim=0)
mean = x.mean(dim=0, keepdim=True)
std = x.std(dim=0, unbiased=False, keepdim=True)

# Perform channel-wise normalization
x_normalized = (x - mean) / std

print("Normalized Tensor:\n", x_normalized)

Output:

Normalized Tensor:
 tensor([[-1., -1., -1.],
        [ 1.,  1.,  1.]])

Explanation:

Compute Mean:

The mean is computed along the batch dimension (dim=0), treating each column as a channel.

mean = x.mean(dim=0, keepdim=True)

This results in mean = [[2.5, 3.5, 4.5]].

Compute Standard Deviation:

The standard deviation is computed along the same dimension with unbiased=False to match the sample size.

std = x.std(dim=0, unbiased=False, keepdim=True)

This results in std = [[1.5, 1.5, 1.5]].

Normalize:

Subtract the mean and divide by the standard deviation for each channel.

x_normalized = (x - mean) / std

This yields the normalized tensor with standardized channels.

Note: Setting keepdim=True ensures that the mean and standard deviation tensors have the same number of dimensions as x, which is necessary for broadcasting during subtraction and division.

ChatGPTの方が正しいよね?

2024-09-11

僕がやってる遠方の親の定期的な生存確認自分生存通知

倒れていても早く気付けるように。


必要ハード

アンドロイドスマホ

必要アプリ

MacroDroid(試用期間ありの500円?)


スマホロック画面を解除したら指定したアドレスメールを送るようにマクロを作製。

トリガーに「ロック画面の解除」

アクションに「メールを送る」と「変数を設定」。マクロ作動後に変数Falseにする。

条件に「変数」でTrue指定。「サービス圏の通信状態」でサービス圏内にいる時。


別のマクロで0時を過ぎたら変数を「True」にするようにしておけば、1日1回0時以降にスマホロック画面を解除したときメールが飛ぶようできる。

変数リセットマクロ曜日指定すれば1週間に1回などにできる。


マクロ作動条件に電波圏内にいる時を設定したほうがいいかも。

フェリー旅行中でメールが飛ばないことがあった。

自分メール送信に借りてるサーバー指定しててだめだったけど、Gmailならオンラインになったとき送信されるかも。


すでにスマホを持ってるならMacroDroidの500円だけでできる。

2024-08-26

上司脳みそいかれている

ユーザー登録フォーム画面があるとしてisShowCommentInputTextFieldがtrueであればコメント入力欄を表示、falseなら非表示という仕様があるとしよう。ありとあらゆる資料にはisShowCommentInputTextFieldはコメント欄を非表示にするフラグであると書かれている。しか実装上は、ユーザー登録フォーム自体非表示にする実装になっている。

実装が正とすると、仕様は誤りだ。上司に聞いてみたところ「何も間違っていない。その仕様書が正しい」という。「実装コメント欄どころか全非表示になるので、実装不具合か?」と聞くと、「実装は正しいし、仕様も正しい」と返してくる。意味不明なので小一時間問答を繰り返した結果引き出せた言葉は「コメント欄も非表示になるのだから正しいに決まっているだろう。当たり前の話だ」という答えだった。

なぜこんな不毛なやり取りのために時間を使わないといけないのか?こいつの脳みそはどうなっているのだ?

2024-08-17

anond:20240817220011

そんでこのロックデータをこんなかんじでRedisにもてばネットワーク越しに依存関係のあるロックできる?

Typeキー
String"Office1"true
String"Office2"false
String"Room1"true
String"Room2"false
String"Schedule1"true
String"Schedule2"false
String"BusinessHour1"true
String"BusinessHour2"false
Bitmaps"BusinessHour1Range"0001111111100000000000000000000000000
Bitmaps"BusinessHour2Range"0001111111100000000000000000000000000

できなくはないか???

RDBMSみたいなトランザクションは無理だけど

ほんとはタスクの直列化ができればいいんだが我のあずかり知らぬ領域なのだ・・・

バグりそう

anond:20240817015407

依存関係は木で表現

ノードロック持たせる

ロックに条件持たせる

やりたいことはできてるように見えるが、うーんしんどい

# Entity Relation Diagram
# ```mermaid
# ---
# title: Rental Office example
# ---
# erDiagram
# OFFICE ||--|{ ROOM : x
# OFFICE {
# number office_id
# }
# ROOM {
# number office_id
# number room_id
# }
# ROOM ||--|{ SCHEDULE : x
# SCHEDULE {
# number room_id
# datetime start_at
# datetime end_at
# }
# OFFICE ||--|{ BUSINESS_HOUR : x
# BUSINESS_HOUR {
# number office_id
# enum week_of_day
# datetime start_at
# datetime end_at
# }
# ```

# Directed Acyclic Graph
#
# ```mermaid
# graph LR
# A[OFFICE] --> B[ROOM]
# B --> C[SCHEDULE]
# A[OFFICE] --> D[BUSINESS_HOUR]
# D --> C
# A --> C
# ```


# 基底クラス: EntityLock
class EntityLock
attr_accessor :entity_name, :entity_locked, :attribute_locks

def initialize(entity_name)
@entity_name = entity_name
@entity_locked = false # エンティティ全体のロック状態を保持
@attribute_locks = {} # IDに対するロック管理するハッシュ
end

def lock_entity
@entity_locked = true
puts "Entity '#{@entity_name}' is now locked."
end

def unlock_entity
@entity_locked = false
puts "Entity '#{@entity_name}' is now unlocked."
end

def lock(attributes)
entity_id = attributes["#{@entity_name.downcase}_id"]
if entity_id && !@attribute_locks[entity_id]
@attribute_locks[entity_id] = true
puts "#{@entity_name} with ID '#{entity_id}' is now locked."
end
end

def unlock(attributes)
entity_id = attributes["#{@entity_name.downcase}_id"]
if entity_id && @attribute_locks[entity_id]
@attribute_locks.delete(entity_id)
puts "#{@entity_name} with ID '#{entity_id}' is now unlocked."
end
end

def locked?(attributes)
# まずエンティティ全体がロックされているかチェック
return true if @entity_locked

# 次に特定IDロックされているかチェック
entity_id = attributes["#{@entity_name.downcase}_id"]
if entity_id && @attribute_locks[entity_id]
return true
end

# ロックされていなければfalseを返す
false
end
end

# 子クラス: OfficeLock, RoomLock, ScheduleLock
class OfficeLock < EntityLock
def initialize
super("Office")
end
end

class RoomLock < EntityLock
def initialize
super("Room")
end
end

class ScheduleLock < EntityLock
def initialize
super("Schedule")
end
end

# 子クラス: BusinessHourLock
class BusinessHourLock < EntityLock
def initialize
super("BusinessHour")
@attribute_locks = [] # BusinessHour用のロック配列管理
end

def lock(attributes)
start_at = attributes["start_at"]
end_at = attributes["end_at"]
if start_at &amp;&amp; end_at
@attribute_locks << [start_at, end_at]
puts "BusinessHour from '#{start_at}' to '#{end_at}' is now locked."
end
end

def unlock(attributes)
start_at = attributes["start_at"]
end_at = attributes["end_at"]
if @attribute_locks.include?([start_at, end_at])
@attribute_locks.delete([start_at, end_at])
puts "BusinessHour from '#{start_at}' to '#{end_at}' is now unlocked."
end
end

def locked?(attributes)
# まずエンティティ全体がロックされているかチェック
return true if @entity_locked

# 次に特定時間範囲ロックされているかチェック
start_at = attributes["start_at"]
end_at = attributes["end_at"]
if start_at &amp;&amp; end_at
@attribute_locks.each do |(locked_start, locked_end)|
if locked_start <= start_at &amp;&amp; end_at <= locked_end
return true
end
end
end

# ロックされていなければfalseを返す
false
end
end

# TreeNodeクラス
class TreeNode
attr_accessor :name, :children, :parents, :lock

def initialize(name, lock)
@name = name
@children = []
@parents = [] # 複数の親ノードを保持する配列
@lock = lock # TreeNodeにロックを持たせる
end

def add_child(child_node)
child_node.parents << self # 子ノードにこのノードを親として追加
@children << child_node
end

def display(level = 0)
indent = " " * (level * 4)
puts "#{indent}#{@name}"
@children.each { |child| child.display(level + 1) }
end

def has_dependency
return false if @parents.empty?

@parents.each do |parent|
puts "#{@name} is dependent on #{parent.name}"
return true
end

@parents.any?(&amp;:has_dependency)
end

def locked?(attributes = {})
# 自身ロックされているか確認
return true if @lock.locked?(attributes)

# 親ノードロックされているか再帰的に確認
@parents.any? { |parent| parent.locked?(attributes) }
end
end

# 木構造の組み立て

# ロックオブジェクト作成
office_lock = OfficeLock.new
room_lock = RoomLock.new
schedule_lock = ScheduleLock.new
business_hour_lock = BusinessHourLock.new

# ノード作成
office_node = TreeNode.new("Office", office_lock)
room_node = TreeNode.new("Room", room_lock)
schedule_node = TreeNode.new("Schedule", schedule_lock)
business_hour_node = TreeNode.new("BusinessHour", business_hour_lock)

# ノード間の依存関係の設定
office_node.add_child(room_node) # Office -> Room
room_node.add_child(schedule_node) # Room -> Schedule
office_node.add_child(business_hour_node) # Office -> BusinessHour
business_hour_node.add_child(schedule_node) # BusinessHour -> Schedule

# 木構造の表示
office_node.display

# ロック確認
puts "Case 1. Office全体がロックされた場合"
puts "Is office_node locked? #{office_node.locked?({})}" # false
puts "Is schedule_node locked? #{schedule_node.locked?({})}" # false
office_lock.lock_entity
puts "Is office_node locked? #{office_node.locked?({})}" # true
puts "Is schedule_node locked? #{schedule_node.locked?({})}" # true
office_lock.unlock_entity

puts "Case 2. Room id:1 がロックされた場合"
puts "Is schedule_node locked? #{schedule_node.locked?({ "room_id" => 1 })}" # false
puts "Is schedule_node locked? #{schedule_node.locked?({ "room_id" => 2 })}" # false
room_lock.lock({ "room_id" => 1 })
puts "Is schedule_node locked? #{schedule_node.locked?({ "room_id" => 1 })}" # true
puts "Is schedule_node locked? #{schedule_node.locked?({ "room_id" => 2 })}" # false
room_lock.unlock({ "room_id" => 1 })

puts "Case 3. BusinessHour start_at:0 end_at:5 がロックされた場合"
puts "Is schedule_node locked? #{schedule_node.locked?({ "room_id" => 1, "start_at" => 0, "end_at" => 5 })}" # false
puts "Is schedule_node locked? #{schedule_node.locked?({ "room_id" => 1, "start_at" => 5, "end_at" => 10 })}" # false
business_hour_lock.lock({ "start_at" => 0, "end_at" => 5 })
puts "Is schedule_node locked? #{schedule_node.locked?({ "room_id" => 1, "start_at" => 0, "end_at" => 5 })}" # true
puts "Is schedule_node locked? #{schedule_node.locked?({ "room_id" => 1, "start_at" => 5, "end_at" => 10 })}" # false
business_hour_lock.unlock({ "start_at" => 0, "end_at" => 5 })

anond:20240817001425

・・・できたけど木の組み立てがしんどすぎるー

class TreeNode:
def __init__(self, name, attributes=None):
self.name = name
self.attributes = attributes or {}
self.children = []

def add_child(self, child_node):
self.children.append(child_node)

def display(self, level=0):
indent = " " * level
print(f"{indent}{self.name} {self.attributes}")
for child in self.children:
child.display(level + 1)

def has_dependency(self):
# ルートノード属性を持たないノード依存関係を判定しない
if not self.children:
return False

for child in self.children:
# 子ノードがBusinessHourかScheduleかをチェック
if "start_at" in child.attributes and "end_at" in child.attributes:
child_start = child.attributes["start_at"]
child_end = child.attributes["end_at"]

# 現在ノードがBusinessHourで、子がScheduleの場合
if "start_at" in self.attributes and "end_at" in self.attributes:
self_start = self.attributes["start_at"]
self_end = self.attributes["end_at"]

if self_start &lt;= child_start and self_end &gt;= child_end:
print(f"{child.name} (start_at: {child_start}, end_at: {child_end}, room_id: {child.attributes['room_id']}) is dependent on {self.name} (start_at: {self_start}, end_at: {self_end})")
else:
print(f"{child.name} (start_at: {child_start}, end_at: {child_end}, room_id: {child.attributes['room_id']}) is NOT dependent on {self.name} (start_at: {self_start}, end_at: {self_end})")

# 現在ノードがRoomで、子がScheduleの場合
elif self.name.startswith("Room"):
print(f"{child.name} (start_at: {child_start}, end_at: {child_end}, room_id: {child.attributes['room_id']}) is dependent on Room {self.name[-1]}")
else:
child.has_dependency()

# 子ノード属性を持たない場合再帰的に依存関係をチェック
else:
child.has_dependency()

# ノード作成
root = TreeNode("Root")
office_node = TreeNode("Office")

# Roomノード作成
room1_node = TreeNode("Room1")
room2_node = TreeNode("Room2")

# BusinessHourノード作成
business_hour1_node = TreeNode("BusinessHour1", {"start_at": 9, "end_at": 12})
business_hour2_node = TreeNode("BusinessHour2", {"start_at": 13, "end_at": 17})

# Scheduleノード作成
schedule1_node = TreeNode("Schedule1", {"start_at": 10, "end_at": 11, "room_id": 1})
schedule2_node = TreeNode("Schedule2", {"start_at": 14, "end_at": 15, "room_id": 1})
schedule3_node = TreeNode("Schedule3", {"start_at": 10, "end_at": 11, "room_id": 2})
schedule4_node = TreeNode("Schedule4", {"start_at": 14, "end_at": 15, "room_id": 2})

# 木構造の構築
root.add_child(office_node)
office_node.add_child(room1_node)
office_node.add_child(room2_node)
office_node.add_child(business_hour1_node)
office_node.add_child(business_hour2_node)

# Room1にSchedule1, Schedule2を追加
room1_node.add_child(schedule1_node)
room1_node.add_child(schedule2_node)

# Room2にSchedule3, Schedule4を追加
room2_node.add_child(schedule3_node)
room2_node.add_child(schedule4_node)

# BusinessHour1にSchedule1, Schedule3を追加
business_hour1_node.add_child(schedule1_node)
business_hour1_node.add_child(schedule3_node)

# BusinessHour2にSchedule2, Schedule4を追加
business_hour2_node.add_child(schedule2_node)
business_hour2_node.add_child(schedule4_node)

# 木構造の表示
root.display()

# 依存関係のチェック
office_node.has_dependency()
room1_node.has_dependency()
room2_node.has_dependency()
business_hour1_node.has_dependency()
business_hour2_node.has_dependency()

Root {}
Office {}
Room1 {}
Schedule1 {'start_at': 10, 'end_at': 11, 'room_id': 1}
Schedule2 {'start_at': 14, 'end_at': 15, 'room_id': 1}
Room2 {}
Schedule3 {'start_at': 10, 'end_at': 11, 'room_id': 2}
Schedule4 {'start_at': 14, 'end_at': 15, 'room_id': 2}
BusinessHour1 {'start_at': 9, 'end_at': 12}
Schedule1 {'start_at': 10, 'end_at': 11, 'room_id': 1}
Schedule3 {'start_at': 10, 'end_at': 11, 'room_id': 2}
BusinessHour2 {'start_at': 13, 'end_at': 17}
Schedule2 {'start_at': 14, 'end_at': 15, 'room_id': 1}
Schedule4 {'start_at': 14, 'end_at': 15, 'room_id': 2}
Schedule1 (start_at: 10, end_at: 11, room_id: 1) is dependent on Room 1
Schedule2 (start_at: 14, end_at: 15, room_id: 1) is dependent on Room 1
Schedule3 (start_at: 10, end_at: 11, room_id: 2) is dependent on Room 2
Schedule4 (start_at: 14, end_at: 15, room_id: 2) is dependent on Room 2
Schedule1 (start_at: 10, end_at: 11, room_id: 1) is dependent on BusinessHour1 (start_at: 9, end_at: 12)
Schedule3 (start_at: 10, end_at: 11, room_id: 2) is dependent on BusinessHour1 (start_at: 9, end_at: 12)
Schedule2 (start_at: 14, end_at: 15, room_id: 1) is dependent on BusinessHour2 (start_at: 13, end_at: 17)
Schedule4 (start_at: 14, end_at: 15, room_id: 2) is dependent on BusinessHour2 (start_at: 13, end_at: 17)
Schedule1 (start_at: 10, end_at: 11, room_id: 1) is dependent on Room 1
Schedule2 (start_at: 14, end_at: 15, room_id: 1) is dependent on Room 1
Schedule3 (start_at: 10, end_at: 11, room_id: 2) is dependent on Room 2
Schedule4 (start_at: 14, end_at: 15, room_id: 2) is dependent on Room 2
Schedule1 (start_at: 10, end_at: 11, room_id: 1) is dependent on BusinessHour1 (start_at: 9, end_at: 12)
Schedule3 (start_at: 10, end_at: 11, room_id: 2) is dependent on BusinessHour1 (start_at: 9, end_at: 12)
Schedule2 (start_at: 14, end_at: 15, room_id: 1) is dependent on BusinessHour2 (start_at: 13, end_at: 17)
Schedule4 (start_at: 14, end_at: 15, room_id: 2) is dependent on BusinessHour2 (start_at: 13, end_at: 17)

anond:20240816235943

高さ3の有向木で根からAという節点が生えAからBという葉が生える

class TreeNode:
def __init__(self, name, attributes=None):
self.name = name
self.attributes = attributes or {}
self.children = []

def add_child(self, child_node):
self.children.append(child_node)

def display(self, level=0):
indent = " " * level
print(f"{indent}{self.name} {self.attributes}")
for child in self.children:
child.display(level + 1)

def has_dependency(self):
# ルートノード属性を持たないノード依存関係を判定しない
if not self.children or "start" not in self.attributes or "end" not in self.attributes:
return False

# Aノードのstartとendを取得
start = self.attributes["start"]
end = self.attributes["end"]

# すべての子ノード(Bノード)に対して依存関係をチェック
for child in self.children:
if "position" in child.attributes:
position = child.attributes["position"]
if start &lt;= position &lt;= end:
print(f"{child.name} (position: {position}) is dependent on {self.name} (start: {start}, end: {end})")
return True
else:
print(f"{child.name} (position: {position}) is NOT dependent on {self.name} (start: {start}, end: {end})")
return False

# ノード作成
root = TreeNode("Root")
a_node = TreeNode("A", {"start": 10, "end": 20})
b1_node = TreeNode("B1", {"position": 15})
b2_node = TreeNode("B2", {"position": 25})

# 木構造の構築
root.add_child(a_node)
a_node.add_child(b1_node)
a_node.add_child(b2_node)

# 木構造の表示
root.display()

# 依存関係のチェック
a_node.has_dependency()

こうかー

2024-08-16

anond:20240816122556

FUNCTION IS弱者男性():

 IF イケメンに生まれる:

  RETURN FALSE

 IF 努力して清潔感を身に着ける:

  RETURN FALSE

 IF 努力してお金を稼ぐ:

  RETURN FALSE

 RETURN TRUE

2024-07-25

朗報黒人・弥助を神とした元ネタ論文が見つかる。

アサクリの弥助・黒人奴隷と、そこから派生したロックリー・岡美穂子両氏の言説の元ネタっぽいものを見つけたので要約しておく。

○著者:David Wright

題名:The Use of Race and Racial Perceptions among Asians and Blacks: The Case of the Japanese and African Ameridans

○出典:1998年一橋大学社会学ジャーナルhttps://hermes-ir.lib.hit-u.ac.jp/hermes/ir/re/8321/

概要(俺の読解なので是非原本にあたられたし)

16世紀半ばからポルトガル人奴隷等としてかなりの数の黒人日本を訪れていた。

日本人は彼らに好意的で、彼らは尊敬対象だった。特に弥助という者について、信長厚遇した。

ポルトガル人が頻繁に黒人奴隷を献上するので、日本人も彼らを見下すようになり、明治維新の頃にはその見方が定着していた。

・というか白人との接触から日本では白い肌が美しいと言われてたけどね。(その割にはお歯黒は何故?)

・一方で、肌の黒い聖人いたこから黒い肌に対する欧米のような差別感情は持ってなかった。オランダから入れ知恵されてたのに不思議だね。

(以下開国時の話が続く)

この、「日本人は彼らを尊敬していた」「肌の黒い聖者もいた」が、ロックリー・岡美穂子両氏による「弥助は神とされた」等に変換されていったのではないだろうか。

なお、知る限り弥助を神とした、または神に近かった、神のようだったなどとする史料発見されておらず、専門家によるものでは、ロックリー氏や岡美穂子氏が述べているものがすべてのようだ。

特に八幡神は南無八幡大菩薩那須与一)で有名な武士の神であり、これになぞらえるというのはとてつもない厚遇だし、文献にも残っていると思うのだが何を根拠にされたのだろうか。

(岡美穂子氏インタビュー記事より)

信長に関する史料では弥助のビジュアルイメージが「八幡神に近かった」と言われています。あるいは、中国史料ではアフリカ系の人を「黒鬼」と表記している。ですから実用的な屈強さを求めただけでなく、そういう人間自分の近くに置くことで「こんなに強いヤツを従えているんだ」という格付けに役立つと考えた、イメージ戦略の部分もあったと思います

https://www.cyzo.com/2021/02/post_268095_entry.html

(岡美穂子氏インタビュー記事より)

弥助もそもそもアフリカ大陸内の部族闘争で生け捕りにされ、外国人に売られたといわれます

(略)

中国では「黒鬼」と呼ばれていましたが、差別的な意味だけでなく強いものに対する憧れ、神格化も含まれているでしょう。

https://books.google.co.jp/books?id=ueI9EAAAQBAJ&pg=PA45&lpg=PA45&dq=%22%E7%A5%9E%E6%A0%BC%E5%8C%96%E3%82%82%E5%90%AB%E3%81%BE%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%22&source=bl&ots=VL8Mdfp5xc&sig=ACfU3U0mVfcGBaVjLwU6pkAfd6NYXORlew&hl=ja&sa=X&ved=2ahUKEwj1_bTS7sOHAxWrb_UHHZRqGX8Q6AF6BAgcEAI#v=onepage&q=%22%E7%A5%9E%E6%A0%BC%E5%8C%96%E3%82%82%E5%90%AB%E3%81%BE%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%22&f=false

ロックリートーマス氏によると、当時の都だった京都住民と同様、信長は弥助の背丈や体格、肌の色に畏怖の念を抱いたという。

(略)

信長は弥助を「大黒天」ではないかと考えた。大黒天は豊穣(ほうじょう)の神で、寺院では通常、黒い像によって表現されている。信長は弥助の肌の色は墨によるものだろうと思い、こすり落とそうとした。本当に黒人だと納得すると、直ちに宴会を開いて敬意を表したという。

https://www.cnn.co.jp/world/35138192.html

追記

中国語の「黒鬼」に屈強なという意味はないのでは?

→通常の中国語ではその通りで、日本語に訳すと「黒い幽霊」といった意味合いになる。

あとは道教では鬼というのは死後の世界の人に該当するもので、鬼世界があって普通に鬼が暮らしていて鬼の役人がいたりもする。

いずれにしても中国語の「鬼」には日本のように「強い」「屈強な」という意味はない。(例えば「悪党中世)」・「悪源太(源義平)」・「悪太郎堀内恒夫)」という使い方はしない)。

なので、岡美穂子氏が「屈強な黒人」「神格化」という意味で取り上げたのは、解釈の誤りのように思う。御本人の説明を求めたいところだが。

ただ中国史については良く分からないので、昔はそういう使い方をしていたというのであれば補足よろしく

追記2

そもそも弥助ってアフリカであるとは限らないのでは?

→弥助はモザンビーク出身って記述があるんだけど、前半生は全くの不明で、岡美穂子氏が「部族闘争の結果生け捕りになった」とした根拠不明

当時のモザンビークってインド人大勢住み着いてるので、インド人とか混血の可能性は十分にある。

追記3

信長が弥助のことを大黒天(神)と思った

トップブコメにこうあったが、そんな証拠はどこにもない。

現時点ではロックリー氏と岡美穂子氏の頭の中だけに存在すると言って良い

2024-07-12

なんかずっと白い血栓がってやってるから拾ってきてあげました

基本、こういうのは英語検索しましよう

 

white clots' to mRNA vaccines

 

 

出てくるやつ→ False claims linking 'white clots' to mRNA vaccines resurface online in Thailand | Fact Check

タイの保健当局によると、虚偽の投稿で共有された画像は、法医学で分類される死後血栓と同じものであり、新しい現象ではありません。

死後血栓

タイ国立ワクチン研究所2024年2月21日声明を発表し、画像に見られる白い血栓mRNAワクチンとは関係ないと明言しました(アーカイブリンク)。 「この主張の画像は、mRNAワクチン接種によって引き起こされた血液障害を示すものではありません」と声明には書かれています。「これは、死後に発生するフィブリン血液の主要なタンパク質成分)の凝集に過ぎません(死後血栓)。」 同じ声明は続けて、「これは、死亡した人の体に一般的に見られる自然現象です。これは、Covidの発生やCovid-19ワクチン使用以前から観察されてきました。」と述べていますバンコクのブミボル・アドゥラデージ病院法医学病理学者であるアッタシット・ドゥルアムヌアイ博士も、白い血栓自然ものであり、死亡した体に一般的に見られると同意しました。 「私は解剖を行うときに常にそのような血栓を見つけます。それはmRNAワクチンとは関係ありません」とアッタシットは2月27日AFPに語りました。 同様に、ハーバード医科大学教育病院であるブリガム・アンド・ウィメンズ病院の肺専門医であるタニー・タニヤヴァーンも、虚偽の投稿掲載された血栓の外観を典型的な死後血栓と同じように説明しています。 「その外観はまさに死後血栓のようです」とタニーは2月23日に述べました。「それは生前血栓のように表面が粗くないので、その主張には疑問があります。」 タニーはまた、死亡した体に白い血栓存在する原因として、肥満糖尿病喫煙さらにはCovid-19感染などが考えられると付け加えました。

https://factcheck.afp.com/doc.afp.com.34KB4DG

 

白い血栓については日本語検索しても出てくると思うけど、AIちゃんにまとめて貰いました

### 白い血栓(白色血栓

 

構成成分:

 

形成メカニズム:

1. 血管内皮の損傷や異常が発生

2. 損傷部位に血小板粘着・凝集

3. 血小板活性化され、凝固因子を放出

4. フィブリノーゲンがフィブリンに変換され、血小板を結合

5. 白血球(主に好中球)が集積

6. 血小板とフィブリンネットワーク形成され、白色血栓が完成

 

白色血栓は主に動脈系で見られ、血流が速い部位で形成されやすいです。

 

 

### 白い死後血栓(死後白色血栓

 

構成成分:

 

形成メカニズム:

1. 死後、血液の凝固が始まる

2. フィブリノーゲンがフィブリンに変換

3. 白血球(主に好中球)が集積

4. フィブリン白血球ネットワーク形成

5. 重力の影響で赤血球が沈降し、上層に白い死後血栓形成

 

白い死後血栓は死後に形成される特殊血栓で、生前の白色血栓とは異なります。主に大血管内で観察されます

 

anond:20240712175024

2024-06-26

非エンジニアだけどClaude3に増田ミュート作ってもらったよ

これを改善してってお願いした。何書いてあるかわからないけど動いたよ。

https://anond.hatelabo.jp/20240125203115

// ==UserScript==
// @name         増田ミュート(白塗り版)
// @namespace    http://tampermonkey.net/
// @version      2024-06-26
// @description  ミューワードを含む最小限の範囲白塗りにする
// @author       You
// @match        https://anond.hatelabo.jp/*
// @icon         https://www.google.com/s2/favicons?sz=64&amp;amp;domain=hatelabo.jp
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const muteWords = [
        "弱者男性",
        "弱男",
        "弱者",
        "婚活",
        "男",
        "女",
        "年収",
        "下方婚",
        "発達障害",
        "発達",
        "ハッタツ",
        "ハッタショ",
        "ハッタショ",
        "競プロ",
        "競技プログラミング",
        "AtCoder",
    ];

    function whiteoutElement(element) {
        element.style.backgroundColor = 'white';
        element.style.color = 'white';
        element.style.textShadow = 'none';
        element.style.cursor = 'default';
        element.style.userSelect = 'none';  // テキスト選択を防止
        element.style.borderBottom = '1px dashed #ccc'; // 枠線を追加してテキストがあることを示す

        // リンク場合クリック無効化
        if (element.tagName === 'A') {
            element.style.pointerEvents = 'none';
            element.removeAttribute('href');
        }

        // 子要素にも適用
        Array.from(element.children).forEach(child =&gt; {
            child.style.backgroundColor = 'white';
            child.style.color = 'white';
            child.style.textShadow = 'none';
        });

        // ツールチップを追加
        element.title = 'この内容にはミューワードが含まれています';
    }

    function shouldMute(text) {
        return muteWords.some(word =&gt; {
            const parts = word.split('');
            const regex = new RegExp(parts.map(char =&gt; `${char}&#92;&#92;s*`).join(''), 'i');
            return regex.test(text);
        });
    }

    function findSmallestMuteableElement(element) {
        if (element.nodeType === Node.TEXT_NODE) {
            return shouldMute(element.textContent) ? element.parentElement : null;
        }

        if (element.tagName === 'PRE' || element.tagName === 'CODE') {
            return shouldMute(element.textContent) ? element : null;
        }

        for (let child of element.childNodes) {
            const result = findSmallestMuteableElement(child);
            if (result) return result;
        }

        return shouldMute(element.textContent) ? element : null;
    }

    function processElement(element) {
        const muteableElement = findSmallestMuteableElement(element);
        if (muteableElement) {
            whiteoutElement(muteableElement);
        }
    }

    function processAllElements(root = document.body) {
        const walker = document.createTreeWalker(
            root,
            NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,
            null,
            false
        );

        let node;
        while (node = walker.nextNode()) {
            if (node.nodeType === Node.ELEMENT_NODE) {
                processElement(node);
            } else if (node.nodeType === Node.TEXT_NODE &amp;amp;&amp;amp; node.parentElement) {
                processElement(node.parentElement);
            }
        }
    }

    function handleClickEvent(event) {
        setTimeout(() =&gt; {
            processAllElements(event.target);
        }, 100);
    }

    // 初回実行
    processAllElements();

    // クリックイベント監視
    document.body.addEventListener('click', handleClickEvent);

    // DOM変更の監視
    const observer = new MutationObserver(mutations =&gt; {
        mutations.forEach(mutation =&gt; {
            if (mutation.type === 'childList') {
                mutation.addedNodes.forEach(node =&gt; {
                    if (node.nodeType === Node.ELEMENT_NODE) {
                        processAllElements(node);
                    }
                });
            } else if (mutation.type === 'characterData') {
                processElement(mutation.target.parentNode);
            }
        });
    });

    observer.observe(document.body, { childList: true, subtree: true, characterData: true });
})();

2024-05-29

anond:20240529160440

訓練データ分布が、99%がTrue1%Falseってタイプのやつだとするだろ?

それでそのまま評価するにしろF1を使うにしろ実用の精度の評価は難しいんよ

なぜって?「ほぼTrueでいけるやろ」の学習をしがちだから

F1評価するにしても、それは「ランダム分類機よりは汎化性能が高い」ということならわかるが、実用判断だと「Falseの見逃しは減らせ!」ってことが結構ある

そんで、テストデータでTure50%False50%としておけば実用上の性能の評価はやりやすいって話ね

2024-05-24

anond:20240523100428

ダブスタ検証用のスクリプト簡単に書いたよ(AIで)

import requests
import json
from urllib.parse import quote

def fetch_bookmarks(url):
    try:
        # URLエスケープ
        escaped_url = quote(url, safe="")
        api_url = f"https://b.hatena.ne.jp/entry/json/?url={escaped_url}"

        response = requests.get(api_url)
        response.raise_for_status()

        try:
            return response.json()
        except json.decoder.JSONDecodeError as e:
            print(f"Error decoding JSON from {api_url}: {e}")
            print("Response content:", response.text)
            return []
    except requests.exceptions.RequestException as e:
        print(f"Error fetching bookmarks from {api_url}: {e}")
        return []

def find_common_bookmarks(bookmarks1, bookmarks2, url1, url2):
    common_users = set(bm["user"] for bm in bookmarks1 if bm["comment"]) &amp; set(bm["user"] for bm in bookmarks2 if bm["comment"])
    common_bookmarks = []
    for user in common_users:
        comments = []
        for bm in bookmarks1:
            if bm["user"] == user and bm["comment"]:
                comments.append({"url": url1, "comment": bm["comment"], "timestamp": bm["timestamp"]})
                break
        for bm in bookmarks2:
            if bm["user"] == user and bm["comment"]:
                comments.append({"url": url2, "comment": bm["comment"], "timestamp": bm["timestamp"]})
                break
        if len(comments) == 2:
            common_bookmarks.append({"user": user, "comments": comments})
    return common_bookmarks

if __name__ == "__main__":
    url1 = "https://news.yahoo.co.jp/articles/f9966c4ccc374fc88babbb50175a9ea844c99638"
    url2 = "https://www.asahi.com/articles/ASN6K7F64N6KUJHB00L.html"

    data1 = fetch_bookmarks(url1)
    data2 = fetch_bookmarks(url2)

    common_bookmarks = find_common_bookmarks(data1["bookmarks"], data2["bookmarks"], url1, url2)

    print(json.dumps(common_bookmarks, indent=2, ensure_ascii=False))

url1, url2のところを対象としたいものに変えれば使えるよ

抽出対象となるのは以下のユーザーだよ

バグあったら直して使ってね

※てかはてな匿名ってシンタックスハイライト記法使えないんだね、使って表示確認したら500エラーになったわ

2024-05-18

フェミニズムT&F

True

 

False

 

こんな簡単なことが何故わからないのか。まあ、そこに物わかりよくなると気持ちよくネット合戦が出来ないからなんだろうけど。

 

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