Skip to content

Instantly share code, notes, and snippets.

% 横に並べる
% cf. http://tex.stackexchange.com/questions/232259/adding-captions-to-aligned-images-in-beamer
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{columns}[onlytextwidth]
@m-note
m-note / Install Python 3.4 on Amazon Linux
Last active May 31, 2016 03:12
Installing Python3.4 and related libraries to Amazon Linux (AmazonEC2) / Amazon EC2へのPython3.4とpandasなどのインストール
########################
# Amazon Linuxでしてみる
sudo passwd # とりあえずrootのパスワードを設定
sudo yum install gcc
sudo yum install zlib-devel
sudo yum install openssl-devel
sudo yum install bzip2-devel
sudo yum install readline-devel
sudo yum -y install make automake gcc gcc-c++ kernel-devel git-core # ビルドツールのインストール
@m-note
m-note / Chicago-citation.tex
Created January 15, 2016 11:45
Chicago style, endnote and bibliography
\documentclass[report, 10.5pt, a4paper, oneside, openany, dvipdfmx]{jsarticle}
%--citation
\usepackage[backend=bibtex,notes,isbn=false,short]{biblatex-chicago}
\usepackage{filecontents}
\addbibresource{ref}
\usepackage{endnotes}
\let\footnote=\endnote
\begin{document}
A Sentence 1 \footcite[25]{Lancaster2008}.
$$\begin{aligned} s_y^2 &= \frac{1}{n} \sum_{i=1}^{n} (y_i - \overline{y})^2 \\ &= {\boldsymbol w}^T S {\boldsymbol w}
\end{aligned}$$
@m-note
m-note / R markdown 初期設定.r
Last active January 26, 2016 04:27
Rmarkdown 初期設定
---
title: " "
author: " "
output:
html_document:
toc: false
number_sections: true
fig_width: 4.5
fig_height: 4.5
---
import pandas as pd
import httplib2
from lxml import etree
import json
from io import StringIO
import re
import unicodedata
import time
import sys
import os
import re
if __name__ == "__main__":
folder = input("Folder pass: ")
file_list = os.listdir(folder)
os.chdir(folder)
for file in file_list:
@m-note
m-note / file_exist_check.py
Last active October 19, 2015 14:47
ファイルを、テキストファイルに改行で記述していたときなどに、書き込もうとしているファイル名が既にあるかをチェックして、なければ新しいファイル名を作る。ファイルのリストの取得などを別の方法でできれば、応用も広がる。
# 実際は with open("downloaded_tag.txt", "r") as file_read: などとして、
# 下のコードでlistになっているところを、file_readに置き換える
save_base = "a"
file_num = 1
save_path = save_base + "_" + str(1)
flag = False
while flag == False:
check = False
results_df = pd.DataFrame()
results_df = results_df.append(pd.DataFrame({
"ID": [user for i in range(len(tweet_list))],
"Date": [date.strftime('%Y-%m-%d') for i in range(len(tweet_list))],
"Time": tweet_time_list,
"Tweet": tweet_list,
"Type": tweet_type_list},
columns = ['ID', 'Date', 'Time', 'Tweet', 'Type']))
title_list.append((element.find_all("h3"))[0].contents)
#<a href="http://togetter.com/li/887196">
#<h3 title="TITLE">TITLE</h3>
#</a>
page_url_list.append((element.find_all("a"))[0]["href"])
#<a href="http://togetter.com/li/887196">
category_temp = element.find_all("a", {"class":"category_link"})
category_list.append(",".join([i.contents[0] for i in category_temp]))