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
\usepackage{algorithm} | |
\usepackage{algorithmic} | |
\usepackage{amssymb} | |
\algsetup{indent=2em} | |
\newcommand{\factorial}{\ensuremath{\mbox{\sc Factorial}}} | |
\newcommand{\emit}{\ensuremath{\mbox{\sc Emit}}} | |
\begin{algorithm}[h!] \caption{$\factorial(n)$}\label{alg:factorial} \begin{algorithmic}[1] | |
\REQUIRE An integer $n \geq 0$. \ENSURE The value of $n!$. |
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: http://devoracles.com/the-best-method-to-check-for-internet-explorer-in-javascript | |
"I declared a new variable, called IE, which has the value a comment block followed by ‘false‘. | |
The above variable will be understood by IE: var IE = !false, because Internet Explorer uses | |
JScript — a Javascript-like dialect of the standard ECMAScript — instead of Javascript which is | |
used by all the other browsers. JScript can parse the comments, just like Internet Explorer (see | |
conditional HTML comments post). This is a unique feature of IE, none of the other browsers can do it, | |
so Firefox, Chrome, Safari, Opera, all will understand the above declaration as IE = false." | |
*/ |
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
soca = ($) -> | |
app = $.sammy '#container', () -> | |
this.use 'Couch', 'st' | |
this.get '#/', (ctx) -> | |
# do something with ctx | |
$ () -> | |
app.run('#/') | |
soca jQuery |
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
Starting CouchDB... | |
Eshell V5.7.5 (abort with ^G) | |
1> Apache CouchDB 1.0.1 (LogLevel=info) is starting. | |
1> [error] [<0.105.0>] {error_report,<0.35.0>, | |
{<0.105.0>,crash_report, | |
[[{initial_call,{mochiweb_socket_server,init,['Argument__1']}}, | |
{pid,<0.105.0>}, | |
{registered_name,[]}, | |
{error_info,{exit,eaddrinuse, | |
[{gen_server,init_it,6}, |
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
<!-- Run the application using "mvn jetty:run" --> | |
<plugin> | |
<groupId>org.mortbay.jetty</groupId> | |
<artifactId>maven-jetty-plugin</artifactId> | |
<version>6.1.9</version> | |
<configuration> | |
<scanIntervalSeconds>5</scanIntervalSeconds> | |
<contextPath>/</contextPath> | |
<connectors> | |
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> |
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
# a messy hack written by Edd Dumbill. http://twitter.com/edd | |
# You may need to rerun this script if you hit a Twitter Error because you | |
# use up API rate limiting. That's why we pickle the results, so we can resume | |
# where we left off. | |
# get the twitter module using 'easy_install twitter' | |
from twitter.api import Twitter, TwitterError | |
from twitter.oauth import OAuth |
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
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView | |
{ | |
if(_reachedEndOfFeed) return; | |
if(!_dynamicFeed) return; | |
DLog(); | |
if (!reloading) | |
{ | |
checkForRefresh = YES; // only check offset when dragging | |
} |
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
var _ = require('underscore')._, | |
events = require('events'); | |
var Actor = function Actor(object) { | |
var postman = new events.EventEmitter(), | |
mailbox = [], | |
that = this, | |
monitor = function monitor() { | |
var data = mailbox.shift(); | |
if (data) { |
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
// Scraping Made Easy with jQuery and SelectorGadget | |
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
// by David Trejo | |
// | |
// Install node.js and npm: | |
// http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
// Then run | |
// npm install jsdom jquery http-agent | |
// node numresults.js | |
// |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>{PageTitle}</title> | |
<link rel="icon" href="/images/favicon.png" type="image/x-png"/> | |
<style type="text/css"> | |
* {border:0;padding:0;margin:0;} | |
img {border:0;} |