This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun fact (n &optional m) ( | |
if (zerop n) | |
m | |
(fact (1- n) (if m (* m n) n)) | |
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var Hoge = Object.create(null); | |
Hoge.x = 10; | |
var h = Object.create(Hoge); | |
var f = Object.create(Hoge); | |
console.log(h.x); | |
// => 10 | |
console.log(f.x); | |
// => 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var Hoge = Object.create(null); | |
Hoge.x = 10; | |
var h = Object.create(Hoge); | |
console.log(h.x); | |
// => 10 | |
Hoge.x = 20; | |
console.log(h.x); | |
// => 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hoge(object): | |
def __init__(self, *args, **kwargs): | |
super(type(self), self).__init__() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
'''以下のようなディレクトリ構成を想定する。 | |
├── src | |
│ ├── fizzbuzz | |
│ ├── __init__.py | |
│ └── main.py | |
└── test | |
├── __init__.py | |
├── test_flake8.py - このテストファイル | |
└── test_main.py - main.py 用テスト |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PIL | |
MySQL-python | |
Jinja2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fatal error: Call to undefined method Symfony\Component\ClassLoader\UniversalClassLoader::registerNamespaces() in phar:///path/to/silex/silex.phar/autoload.php on line 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# このページより PHP のオプションを参考にいたしました。 | |
# http://blog.madapaja.net/2011/12/php54-symfony2.html | |
# 下記のページより、ビルド用シェルスクリプトの着想を得ました。 | |
# http://okwave.jp/qa/q566511.html | |
# 改めて御礼いたします。 | |
cd php-5.4.0RC4 | |
make clean | |
./configure \ | |
--prefix=/path/to/php-5.4.0RC4 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
easy_install -U `python -c "for dist in [dist for dist in __import__('pkg_resources').working_set if dist.project_name != 'Python']: print dist.project_name"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> timeit.timeit('{x: x for x in range(10000)}', number=1000) | |
0.5202829837799072 | |
>>> timeit.timeit('dict((x, x) for x in range(10000))', number=1000) | |
1.0116031169891357 |