Serve files in the current directory over HTTP:
python -m SimpleHTTPServer 8000
Start a simple SMTP server that prints messages to stdout
:
python -m smtpd -n -c DebuggingServer localhost:25
(ns montecarlopi.core | |
(require [incanter.core :refer [sqrt sq view]] | |
[incanter.charts :refer [function-plot | |
add-points | |
add-text | |
set-x-label | |
set-y-label | |
set-y-range | |
xy-plot]])) |
(ns keylistener.core | |
(:require [clojure.java.io :as io]) | |
(:import [jline.console ConsoleReader]) | |
(:gen-class)) | |
(def console (ConsoleReader.)) | |
(defn keypress-loop [] | |
(let [char (.readCharacter console)] | |
(if (not (nil? char)) |
@RunWith(JUnit4.class) | |
public class TerminalViewTest extends TicTacToeTest { | |
private final PrintStream stdout = System.out; | |
private final ByteArrayOutputStream output = new ByteArrayOutputStream(); | |
private TerminalView terminalview; | |
@Before | |
public void setUp() throws UnsupportedEncodingException { | |
terminalview = new TerminalView(); |
Serve files in the current directory over HTTP:
python -m SimpleHTTPServer 8000
Start a simple SMTP server that prints messages to stdout
:
python -m smtpd -n -c DebuggingServer localhost:25
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import animation | |
def new_figure(): | |
figure = plt.figure(122, figsize=(10.0, 5.0)) | |
figure.add_subplot(121) | |
plt.axis('equal') |
def free(exp): | |
return set(walkreduce(lambda x: isinstance(x, unicode), | |
walkfilter(lambda x: (x not in bound(exp) and | |
x != 'lambda'), | |
exp))) |
[Jasmine][jas] is an excellent framework for JavaScript testing, but I had a tough time coaxing it into cooperation with the Chrome extension I was developing. Jasmine's default testrunner uses an inline script block that listens for window.onload
to setup the test environment, but Chrome prohibits extensions from running inline code. Alas, it's not as easy as importing the inline code as a separate file. After a little tinkering, this is what I came up with:
Extension
├── html
├── js
├── manifest.json
└── tests
├── jasmine
│ └── lib
│ └── jasmine-1.2.0