Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Feb 4, 2011
0 parents commit c83f4ca
Show file tree
Hide file tree
Showing 37 changed files with 10,460 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
/.hg
18 changes: 18 additions & 0 deletions Makefile
@@ -0,0 +1,18 @@
OUTPUT=slides.html# slides.pdf

all: $(OUTPUT)

clean:
rm -f $(OUTPUT) slides.{snm,aux,out,log,nav,toc,latex}

slides.latex: slides.txt ui/beamerdefs.txt ui/stylesheet.latex ui/author.latex
./bin/rst2beamer.py --stylesheet=ui/stylesheet.latex --documentoptions=14pt slides.txt $@
sed -i.old 's/\\date{}/\\input{ui\/author.latex}/' $@

slides.pdf: slides.latex
pdflatex slides.latex

slides.html: slides.txt includes/*.html
rst2s5.py --theme-url ui/mochikit slides.txt $@

.PHONY: all clean
1 change: 1 addition & 0 deletions bin/README.txt
@@ -0,0 +1 @@
curl -O http://codespeak.net/svn/user/antocuni/bin/rst2beamer.py
170 changes: 170 additions & 0 deletions bin/rst2beamer.py
@@ -0,0 +1,170 @@
#!/usr/bin/env python
# encoding: utf-8
"""
A docutils script converting restructured text into Beamer-flavoured LaTeX.
Beamer is a LaTeX document class for presentations. Via this script, ReST can
be used to prepare slides. It can be called::
rst2beamer.py infile.txt > outfile.tex
where ``infile.tex`` contains the produced Beamer LaTeX.
See <http:www.agapow.net/programming/python/rst2beamer> for more details.
"""
# TODO: modifications for handout sections?
# TOOD: sections and subsections?
# TODO: enable beamer themes?
# TODO: convert document metadata to front page fields?
# TODO: toc-conversion?
# TODO: fix descriptions

# Unless otherwise stated, created by P-M Agapow on 2007-08-21
# and open for academic & non-commercial use and modification .

__docformat__ = 'restructuredtext en'
__author__ = "Paul-Michael Agapow <agapow@bbsrc.ac.uk>"
__version__ = "0.2"


### IMPORTS ###

import locale
from docutils.core import publish_cmdline, default_description
from docutils.writers.latex2e import Writer as Latex2eWriter
from docutils.writers.latex2e import LaTeXTranslator, DocumentClass
from docutils import nodes

## CONSTANTS & DEFINES: ###

BEAMER_SPEC = (
'Beamer options',
'These are derived almost entirely from the LaTeX2e options',
tuple (
[
(
'Specify theme.',
['--theme'],
{'default': '', }
),
(
'Specify document options. Multiple options can be given, '
'separated by commas. Default is "10pt,a4paper".',
['--documentoptions'],
{'default': '', }
),
] + list (Latex2eWriter.settings_spec[2][2:])
),
)

BEAMER_DEFAULTS = {
'output_encoding': 'latin-1',
'documentclass': 'beamer',
}


### IMPLEMENTATION ###

try:
locale.setlocale (locale.LC_ALL, '')
except:
pass

class BeamerTranslator (LaTeXTranslator):
"""
A converter for docutils elements to beamer-flavoured latex.
"""

def __init__ (self, document):
LaTeXTranslator.__init__ (self, document)
self.head_prefix = [x for x in self.head_prefix if ('{typearea}' not in x)]
hyperref_posn = [i for i in range (len (self.head_prefix)) if ('{hyperref}' in self.head_prefix[i])]
self.head_prefix[hyperref_posn[0]] = '\\usepackage{hyperref}\n'
self.head_prefix.extend ([
'\\definecolor{rrblitbackground}{rgb}{0.55, 0.3, 0.1}\n',
'\\newenvironment{rtbliteral}{\n',
'\\begin{ttfamily}\n',
'\\color{rrblitbackground}\n',
'}{\n',
'\\end{ttfamily}\n',
'}\n',
])
# this fixes the hardcoded section titles in docutils 0.4
self.d_class = DocumentClass ('article')

def begin_frametag (self):
return '\\begin{frame}\n'

def end_frametag (self):
return '\\end{frame}\n'

def visit_section (self, node):
if (self.section_level == 0):
self.body.append (self.begin_frametag())
LaTeXTranslator.visit_section (self, node)

def depart_section (self, node):
# Remove counter for potential subsections:
LaTeXTranslator.depart_section (self, node)
if (self.section_level == 0):
self.body.append (self.end_frametag())

def visit_title (self, node):
if (self.section_level == 1):
self.body.append ('\\frametitle{%s}\n\n' % self.encode(node.astext()))
raise nodes.SkipNode
else:
LaTeXTranslator.visit_title (self, node)

def depart_title (self, node):
if (self.section_level != 1):
LaTeXTranslator.depart_title (self, node)

def visit_literal_block(self, node):
if not self.active_table.is_open():
self.body.append('\n\n\\smallskip\n\\begin{rtbliteral}\n')
self.context.append('\\end{rtbliteral}\n\\smallskip\n\n')
else:
self.body.append('\n')
self.context.append('\n')
if (self.settings.use_verbatim_when_possible and (len(node) == 1)
# in case of a parsed-literal containing just a "**bold**" word:
and isinstance(node[0], nodes.Text)):
self.verbatim = 1
self.body.append('\\begin{verbatim}\n')
else:
self.literal_block = 1
self.insert_none_breaking_blanks = 1

def depart_literal_block(self, node):
if self.verbatim:
self.body.append('\n\\end{verbatim}\n')
self.verbatim = 0
else:
self.body.append('\n')
self.insert_none_breaking_blanks = 0
self.literal_block = 0
self.body.append(self.context.pop())


class BeamerWriter (Latex2eWriter):
"""
A docutils writer that modifies the translator and settings for beamer.
"""
settings_spec = BEAMER_SPEC
settings_defaults = BEAMER_DEFAULTS

def __init__(self):
Latex2eWriter.__init__(self)
self.translator_class = BeamerTranslator


if __name__ == '__main__':
description = (
"Generates Beamer-flavoured LaTeX for PDF-based presentations." + default_description)
publish_cmdline (writer=BeamerWriter(), description=description)


### END ######################################################################

Binary file added images/649px-Bloom_filter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/i-has-minions.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mochi_ad_sales.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sc4_pub_ss_cassandra003_copy.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/we-await-ur-instrucsions.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions includes/logo.html
@@ -0,0 +1,6 @@
<script type="text/javascript">
addLoadEvent(function () {
appendChildNodes(document.body,
DIV({id: "mochikit_logo", 'class': 'draggable'}));
});
</script>
67 changes: 67 additions & 0 deletions notes.txt
@@ -0,0 +1,67 @@
Theory:

* http://queue.acm.org/detail.cfm?id=1394128
* http://www.readwriteweb.com/archives/is_the_relational_database_doomed.php
* http://research.microsoft.com/en-us/um/people/lamport/pubs/pubs.html#paxos-simple
* http://en.wikipedia.org/wiki/Lamport_timestamps
* http://en.wikipedia.org/wiki/Vector_clocks
* http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=755678

Caching:

* http://www.danga.com/memcached/
* Invalidation is hard

Bloom filters:

* http://en.wikipedia.org/wiki/Bloom_filter
* http://www.youtube.com/watch?v=947gWqwkhu0
* http://github.com/jaybaird/python-sbf/tree/master
* http://www.eecs.harvard.edu/~kirsch/pubs/bbbf/esa06.pdf
* Bloom Filter, Scalable Bloom Filter, Counting Bloom Filter

Cassandra:

* http://code.google.com/p/the-cassandra-project/
* http://www.slideshare.net/jhammerb/data-presentations-cassandra-sigmod
* http://perspectives.mvdirona.com/2009/02/07/FacebookCassandraArchitectureAndDesign.aspx

Column Databases:

* http://hypertable.org/
* http://db.csail.mit.edu/projects/cstore/
* http://monetdb.cwi.nl/
* http://code.google.com/appengine/docs/python/datastore/

Bitmap Indexes:

* https://codeforge.lbl.gov/projects/fastbit/

Key-value stores:

* http://blog.plathome.com/2009/02/first-key-value-storage-meeting-held.html
* http://www.oracle.com/technology/products/berkeley-db/index.html
* http://tokyocabinet.sourceforge.net/
* http://code.google.com/p/redis/

Distributed Key-Value stores:

* http://opensource.plurk.com/LightCloud/
* http://www.metabrew.com/article/anti-rdbms-a-list-of-distributed-key-value-stores/
* http://delicious.com/RichardJones
* http://en.wikipedia.org/wiki/Vector_clocks
* http://en.wikipedia.org/wiki/Lamport_timestamps

Distributed Databases

* http://www.allthingsdistributed.com/2007/10/amazons_dynamo.html
* http://labs.google.com/papers/bigtable.html
* http://wiki.apache.org/hadoop/Hbase
* http://www.hypertable.org/


Document Databases:

* http://www.mongodb.org/
* http://couchdb.apache.org/
* http://code.google.com/p/thrudb/

0 comments on commit c83f4ca

Please sign in to comment.