This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def dunnett_critical_value_from_groups(alpha=0.05, | |
| g_total=3, # ★ 表に書いてある「群数 g(対照+処理の総数)」を渡す | |
| df=20, | |
| rho=0.5, # 等nなら 0.5 | |
| n_sim=100_000, | |
| random_state=None): | |
| """ | |
| Dunnett 検定の臨界値 K をモンテカルロで近似する(両側検定想定)by ChatGPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| form.setIsQuiz(true); | |
| form.setCollectEmail(true); // メールアドレス収集 | |
| //form.setRequireLogin(true); // 非推奨メソッド (これは使わない) | |
| //確認済みメールアドレスで収集 (これが正解) | |
| form.setEmailCollectionType(FormApp.EmailCollectionType.VERIFIED); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| REGION = os.getenv("AWS_REGION", "us-east-1") | |
| brt = boto3.client("bedrock-runtime", region_name=REGION) | |
| def call_claude(model_id: str, user_text: str, max_tokens=600, temperature=0): | |
| body = { | |
| "anthropic_version": "bedrock-2023-05-31", | |
| "max_tokens": max_tokens, | |
| "temperature": temperature, | |
| "messages": [{"role": "user", "content": [{"type":"text","text": user_text}]}] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function createQuizForm() { | |
| var form = FormApp.create('復習テスト'); // フォームのタイトル | |
| form.setIsQuiz(true); | |
| form.setCollectEmail(true); // メールアドレス収集 | |
| form.setLimitOneResponsePerUser(true); // 1人1回答 | |
| var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
| // シート全体のデータ | |
| var data = sheet.getDataRange().getValues(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests, json, urllib.parse as ul | |
| # === 事前設定 === | |
| ENDPOINT = "https://<your-ll-host>/data/xAPI/" # 末尾は /data/xAPI/ | |
| KEY = "<LL_CLIENT_KEY>" | |
| SECRET = "<LL_CLIENT_SECRET>" | |
| #ここのパラメータを変えることで検索条件を指定できる | |
| params = { | |
| "limit": 10, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker pull redis:5.0.4 | |
| docker run --rm \ | |
| -v learning-locker-docker-image-main_learninglocker-redis:/data \ | |
| -v $(pwd):/backup \ | |
| alpine sh -c 'cd /data && tar czf /backup/redis-data-backup-$(date +%F-%H%M%S).tar.gz .' | |
| docker run --rm -it \ | |
| -v learning-locker-docker-image-main_learninglocker-redis:/data \ | |
| --entrypoint redis-check-aof \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $EMAIL_ADDRESS = "[email protected]" | |
| $ORGANIZATION = "personal" | |
| $PASSWORD = "************" | |
| $CONTAINER = "learninglocker" | |
| Write-Host "Creating site admin for Learning Locker..." | |
| Write-Host "Email: $EMAIL_ADDRESS" | |
| Write-Host "Organization: $ORGANIZATION" | |
| docker exec $CONTAINER bash -lc "cd /usr/local/src/learninglocker && node cli/dist/server createSiteAdmin '$EMAIL_ADDRESS' '$ORGANIZATION' '$PASSWORD'" | |
| Write-Host "Done." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import flet as ft | |
| import threading | |
| from PIL import Image, ImageDraw | |
| import pystray | |
| import asyncio | |
| import time | |
| def main(page: ft.Page): | |
| page.title = "Flet MenuBar App" | |
| page.add(ft.Text("メニューバー常駐のサンプル")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import base64 | |
| import threading | |
| import flet as ft | |
| from io import BytesIO | |
| from PIL import Image | |
| # カメラ映像を定期的にキャプチャして画像を更新 | |
| def camera_thread(page: ft.Page, image_control: ft.Image): | |
| cap = cv2.VideoCapture(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import torch | |
| from segment_anything import sam_model_registry, SamPredictor | |
| import numpy as np | |
| from google.colab.patches import cv2_imshow | |
| # SAMモデルの読み込み(パスは適宜変更) | |
| # sam_checkpoint = "sam_vit_h.pth" | |
| sam_checkpoint = "sam_vit_h_4b8939.pth" |
NewerOlder