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 | |
# encoding:utf-8 | |
import random | |
THRESHOLD = 1 # threshold for neuron's firing. | |
SYNAPSE_LIMIT = 4 # how strong synapses are allowed to be. | |
LTPRATIO = 1.1 # LTP : strength = strength*LTPRATIO | |
FORGETRATIO = 0.95 # A little forgetfullness | |
SUPPRESSION_RATIO = 0.5 # the frequency of suppressive synapses | |
SUP_WEAKNESS = 0.7 # when initialising, |
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 | |
# encoding:utf-8 | |
import random | |
class Neuron(object): | |
# 神経細胞体 class. | |
# i) synapse からの入力を受けることができ, | |
# ii) ある間にうけた入力の総和が threshold を超えれば | |
# iii) 発火し,本人から出ていく synapse に伝達される. |
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
# 1 | |
for element in a | |
do_something_with(element) | |
end | |
# 2 | |
a.each do |element| | |
do_something_with(element) | |
end |
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
for element in a: | |
do_something_with(element) |
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 Hello(object): | |
def __init__(self, friend): | |
self.friend = friend | |
def sayhello(self): | |
print "Hello, %s!"%(self.friend) | |
# helloworld = Hello('World') | |
# helloworld.sayhello() |
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/bash | |
for i in `seq 1 400`; | |
do | |
printf "%3d\t" "$i" | |
aplay /usr/share/skype/sounds/SkypeLogin.wav | |
done |
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
print "Hello, World!\n" | |
# on python 3.*, print ("Hello, World!\n") |
NewerOlder