Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
import random | |
from sklearn import svm | |
from sklearn.grid_search import GridSearchCV | |
import pylab | |
import numpy as np | |
data = [] | |
labels = [] |
Project Euler Sprint Hack Nights are beginner friendly events where you can work on your own projects or engage in a friendly competition called the Project Euler Sprint.
The Project Euler Sprint is a friendly competition involving solving Project Euler ([http://projecteuler.net][projecteuler]) problems for points. Project Euler is a series of increasingly difficult computational math problems that must be solved with code (generally speaking - we've had some impressive solutions in pen and paper as well as on an Excel spreadsheet).
Each problem is harder than the last, so each problem is worth its problem number in points. Problem #1 is easy, so it's worth 1 point, while problem #50 is much harder, but worth 50 points. You can form teams of 4 people and solutions can be in any language as long as it's coded there. More detailed rules below.
import numpy as np | |
import pylab | |
# make some random data | |
x = np.random.randn(15) | |
# get length of data | |
n = len(x) | |
# compute PSD (square of the abs of the fft values) |
from openmdao.main.api import Component | |
from openmdao.lib.datatypes.api import Float | |
import numpy as np | |
from itertools import combinations | |
class ActuatorDisc(Component): | |
"""Simple wind turbine model based on actuator disc theory""" | |
# inputs |
from openmdao.main.api import Component | |
from openmdao.lib.datatypes.api import Float, Array, Str | |
from rk4 import RK4 | |
import numpy as np | |
import pylab | |
# http://www.math.psu.edu/tseng/class/Math251/Notes-Predator-Prey.pdf |
from openmdao.main.api import Component | |
from openmdao.main.datatypes.api import Float, Array | |
import numpy as np | |
class ArraySquaredError(Component): | |
""" | |
Computes the square of the norm of the distance (error) between two | |
n-dimensional arrays "current" and "target", with analytic derivatives. | |
Meant for use in models which seek to minimize the distance/error between |
import numpy as np | |
from openmdao.main.api import Component, Assembly, set_as_top | |
from openmdao.lib.datatypes.api import Float, Array | |
class KSComponent(Component): | |
""" | |
Aggregates a number of functions to a single value via the | |
Kreisselmeier-Steinhauser Function. Often used in the aggregation of |
def doctor(self): | |
print "-- OpenMDAO Doctor --" | |
print 30*"-" | |
uncon_inputs = self.get_unconnected_inputs() | |
n_uncon = len(uncon_inputs) | |
if n_uncon > 0: | |
print "- Assembly contains %i unconnected inputs:" % n_uncon | |
for name in uncon_inputs: | |
print " " + name |