This file contains 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
launch_super_query('foo', <<-SQL, <<-TEXT) | |
drop table user; | |
SQL | |
I'm so sorry. | |
TEXT |
This file contains 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
p DATA.read # => "wait what?\n" | |
__END__ | |
wait what? |
This file contains 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
(ns zero-island.core) | |
(def problem "+++0++\n++000+\n+++0++\n++++++") | |
(def ^:private value-encoding {\0 :zero \+ :plus}) | |
(defn- split-lines [problem] | |
(clojure.string/split problem #"\s+")) | |
(defn- indexed-seq [s] |
This file contains 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
Company's quest for world domination has prompted us to open a convenience store - we sell only three products: | |
Product code | Name | Price | |
GR1 | Green tea | £3.11 | |
SR1 | Strawberries | £5.00 | |
CF1 | Coffee | £11.23 |
This file contains 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
function git-mode() { | |
alias gst='git status' | |
alias st='git status' | |
alias gco='git checkout' | |
alias co='git checkout' | |
alias gbr='git branch' | |
alias br='git branch' | |
alias gcommit='git commit' | |
alias commit='git commit' | |
alias gdiff='git diff' |
This file contains 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 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 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 => 'tomas@varneckas.lt', | |
:password => '', | |
:authentication => 'plain', |
This file contains 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 => 'tomas@varneckas.lt', | |
:password => '', | |
:authentication => 'plain', |
This file contains 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 |
OlderNewer