Skip to content

Instantly share code, notes, and snippets.

View serialhex's full-sized avatar
😸
Pondering language design...

serialhex

😸
Pondering language design...
View GitHub Profile
@serialhex
serialhex / note.md
Created June 9, 2012 18:05
GRC's UHE PRNG Ultra-High Entropy Pseudo-Random Number Generator.

I did not write this software; Gibson Research did. Sounds like it's pretty spiffy!

{-# LANGUAGE OverloadedStrings #-}
module Tech where
import Templates
import Happstack.Server (ServerPart, Response, ok, toResponse)
import Text.Blaze ((!))
import qualified Text.Blaze.Html4.Strict as H
import qualified Text.Blaze.Html4.Strict.Attributes as A
tech :: String -> ServerPart Response
module Main where
import Control.Applicative ((<$>), (<*>))
import Happstack.Server (ServerPart, badRequest, nullConf, ok, simpleHTTP)
import Happstack.Server.RqData (RqData, checkRq, getDataFn, look, lookRead)
data Vote = Yay | Nay deriving (Eq, Ord, Read, Show, Enum, Bounded)
inRange :: (Show a, Ord a) => a -> a -> a -> Either String a
inRange lower upper a
@serialhex
serialhex / gist:2759111
Created May 20, 2012 18:46
installing happstack-lite... *now* it works!
╭─serialhex@multi-hex ~/src/edekatun/yesod_lern/yosog ‹ruby-1.9.3› ‹master*›
╰─$ cabal install happstack-light
cabal: There is no package named 'happstack-light'.
You may need to run 'cabal update' to get the latest list of available
packages.
╭─serialhex@multi-hex ~/src/edekatun/yesod_lern/yosog ‹ruby-1.9.3› ‹master*›
╰─$ cabal update 1 ↵
Downloading the latest package list from hackage.haskell.org
╭─serialhex@multi-hex ~/src/edekatun/yesod_lern/yosog ‹ruby-1.9.3› ‹master*›
╰─$ cabal install happstack-light
@serialhex
serialhex / surreal.hs
Created April 20, 2012 00:18
the beginnings of surreal numbers using haskell...
--import Data.Set (Set)
import qualified Data.Set as Set
--Forms
--A form is a pair of sets of surreal numbers, called its left set and its right set. A form with left set L and right set R is written { L | R }. When L and R are given as lists of elements, the braces around them are omitted.
--Either or both of the left and right set of a form may be the empty set. The form { { } | { } } with both left and right set empty is also written { | }.
data l `Surreal` r = Zero
| (l `Surreal` Set.empty) `Surreal` (Set.empty `Surreal` r)
deriving (Show)
Error detected while loading xmonad configuration file: /home/serialhex/.xmonad/xmonad.hs
xmonad.hs:19:28:
No instance for (LayoutClass Circle a0)
arising from a use of `|||'
Possible fix:
add an instance declaration for (LayoutClass Circle a0)
In the second argument of `(|||)', namely
`Circle ||| tabbed shrinkText defaultTheme ||| Accordion'
In the expression:
/* John J. Scuteri 9/13/2011
BCS 230 Foundations of Computer Programming
Assignment # 4 Paint Job Estimation */
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
@serialhex
serialhex / rbgtkinits.c
Created September 10, 2011 15:30
file for ashbb
extern void Init_gtk_gdk_gc();
extern void Init_gtk_treemodel();
extern void Init_gtk_accel_group();
extern void Init_gtk_entry();
extern void Init_gtk_textview();
extern void Init_gtk_fontbutton();
extern void Init_gtk_progress_bar();
extern void Init_gtk_gdk_pangorenderer();
extern void Init_gtk_gdk_colormap();
extern void Init_gtk_recent_manager();
# this was trancekoded by the awesome trancekoder
require 'narray'
require 'modshogun'
require 'load'
require 'pp'
strings=['hey','guys','i','am','a','string']
parameter_list=[[strings]]
@serialhex
serialhex / trancekoder.rb
Created August 9, 2011 03:40
RTFKODE!!!
#!/usr/bin/env ruby
# serialhex's awesome quick-and-dirty python-to-ruby trancekoder of indomnitable awesomeness!!
#
# use: for quickly trancekoding python source into ruby source...
# in the context of shogun anyway, it's probably not going to work too well with projects of any *real* size
# (plus, i'm hardcoding a number of things, so tough noogies!)
#
# anyway, this should be pretty interesting, as i imagine there will be a *lot* of regexes & stuff i haven't played with much before... so lets see how bad i break things!!!