Skip to content

Instantly share code, notes, and snippets.

@wakusei-meron-
wakusei-meron- / textfield.m
Last active August 29, 2015 14:03
UITextFieldで変換を完了せずに、テキストフィールド内の文字を取得
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
// NSLog(@"change");
NSMutableString *tmpStr = [NSMutableString stringWithString:textField.text];
[self.view addSubview:self.resultTableView];
if ([string isEqualToString:@""]){//delete押された時
if ([textField.text length] == 1) {
[self.resultTableView removeFromSuperview];
@wakusei-meron-
wakusei-meron- / NewtonMethod.py
Last active September 30, 2015 06:08
ニュートン法とは何か??ニュートン法で解く方程式の近似解 ref: http://qiita.com/PlanetMeron/items/09d7eb204868e1a49f49
# 適当な初期値の設定
x = 5.0
while True:
# ニュートン法による新しいxを求める
x2 = x - (x * x - 2) / (x * 2)
# 計算後の値が誤差の範囲内になったら計算終了
if abs(x2 - x) < 0.0001:
{"110000": "w", "110001": "x", "110101": "1", "110100": "0", "010100": "U", "010101": "V", "001100": "M", "001101": "N", "011110": "e", "011111": "f", "001001": "J", "001000": "I", "011011": "b", "011010": "a", "000110": "G", "000111": "H", "000011": "D", "000010": "C", "100100": "k", "100101": "l", "111100": "8", "111101": "9", "100010": "i", "100011": "j", "101110": "u", "101111": "v", "111001": "5", "111000": "4", "101011": "r", "101010": "q", "110011": "z", "110010": "y", "010010": "S", "010011": "T", "010111": "X", "010110": "W", "110110": "2", "110111": "3", "011000": "Y", "011001": "Z", "001111": "P", "001110": "O", "011101": "d", "011100": "c", "001010": "K", "001011": "L", "101101": "t", "000000": "A", "000001": "B", "100111": "n", "100110": "m", "000101": "F", "000100": "E", "111111": "/", "111110": "+", "100001": "h", "100000": "g", "010001": "R", "010000": "Q", "101100": "s", "111010": "6", "111011": "7", "101000": "o", "101001": "p"}
#coding: utf-8
from scipy import sin
from math import pi
import numpy as np
import pylab as pl
import struct
import time
def createSinWave(a, f, sampling_rate, time_s):
import urllib3
from bs4 import BeautifulSoup
## データベースの準備
import psycopg2
conn = psycopg2.connect("user=USER_NAME dbname=dev host=127.0.0.1")
cur = conn.cursor()
# URL
### 株価の保存
import urllib3
import pandas as pd
from io import StringIO
## データベースの準備
import psycopg2
conn = psycopg2.connect("user=USER_NAME dbname=dev host=127.0.0.1")
cur = conn.cursor()
@wakusei-meron-
wakusei-meron- / scipy_io_wavwile.ipynb
Last active March 4, 2019 12:07
Desktop/PPP/python/audio/Untitled.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wakusei-meron-
wakusei-meron- / sin.ipynb
Last active March 9, 2019 12:22
Desktop/PPP/python/audio/sin.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wakusei-meron-
wakusei-meron- / ASK・FSK・PSK.ipynb
Created March 24, 2019 13:10
Desktop/PPP/python/audio/Untitled.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wakusei-meron-
wakusei-meron- / envelop_detector.ipynb
Last active March 31, 2019 12:27
Desktop/PPP/python/audio/envelop_detector.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.