This file contains 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
Mat m = new Mat(@"C:\Users\Public\Pictures\Sample Pictures\tu.jpg"); | |
Cv2.ImShow("before", m); | |
Mat m2 = new Mat(m.Height, m.Width, MatType.CV_8UC3); | |
for (int i = 0; i < m2.Height; i++){ | |
for (int j = 0; j < m2.Width; j++){ | |
byte by = 255; | |
Vec3b pix = m2.At<Vec3b>(i, j); | |
pix[0]=0; //B | |
pix[1] = by; //G |
This file contains 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 moveGCalEvent(event,targetCalendarId) { | |
var targetCalendar = CalendarApp.getCalendarById(targetCalendarId); | |
// イベントの詳細を取得 | |
var eventTitle= event.getTitle(); | |
var date =event.getAllDayStartDate(); //終日イベントが対象 | |
// 新しいカレンダーに同じイベントを作成 | |
var newEvent = targetCalendar.createAllDayEvent(eventTitle,date); | |
// 元のカレンダーから旧イベントを削除 | |
event.deleteEvent(); |
This file contains 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
/** | |
sinceから現在まですべてのタスクをとってくる | |
since: 取得開始する日時 (2023-06-26 というフォーマットの文字列) | |
**/ | |
function todoistGetCompleteItems(since) { | |
const token = PropertiesService.getScriptProperties().getProperty('TODOIST_TOKEN'); | |
const url = 'https://api.todoist.com/sync/v9/completed/get_all?since='+since+'T00:00:00'; | |
const params = { | |
headers: { 'Authorization': `Bearer ${token}` } | |
}; |
This file contains 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 assignScriptsToImages() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var images =sheet.getImages(); | |
for(var i=0;i<images.length;i++){ | |
switch(images[i].getAltTextTitle()){ | |
case "risu": | |
images[i].assignScript("risuSay"); | |
break; | |
case "momo": | |
images[i].assignScript("momoSay"); |
This file contains 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 | |
import cv2 | |
import pykinect_azure as pykinect | |
if __name__ == “__main__“: | |
# Initialize the library, if the library is not found, add the library path as argument | |
pykinect.initialize_libraries(track_body=True) | |
# Modify camera configuration | |
device_config = pykinect.default_configuration | |
device_config.color_resolution = pykinect.K4A_COLOR_RESOLUTION_OFF | |
device_config.depth_mode = pykinect.K4A_DEPTH_MODE_WFOV_2X2BINNED |
This file contains 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 doPost(e){ | |
var params = JSON.parse(e.postData.getDataAsString()); | |
var data = params.data; | |
//// 以下の範囲独自処理を書く | |
//シートへの書き込み | |
const ss = SpreadsheetApp.getActiveSpreadsheet(); | |
const sheet = ss.getSheetByName('シート1'); | |
// A2セルを選択 |
This file contains 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 doPost(e){ | |
var params = JSON.parse(e.postData.getDataAsString()); | |
var data = params.data; | |
//// 以下の範囲独自処理を書く | |
//シートへの書き込み | |
const ss = SpreadsheetApp.getActiveSpreadsheet(); | |
const sheet = ss.getSheetByName('シート1'); |
This file contains 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 urllib.request | |
def urllibRequest(): | |
url="https://xxxxxxxxxxxx" | |
response = urllib.request.urlopen(url) | |
content = response.read() | |
if content is not None: | |
response = { | |
'statusCode': 200, | |
'body': content |
This file contains 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 getClassList(){ | |
var optionalArgs = { | |
pageSize: 100 //クラスの数が多い場合はここを増やす | |
}; | |
var response = Classroom.Courses.list(optionalArgs); | |
var courses = response.courses; | |
if (courses && courses.length > 0) { | |
for (i in courses) { | |
var course = courses[i]; | |
Logger.log(course.name); |
This file contains 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 | |
cap = cv2.VideoCapture(0) | |
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) | |
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) | |
# フォーマット指定 | |
fmt = cv2.VideoWriter_fourcc('m', 'p', '4', 'v') | |
writer = cv2.VideoWriter('output.mp4', fmt, 25, (width, height)) |