Skip to content

Instantly share code, notes, and snippets.

View spockz's full-sized avatar

Alessandro Vermeulen spockz

View GitHub Profile
Running "recess:bootstrap" (recess) task
>> Parser error in bootstrap/less/mixins.less
>> 643. padding-right: (@grid-gutter-width / 2);
>> 644. &:extend(.clearfix all);
>> 645. }
Warning: Use --force to continue.
Section *cycling = [[Section alloc] initWithName:@"fietsen" NamedThumb:@"Icon_fietsen.png" andDataURL:@"http://parklingezegen.nl/category/fietsroutes/?json=1"];
Section *walking = [[Section alloc] init];
walking.name = @"wandelen";
walking.thumb = [UIImage imageNamed:@"Icon_wandelen.png"];
walking.dataUrl = [NSURL URLWithString:@"http://parklingezegen.nl/category/wandelen/?json=1"];
package nl.spockz.spray.routing.generator
import spray.routing.Route
object Generator {
def fromJaxRsAnnotatedPackage(packageName: String) : Route = _ => Unit
}
$> cat > foo.hs
{-# RULES "foo/Integer" foo = intFoo #-}
foo :: Num a => a -> a -> a
foo = (+)
intFoo = (-)
main = (putStrLn . show) ((foo (1::Integer) (1::Integer))::Integer)
$> ghc --make -O -ddump-rules -ddump-simpl-stats foo.hs
module Main where
import Control.Parallel
import Control.Parallel.Strategies
foo = map (id) [1..10000] `using` parListChunk 400 rdeepseq
type Square = Square' Nil
data Square' t a = Zero (t (t a)) | Succ (Square' (Cons t) a)
data Nil a = Nil deriving Show
data Cons t a = Cons a (t a) deriving Show
mapNil :: (a -> b) -> Nil a -> Nil b
mapNil _ _ = Nil
mapCons :: ((a -> b) -> (t a -> t b))
-> (a -> b)
renderPixel :: Int -> Int -> Int -> RayMaker -> World -> Colour Int
--
parMap rdeepseq
(\(i,j) -> renderPixel depth i j raymaker world)
[(i,j) | i <- [0..h-1], j <- [0..w-1]]
--
$> +RTS -N2 -s -RTS ... => 100% cpu usage;
----
pixels = concat
[[renderPixel depth i j raymaker world | i <- [0..(h `div` 2 - 1)], j <- [0..w-1]] `using` parListChunk (w*h `div` 4) rdeepseq
,[renderPixel depth i j raymaker world | i <- [(h `div` 2)..h-1], j <- [0..w-1]]] `using` parListChunk (w*h `div` 4) rdeepseq
`using` parListChunk (w*h `div` 4) rdeepseq
solveQuadratic :: Double -> Double -> Double -> Intersections
solveQuadratic a b c =
case compare discr 0.0 of
LT -> []
EQ -> [-b / (2 * a)]
GT -> [abc (-), abc (+)]
where discr = b ^ 2 - 4 * a * c
abc op = (-b `op` sqrt discr) / (2 * a)
-- vs
Thu Apr 1 18:31 2010 Time and Allocation Profiling Report (Final)
raytrace +RTS -P -hc -RTS tests/Input/gml/references/testall.gml
total time = 175.26 secs (8763 ticks @ 20 ms)
total alloc = 34,673,331,808 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc ticks bytes
intervals'_ayp1 Base.Shape.Cylinder 22.0 17.9 1926 1552298191