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
| Started GET "/api/system_status?_=1412070154562" for 127.0.0.1 at 2014-09-30 12:42:34 +0300 | |
| Processing by Api::V1::SystemStatusesController#index as JSON | |
| Parameters: {"_"=>"1412070154562"} | |
| LocalUser Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."type" IN ('LocalUser') AND "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1 | |
| Completed 500 Internal Server Error in 2ms (Views: 0.1ms | ActiveRecord: 0.2ms) |
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 WikiNews where | |
| import Network.HTTP(simpleHTTP, getRequest, getResponseBody) | |
| import Data.List(isInfixOf, intersperse) | |
| import Data.Char(isSpace, toLower) | |
| import Control.Category((>>>)) | |
| import System.Random(getStdGen) | |
| -- from package tagsoup: |
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
| function debounce(f, millis) { | |
| var ready = true; | |
| var timeoutId; | |
| var lastMissed; | |
| function resetTimeout(){ | |
| window.clearTimeout(timeoutId); | |
| timeoutId = window.setTimeout(function() { | |
| if (lastMissed) { | |
| lastMissed(); | |
| } |
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
| // (c -> c) | |
| // c | |
| var id = function(x) { return x; }; | |
| // (i -> i) | |
| // TNumber | |
| var num = id(3); | |
| // (n -> n) | |
| // TString | |
| var str = id('a'); |
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
| {-# LANGUAGE FlexibleContexts, FlexibleInstances #-} | |
| module FixT where | |
| data Expr = Val | |
| | Divide Expr Expr | |
| | Times Expr Expr | |
| deriving Show | |
| flipDivide :: Expr -> Expr | |
| flipDivide Val = Val |
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 System.Directory (getDirectoryContents) | |
| import Control.Monad (forM_) | |
| import Data.Functor ((<$>)) | |
| import System.Posix.Files (getSymbolicLinkStatus, isDirectory) | |
| withIsLast :: [a] -> [(a, Bool)] | |
| withIsLast [] = [] | |
| withIsLast [x] = [(x, True)] |
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
| #include <rfftw.h> | |
| #include <math.h> | |
| #include <stdio.h> | |
| /* the out format is: */ | |
| /* r0, r1, r2, ..., rn/2, i(n+1)/2-1, ..., i2, i1 */ | |
| void fft(int n, fftw_real in[n], fftw_real power_spectrum[n/2+1]) | |
| { | |
| fftw_real out[n]; | |
| rfftw_plan p; |
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
| ;;(load "/local-home/user18/repos/thirdparty/emacs-haskell-config/init.el") | |
| (add-to-list 'load-path "~/repos/thirdparty/emacs-haskell-config/packages/haskell-mode/") | |
| (require 'haskell-mode-autoloads) | |
| (add-to-list 'Info-default-directory-list "~/repos/thirdparty/emacs-haskell-config/packages/haskell-mode/") | |
| (require 'cl) | |
| (add-to-list 'load-path "~/.emacs.d/lisp") | |
| (require 'cask "~/.cask/cask.el") |
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
| {-# OPTIONS -Wall #-} | |
| {-# LANGUAGE TypeFamilies, FlexibleInstances #-} | |
| import Data.Map | |
| class Indexable a where | |
| type Index a | |
| type Result a | |
| index :: a -> Index a -> Result a |
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
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| class Indexable a where | |
| instance Indexable (String, Int, Char) where | |
| instance Indexable ([(String, a)], String, a) where | |
| test1 :: Indexable (a,b,c) => a -> b -> c |