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
class Presentation | |
attr_accessor :description, :date, :location, :slides | |
def initialize(description = nil, date = nil, location = nil, slides = nil) | |
@description = description | |
@date = date | |
@location = location | |
@slides = slides |
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
from django.db import models | |
# an outline of a model for a course | |
# an umbrella organization (school, etc.)? | |
class AcademicSession(models.Model): | |
""" | |
A block of time (such as a semester) during which courses may be | |
offered. | |
""" |
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
% using minion pro with hanging-hz, opticals and old-style figures on mkiv | |
% engine=luatex | |
\usetypescriptfile[type-optical] | |
\usemodule[fullpage][style={margin,headings}] | |
\setupfullpage [margin=1.75in] | |
\definefontfeature |
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
# scala has elegant xml parsing baked in | |
import scala.xml._ | |
# load the xml file | |
val style = XML.loadFile("apa.csl") | |
# get the title | |
# note: while the parser is namespace-aware, it still returns a result | |
(style \\ "title").text |
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
from rdflib import Namespace | |
from rdfalchemy import rdfSubject, rdfsSubject, rdfSingle, rdfMultiple | |
from rdfalchemy.orm import mapper | |
RS = Namespace('http://vocab.org/resourcelist/schema#') | |
class List(rdfSubject): | |
rdf_type = RS['List'] | |
contains = rdfMultiple(RS.contains) | |
created = rdfSingle(RS.created) |
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
<script src="http://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
google.load("jquery", "1.3.2"); | |
google.load("jqueryui", "1.7.2"); | |
$(document).ready(function() { | |
$(function() { | |
$("#TOC").tabs(); | |
}); | |
}); |
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
\usemodule[simpleslides] | |
\usetypescriptfile[type-optical] | |
\setuplayout[textwidth=5in] | |
\definefontfeature | |
[default][default] | |
[mode=node,language=dflt,script=latn,onum=yes,tnum=yes, | |
expansion=quality,protrusion=quality] |
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
FEEDS = [ | |
"http://www3.interscience.wiley.com/rss/journal/118485807", | |
"http://phg.sagepub.com/rss/current.xml", | |
"http://www.informaworld.com/ampp/rss~content=t713446924", | |
"http://www.informaworld.com/ampp/rss~content=t788352614", | |
"http://www.envplan.com/rss.cgi?journal=D", | |
"http://www.envplan.com/rss.cgi?journal=A", | |
"http://cgj.sagepub.com/rss/current.xml" | |
] |
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
# mechanize | |
require 'rubygems' | |
require 'mechanize' | |
agent = WWW::Mechanize.new | |
page = agent.get('http://google.com/') | |
page = agent.click page.links.find { |l| l.text == 'News' } | |
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
{ | |
"http://www.vanityfair.com": { | |
"author": "span.author", | |
"title": "span#articlehed", | |
"date": "span.display-date", | |
"periodical-title": "Vanity Fair" | |
} | |
} |
OlderNewer