I hereby claim:
- I am SKoschnicke on github.
- I am skoschnicke (https://keybase.io/skoschnicke) on keybase.
- I have a public key whose fingerprint is 00F0 5868 1412 6596 C9FF ACFB A408 2AE0 90DE 5CE9
To claim this, I am signing this object:
class A < ActiveRecord::Base | |
# has attribute "value" | |
end | |
class B < ActiveRecord::Base | |
has_many :as |
import System.IO | |
import Numeric(showIntAtBase) | |
import Char(ord, intToDigit) | |
main :: IO () | |
main = do | |
output stdin | |
printFile :: String -> IO () | |
printFile filename = |
class Bar < ActiveRecord::Base | |
attr_accessible :rec_type | |
end |
$('<tr></tr>').append( | |
$.makeArray($(data).map(function(index, element) { | |
return $('<td></td>').html(element.instrument_name) | |
})) | |
).appendTo(custom_factor_table) | |
$('<tr></tr>').append( | |
$.makeArray($(data).map(function(index, element) { | |
return $('<td></td>').html('bla') | |
})) | |
).appendTo(custom_factor_table) |
import Control.Error | |
-- A made-up type for this example. | |
-- This is a bit simplified because mostly there are not only these encapsuled | |
-- types but dependent values which can only be retrieved sequentially (e.g. | |
-- reading an id from stdin, then retrieving the record for this id from a | |
-- database). | |
type MyType = (Maybe (Maybe Int)) | |
-- The goal: Return the int when it is less than 10, on other cases (greater or |
{-# LANGUAGE TemplateHaskell, Rank2Types #-} | |
module ExampleForSO where | |
import Control.Lens | |
import Control.Applicative ((<$>), pure) | |
import Data.List (any) | |
data SomeRec = SomeRec { _name :: String, _val :: Int } | |
deriving (Show) | |
$(makeLenses ''SomeRec) |
<?php | |
class Test { | |
private $number = 0; | |
private $sub; | |
public function __construct($n) { | |
$this->number = $n; | |
$this->sub = new SubTest($n, $this); | |
echo "construct ".$this->number."\n"; |
<?php | |
$a = array(1 => array(1),2 => array(2),3 => array(3), 12 => array(5)); | |
$b = array(1 => 5,2 => 6,3 => 7, 5 => 12); | |
$result = $a + array_fill_keys(array_keys($b), []); | |
foreach ($b as $key => $value) { | |
array_push($result[$key], $value); | |
} |
import Reactive.Banana | |
import Control.Concurrent | |
main = do | |
-- Create handles for pushing values into events | |
(addHandler1, push1) <- newAddHandler | |
(addHandler2, push2) <- newAddHandler | |
-- Create event network | |
network <- compile $ do | |
-- Actual events from AddHandlers |
I hereby claim:
To claim this, I am signing this object: