This document has now been incorporated into the uWSGI documentation:
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Steps with explanations to set up a server using:
| Memoization is fundamentally a top-down computation and dynamic | |
| programming is fundamentally bottom-up. In memoization, we observe | |
| that a computational *tree* can actually be represented as a | |
| computational *DAG* (the single most underrated data structure in | |
| computer science); we then use a black-box to turn the tree into a | |
| DAG. But it allows the top-down description of the problem to remain | |
| unchanged. | |
| In dynamic programming, we make the same observation, but construct | |
| the DAG from the bottom-up. That means we have to rewrite the |
| package object mail { | |
| implicit def stringToSeq(single: String): Seq[String] = Seq(single) | |
| implicit def liftToOption[T](t: T): Option[T] = Some(t) | |
| sealed abstract class MailType | |
| case object Plain extends MailType | |
| case object Rich extends MailType | |
| case object MultiPart extends MailType |
| #!perl | |
| use 5.010; | |
| use strict; | |
| use warnings; | |
| use autodie; | |
| use Benchmark qw(timethis); | |
| use List::Util qw(min); | |
| use Regexp::Common qw /balanced/; |
| my Int $i = 2 * 10 ** 20_002; | |
| my Int $sqrt = 10 ** 10_001; | |
| my Int $next_sqrt = ($i div $sqrt + $sqrt) div 2; | |
| loop { | |
| $sqrt = $next_sqrt; | |
| $next_sqrt = ($i div $sqrt + $sqrt) div 2; | |
| last if $sqrt == $next_sqrt; | |
| } |
| digraph G { | |
| subgraph cluster_1 { | |
| Rscript -> localDir; | |
| localDir -> Rscript; | |
| Rscript -> Sweave; | |
| Sweave -> TeX; | |
| TeX -> PDF [ label = "laTeX"] | |
| Rscript -> Rmarkdown; | |
| RCurl -> Rscript; |
| use strict; | |
| use warnings; | |
| use DateTime; | |
| my $dt = DateTime->new( | |
| day => 13, | |
| year => 2012, | |
| ); | |
| my $count = 0; |
| with(x, { | |
| f(z) | |
| }) | |
| # Which of the following statements is this equivalent to? | |
| # | |
| # a) x$f(x$z) | |
| # b) f(x$z) | |
| # c) x$f(z) | |
| # d) f(z) |
| (ns potato.core | |
| (:use [slingshot.slingshot :only [throw+ try+]]) | |
| (:use [clojure.string :only [trim split]])) | |
| ;; use this provide template values at write time (i.e. not compile time). | |
| ;; "name" will be the name of the template variable. "context", when not nil, | |
| ;; will be the value previously returned by *template-value* for the enclosing | |
| ;; section. | |
| (defn ^:dynamic *template-value* [name context]) |