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
# Solves the SEND + MORE = MONEY letter substituion puzzle as a constraint satisfaction problem using backtracking search, | |
# searching variables (letters) in the least constrained ordering and values (digits) in the most constrained ordering, | |
# making the algorithm thousands of times faster. | |
from pprint import pprint | |
s1 = 'send' | |
s2 = 'more' | |
s3 = 'money' |
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
{ | |
"info": { | |
"name": "Web Speech API Specification", | |
"subsection_number": null, | |
"subsection_name": null, | |
"url": "https://w3c.github.io/speech-api/webspeechapi.html" | |
}, | |
"features": [ | |
"SpeechRecognition", | |
"SpeechRecognitionAlternative", |
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
#include <stdio.h> | |
#include <setjmp.h> | |
#include <signal.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/time.h> | |
#define SECOND 1000000 | |
#define STACK_SIZE 4096 |
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
/* Badly Coded Print Server BCLPR, a product of Badly Coded, Inc. */ | |
/* Change log: */ | |
/* Version 1.4, released 10/ 6/2014 */ | |
/* Version 1.3, released 9/29/2014 */ | |
/* Version 1.2, released 9/22/2014 */ | |
/* Version 1.1, released 9/15/2014 */ | |
/* Version 1.0, released 9/ 9/2014 */ |
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
.file "foo.c" | |
.section .rodata | |
.align 8 | |
.LC0: | |
.string "%s should get paid %.3f because %s.\n" | |
.text | |
.globl write_check | |
.type write_check, @function | |
write_check: | |
.LFB0: |
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
/* Badly Coded Text Editor BCVI, a product of Badly Coded, Inc. */ | |
/* This is an example insecure program for CSci 5271 only: don't copy | |
code from here to any program that is supposed to work | |
correctly! */ | |
/* version 1.0 was for exploits due 9/15/2017 */ | |
/* This is version 1.1, for exploits due 9/22/2017. */ | |
long bcvi_version = 110; /* 1.1 */ |
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
/* | |
Here’s a function that’s intended to reverse the order of a subsequence of integers within an | |
array. For instance suppose the array a originally contains the integers 1 2 3 4 5 6 7 8 9. If | |
you call reverse_range(a, 2, 5), the afterwards the array a will contain the same integers but | |
with the ones in positions 2 through 5 (counting from zero) in the opposite order. I.e., a will be 1 | |
2 6 5 4 3 7 8 9. | |
Unfortunately you’ll see that this function was not implemented very carefully. | |
*/ | |
/* |
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
import unittest | |
import requests | |
from io import BytesIO | |
print(requests.__file__) | |
class TestIterLines(unittest.TestCase): | |
def iter_lines_response(self, chunk_size, delimiter=None): | |
response = requests.Response() |
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
2.4.1 :009 > PackageManager::Rubygems.update "split" | |
ETHON: performed EASY effective_url=https://rubygems.org/api/v1/gems/split.json response_code=200 return_code=ok total_time=0.186102 | |
HTTP Cache: [GET /api/v1/gems/split.json] miss, store | |
Saving split | |
Project Load (1.3ms) SELECT "projects".* FROM "projects" WHERE "projects"."name" = $1 AND "projects"."platform" = $2 LIMIT $3 [["name", "split"], ["platform", "Rubygems"], ["LIMIT", 1]] | |
(0.6ms) BEGIN | |
Project Exists (1.3ms) SELECT 1 AS one FROM "projects" WHERE "projects"."name" = $1 AND ("projects"."id" != $2) AND "projects"."platform" = $3 LIMIT $4 [["name", "split"], ["id", 2], ["platform", "Rubygems"], ["LIMIT", 1]] | |
Version Load (1.1ms) SELECT "versions".* FROM "versions" WHERE "versions"."project_id" = $1 [["project_id", 2]] | |
SQL (0.9ms) UPDATE "projects" SET "updated_at" = $1, "latest_release_published_at" = $2 WHERE "projects"."id" = $3 [["updated_at", "2017-08-25 15:47:13.860364"], ["latest_release_published_at", "2017-08-25 15:46:55 |
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
0.04s$ $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN | |
flag needs an argument: -repotoken | |
Usage: /home/travis/gopath/bin/goveralls [options] | |
-covermode string | |
sent as covermode argument to go test (default "count") | |
-coverprofile string | |
If supplied, use a go cover profile (comma separated) | |
-debug | |
Enable debug output | |
-endpoint string |