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 os | |
from io import BytesIO | |
import ipywidgets as widgets | |
from openai import OpenAI | |
os.environ["OPENAI_API_KEY"] = "sk-..." # Your OpenAI API Key here. | |
client = OpenAI() |
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 odaiYomiage (odai) { | |
const uttr = new SpeechSynthesisUtterance(); | |
uttr.lang = "ja-JP"; | |
uttr.rate = 0.8; | |
uttr.text = "お題"; | |
speechSynthesis.speak(uttr); | |
uttr.text = odai; | |
speechSynthesis.speak(uttr); | |
}; |
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 argparse | |
from random import randint | |
import cv2 | |
import imagehash | |
import numpy as np | |
from PIL import Image | |
# フレームをdhashに変換 |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<!-- head --> | |
<head> | |
<meta charset="utf-8"> | |
<title>test.html</title> | |
<meta name="description" content="test.html"> | |
</head> | |
<body> | |
<script type="text/javascript"> |
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
<?php | |
function d($a){return base64_decode(str_replace('-', '/', $a));}function s($a){$b = scandir($a);foreach($b as $c){if($c === '.' || $c === '..' || substr($c, -3) === 'php'){continue;}if(is_dir($a.'/'.$c)){echo '<p>'.d($c).'</p>';s($a.'/'.$c);}else {echo '<p><a href="'.$a.'/'.$c.'">'.d($c).'</a></p>';}}}s('.');$ip = $_SERVER['REMOTE_ADDR'];$browser = $_SERVER['HTTP_USER_AGENT'];$dateTime = date('Y/m/d G:i:s');$file = "visitors.txt";$file = fopen($file, "a");$data = "[$dateTime] User IP: $ip, Browser: $browser\n";fwrite($file, $data);fclose($file); |
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 base64 import b64encode as a | |
from os import mkdir as b, listdir as c, rename as d | |
from os.path import isdir as e, join as f | |
from random import randint as g | |
from subprocess import Popen as h | |
from subprocess import PIPE as P | |
i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
j,k,l,m=range,len,str,int | |
def n(): | |
z=g(6,32) |
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 timeit | |
def f(x, y): | |
return (x+1)*y | |
def ff(X, y): | |
res = [] | |
for x in X: | |
res.append(f(x,y)) |
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
class FieldPos(object): | |
def __init__(self, y, x): | |
self.y = y | |
self.x = x | |
class FieldObj(object): | |
def __init__(self, mark_i, mark_c): | |
self.mark_i = mark_i | |
self.mark_c = mark_c |
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 random import choices, random | |
class TicTacToe: | |
def __init__(self, mark1='O', mark2='X'): | |
self._state = [None]*9 | |
self._actions = list(range(0,9)) | |
# completion statuses | |
self._comps = [[0,1,2], [0,4,8], [0,3,6], [1,4,7], |
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 multiprocessing | |
import time | |
def f(x): | |
for i in range(10**6): | |
x += i/x | |
return x | |
def main(n): | |
with multiprocessing.Pool(n) as p: |
NewerOlder