Skip to content

Instantly share code, notes, and snippets.

# Solution for astrophysics #8.3
from __future__ import division
from numpy import sqrt, linspace
from scipy.integrate import odeint
from pylab import plot, axis, show
# Define the initial conditions for each of the four ODEs
inic = [0,0]
# Times to evaluate the ODEs. 800 times from 0 to 100 (inclusive).
require "eventmachine"
module Echo
def post_init
puts "got new conn"
end
protected
def receive_data(data)
puts "receieved #{data}"
from __future__ import division
from numpy import sqrt, linspace
from scipy.integrate import odeint
from pylab import plot, axis, show
# Define the initial conditions for each of the four ODEs
inic = [25,0,0,0.2]
E = 0.2
# Times to evaluate the ODEs. 800 times from 0 to 100 (inclusive).
class RESTController < Controller
def self.object_name=(object_name)
@@object_name = object_name
end
def self.object_name
@@object_name
end
# @api plugin
from __future__ import division
from numpy import sqrt, linspace
from scipy.integrate import odeint
from pylab import plot, axis, show
# Define the initial conditions for each of the four ODEs
#inic = [0.5,0,0.2,0] # chaotic
#inic = [0.7,0,0,0] # Secondary
#inic = [0,0.2,0.3,0.5] # Primary
E = 0.2
require_relative 'init'
require 'baretest'
require 'rack/test'
module Rack::Test::Methods
def app
Rango::Router.app
end
end
BareTest::Assertion::Context.send :include, Rack::Test::Methods
# Add PROJECT/lib to $LOAD_PATH
$LOAD_PATH.unshift(File.expand_path("#{__FILE__}/../../lib"))
# Ensure baretest is required
require 'baretest'
# Some defaults on BareTest (see Kernel#BareTest)
BareTest do
require_baretest "0.4.0" # minimum baretest version to run these tests
require_ruby "1.9.1" # minimum ruby version to run these tests
require 'erector'
module Rango
module ErectorMixin
# Erects a html using the given class
#
# @param klass [Erector::Widget] the class to render with
# @param options [Hash]
# :exclude Array<Symbols>
# ivars not to pass via serializing
# :explicit Hash<Symbol, Object>
#
# High-level wmii configuration.
#
# Ruby code in this file has access
# to a CONFIG constant which contains
# the data in this configuration file.
#
##
# A list of configuration files (partials) to import before
# -*- coding: utf-8 -*-
module DataMapper
module Validate
class SizeValidator < GenericValidator
def call(target)
return true if valid?(target)
# Copied from within_validator
size = @options[:size]
msg = @options[:message]