This file contains hidden or 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
| from math import * | |
| from numpy import * | |
| class Layer: | |
| def __init__(self, params = {}): | |
| self.eps = params["eps"] | |
| self.l_coef = params["l_coef"] | |
| self.n = sqrt( self.eps ) |
This file contains hidden or 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
| a.out |
This file contains hidden or 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
| x = numpy.arange(0,math.pi,0.01) | |
| pylab.plot(x, numpy.sin(x)) | |
| pylab.xlim((0, x[-1])) | |
| pylab.grid(True) | |
| pylab.savefig("simple.png") | |
| pylab.gcf().clear() | |
| os.system("open simple.png") |
This file contains hidden or 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 Hello(): | |
| def world(self): | |
| return "world" | |
| world = classmethod(world) | |
| def foo(): | |
| return "foo" |
This file contains hidden or 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 | |
| #-*- mode: python -*- | |
| import numpy | |
| class Plane(numpy.ndarray): | |
| """ | |
| """ | |
| def __new__(cls, abuffer): |
This file contains hidden or 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 ruby | |
| require "rubygems" | |
| require "rack" | |
| require "rack/showexceptions" | |
| require "rack/request" | |
| require "rack/response" | |
| class Hash |
This file contains hidden or 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 perl | |
| use HTTP::Request::Common; | |
| use LWP::UserAgent; | |
| use pQuery; | |
| sub whois_tanic { | |
| my ($query, $sld) = @_; |
This file contains hidden or 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 content_for { | |
| my ($tag, $params, $content) = @_; | |
| my $res = "<$tag"; | |
| for (keys %{$params}) { | |
| $res .= " $_=$params->{$_}"; | |
| } | |
| $res .= ">\n"; | |
| if (ref($content) ~~ /CODE/) { | |
| $res .= $content->(); |
This file contains hidden or 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 perl | |
| use 5.010; | |
| use Parallel::MPI::Simple; | |
| $total = 0; | |
| MPI_Init(); | |
This file contains hidden or 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
| myrank = MPI::Comm::WORLD.rank() | |
| csize = MPI::Comm::WORLD.size() | |
| if myrank % 2 == 0 then | |
| if myrank + 1 != csize then | |
| hello = "Hello, I'm #{myrank}, you must be #{myrank+1}" | |
| MPI::Comm::WORLD.send(hello, myrank + 1, 0) | |
| end | |
| else | |
| msg, status = MPI::Comm::WORLD.recv(myrank - 1, 0) |