Couldn't find the text of this for a while...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/nfnt/resize" | |
"image" | |
"image/color" | |
_ "image/gif" | |
_ "image/jpeg" | |
_ "image/png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# This code snippet shows how to enable SSL in Sinatra+Thin. | |
# | |
require 'sinatra' | |
require 'thin' | |
class MyThinBackend < ::Thin::Backends::TcpServer | |
def initialize(host, port, options) |
Edward Snowden answered questions after a showing of CITIZENFOUR at the IETF93 meeting; this is a transcript of the video recording.
For more information, see the Internet Society article.
Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def convex_hull_graham(points): | |
''' | |
Returns points on convex hull in CCW order according to Graham's scan algorithm. | |
By Tom Switzer <thomas.switzer@gmail.com>. | |
''' | |
TURN_LEFT, TURN_RIGHT, TURN_NONE = (1, -1, 0) | |
def cmp(a, b): | |
return (a > b) - (a < b) |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sage.all import * | |
import itertools | |
# display matrix picture with 0 and X | |
# references: https://github.com/mimoo/RSA-and-LLL-attacks/blob/master/boneh_durfee.sage | |
def matrix_overview(BB, bound): | |
for ii in range(BB.dimensions()[0]): | |
a = ('%02d ' % ii) | |
for jj in range(BB.dimensions()[1]): | |
a += ' ' if BB[ii,jj] == 0 else 'X' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
CRC is affine. | |
CRC(x) = L(x) + C, where L is linear. | |
We want CRC(x) = L(x) + C = x. | |
Write as L(x)+x = C. | |
Solve matrix equation. | |
''' | |
from sage.all import * |
OlderNewer