目次
- redux について
- redux の良いところ
- good/motto
def removeMention(text): | |
startIndex = text.find("@") | |
endIndex = 0 | |
index = startIndex | |
while True: | |
s = text[index] | |
print s | |
if s==" ": | |
endIndex = index | |
break |
# coding:utf-8 | |
import re | |
import jaconv | |
# @メンションを削除 | |
def removeMention(text): | |
startIndex = text.find("@") | |
endIndex = 0 | |
index = startIndex |
#coding:utf-8 | |
import json | |
import requests | |
import time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from requests_oauthlib import OAuth1 | |
from datetime import datetime, timedelta | |
from email.utils import parsedate_tz |
# coding: utf-8 | |
import math | |
def calc_cos(dictA, dictB): | |
""" | |
cos類似度を計算する関数 | |
@param dictA 1つ目の文章 | |
@param dictB 2つ目の文章 | |
@return cos類似度を計算した結果。0〜1で1に近ければ類似度が高い。 | |
""" |
#coding:utf-8 | |
# 正規表現のためのライブラリ「re」を導入 | |
import re | |
# 正規表現のパターン | |
# [\d]は任意の数値という意味、[\d+]で任意の数値が1個以上連続しているという意味 | |
# なので、(\d+年\d+月\d+日)は | |
# 任意の数値の連続 + 年 + 任意の数値の連続 + 月 + 任意の数値の連続 + 日 という意味になる。 | |
pattern = r"(\d+年\d+月\d+日)" |
<?php | |
date_default_timezone_set('Asia/Tokyo'); | |
$url = "https://scrapbox.io/api/pages/yoneda/?limit=3"; | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET"); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
$results = curl_exec($curl); | |
curl_close($curl); |
# coding:utf-8 | |
import re | |
text = "apple_100" | |
anapat = r"(\w+_)(\d+)" | |
reppat = r"\2" | |
result = re.sub(anapat,reppat,text) | |
print(result) |
# coding: utf-8 | |
num = 11 | |
print("num is ... {}".format(num)) | |
name = "tarou" | |
print("name is ... {}".format(name)) | |
fruits = {"apple":100,"orange":400} | |
print("fruits is ... {}".format(fruits)) |
// js単体でプログラムを動かしたい時は、 | |
// $ node test.js | |
// でOK | |
var a = 50; | |
var b = 60; | |
var result = a + b; | |
console.log("結果は:"+result); |