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 -*- | |
class ManagerCreator(object): | |
u"""プリパラマイマネ問題検証用スクリプト""" | |
color = [u'赤', u'橙', u'黄', u'緑', u'水', u'青', u'紫'] | |
animal = [u'熊', u'兎', u'鳥', u'鼠', u'猫'] | |
def get_manager(self, name): | |
uni_code_point = ord(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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.core.files.uploadedfile import SimpleUploadedFile | |
from StringIO import StringIO | |
from PIL import Image | |
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
<?php | |
function mygenerator() { | |
yield 0; | |
yield 1; | |
yield 2; | |
yield 3; | |
} | |
$g = mygenerator(); |
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
<?php | |
function fib_gen() { | |
list($a, $b) = [0, 1]; | |
while(true) { | |
yield $a; | |
list($a, $b) = [$b, $a+$b]; | |
} | |
} |
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
DROP TABLE IF EXISTS result; | |
DROP TABLE IF EXISTS student; | |
DROP TABLE IF EXISTS subject; | |
CREATE TABLE student( | |
student_id INT NOT NULL, | |
name VARCHAR(256) NOT NULL, | |
prefecture VARCHAR(256) NOT NULL, | |
age INT NOT NULL, | |
PRIMARY KEY(student_id) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
def f(x): | |
return x**3 + 2*x**2 + 10*x - 20 | |
def df(x): | |
return 3*x**2 + 4*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
<?php | |
function take($num, $iterable) { | |
$i = 0; | |
foreach($iterable as $key => $val) { | |
if($i >= $num) { | |
break; | |
} else{ | |
$i++; | |
yield $key => $val; |
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
.hearty .icon-favorite:before { | |
content: "\1f363"; | |
} | |
.hearty .is-favorite .icon-favorite:before { | |
content: "\1f37a"; | |
} |
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
object MyGenerator { | |
def main(args: Array[String]) = { | |
val g = myGenerator() | |
println(g()) // 1 | |
println(g()) // 2 | |
println(g()) // 3 | |
} | |
private[this] def myGenerator(): (() => Int) = { |
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
object MyStream { | |
def main(args: Array[String]): Unit = { | |
range(1, 10).take(10).print | |
} | |
private[this] def range(start: Int, end: Int): Stream[Int] = { | |
if(start >= end) { | |
Stream.empty | |
} else { |
OlderNewer