#wut
Never criticize someone until you've walked a mile in their shoes. That way, when you criticize them, they won't be able to hear you from that far away. Plus, you'll have their shoes. - Abraham Lincoln (probably)
Who said that?
python3
and tested on macOS 10.14
#! /usr/bin/env python3
which means it tries to use python3
by default. python3
no longer supports type long
. This means that$ ./binomial.py -n 150 -k 40
4408904561911885789946649584764715008
however, when it is run with python2
it will show
$ python ./binomial.py -n 150 -k 40
4.40890456191e+36
doctest
module has problems with returning integers vs floating point values if run with python2
$ python ./binomial.py --test
testing the module...
**********************************************************************
File "./binomial.py", line 85, in __main__.choose
Failed example:
choose(5, 3)
Expected:
10
Got:
10.0
**********************************************************************
Even though the code says
logChoose = logfactorial(n, k) - logfactorial(n - k)
if log:
return logChoose
else:
return round(math.exp(logChoose)) # returns whole number
@cecileane and @coraallencoleman
Eliminate commas and quotes from second column of csv file:
sed -E 's/"([0-9]+),([0-9]+),*([0-9]*)"/\1\2\3/' tableofSNPs.csv > out.csv
Check there are only three commas in each line:
sed -E 's/[^,]//g' out.csv | sort | uniq
The output should only contain one line consisting of 3 commas indicating a successful step 1.
Replace all A
and T
with T
and A
respectively:
sed -E 'y/AT/TA/' tableofSNPs.csv > rev.csv
Check that the replacement was correct:
sed -E s/'[^AT]'//g rev.csv | sort | uniq -c | tail -n 2 > countRev
sed -E s/'[^AT]'//g out.csv | sort | uniq -c | tail -n 2 > countOut
diff countRev countOut
This is a three line solution. I don't know how to do a one-liner for this; please help.
@cecileane and @coraallencoleman
@morrowcj I started a new branch called A
.
Your turn!
One really important thing I learned was how to undo changes in a repository. For example, if I have added something using git add <file>
, then I can un-stage it using git reset HEAD <file>
. I think this is a super useful feature to "undo" things.
@cecileane and @coraallencoleman
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.