Now that we live in the Big Data, Web 3.14159 era, lots of people want to build databases that are too big to fit on a single machine. But there's a problem in the form of the CAP theorem, which states that if your network ever partitions (a machine goes down, or part of the network loses its connection to the rest) then you can keep consistency (all machines return the same answer to
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
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RankNTypes #-} |
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
-- | |
-- Hello-World of the cordova/phonegap application using Haskell. | |
-- | |
-- here is the screenshoot | |
-- | |
-- https://twitter.com/AGoCorona/status/532948528621178880 | |
-- | |
-- So that Haste-Haskell can be used to create hybrid smartphone applications | |
-- | |
-- The original cordova JavaScript hello world is installed following the instructions of this page |
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
# Assumes you have a np.array((height,width,3), dtype=float) as your HDR image | |
import numpy as np | |
f = open("xxx.hdr", "wb") | |
f.write("#?RADIANCE\n# Made with Python & Numpy\nFORMAT=32-bit_rle_rgbe\n\n") | |
f.write("-Y {0} +X {1}\n".format(image.shape[0], image.shape[1])) | |
brightest = np.maximum(np.maximum(image[...,0], image[...,1]), image[...,2]) | |
mantissa = np.zeros_like(brightest) |
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
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-} | |
-- Stuff taken from the RSA module for now | |
module Primes where | |
import Data.Bits | |
import Data.Int | |
import Data.Word | |
import Data.ByteString.Lazy (ByteString) |
NewerOlder