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
| module NotMonkeyPatchable | |
| def method_added(name) | |
| @methods ||= {} | |
| if @methods[name] and not @unpatching | |
| @unpatching = true | |
| method = @methods[name] | |
| define_method(name) { |*args, &block| | |
| method.bind(self).call(*args, &block) | |
| } |
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
| module Gauss where | |
| import Datatypes | |
| import Extra | |
| -- 3 point Gauss coeficients and nodes | |
| c1 = 0.5555556 | |
| c2 = 0.8888889 | |
| c3 = 0.5555556 |
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 'rubygems' | |
| require 'mail' | |
| Mail.defaults do | |
| delivery_method :smtp, { :address => "smtp.gmail.com", | |
| :port => 587, | |
| :domain => 'varneckas.lt', | |
| :user_name => '[email protected]', | |
| :password => '', | |
| :authentication => 'plain', |
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 'rubygems' | |
| require 'mail' | |
| Mail.defaults do | |
| delivery_method :smtp, { :address => "smtp.gmail.com", | |
| :port => 587, | |
| :domain => 'varneckas.lt', | |
| :user_name => '[email protected]', | |
| :password => '', | |
| :authentication => 'plain', |
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
| module Main where | |
| import Control.Monad.Writer | |
| import Control.Monad.Reader | |
| rwt :: A Int | |
| rwt = ask >>= \x -> tell ("Got " ++ show x) >> return (x * 2) | |
| type A = ReaderT Int (WriterT String Maybe) |
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
| module Main where | |
| omitElementAt :: Int -> [a] -> [a] | |
| omitElementAt i list = let (left, right) = splitAt i list in left ++ (tail right) | |
| jacobiProductSum :: Int -> [Double] -> [Double] -> Double | |
| jacobiProductSum i a x = sum [ aj * xj | (aj, xj) <- aFiltered `zip` xFiltered ] | |
| where | |
| aFiltered = omitElementAt i a | |
| xFiltered = omitElementAt i x |
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
| import XMonad | |
| import Data.Monoid | |
| import System.Exit | |
| import qualified XMonad.StackSet as W | |
| import qualified Data.Map as M | |
| import XMonad.Hooks.DynamicLog | |
| import XMonad.Hooks.ManageDocks | |
| import XMonad.Hooks.EwmhDesktops |
NewerOlder