Open python
python
and type
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1g 7 Apr 2014'
// A cute hack demonstrating one (weird?) way of doing optional | |
// parameters in Go. | |
// | |
// Please don't write code like this. It is fun code, though. | |
// | |
// Output: (see it live at golang.org) | |
// | |
// I like cheese. | |
// Do you like cheese too? | |
// I DO! |
var http = require('http'), // intentionally using http to connect to https | |
options = { | |
host: 'localhost', | |
port: 4443, | |
path: '/ping', | |
}; | |
function pingLoop() { | |
http.get(options, function (res) { | |
console.assert(false, "server should never accept http over https"); |
DON'T JUST COPY AND PASTE | |
YOUR USB DRIVE MAY NOT BE /dev/sdd AND THIS WILL ERASE IT | |
$ df -h | |
Filesystem Size Used Avail Use% Mounted on | |
/dev/sda7 7.4G 3.9G 3.2G 56% / | |
none 3.9G 720K 3.9G 1% /dev | |
none 3.9G 704K 3.9G 1% /dev/shm | |
none 3.9G 96K 3.9G 1% /var/run | |
none 3.9G 0 3.9G 0% /var/lock |
-- http://stackoverflow.com/questions/1124603/grouped-limit-in-postgresql-show-the-first-n-rows-for-each-group | |
-- http://www.postgresql.jp/document/9.2/html/tutorial-window.html | |
CREATE TABLE empsalary ( | |
depname varchar(10) not null | |
, empno integer not null | |
, salary integer not null | |
); | |
INSERT INTO empsalary (depname, empno, salary) VALUES ('develop', 11, 5200); |
# Thee will be more information here when I share the entire problem space I'm working on, but | |
# in short, this is preview material for my second talk in a series called "What Computer Scientists Know". | |
# The first talk is on recursion, and goes through several examples., leading up to a problem based | |
# on a simple puzzle that initial estimates based on performance of a previous puzzle would take years | |
# to solve on modern computers with the techniques shown in Ruby. That sets the stage for improving the | |
# performance of that problem with threading, concurrency, and related tuning. | |
# | |
# The second talk is on threading and concurrency, touching on algorithmic performance as well. | |
# Using some knowledge of the problem (board symmetry, illegal moves, etc), we reduce the problem space | |
# to about .5% of what we initially thought it was. Still, the initial single threaded solution took more |
http{ | |
index index.html; | |
server { | |
listen 80; | |
root /gocode/src/personalwebsiteapp; | |
server_name personal-website.com; |
start = Time.now | |
loop { | |
elapsed = Time.now - start | |
puts "#{(elapsed/60).round}m:#{(elapsed%60).round}s" | |
sleep 1 | |
} |
Open python
python
and type
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1g 7 Apr 2014'
// The player | |
var player = netflix.cadmium.objects.videoPlayer(); | |
// Metadata about current episode -- ID and url to get frame at a specific time | |
var episodeId = netflix.cadmium.metadata.getActiveVideo().episodeId; | |
var imgRoot = netflix.cadmium.metadata.getActiveVideo().progressImageRoot; | |
// Generates URL of preview image for given timestamp | |
function getFrame(timestamp) { | |
var t = Math.floor(timestamp/10000).toString(10); |