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
| # 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). |
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
| require "eventmachine" | |
| module Echo | |
| def post_init | |
| puts "got new conn" | |
| end | |
| protected | |
| def receive_data(data) | |
| puts "receieved #{data}" |
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 __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). |
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 RESTController < Controller | |
| def self.object_name=(object_name) | |
| @@object_name = object_name | |
| end | |
| def self.object_name | |
| @@object_name | |
| end | |
| # @api plugin |
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 __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 |
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
| 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 |
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
| # 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 |
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
| 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> |
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
| # | |
| # 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 |
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
| # -*- 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] |