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
Program Quicksort; | |
{ | |
My first Pascal code. | |
Populates and array numbers of length N with random numbers between 1 and M, sorts it in place using quicksort, then prints each element of the list. | |
The quicksort algorithm is translate from C as found in "The Most Beautiful Code I Never Wrote" by Jon Bentley as found in the book "Beautiful Code" | |
} | |
Uses math; | |
Const |
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
require 'redcarpet' | |
class CustomRenderHTML < Redcarpet::Render::HTML | |
def initialize(args) | |
@link_prefix = args[:link_prefix] || '' | |
super | |
end | |
def link(link, title, content) | |
link = @link_prefix + link unless link.start_with? 'http' |
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 FlexibleInstances #-} | |
-- From exercise 2.40 in Algebra of Programming (Bird, 1997) | |
data TreeF a b = Leaf a | Branch b b | |
newtype Mu f = InF { outF :: f (Mu f) } | |
type Tree a = Mu (TreeF a) |
OlderNewer