Skip to content

Instantly share code, notes, and snippets.

View etrepum's full-sized avatar
😎
Currently retired

Bob Ippolito etrepum

😎
Currently retired
View GitHub Profile
@etrepum
etrepum / QSort1.hs
Last active January 3, 2016 09:59
First pass at Haskell port of glibc qsort.c
module QSort1 ( qsort, quicksort, main, prop_qsort ) where
-- Ported from glibc's qsort.c
-- Copyright (C) 1991-2014 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
-- Written by Douglas C. Schmidt (schmidt@ics.uci.edu).
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Douglas C. Schmidt (schmidt@ics.uci.edu).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,

Mission Bit is a local 501(c)(3) non-profit that is providing an after school coding class for public school students. Classes are from ~4pm-6pm Monday/Wednesday or Tuesday/Thursday depending on which course it is. I'm a lead instructor for one of the courses and I'm also a board member. I'm looking forward to working with you all here at CoderDojo but maybe also at Mission Bit! :)

The survey for scheduling assistant instructors is here: :pencil: https://missionbit.wufoo.com/forms/mission-bit-spring-2014-teacher-scheduling/

All high school classes begin the week of February 3 and run through May 15.

  • 'Intro to Computer Programming', Tuesdays and Thursday from 4pm - 6pm at Lick Wilmerding High School, 755 Ocean Ave. The course curriculum will be a revised version of the Fall 'Intro' class and focus on HTML5, CSS3 and Javascript. The lead instructor will be me (@etrepum / :octocat: etrepum).

  • 'Intro to Computer Pro

@etrepum
etrepum / unpack.erl
Created January 13, 2014 20:01
Example of Erlang's native binary matching syntax, using the example from sacker.py https://github.com/shamrin/pyxtf/blob/master/sacker.py The `1>`, `2>` are interpreter prompts, like Python's `>>>`.
1> <<16#ff:16/little, Data:4/binary, _:4/binary, Byte, Rest/binary>> = <<"\xff\x00DATA1234\x10something else">>.
<<255,0,68,65,84,65,49,50,51,52,16,115,111,109,101,116,
104,105,110,103,32,101,108,115,101>>
2> Data.
<<"DATA">>
3> Byte.
16
4> Rest.
<<"something else">>
@etrepum
etrepum / gist:8366874
Created January 11, 2014 04:05
Exercism rust exercises
$ ./test/rust/check-exercises.sh
anagram.rs:5:5: 5:16 error: unresolved import: there is no `sort` in `extra`
anagram.rs:5 use extra::sort;
^~~~~~~~~~~
anagram.rs:5:5: 5:16 error: failed to resolve import `extra::sort`
anagram.rs:5 use extra::sort;
^~~~~~~~~~~
error: aborting due to 2 previous errors
task 'rustc' failed at 'explicit failure', /private/tmp/rust-R5p2/rust-0.9/src/libsyntax/diagnostic.rs:75
task '<main>' failed at 'explicit failure', /private/tmp/rust-R5p2/rust-0.9/src/librustc/lib.rs:453
@etrepum
etrepum / gist:8366444
Created January 11, 2014 03:00
Gee thanks Homebrew Python 2.7.3, I really appreciate how you completely ignore --prefix.
[bob@res ipython-src ((9c922f5...))]$ python setup.py install --prefix=$HOME/.ihaskell/ipython
============================================================================
BUILDING IPYTHON
python: 2.7.3 (default, Nov 10 2012, 13:35:56) [GCC 4.2.1
Compatible Apple Clang 4.1
((tags/Apple/clang-421.11.66))]
platform: darwin
OPTIONAL DEPENDENCIES
sphinx: 1.1.3
@etrepum
etrepum / gist:8359367
Created January 10, 2014 18:04
Prelude IO functions that act on stdin/stdout
$ echo ':browse Prelude' | ghci | grep '\(::\|->\) IO ' | grep -v '\(FilePath\|IOError\)'
getChar :: IO Char
getContents :: IO String
getLine :: IO String
interact :: (String -> String) -> IO ()
print :: Show a => a -> IO ()
putChar :: Char -> IO ()
putStr :: String -> IO ()
putStrLn :: String -> IO ()
readIO :: Read a => String -> IO a
module MergeSort (mergeSort) where
-- | Bottom-up merge sort.
mergeSort :: Ord a => [a] -> [a]
mergeSort = mergeAll . map (:[])
where
mergeAll [] = []
mergeAll [xs] = xs
mergeAll xss = mergeAll (mergePairs xss)
mergePairs (a:b:xs) =
diff -rN -u old-ThreadScope/GUI/SaveAs.hs new-ThreadScope/GUI/SaveAs.hs
--- old-ThreadScope/GUI/SaveAs.hs 2014-01-09 10:55:58.000000000 -0800
+++ new-ThreadScope/GUI/SaveAs.hs 2014-01-09 10:55:58.000000000 -0800
@@ -10,6 +10,20 @@
-- Imports for GTK
import Graphics.UI.Gtk
import Graphics.Rendering.Cairo
+ ( Render
+ , Operator(..)
+ , Format(..)
@etrepum
etrepum / .gitignore
Last active January 2, 2016 13:48
Haskell Control.Concurrent client
.cabal-sandbox
dist
cabal.sandbox.config
client
server
*.hi
*.o