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
object Benchmarks { | |
import io.Source | |
import util.{Try, Success} | |
case class Benchmark(name: String, lang: String, id: Int, n: Int, size: Int, | |
cpu: Double, mem: Int, status: Int, load: String, elapsed: Double) | |
object Benchmark { def fromSeq(s: Seq[String]) = Benchmark(s(0), s(1), s(2).toInt, s(3).toInt, | |
s(4).toInt, s(5).toDouble, s(6).toInt, s(7).toInt, s(8), s(9).toDouble) } | |
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
using System; | |
namespace fero23.DateTime | |
{ | |
public class UnixDateTime | |
{ | |
public enum WeekDays | |
{ | |
Monday = 4, | |
Tuesday = 5, |
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 System.CPUTime | |
wait :: a -> IO a | |
wait x = seq x (return x) | |
main :: IO () | |
main = do | |
start <- getCPUTime | |
l <- wait . last $ map abs [1..1000000000] | |
end <- getCPUTime |
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 OverloadedStrings #-} | |
module Formatter where | |
import Foreign.C.String | |
import Foreign.C.Types | |
import qualified Data.Text as T | |
foreign export ccall | |
format :: CString -> IO CString |
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
using System; | |
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
namespace HSTest | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ |
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 Text.ParserCombinators.Parsec | |
import Data.List | |
type Args = [String] | |
type Body = [String] | |
type Label = String | |
data JSONProp = JSONProp Label JSON deriving Show | |
data JSON = JSONObject [JSONProp] | |
| JSONNumber Double |
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 Data.List (sortBy) | |
type Tag = String | |
type NodeData = (Tag, Double, Double, [Node]) | |
data Node = DecisionNode NodeData | RandomNode Double NodeData deriving Show | |
data SortedNode = SortedNode { | |
tag::Tag, | |
isRandom::Bool, | |
isCase::Bool, | |
getValue::Double, |
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
use std::thread; | |
use std::sync::{Arc, Mutex}; | |
fn main() { | |
const MAX_HAND: u32 = 5; | |
const PLAYERS: usize = 5; | |
let players: Arc<Mutex<Vec<u32>>> = Arc::new(Mutex::new(vec![0;PLAYERS])); | |
let dealer: Arc<Mutex<u32>> = Arc::new(Mutex::new(MAX_HAND)); | |
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
"use strict"; | |
var cheerio = require("cheerio"); | |
var request = require("request"); | |
var _ = require("lodash"); | |
var parseString = require('xml2js').parseString; | |
var ProgressWatcher = require("./progress_watcher"); | |
let urls = { | |
drupal: [ |
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
type State = (String, Integer) | |
data ST x = S(State -> (x, State)) | |
apply st (S f) = f st | |
instance Functor ST where | |
fmap f (S f') = S(\s -> let (x, s') = f' s in (f x, s')) | |
instance Applicative ST where | |
pure x = S(\s -> (x, s)) |
OlderNewer