I hereby claim:
- I am readevalprint on github.
- I am readevalprint (https://keybase.io/readevalprint) on keybase.
- I have a public key ASD-995N5m2iZEtYNV0P_9VSpq2CycQv-krC4srA6BzYbAo
To claim this, I am signing this object:
''' | |
from nltk import CFG | |
from nltk.parse.generate import demo_grammar | |
grammar = CFG.fromstring(demo_grammar) | |
s = list(grammar._lhs_index.keys())[0] | |
generate_sample(grammar, s, 1, 10) | |
''' |
def show_debug_toolbar(request): | |
if request.__class__.__name__ == "AsgiRequest": | |
return ( | |
b"DEBUG" in request.scope["query_string"] | |
or "djdt=show" in request.META.get("HTTP_COOKIE", "") | |
) and (DEBUG or request.user.is_superuser) | |
s = ( | |
"DEBUG" in request.environ.get("QUERY_STRING", "") | |
or "djdt=show" in request.environ.get("HTTP_COOKIE", "") | |
) and (DEBUG or request.user.is_superuser) |
pragma solidity 0.4.15; | |
contract SimpleCron { | |
/// @notice Will return the next timesamp after the speicifed units have passed `timestamp` | |
function next(uint s,uint m,uint h, uint d, uint w, uint timestamp) constant returns (uint){ | |
return (timestamp * 1 seconds) + (s * 1 seconds) + (m * 1 minutes) + (h * 1 hours) + _days(d) + _weeks(w); | |
} | |
pragma solidity 0.4.11; | |
contract Foo { | |
event Debug(string msg); | |
modifier checkThis(string action) { | |
Debug(action); | |
_; | |
} | |
I hereby claim:
To claim this, I am signing this object:
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
// test |
Lesson 1: Namespace. | |
Why is this broken, and how would you fix it? | |
Directions: | |
$ wget https://gist.github.com/readevalprint/7653435/raw/random.py | |
$ python ./random.py | |
random() : | |
Traceback (most recent call last): | |
File "./random.py", line 2, in <module> |