Skip to content

Instantly share code, notes, and snippets.

@tututen
tututen / sh
Created January 27, 2014 02:51
Python の shallow copyとdeep copyについて
In [1]: a=[[0]*5]*4
In [2]: a
Out[2]: [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]
In [3]: a[0][0]=1
In [4]: a
Out[4]: [[1, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 0, 0, 0, 0]]
@tututen
tututen / gist:c8a56c37ea7112a3351f
Created July 15, 2014 07:55
C#で指定した送信元IPを使って通信行う場合
var socket = new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork,
System.Net.Sockets.SocketType.Dgram,
System.Net.Sockets.ProtocolType.Udp);
socket.Bind(new System.Net.Sockets.IPEndPoint(System.Net.IPAddress.Parse("192.168.0.4"), 0));
@tututen
tututen / index.html
Created August 12, 2014 07:31
#codejp 2014 出題時のソース
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body style="font-family:monospace;">
<script type="text/javascript" src="main.js"></script>
</body>
</html>
@tututen
tututen / zundoko.py
Created August 7, 2016 04:26
zundoko KIYOSHI PYTHON #codejp
#!/usr/bin/env python
import random as r
s=' '*16
while True:
p=r.choice(['zun','doko'])
print(p)
s+=p
if s[-16:]=='zun'*4+'doko':
print 'KIYOSHI!'
break
@tututen
tututen / ClosedRange.java
Last active August 1, 2017 09:54
TDDワークショップ 小室・横山チーム 2017/08/01
package jp.classmethod.tddbc;
public class ClosedRange {
private int lowerEndpoint;
private int upperEndpoint;
public int getLowerEndpoint() {
return this.lowerEndpoint;
}
@tututen
tututen / 日次RSSフィード開発日誌のDEMO_output済.ipynb
Created January 16, 2018 02:58
日次RSSフィード開発日誌のDEMO
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tututen
tututen / docker-compose.yml
Created November 10, 2018 06:09
manzyun docker
version: '3'
services:
wordpress:
image: wordpress:latest
depends_on:
- db
ports:
- "8000:80"
restart: always