An example problem from the textbook Physics for Scientists and Engineers by Serway and Jewett:
Let's solve this using Symbolism, a C# library for computer algebra and symbolic computation.
| """A library for describing and applying affine transforms to PIL images.""" | |
| import numpy as np | |
| import PIL.Image | |
| class RGBTransform(object): | |
| """A description of an affine transformation to an RGB image. | |
| This class is immutable. |
| # Simulator for depth comparison error (i.e. z-fighting) | |
| # Nathan Reed, June 2015 | |
| # Written for Python 3.4; requires numpy | |
| import math | |
| import numpy as np | |
| import optparse | |
| # Parse command-line options | |
| parser = optparse.OptionParser() |
An example problem from the textbook Physics for Scientists and Engineers by Serway and Jewett:
Let's solve this using Symbolism, a C# library for computer algebra and symbolic computation.
| command | count | num_people_using | |
|---|---|---|---|
| cd | 347893.0 | 803.0 | |
| ls | 326227.0 | 783.0 | |
| rm | 80394.0 | 744.0 | |
| git | 426701.0 | 696.0 | |
| sudo | 109042.0 | 690.0 | |
| mkdir | 22987.0 | 655.0 | |
| cat | 54491.0 | 642.0 | |
| mv | 39297.0 | 640.0 | |
| ssh | 83035.0 | 623.0 |
| def numerical(): | |
| from scipy.integrate import odeint | |
| from numpy import array | |
| # [position, mass, velocity, mass flow] | |
| def acceleration(y, t, v_exhaust=1.0): | |
| return array([y[2], y[3], v_exhaust * y[3]/y[1], 0.0]) | |
| initial_state = array([0.0, 2.0, 0.0, -1.0]) |
| import asyncio | |
| import aiohttp | |
| import bs4 | |
| import tqdm | |
| @asyncio.coroutine | |
| def get(*args, **kwargs): | |
| response = yield from aiohttp.request('GET', *args, **kwargs) | |
| return (yield from response.read_and_close(decode=True)) |
Author: Yotam Gingold
License: Public Domain (CC0)
This document is intended as a reference or introduction to JavaScript for someone familiar with a language like C/C++/Java or Python. It follows best practices and gathers the scattered wisdom from matny stackoverflow questions and in-depth JavaScript essays. It relies on no external libraries.
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| #!/usr/bin/perl | |
| use strict; | |
| use warnings FATAL => 'all'; | |
| use English qw(-no_match_vars); | |
| use Lingua::EN::Fathom; | |
| use TeX::Hyphen; | |
| use List::Util qw(min); |
| import urllib2 | |
| import re | |
| import sys | |
| from collections import defaultdict | |
| from random import random | |
| """ | |
| PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS | |
| NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE | |
| CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt" |