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
#I'm trying to write a wrapper function to use in place of long nested callbacks like a(b(c())). | |
runner = (cb, args...) -> | |
puts 'run' | |
cb(args...) | |
a = (cb, args...) -> | |
puts 'a' | |
cb(args...) |
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 foo(): | |
a = 10 | |
def _foo(): | |
print a | |
_foo() | |
#Outputs 10 | |
def foo(): |
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
class Node: | |
def __init__(self, b, e, data, L, R): | |
self.b = b | |
self.e = e | |
self.L = L | |
self.R = R | |
self.data = data |
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
class SegmentTree: | |
def __init__(self, N, quads): | |
def _init(b, e): | |
if b is e: | |
q = [0] * 4 | |
q[quads[b]] = 1 | |
return Node(b, e, q, None, None) | |
else: | |
mid = (b + e ) / 2 |
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
#Replace readline() with raw_input for actual submission | |
f = open('test') | |
N = int(f.readline()) | |
points = [f.readline() for i in xrange(N)] | |
Q = int(f.readline()) | |
moves = [f.readline() for i in xrange(Q)] | |
for i in xrange(N): |
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
Take 2: | |
vendor/ | |
TesseractStatic/ | |
(all .h files) | |
liblept.a | |
libtesseract_all.a | |
Rakefile | |
app.vendor_project('vendor/TesseractStatic', :static) |
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
require 'ipaddr' | |
require 'ostruct' | |
require 'yaml' | |
SETTINGS = OpenStruct.new(YAML.load_file(File.expand_path('../vagrant.yaml', __FILE__))) | |
CLOUD_CONFIG_PATH = File.expand_path('../user-data.yaml', __FILE__) | |
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
ERROR in ./app/Main.jsx | |
Module parse failed: /Users/pikeas/Documents/code/pypjs/crypto/front/react-starter/app/Main.jsx Line 19: Unexpected token < | |
You may need an appropriate loader to handle this file type. | |
| var Application = React.createClass({ | |
| render: function() { | |
| return <Example />; | |
| } | |
| }); | |
@ ./config/app.jsx?Main 4:18-64 |
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
# Bad config | |
/***/ 128: | |
/*!************************!*\ | |
!*** ./app/style.styl ***! | |
\************************/ | |
/***/ function(module, exports, __webpack_require__) { | |
module.exports = | |
"body {\n background: #eef;\n}\nhtml,\nbody {\n height: 100%;\n margin: 0;\n}\n"; |
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
# Relevant bits only | |
{ | |
entry: { | |
main: [ | |
'webpack-dev-server/client?http://localhost:8080', | |
'webpack/hot/only-dev-server', | |
... | |
] | |
vendor: ['jquery', 'react', 'reflux', 'react/lib/ReactComponentBrowserEnvironment'] |
OlderNewer