Skip to content

Instantly share code, notes, and snippets.

\usemodule[simpleslides]
\setupTitle
[title={Title of the presentation},
author={Author of the presentation},
date={date of the presentation}]
\starttext
\placeTitle
% This file is a solution template for:
% - Giving a talk on some subject.
% - The talk is between 15min and 45min long.
% This is adapted from the example by Till Tantau <tantau@users.sourceforge.net>
% included as part of the beamer package in LaTeX
%
% In principle, this file can be redistributed and/or modified under
% the terms of the GNU Public License, version 2.
\startmessages english library: floatblocks
12: To be drawn
\stopmessages
import Data.Teams.Structure
x = mkNonReward "x"
x' = mkNonReward "x'"
y = mkNonReward "y"
m = mkNonReward "m"
r = mkReward "r"
f = mkDynamics "f"
c = mkControl "c"
@adityam
adityam / gist:856072
Created March 5, 2011 03:26
Josephus problem
import Data.Sequence as Seq
import System.Environment
survivor :: Int -> [a] -> a
survivor k soldiers = viewnext k (Seq.fromList soldiers)
where
viewnext l list = killnext l (Seq.viewl list)
killnext l (x:<xs) | Seq.null xs = x
| l == 1 = viewnext k xs
| otherwise = viewnext (l-1) (xs|>x)
@adityam
adityam / mkiv-export.css
Created May 30, 2011 03:19
CSS file for ConTeXt XHTML export
/*
author : Hans Hagen, PRAGMA-ADE, Hasselt NL
copyright : PRAGMA ADE / ConTeXt Development Team
license : see context related readme files
comment : companion to cld-mkiv-export.xml
*/
document:before {
@adityam
adityam / test-xii.xhtml
Created May 30, 2011 03:42
Output of xii.tex
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!-- input filename : test-xii -->
<!-- processing date : Sun May 29 23:40:03 2011 -->
<!-- context version : 2011.05.18 22:26 -->
<!-- exporter version : 0.20 -->
<?xml-stylesheet type="text/css" href="mkiv-export.css"?>
<document xmlns:m="http://www.w3.org/1998/Math/MathML" version="0.20" language="en" date="Sun May 29 23:40:03 2011" file="test-xii" context="2011.05.18 22:26" xmlns:xhtml="http://www.w3.org/1999/xhtml">
@adityam
adityam / meta-imp-hooks.mkiv
Created November 19, 2011 20:10
ConTeXt module for drawing hooked lines
\unprotect
% Override default value in pack-fen.mkiv
\def\setinstalledframedimensions
{\edef\overlaywidth {\the\frameddimenwd\space}%
\edef\overlayheight{\the\dimexpr\frameddimenht+\frameddimendp\relax\space}%
\edef\overlaydepth {\the\frameddimendp\space}%
\edef\overlaycolor {\framedparameter\c!backgroundcolor}%
\edef\overlaylinecolor{\framedparameter\c!framecolor}%
\edef\overlaylinewidth{\the\ruledlinewidth}}
@adityam
adityam / gist:1431606
Created December 4, 2011 23:15
HTML entities
cups ∪︀ cup
b.rhov 𝛠 not defined
loplus ⨭ not defined
notinvb ⋷ not defined
boxplus ⊞ boxplus
DoubleLongLeftRightArrow ⟺ Longleftrightarrow
szlig ß ssharp
xoplus ⨁ bigoplus
ensp   enspace
upharpoonleft ↿ upharpoonleft
@adityam
adityam / t-irex.tex
Created February 22, 2012 19:02
Style of IREX 1000
\startmodule irex
%D Paper Size
\definepapersize[irexpaper][height=8in,width=6.25in]
\setuppapersize[irexpaper][irexpaper]
%D Layout
\setuplayout