2012-06-01から1ヶ月間の記事一覧
Hi there!Today, I would like to introduce cvxopt to you. CVXOPT is a library for resolving convex optimization like linear programs, and it is written by Python.please be careful for other packages when you want to install this in Mac. bec…
This is the famous model for simulating the action potential of a neuron.In terms of neuroscience, the mechanism of an action potential is explained as like this. (1)When a membrane receives a stimulus, stimulus-dependent Na+ channels open…
(When I go back to Tokyo, I would like to comment on this code.)This code is mostly copied from the end of this site.... Neurdon #-*- coding:utf-8 -*- from __future__ import division import numpy as np import matplotlib.pyplot as plt class…
In this log, I am summarizing Neural Models' articles. Later, I would like to make gists of them with python codes.Spiking Neuron Models Single Neurons, Populations, Plasticity comments for modelsSTEPS: Modeling and Simulating Complex Reac…
#-*- coding:utf-8 -*- from datetime import datetime def smallest_num(n): counter = 0 num = n dict_num = {"0":0, "1":1, "2":2, "3":3, "4":2, "5":1, "6":2, "7":3, "8":4, "9":2} if n >= 1000: counter += num / 1000 num = num % 1000 for i, d in…
#-*- coding:utf-8 -*- import random from datetime import datetime #素数判定 def is_prime3(q,k=50): q = abs(q) if q == 2: return True if q < 2 or q&1 == 0: return False d = (q-1)>>1 while d&1 == 0: d >>= 1 for i in xrange(k): a = random.ran…
解き方的な #-*- coding:utf-8 -*- import random from datetime import datetime #素数判定 def is_prime3(q,k=50): q = abs(q) if q == 2: return True if q < 2 or q&1 == 0: return False d = (q-1)>>1 while d&1 == 0: d >>= 1 for i in xrange(k): a =…
#-*- coding: utf-8 -*- from datetime import datetime def Euler63(): total = 0 for i in xrange(1,10): counter = 1 length = len(str(i ** counter)) while counter == length: total += 1 counter += 1 length = len(str(i ** counter)) return total …
完全に敗北です。 くそコードだけども、仕方ない。 999999 -> 567だと気づけばもっと早いコードがかける。 が、考慮しても30秒しな縮まらず敗北感。 #-*- coding:utf-8 -*- from datetime import datetime def square_count(x, List1, List2): count_squar…