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 = "xxxxx@yyyy.com" | |
$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" |
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 pandas as pd | |
import torch | |
from py_irt.models.two_param_logistic import TwoParamLog | |
class SafeTwoParamLog(TwoParamLog): | |
def fit_MCMC(self, models, items, responses, num_epochs=1000): | |
from pyro.infer import MCMC, NUTS | |
nuts_kernel = NUTS(self.model_vague, adapt_step_size=True) | |
hmc_posterior = MCMC( |
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 mido | |
# 利用可能なMIDI入力ポートの一覧を表示 | |
print("利用可能なMIDI入力ポート:") | |
ports = mido.get_input_names() | |
for i, name in enumerate(ports): | |
print(f"{i}: {name}") | |
# # 適切なポート名に置き換えてください(例:"MIDI 1") | |
port_name = mido.get_input_names()[0] |
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 test(){ | |
var result = getSheetData("001"); | |
Logger.log(result); | |
} | |
function doGet(e) { | |
const keyword = (e.parameter.keyword || "").trim(); | |
if (!keyword) { | |
return ContentService.createTextOutput( | |
JSON.stringify({ error: "No keyword provided" }) |
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 | |
import json | |
import flet as ft | |
### Google Apps ScriptのURLを指定 | |
url="ここにGASのURL" | |
def fetch_data(value): | |
global url | |
url2=url+"?keyword=" + value | |
# Google Apps ScriptのURLを指定 |
NewerOlder