This file contains hidden or 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
(ns interpreter | |
(:require [clojure.test :refer :all])) | |
(defn operation_mod_n [operation n] | |
(fn [& args] | |
(mod (apply operation args) n))) | |
(def m+ (operation_mod_n + 1000)) | |
(def m* (operation_mod_n * 1000)) |
This file contains hidden or 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
(cua-mode t) | |
(setq make-backup-files nil) | |
(setq inhibit-startup-message t) | |
(setq column-number-mode t) | |
(show-paren-mode 1) | |
(setq-default indent-tabs-mode nil) | |
(when (fboundp 'tool-bar-mode) | |
(tool-bar-mode -1)) | |
(require 'uniquify) |
This file contains hidden or 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
echo "<h1>3</h1>" > index.html && python3 -m http.server & firefox localhost:8000 |
This file contains hidden or 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
<blockquote>So if you have P_1 that gives x 50% of the time and y the | |
rest, and P_2 that gives x 40% of the time and y 60% of the time, we | |
say that the difference is .2: given 100 samples, we will have 80 | |
matching samples and 20 unaccounted for (10 more x samples for P_1, | |
and 10 less y).</blockquote> | |
<p>What? Out of a hundred samples, P_1 yields x in 50 of them, and of | |
these, P_2 matches it with another x 50*0.4 = 20 times. In another 50 | |
samples, P_1 yields y, and P_2 matches it 50*0.6 = 30 times, for a | |
total of 20 + 30 matching samples. (And it would be the same for any |
This file contains hidden or 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
zmd@SuddenHeap:~/Code/Finetooth$ git commit --amend | |
Traceback (most recent call last): | |
File "./manage.py", line 8, in <module> | |
from django.core.management import execute_from_command_line | |
ImportError: No module named django.core.management |
This file contains hidden or 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
zmd@ExpectedReturn:~/Code/Textbook_Exercises_A/Programming_Challenges$ rustc 5-9-7.rs --test | |
<std macros>:8:12: 31:67 error: cannot apply unary operator `!` to type `Hardcover` | |
<std macros>:8 if !$cond { | |
<std macros>:9 fail!($($arg),+) | |
<std macros>:10 } | |
<std macros>:11 ); | |
<std macros>:12 ) | |
error: internal compiler error: unexpected failure | |
note: the compiler hit an unexpected failure path. this is a bug. | |
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html |
This file contains hidden or 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
http://eli.thegreenplace.net/2010/06/30/python-internals-adding-a-new-statement-to-python/ | |
http://mathamy.com/import-accio-bootstrapping-python-grammar.html | |
https://hg.python.org/cpython/file/8bc29f5ebeff/Grammar/Grammar |
This file contains hidden or 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
(setq python-debug-line-identifier-counter ?A) | |
(defun python-print-debug-line () | |
(interactive) | |
(insert "print(\"MY DEBUG MARKER ") | |
(insert python-debug-line-identifier-counter) | |
(insert "\", )") | |
(backward-char 1) | |
(setq python-debug-line-identifier-counter | |
(1+ python-debug-line-identifier-counter))) |
This file contains hidden or 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
In [9]: datetime.datetime.now().strftime('%F-%T%z') | |
Out[9]: '2014-12-18-23:25:42' | |
In [10]: datetime.datetime.strptime(datetime.datetime.now().strftime('%F-%T%z'), '%F-%T%z') | |
--------------------------------------------------------------------------- | |
ValueError Traceback (most recent call last) | |
/deploy/ssman/current/ssman/app/management/commands/shell.pyc in <module>() | |
----> 1 datetime.datetime.strptime(datetime.datetime.now().strftime('%F-%T%z'), '%F-%T%z') | |
/usr/lib/python2.7/_strptime.pyc in _strptime(data_string, format) |
This file contains hidden or 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 condense_meeting_times(meetings) | |
start_times = meetings.map { |start, _stop| [start, :start] } | |
stop_times = meetings.map { |_start, stop| [stop, :stop] } | |
boundaries = start_times + stop_times | |
boundaries.sort! | |
meetings_in_session = 0 | |
everyone_is_free = true | |
shadows = [] | |
current_meeting_shadow = [] |