Skip to content

Instantly share code, notes, and snippets.

View a-yasui's full-sized avatar
🐆
にゃおす

a.yasui a-yasui

🐆
にゃおす
View GitHub Profile
@a-yasui
a-yasui / wareki.py
Created August 9, 2012 09:55
明治元年から平成二十四年までの毎年の日数を出力するプログラム
#!/usr/bin/env python
# -*- coding: utf_8 -*-
def yearToWareki (year):
r"""
result: tuple [('元号', 年, 日数), ('元号', 年, 日数)]
2つ目の要素はほぼないが、変わり目の時にある
"""
# 明治元年: 1868
# 明治45年: 1912 (~7/29)
@a-yasui
a-yasui / cal.py
Created August 9, 2012 09:18
1900年から2010年までのうち、毎年の日数を出力するプログラム
#!/usr/bin/env python
def is_uru (year):
if year % 4 == 0:
if year % 400 == 0:
return True
elif year % 100 == 0:
return False
return True
return False
<html>
<head>
<meta charset="utf-8">
<title></title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>