Skip to content

Instantly share code, notes, and snippets.

@NaoY-2501
NaoY-2501 / arithmetic.py
Created September 24, 2017 14:53
argparse練習用 四則演算を行うCLIツール
# coding: utf-8
import argparse
def subtraction(args):
""" subtraction
: param args
: return: result of subtraction
: rtype: int
"""
@NaoY-2501
NaoY-2501 / m3_scraping.py
Last active October 16, 2017 04:44
m3_scraping.py
import requests
from bs4 import BeautifulSoup as bs
def get_html(url):
req = requests.get(url)
if req.status_code != 200:
print('HTML Error:{}'.format(req.status_code))
return False
return req.text
@NaoY-2501
NaoY-2501 / circle_list.tpl
Last active November 4, 2017 17:29
Fetch_M3_2017Fall_Circle_list
<!DOCTYPE html>
<head>
<title>M3 2017 サークルリスト</title>
</head>
<body>
<table>
{% for circle in circles %}
<tr>
<td>{{ circle.space }}</td>
<td>{{ circle.name }}</td>
@NaoY-2501
NaoY-2501 / note-NetworkX.md
Last active February 24, 2018 05:42
note-NetworkX.md

NetworkX 1.11 -> 2.0

We have made some major changes to the methods in the Multi/Di/Graph classes.

  • マルチグラフ・有向グラフクラスのメソッドが修正

With the release of NetworkX 2.0 we are moving to a view/iterator reporting API. We have moved many methods from reporting lists or dicts to iterating over the information. Most of the changes in this regard are in the base classes. Methods that used to return containers now return views (inspired from dictionary views in Python) and methods that returned iterators have been removed.

  • view/iteratorを返すAPIに関する変更
@NaoY-2501
NaoY-2501 / nlp_for_ml.md
Last active April 21, 2018 07:12
20180421_言語処理のための機械学習入門 読書会

言語処理のための機械学習入門 読書会

キーワードをつかむ

  • 言語処理のための機械学習入門

  • 監修/著者: 奥村学(東工大教授)/高村大也(東工大准教授)

  • 目的: 機械学習を用いた言語処理技術を理解するための基礎的な知識・考え方を伝える

@NaoY-2501
NaoY-2501 / create_QRcode.py
Last active September 24, 2018 07:37
PythonでQRコードを生成してSVGタグに変換する
import xml.dom.minidom
import qrcode
import qrcode.image.svg as svg
def make_qrcode_svg(text):
"""
QRコードのSVGを作る関数
:param text: QRコードに埋め込みたい文字列
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@NaoY-2501
NaoY-2501 / sample.html
Created February 15, 2019 03:48
DataMaps Sample
<!-- http://datamaps.github.io/ -->
<!-- https://github.com/markmarkoh/datamaps/blob/master/README.md#getting-started -->
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.9/topojson.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datamaps/0.5.9/datamaps.world.min.js"></script>
</head>
<body>
@NaoY-2501
NaoY-2501 / notebook.css
Last active September 20, 2019 01:58
CSS for Notebook(Jupyter and Colaboratory)
.cm-variable,
.cm-stringm,
.line-numbers,
.CodeMirror-gutter-elt,
.view-line
{
line-height: 25px;
font-size: 15px;
font-weight: 600;
}
# Chillhopっぽい感じを目指したつもり
Clock.bpm = 99
Scale.default = "major"
print(Scale.default)
bd >> play("x X", dur=[0.5])