Permalink
Browse files

much-needed revamp

  • Loading branch information...
1 parent 96200f4 commit b1d7525aae18afeb47b463f5c34dacd1fec398cb @earldouglas committed Jul 9, 2012
View
@@ -1 +0,0 @@
-earldouglas.com
@@ -3,7 +3,7 @@
<html>
<head><title>Function Memoization in Scala and Haskell</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" type="text/css" href="/style.css">
+<link rel="stylesheet" type="text/css" href="style.css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
</head>
<body>
File renamed without changes.
View
@@ -4,28 +4,110 @@
<head>
<title>James Earl Douglas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <link rel="stylesheet" type="text/css" href="/style.css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
+ <style type="text/css">
+
+ body { font-family: Arial; }
+ a { text-decoration: none; color: #00f; }
+ a:hover { color: #f00; }
+
+ h1.title { text-align: center; margin-bottom: 0px; }
+
+ ul.nav { text-align: center; list-style: none; position: relative; padding: 0px; }
+ ul.nav li { display: inline; margin: 0 10px 10px 10px; }
+
+ div.sections { width: 600px; margin: 40px auto auto auto; }
+ div.sections div { margin: 10px; }
+ div.sections span { display: block; }
+ div.sections ul { list-style: none; padding: 0px; }
+ div.sections li { margin-bottom: 20px; white-space: nowrap; }
+
+ </style>
</head>
<body>
- <h1 align="center" style="margin-bottom: 12px;">James Earl Douglas</h1>
- <div align="center">
- <span style="margin: 10px"><a href="mailto:james@earldouglas.com">email</a></span>
- <span style="margin: 10px"><a href="https://github.com/JamesEarlDouglas">github</a></span>
- <span style="margin: 10px"><a href="feed/">rss</a></span>
- </div>
- <div style="width: 700px; margin-left: auto; margin-right: auto;">
- <h2>Selected work</h2>
- <ul class="clean">
- <li><a href="http://earldouglas.com/monadic-parsing-in-haskell-maybe/">Monadic Parsing in Haskell (Maybe)</a><div>Feb 18, 2012</div></li>
- <li><a href="http://earldouglas.com/function-memoization-in-scala-and-haskell/">Function Memoization in Scala and Haskell</a><div>Feb 6, 2012</div></li>
- <li><a href="base-201111/">Fruit: Functional Reactive UI Thing</a><div>Bay Area Scala Enthusiasts, Mountain View, Nov 14, 2011<div></li>
- <li><a href="cw2011/">Swarm: Transparent Scalability through Portable Continuations</a><div>ACM SIGPLAN Continuation Workshop, Tokyo, Sep 24, 2011</div></li>
- <li><a href="http://earldouglas.com/suspendable-recursion-with-scala-continuations/">Suspendable Recursion with Scala Continuations</a><div>Sep 16, 2011</div></li>
- <li><a href="base-201109/">Swarm: Transparent Scalability</a><div>Bay Area Scala Enthusiasts, Mountain View, Sep 12, 2011</div></li>
- <li><a href="publications/20090529-secure-collaborative-envrionment.pdf">Secure Collaborative Environment</a><div>US Patent, May 29, 2009</div></li>
- <li><a href="publications/20070115-data-format-variability.pdf">Impacts of Data Format Variability on Environmental Visual Analysis Systems</a><div>AMS 16th Conference on Applied Climatology Jan 14, 2007</div></li>
- </ul>
+
+ <h1 class="title">James Earl Douglas</h1>
+
+ <ul class="nav">
+ <li><a href="mailto:james@earldouglas.com">email</a></li>
+ <li><a href="https://github.com/JamesEarlDouglas">github</a></li>
+ <li><a href="http://twitter.com/jearldouglas">twitter</a></li>
+ <li><a href="feed/">rss</a></li>
+ </ul>
+
+ <div class="sections">
+ <div>
+ <h2>Presentations</h2>
+ <ul>
+ <li>
+ <a href="http://jamesearldouglas.github.com/imperatively/base-20120709/">Imperative Web workflows via delimited continuations</a>
+ <span>July 9, 2012, Bay Area Scala Enthusiasts, Palo Alto</span>
+ </li>
+ <li>
+ <a href="http://jamesearldouglas.github.com/fruit/base-201111/">Fruit: Functional Reactive UI Thing</a>
+ <span>November 14, 2100, Bay Area Scala Enthusiasts, Mountain View<span>
+ </li>
+ <li>
+ <a href="http://jamesearldouglas.github.com/Swarm/cw-2011/">Swarm: Transparent Scalability through Portable Continuations</a>
+ <span>September 24, 2011, ACM SIGPLAN Continuation Workshop, Tokyo</span>
+ </li>
+ <li>
+ <a href="http://jamesearldouglas.github.com/Swarm/base-201109/">Swarm: Transparent Scalability</a>
+ <span>September 12, 2011, Bay Area Scala Enthusiasts, Mountain View</span>
+ </li>
+ </ul>
+ </div>
+
+ <div>
+ <h2>Publications</h2>
+ <ul>
+ <li>
+ <a href="publications/20090529-secure-collaborative-envrionment.pdf">Secure Collaborative Environment</a>
+ <span>May 29, 2009, US Patent</span>
+ </li>
+ <li>
+ <a href="publications/20070115-data-format-variability.pdf">Impacts of Data Format Variability on Environmental Visual Analysis Systems</a>
+ <span>AMS 16th Conference on Applied Climatology Jan 14, 2007</span>
+ </li>
+ </ul>
+ </div>
+
+ <div>
+ <h2>Projects</h2>
+ <ul>
+ <li>
+ <a href="https://github.com/JamesEarlDouglas/Swarm">Swarm</a>
+ <span>Transparent scalability through portable delimited continuations</span>
+ </li>
+ <li>
+ <a href="https://github.com/JamesEarlDouglas/funtinuations">funtinuations</a>
+ <span>A playground for Scala delimited continuations</span>
+ </li>
+ <li>
+ <a href="https://github.com/JamesEarlDouglas/imperatively">Imperatively</a>
+ <span>Imperative Web workflows via delimited continuations</span>
+ </li>
+ <li>
+ <a href="https://github.com/JamesEarlDouglas/fruit">fruit</a>
+ <span>Functional Reactive UI Thing</span>
+ </li>
+ </ul>
+ </div>
+
+ <div>
+ <h2>Articles</h2>
+ <ul>
+ <li>
+ <a href="/monadic-parsing-in-haskell-maybe/">Monadic Parsing in Haskell (Maybe)</a>
+ <span>February 18, 2012</span>
+ </li>
+ <li>
+ <a href="/function-memoization-in-scala-and-haskell/">Function Memoization in Scala and Haskell</a>
+ <span>February 6, 2012</span>
+ </li>
+ </ul>
+ </div>
+
</div>
</body>
</html>
@@ -3,7 +3,7 @@
<html>
<head><title>Monadic Parsing in Haskell (Maybe)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" type="text/css" href="/style.css">
+<link rel="stylesheet" type="text/css" href="style.css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
</head>
<body>
@@ -0,0 +1,28 @@
+a { text-decoration: none; color: #00f; }
+a:hover { color: #f00; }
+body { padding: 0 12px 0 12px; }
+
+div.breakout,
+div.date { margin-bottom: 18px; }
+
+div.breakout { font-style: italic; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; }
+
+div.figure { margin: 6px 6px 24px 6px; }
+div.figure div { margin: 6px; }
+
+div.quote, pre { border-left: 1px solid #ccc; padding-left: 18px; margin: 18px; }
+
+div.quote { font-style: italic; }
+pre { font-family: monospace; }
+
+li { margin-top: 6px; margin-bottom: 12px; }
+p { text-align: justify; margin: 12px 0 12px 0; }
+
+table { border-width: 0px; border-collapse: collapse; }
+th, td { padding: 3px 12px 3px 12px; }
+th { background-color: #eee; }
+
+pre, tt { font-size: 13px; }
+tt { font-family: monospace; }
+ul.clean { list-style-type: none; padding: 0px; }
+
@@ -1,89 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head><title>Suspendable Recursion with Scala Continuations</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" type="text/css" href="/style.css">
-<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
-</head>
-<body>
-<p><a href="/">home</a>
-<h1>Suspendable Recursion with Scala Continuations</h1>
-<div class="date">16 Sep 2011</div>
-
-<p>Consider the following recursive Pi estimation method:
-
-<pre>
-def pi(n: Int = 0): Double =
- 4 * math.pow(-1, n) / (2 * n + 1) + pi(n + 1)
-</pre>
-
-<p>Having no defined end, this method won't do much aside from heating up the CPU until it eventually blows the stack. Sometimes it can be useful to peek into the progress of such a recursive method, which can be done by suspending it in a continuation.
-
-<pre>
-def pi(n: Int = 0): Double @dd =
- 4 * math.pow(-1, n) / (2 * n + 1) + suspend(pi(n + 1))
-</pre>
-
-<p>Here, the <tt>suspend</tt> function takes the rest of the execution, which includes the recursive call(s) to <tt>pi</tt>, and puts it off to the side as a continuation. Meanwhile, the current estimate of Pi is returned by the <tt>pi</tt> function. Resuming the continuation will refine the estimate of Pi by one iteration, and again sidebar the next recursive call to <tt>pi</tt>. The <tt>@dd</tt> annotation is simply an alias for the otherwise wordy <tt>@cpsParam[Double, Double]</tt>.
-
-<p>This behavior is accessed via the <tt>calc()</tt> function in the following object:
-
-<pre>
-import scala.util.continuations._
-
-object InterrupterJones {
-
- type dd = cpsParam[Double, Double]
-
- def calc() = reset(next())
-
- private var next: () =&gt; Double @dd =
- () =&gt; pi()
-
- private def pi(n: Int = 0): Double @dd =
- 4 * math.pow(-1, n) / (2 * n + 1) + suspend(pi(n + 1))
-
- private def suspend(f: =&gt; Double @dd): Double @dd =
- shift { k: (Double =&gt; Double) =&gt;
- val curr = k(0.0)
- next = () =&gt; curr + f
- curr
- }
-}
-</pre>
-
-An example interaction looks something like this:
-
-<pre>
-$ scala -P:continuations:enable
-Welcome to Scala version 2.9.1.final (OpenJDK Server VM, Java 1.6.0_22).
-Type in expressions to have them evaluated.
-Type :help for more information.
-
-scala&gt; :load InterrupterJones.scala
-Loading InterrupterJones.scala...
-import scala.util.continuations._
-defined module InterrupterJones
-
-scala&gt; InterrupterJones.calc()
-res0: Double = 4.0
-
-scala&gt; InterrupterJones.calc()
-res1: Double = 2.666666666666667
-
-scala&gt; InterrupterJones.calc()
-res2: Double = 3.466666666666667
-
-scala&gt; InterrupterJones.calc()
-res3: Double = 2.8952380952380956
-</pre>
-
-<p>Each call to <tt>calc()</tt> iterates the recursive <tt>pi</tt> function once, slightly improving the estimate of Pi, and updating the continuation to be run upon the next call to <tt>calc()</tt>. Furthermore, the <tt>pi</tt> function can now be called repeatedly without worrying about a stack overflow:
-
-<pre>
-scala&gt; (1 to 1000000).map(_ =&gt; InterrupterJones.calc()).reverse.head
-res4: Double = 3.1415916535937742
-</pre>
-</body>
-</html>

0 comments on commit b1d7525

Please sign in to comment.