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 ListAllStudentWork(courseId,courseWorkId){ | |
var listStudentWork = function (pageToken){ | |
if (pageToken){ | |
var newResponse = Classroom.Courses.CourseWork.StudentSubmissions.list(courseId,courseWorkId,{pageToken: pageToken}); | |
if(newResponse.nextPageToken){ | |
return newResponse.studentSubmissions.concat(listStudentWork(newResponse.nextPageToken)); | |
} else{ | |
return newResponse.studentSubmissions; | |
} | |
} |
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 getAllWorkList(courseId){ | |
var response = Classroom.Courses.CourseWork.list(courseId); | |
var result= new Array(); | |
response.courseWork.forEach(function(e){ | |
var w= new workInfo(e.id, e.title); | |
result.push(w); | |
//Logger.log('%s (%s)', e.title, e.id); | |
}); | |
return result; | |
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 azure.cognitiveservices.speech as speechsdk | |
import time | |
import json | |
#シークレットキー、サービスリージョン、言語の設定など | |
speech_key, service_region,language = "xxxxxxxxxxxxxxxxxxxxxxx", "westus2","ja-jp" | |
speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region, speech_recognition_language=language) | |
speech_config.request_word_level_timestamps() | |
#音声ファイルの設定 |
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 PySimpleGUI as sg | |
textlbl = sg.Text('何か入力', size=(10,1)) | |
textBox = sg.InputText('', size=(30,1),key='textBox') | |
submitButton = sg.Button('入力') | |
layout = [[textBox], [submitButton]] | |
# 画面レイアウトを指定 | |
layout = [ | |
[textlbl,textBox], |
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
Future createFile(GoogleAuthClient authenticateClient) async { | |
// 引数の authenticateClientは Goolge Driveのスコープを設定しているという前提です | |
final driveApi = drive.DriveApi(authenticateClient); | |
var driveFile = new drive.File(); | |
driveFile.name = "xxxxxx"; | |
driveFile.mimeType = 'xxxxxxxxxxx'; | |
final result = await driveApi.files.create(driveFile); | |
return result.id; | |
} |
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
//ログインボタンを押した場合 | |
onPressed: () async { | |
GoogleSignInAccount? signinAccount = await GoogleSignIn().signIn(); | |
if (signinAccount == null) return; | |
GoogleSignInAuthentication auth = await signinAccount.authentication; | |
final OAuthCredential credential = GoogleAuthProvider.credential( | |
idToken: auth.idToken, | |
accessToken: auth.accessToken, | |
); | |
User? user = |
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
using Amazon.DynamoDBv2; | |
using Amazon.DynamoDBv2.DocumentModel; | |
AmazonDynamoDBClient client = null; | |
Table table = null; | |
client = new AmazonDynamoDBClient(); | |
//目的のテーブルを取得 | |
table = Table.LoadTable(client, tableName); |
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 asyncio | |
from bleak import discover | |
import time | |
async def run(): | |
while True: | |
devices = await discover() | |
for d in devices: | |
print(d.address,d.metadata,d.name,d.rssi) |
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
DynamoDBMapper mapper = new DynamoDBMapper(client); | |
List list = new ArrayList(); | |
list.add(item); | |
list.add(item); | |
mapper.batchSave(list); |
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
void heap (int array[], int left, int right) { | |
int target; | |
int parent; | |
for(parent=left;2*parent<=right;parent=target){ | |
int cl = 2* parent; //左の子 | |
int cr=cl+1;// 右の子 | |
//比較対象の選定 | |
if ((cl < right) && (array[cl] > array[cr])) { | |
target=cr;// 右の子の方が小さい | |
} |