Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
import pandas as pd | |
import numpy as np | |
def get_dataset(size): | |
# Create Fake Dataset | |
df = pd.DataFrame() | |
df['size'] = np.random.choice(['big','medium','small'], size) | |
df['age'] = np.random.randint(1, 50, size) | |
df['team'] = np.random.choice(['red','blue','yellow','green'], size) | |
df['win'] = np.random.choice(['yes','no'], size) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
<p class="results"></p> | |
<ol> | |
<li> | |
<p>Name: Alabama</p> | |
<p>Capital Name: Montgomery</p> | |
<p>Capital Latitude: 32.361538</p> | |
<p>Capital Longitude: -86.279118</p> | |
</li> | |
<li> | |
<p>Name: Alaska</p> |
/** Vertical Align element **/ | |
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); | |
} |
function distance(lat1,lon1,lat2,lon2) { | |
var R = 6371; // km (change this constant to get miles) | |
var dLat = (lat2-lat1) * Math.PI / 180; | |
var dLon = (lon2-lon1) * Math.PI / 180; | |
var a = Math.sin(dLat/2) * Math.sin(dLat/2) + | |
Math.cos(lat1 * Math.PI / 180 ) * Math.cos(lat2 * Math.PI / 180 ) * | |
Math.sin(dLon/2) * Math.sin(dLon/2); | |
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); | |
var d = R * c; | |
if (d>1) return Math.round(d)+"km"; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Queueing Asynchronous Functions in JavaScript</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script type="text/javascript" src="queue.js"></script> | |
</head> | |
<body> | |
<p><input type="button" id="process-button" value="Process Queue" /></p> | |
<div id="output"></div> |
function Queue() { | |
this.reset(); | |
} | |
Queue.prototype.dequeue = function () { | |
if (this.empty() !== true) { | |
this.length -= 1; | |
return this.items.shift(); | |
} | |
return undefined; |
if (!window.console) { | |
(function() { | |
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", | |
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; | |
window.console = {}; | |
for (var i = 0; i < names.length; ++i) { | |
window.console[names[i]] = function() {}; | |
} | |
}()); | |
} |