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
const playlist_title = '授業チャイム'; // ファイル名・スキル名とは別に表示させたいテキスト(アーティストなど) | |
const playlist_track = 'SchoolChime2.mp3'; // 再生する音楽ファイル名 | |
const token_prefix = 'mymusic001'; // 画像などを変更したとき、この識別子を変更するとすぐに反映される | |
const Util = require('util.js'); | |
const Alexa = require('ask-sdk-core'); | |
exports.handler = Alexa.SkillBuilders.custom().addRequestHandlers({ | |
canHandle(input) { |
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
System.Text.Encoding enc = System.Text.Encoding.UTF8; | |
//サーバ側 | |
System.Net.Sockets.UdpClient udp = new System.Net.Sockets.UdpClient(11000); | |
byte[] sendBytes = enc.GetBytes(str); | |
////リモートホストを指定してデータを送信する | |
udp.Send(sendBytes, sendBytes.Length,"192.168.1.25", 11000); | |
//以下クライアント側 |
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 generateUniqueRandomIntegers() { | |
var generatedNumbers = {}; | |
var uniqueNumbers = []; | |
while (uniqueNumbers.length < 200) { | |
// 6桁の整数を生成: 100000 から 999999 の範囲 | |
var randomNumber = Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000; | |
if (!generatedNumbers[randomNumber]) { // この数値がまだリストに含まれていないか確認 | |
generatedNumbers[randomNumber] = true; | |
uniqueNumbers.push(randomNumber); |
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 getUserEmailsInCourse(courseId) { | |
var emailList = []; | |
var nextPageToken; | |
do { | |
var response = Classroom.Courses.Students.list(courseId, { | |
pageToken: nextPageToken | |
}); | |
var students = response.students; |
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
from __future__ import print_function | |
import os.path | |
from google.auth.transport.requests import Request | |
from google.oauth2.credentials import Credentials | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from googleapiclient.discovery import build | |
from googleapiclient.errors import HttpError |
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 createQuizForm() { | |
var row=10; //問題数 | |
var col=7; //シートの列数 | |
var form = FormApp.create('クイズフォーム(自動生成)'); // フォームのタイトルを設定 | |
form.setIsQuiz(true); | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
//シートのデータを全部取得 | |
var data = sheet.getDataRange().getValues(); |
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
### MeCabと辞書をインストール | |
!sudo apt install mecab | |
!sudo apt install libmecab-dev | |
!sudo apt install mecab-ipadic-utf8 | |
### 辞書を使える場所に移す | |
!mv /etc/mecabrc /usr/local/etc/ | |
### Mecabライブラリのインストール | |
!pip3 install mecab-python3 |
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}` } | |
}; |
NewerOlder