カテゴリー: Tech Notes

  • 1024 Tech Memo

    defaultdictとは?
    from collections import defaultdictで持って来れる
    キーがない時に、自動で初期値を作ってくれる辞書。例えば、キーがまだない時に普通だとエラーになるけど、勝手にゼロを入れて作ってくれる。

    Counterは?
    defaultdictのintバージョン。数え上げ専用。dictクラスから継承されてる。
    s =”abracadabra”
    for char in s:

    c2[char] += 1
    Counter({‘a’: 5, ‘b’: 2, ‘r’: 2, ‘c’: 1, ‘d’: 1})
    most_common(k)というメソッドを使うと、上位kの頻度の文字を返してくれる。

    Counter(s).most_common(2)
    [(‘a’, 5), (‘b’, 2)]
    こんな感じ。

    Composing programs 1.3まで読了
    pure function: 同じインプットに対して、必ず同じアウトプットを返す

    non-pure function: 返り値がNoneだったりする

    print(print(1),print(2))
    1
    2
    None None

    list.sort()

    • リスト専用のメソッドmy_list.sort(...)
    • 就地(in-place)で並べ替える → 元のリストが変わる
    • 戻り値は None(だからチェーンや [:K] 直結はNG)
    • 追加メモリほぼゼロ(O(1) 追加)

    sorted(iterable)

    • どんなイテラブルでもOK(list, tuple, set, dict, generator…)
    • 新しい “リスト” を返す → 元は壊さない
    • 戻り値がリストなのでチェーン可sorted(...)[ :K ] など)
    • 返すぶんのメモリが要る(O(n) 追加)

  • 1020 Tech Memo

    PII: Personal Identifiable Identity

    ArNS: Arweave Name System

    Toml: Tom’s minimal language, 設定ファイル用のシンプルな書式

    npm -i: npmからインストール

    SmartWeave: Use lazy evaluation to move the burden of contract execution from network nodes to smart contract users

    • Source code and state are stored on Arweave
    • User writes input to the smart contract
    • Clients evaluate the contract state by replying to all the state updates.
    • ❌Complex smart contracts or contracts with many transactions can take a long time to process

    Warp

    • The Core Protocol layer is the implementation of the original SmartWeave protocol and is responsible for communication with the SmartWeave smart contracts deployed on Arweave
    • The Caching layer is built on top of the Core Protocol layer and always caches the results of each of the Core Protocol modules separately.
    • Extensions layer – a CLI, Debugging tools, different logging implementations, so-called “dry-runs”(i.e., actions that allow to quickly verify the result of given contract interaction without writing anything on Arweave.

  • 20250902

    関西テック PMとの初回MTG

    • 少子化の中で、大学はどんどん減っていく。成績証明書を台帳で管理するのは、需要はありそう。
    • 秘密鍵とウォレットをバインドすると、秘密鍵が誰かに渡ると学歴偽造になるのではないかという意見をもらった
      • マイナンバーなら防げるのではと言われたので要検討
    • あとは、人と人を繋げるってのはまた別の話だよね、そこに持っていくならもう少し流れが必要だとアドバイス頂いた。
      • ここはビジネスモデル?に関わる話な気がする。そこはもう少し明確化して考えていきたいな。

    先輩との会話

    • 世界的にはNFTで成績証明はよくある
      • 僕のプロジェクトの違いは、先生が発行するところ。
    • 生徒のデータ、100単位*1万とかになるのでは?
      • それはそう
      • layer1で成績証明とlayer2で単位というアイデアをもらった。
      • layer1:ブロックチェーン layer2:ブロックチェーン以外
  • 20250831

    今日の内容

    • スマートコントラクト開発 
      • 配列の宣言
      • uint8[] memory numbers = new uint8;
      • numbers[0] = 1;
      • numbers[1] = 2;
      • numbers[2] = 3;
      • numbers[3] = 4;
      • numbers[4] = 5;
  • 2025.08.14 技術メモ

    初投稿してみます。

    ufw status : ファイアウォールの状態を確認

    ufw allow 443/tcp : ファイアウォールに443番ポートを通るようにする

  • 2025 8.18 今日の記録

    初めてのシェルスクリプト

    #! /bin/sh(シバンというらしい。)

    date

    uname -a —— username

    lsb_release -a —— list distribution

    -aはallという意味