[CentralOH] 2015-07-18 道場 Scribbles 落書/惡文? July 31 Sprints; combat; minio; bash list; relativity; $* & "$@"; olp; pep8 mla; py.test; varargs; 3rd Man; flash
jep200404 at columbus.rr.com
jep200404 at columbus.rr.com
Sat Jul 18 20:02:19 CEST 2015
We will likely combine with Friday sprints of PyOhio on July 31.
CodeCombat - Learn how to code by playing a game
http://codecombat.com/
minio
http://opensource.com/business/15/7/minimal-object-storage-minio
https://gitter.im/minio/minio
https://github.com/minio/minio
https://github.com/minio/minio/blob/master/CONTRIBUTING.md
script foo: list variables in bash
[test at dojo ~]$ cat array.sh
function showfoo()
{
echo "$@"
i=0
echo "len(foo) = ${#foo[@]}"
for arg in "${foo[@]}"; do
echo "foo[$i] = '$arg'"
i=`expr $i + 1`
done
}
showfoo before declare
declare -a foo
showfoo after declare
foo[0]='hello world'
showfoo after first assignment
foo[1]='bacon spam'
showfoo after second assignment
foo[${#foo[@]}]='appended another'
showfoo after third assignment
foo[${#foo[@]}]='and appended another'
showfoo after fourth assignment
[test at dojo ~]$ ./array.sh
before declare
len(foo) = 0
after declare
len(foo) = 0
after first assignment
len(foo) = 1
foo[0] = 'hello world'
after second assignment
len(foo) = 2
foo[0] = 'hello world'
foo[1] = 'bacon spam'
after third assignment
len(foo) = 3
foo[0] = 'hello world'
foo[1] = 'bacon spam'
foo[2] = 'appended another'
after fourth assignment
len(foo) = 4
foo[0] = 'hello world'
foo[1] = 'bacon spam'
foo[2] = 'appended another'
foo[3] = 'and appended another'
[test at dojo ~]$
General Relativity in Python
http://www.linuxjournal.com/content/general-relativity-python
Bourne Shell: $* versus "$@"
[test at dojo 1]$ ll
total 4
-rwxr-x---. 1 test jep 222 Jul 16 19:53 starat.sh
[test at dojo 1]$ head -50 -v starat.sh
==> starat.sh <==
#!/bin/sh
echo "There are $# arguments."
echo
echo '$* yields the following'
for arg in $*; do
echo " arg is '$arg'"
done
echo
echo '"$@" yields the following'
for arg in "$@"; do
echo " arg is '$arg'"
done
[test at dojo 1]$ ./starat.sh 'spam' 'hello world' 'who am i'
There are 3 arguments.
$* yields the following
arg is 'spam'
arg is 'hello'
arg is 'world'
arg is 'who'
arg is 'am'
arg is 'i'
"$@" yields the following
arg is 'spam'
arg is 'hello world'
arg is 'who am i'
[test at dojo 1]$
our lady of peace festival
http://olp-parish.org/organizations-and-opportunities/festival-committee
PEP8
http://legacy.python.org/dev/peps/pep-0008/
What Is MLA Style?
MLA http://www.mla.org/style
Mostly did refactoring.
Tried to add TDD at end. Did not work.
Maybe issues with environment on Macbook.
virtualenv env -p `which python3`
py.test -f . was very unhappy complaining about not having permissions for
Adobe Flash stuff (that we were not trying to use)
virtualenv env -p `which python3` --no-site-packages
py.test -f . was much happier
Afterwards, realized that tuple was a bad name for a variable.
s/\<tuple\>/day_age_tuple/
Varargs unpacking: pass arbitrarily many positional or keyword arguments
Start with "Arbitrary Argument Examples"
page 534 of Learning Python 5th edition.
The Third Man
Adobe released the security update for the Linux version of their Flash player.
http://www.adobe.com/software/flash/about/
download flash for linux
More information about the CentralOH
mailing list