I hereby claim:
- I am dlamblin on github.
- I am lamblin (https://keybase.io/lamblin) on keybase.
- I have a public key ASBAVHV42mQM8gQI_cDjr5CrDH6F8c5nkiEHQRKwFivIjgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
In order to practice Python, Sophie worked on some Python that implements a game.
The first practice was to figure out how to take an ordered list of cards and shuffle that list like a deck of cards. After quickly figuring out a way to shuffle cards and then display the mixed up deck, she worked on making a guessing game out of it.
refmt | mentions | EG | |
---|---|---|---|
detab | 468 | Fixed crash when detabbing with zero spaces per tab. | |
entab | 88 | Add C functions to centralize entab processing | |
reindent | 6311 | lang_css: reindented parser_css.mly |
#!/usr/bin/env python3 | |
# vim: et sw=4 ai | |
""" | |
This script takes in files named in presumed yaml format and OVERWRITES them | |
with all their keys sorted by the key name. It does not preserve comments. I've | |
not tested it with lists. | |
Using '-' as a filename opens and consumes stdin in addition to other files. | |
stdin is written to stdout with the same processing. |
""" | |
This module contains four methods for muting file descriptors. | |
You can mute the standard file descriptors: | |
with mute_stdout(): | |
... | |
with mute_stderr(): | |
... | |
with mute_stdout_stderr(): | |
... | |
Or mute a list of known file descriptors: |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
""" | |
n-gram of a string by characters (not by words) | |
takes all args as input unless the first two args are numbers which are in | |
order, then it assume these are min and max length. Default min max is 2 - 60 | |
""" | |
def ngram(inp='', mn=2, mx=60): | |
""" |
#!/usr/bin/env perl | |
use bignum; | |
$a=1; | |
for(0..64){ | |
printf "%2s%21s\n", $_, $a; | |
$a<<=1; | |
} | |
# (perl)$ perl -Mbignum -E '$a=1;for(0..64){say" "x($_<10).$_." "x(21-length($a)).$a;$a<<=1}' | |
# (perl)$ perl -Mbignum -E '$a=1;for(0..64){printf"%2s%21s\n",$_,$a;$a<<=1}' |
sleep 5; while read -r line; do clear; echo $line; echo "$line" | pbcopy; sleep 1; done < "feed_commands_for_seoul_ap-northeast-2.txt" |