Lovelace, Ada Augusta (1842) "Notes on the Analytical Engine"
Aiken, Howard (1937) "Proposed Automatic Calculating Machine"
#!/bin/sed -rf | |
# How to run: | |
# echo 'A A<1+B1-C>B<1-A1+B>D<1-B1qC> 0<0>0' | |
# Note: Your local sed may use a different flag for "extended" regexes; this is written for GNU sed. | |
# | |
# tape: [active-state] " " (state-name "<" (write move next-state)_0 (write move next-state)_1 ">")* " " tape... "<" curpos ">" tape... | |
# State names can be any character not in " <>". | |
# The tape consists of 0's and 1's. | |
# The "move" field can be "-" to move left, "+" to move right, or "q" to halt. |
// add to Preferences > Key Bindings - User | |
// see http://stackoverflow.com/a/26619524 for context | |
{ "keys": ["tab"], "command": "expand_abbreviation_by_tab", | |
"context": [ | |
{ | |
"operand": "source.js", | |
"operator": "equal", | |
"match_all": true, | |
"key": "selector" |
import code; code.interact(local=dict(globals(), **locals())) |
Php fpm is the new way to setup php to run with your webserver. Php-fpm is a fastcgi process manager for php that is totally separate from the webserver. The webserver communicates with fpm through a socket and passes the name of the script to execute. So fpm can run with any web server that is fastcgi compatible.
I recently moved from my old shared hosting to linode. Linode provides linux vps hosting at economic prices. However the servers are totally unmanaged are just raw linux machines that have shell access. So through the shell you have to setup everything including the web server, php and the web files.
So this time I decided to go with the combination of nginx and php-fpm. I had multiple sites to setup on this new webserver. Nginx deals with these through separate server blocks (aka vhost in apache). However there was another thing needed. Php on each site should run with its own user and not the nginx common user named www-data.
Running each site with its own uid/gid is more secure and
pfSsh.php playback disablereferercheck |
from flask import Flask, render_template, request | |
import os , shelve , atexit , threading , urllib2 , time | |
app = Flask(__name__) | |
poll_data = { | |
'question' : 'You agree that the Brazilian internet should be stapled?', | |
'fields': ['Yes', 'No'] | |
} | |
db = shelve.open("votes.db",writeback=True) |
The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.
With ffmpeg
this can be achieved with -c copy
. Older examples may use -vcodec copy -acodec copy
which does the same thing.
These examples assume ffmpeg
is in your PATH
. If not just substitute with the full path to your ffmpeg binary.
<script> | |
const arrayDays = [] | |
for (let i = {{ firstDay }}; i <= {{ lastDay }}; i++) { | |
arrayDays.push(i); | |
} | |
let arrayIndex = 0; | |
$('.up-arrow').click(function(){ | |
if (arrayIndex === 0) { | |
arrayIndex = arrayDays.length-1 | |
} else { |