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 React, {useState, useEffect} from "react"; | |
export const ColorCodes = () => { | |
const [colors, setColors] = useState([]); | |
const [correctColor, setCorrectColor] = useState(""); | |
const [isCorrect, setIsCorrect] = useState(false); | |
const [isShowResult, setIsShowResult] = useState(false); | |
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
""" | |
雑です。日本語として成立していないものも出力されます。 | |
5600個くらい出ます。 | |
""" | |
excludes = 'ぁぃぅぇぉゔゕゖゐゑゎ' | |
hiragana = [chr(i) for i in range(ord("ぁ"), ord("ゖ")+1) if chr(i) not in excludes] | |
print("".join(hiragana)) | |
count = 1 | |
for first in hiragana: |
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 Foundation | |
enum timingFunction{ | |
case Linear,EaseIn,EaseOut,EaseInOut, | |
Spring, | |
EaseInSine,EaseOutSine,EaseInOutSine, | |
EaseInQuad,EaseOutQuad,EaseInOutQuad, | |
EaseInCubic,EaseOutCubic,EaseInOutCubic, | |
EaseInQuart,EaseOutQuart,EaseInOutQuart, | |
EaseInQuint,EaseOutQuint,EaseInOutQuint, |
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
# 1. デスクトップフォルダに移動 | |
cd ~/Desktop/ | |
# 2. ファイル生成コマンドを実行 | |
for i in {1..200}; do echo "yo" > hack$i.html; done | |
# 3. 一括ファイル削除 | |
rm hack*.html |
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
# -*- coding: utf-8 -*- | |
u""" | |
マルコフ連鎖を用いて適当な文章を自動生成するファイル | |
""" | |
import os.path | |
import sqlite3 | |
import random |
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
# -*- coding: utf-8 -*- | |
# Inspired | |
# [TensorFlow-Examples/autoencoder.py at master · aymericdamien/TensorFlow-Examples](https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/autoencoder.py) | |
import tensorflow as tf | |
import numpy as np | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data", one_hot=True) |
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 request = require('request'); | |
const PAGE_ACCESS_TOKEN = ""; | |
var options = { | |
hostname: "graph.facebook.com", | |
path: "/v2.6/me/messages?access_token=" + PAGE_ACCESS_TOKEN, | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json' |
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
#探す対象リスト:my_arrayはnumpy | |
#例:上位3件 | |
K = 3 | |
# ソートはされていない上位k件のインデックス | |
unsorted_max_indices = np.argpartition(-my_array, K)[:K] | |
# 上位k件の値 | |
y = my_array[unsorted_max_indices] |
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 | |
from os import path | |
import numpy as np | |
from matplotlib import pyplot as plt | |
%matplotlib inline | |
cascades_dir = path.normpath(path.join(cv2.__file__, '..', '..', '..', '..', 'share', 'OpenCV', 'haarcascades')) | |
cascade_f = cv2.CascadeClassifier(path.join(cascades_dir, 'haarcascade_frontalface_alt2.xml')) | |
def faceDetect(filePath): |
NewerOlder