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 Dancer | |
def description() | |
"is like a beautiful swan, gracefully flying over a lake" | |
end | |
def steps() | |
"⚡→→→→↓↓↓↓←↓→↓←↑↑↑↑→↓←↑Ϟ" | |
end | |
def dance() | |
puts self.WHAT | |
puts "My dance " + self.description |
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 City(Base): | |
__tablename__ = "city" | |
name = Column(Unicode(6), primary_key=True) | |
rooms = relationship("Room", backref="city") | |
def __repr__(self): | |
return u'<City "%s" with %d rooms>' % (self.name, len(self.rooms)) | |
class Room(Base): | |
__tablename__ = "room" |
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/python | |
import math | |
import pygame | |
import random | |
import time | |
class Coord: | |
def __init__(self, x=0, y=0): |
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
# put this file into any folder under which ipynb files shall be collected. | |
import pytest | |
import os,sys | |
wrapped_stdin = sys.stdin | |
sys.stdin = sys.__stdin__ | |
from IPython.zmq.blockingkernelmanager import BlockingKernelManager | |
sys.stdin = wrapped_stdin | |
from IPython.nbformat.current import reads |
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 PB::SubMsg { | |
} | |
class PB::Option { | |
has Str $.name; | |
has $.constant; | |
has PB::SubMsg $.sub-message; | |
method gist() { |
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
sub agm( $a is copy, $g is copy ) { | |
($a, $g) = ($a + $g)/2, sqrt $a * $g | |
until abs($a - $g) < 0.000001; | |
return $a; | |
} | |
say agm 1, 1/sqrt 2; |
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
Hey! | |
This is a poll about VMs for Perl 6. It would be awesome if you fill it, | |
just write a comment with your answers. | |
I need it because I work on a huge summary (including, among the others, statistics, tests) | |
of VMs and Perl 6 itself. | |
Thank you very much in advance! | |
sergot |
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 python3.2 | |
import subprocess, re | |
matchers = { | |
'../scripts/public-add': re.compile('[AM]\tpublic/[\w.]'), | |
'../scripts/public-del': re.compile('D\tpublic/[\w.]'), | |
} | |
for line in subprocess.check_output(["git", "show", "--name-status"]).decode().split('\n')[4:-1]: |
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
# | |
# The Great Computer Language Shootout | |
# http://shootout.alioth.debian.org/ | |
# | |
# contributed by Christoph Bauer | |
# converted into Perl by Márton Papp | |
# | |
my num $pi = 3.141592653589793e0; | |
my num $solar_mass =(4 * $pi * $pi); |
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
#!perl6 | |
use NativeCall; | |
my $samplerate = 44100; | |
my $frequency = 440; | |
sub gen-sin(Int $sample-rate, Int $frequency) { | |
my num $spf = $sample-rate.Num / $frequency.Num; | |
my num $twopi = (2 * pi).Num; |
OlderNewer