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 struct | |
import threading | |
import time | |
import wave | |
import numpy as np | |
import pyaudio | |
from openai import OpenAI | |
CHUNK = 1000 |
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
// | |
// ContentView.swift | |
// MyFirstSwiftUIApp | |
// | |
// Created by Koichiro Mori on 2022/04/24. | |
// | |
import SwiftUI | |
struct Data: Identifiable { |
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
// | |
// ContentView.swift | |
// war-challenge | |
// | |
// Created by Koichiro Mori on 2022/04/20. | |
// | |
import SwiftUI | |
struct ContentView: View { |
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 json | |
import requests | |
url = 'https://www.googleapis.com/books/v1/volumes?q=isbn:' | |
with open('list.txt', 'r') as f: | |
for line in f.readlines(): | |
isbn = line.rstrip() | |
res = requests.get(url + isbn, headers={"content-type": "application/json"}).json() |
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 | |
import sounddevice as sd | |
import soundfile as sf | |
from ring_buffer import InputRingBuffer | |
input_device = 'Yeti Stereo Microphone' | |
output_device = 'MacbookProのスピーカー' | |
fft_size = 1024 |
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 React, { useCallback, useEffect, useState } from 'react'; | |
import './App.css'; | |
import MoviesList from './components/MoviesList'; | |
function App() { | |
const [movies, setMovies] = useState([]); | |
const [isLoading, setIsLoading] = useState(false); | |
const [error, setError] = useState(null); | |
const fetchMovieHandler = useCallback(async () => { |
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 React, { useState } from 'react'; | |
import './App.css'; | |
import MoviesList from './components/MoviesList'; | |
function App() { | |
const [movies, setMovies] = useState([]); | |
function fetchMovieHandler() { | |
fetch('https://swapi.dev/api/films/') | |
.then((response) => { |
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 { Fragment, useEffect, useState } from 'react'; | |
import classes from './UserFinder.module.css'; | |
import Users from './Users'; | |
const DUMMY_USERS = [ | |
{ id: 'u1', name: 'Max' }, | |
{ id: 'u2', name: 'Manuel' }, | |
{ id: 'u3', name: 'Julie' }, | |
]; |
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 asyncio | |
async def main(): | |
print('tim') | |
# タスクを作成 | |
task = asyncio.create_task(foo('text')) | |
# 別のタスクに処理を譲る => fooが動き出す | |
await asyncio.sleep(0.5) | |
print('finished') |
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 | |
import sounddevice as sd | |
import soundfile as sf | |
sd.default.device = 'MacBook Proのスピーカー' | |
filename = '../slow-drum-loop.wav' | |
# filename = '../DIALOG_001_01.wav' | |
data, fs = sf.read(filename) | |
data = data[:, 0] # stereo -> mono |
NewerOlder