Essentially every software project having more than one developer is a collaborative project
Benedikt Hegner on Collaborative Software Development, GridKa School 2017, 28.08.2017
For us, collaborative software development already starts with you
... and your future you!
goto
https://GKS-2018-CollaborativeSoftware.github.io/workshop-collaborative_software/ to see this presentationif you have a GitHub account:
write your GitHub identification on a piece of paper
else:
create a GitHub account
write your GitHub identification on a piece of paper
while not invited:
sleep
gksXX
with a passwordagile software development
if you have no neighbour next to you:
choose another seat
move
Johan G. Bonte / CC-BY-SA-3.0
fork
the workshop repositorygksolite.patterns
We focus on git
as an example for a decentralised version control
git
locally# Initialise an empty git repository
$ git init
# Put a file into your staging area
$ git add <file>
# This makes your commit.
# To show what's in your staging area, use `git status`
$ git commit -m "message"
# You can also check what you did lately
$ git show
Introduce yourself...
# Configure your user name and email
$ git config --global user.name 'Your Name'
$ git config --global user.email 'Your email'
Configure auto correction for git
commands
$ git config --global help.autocorrect 1
Use colors to show git
information
$ git config --global color.ui auto
$ echo ".idea/" >> .gitignore
.gitignore
file for your projectgit
is configured properlybug
or improvement
)gksolite
module in the repository was recently renamedgksolite/gksolite_unittests/test_mixins.py
Larger projects usually require more complex workflows than the centralised workflow to manage simultaneous code changes e.g. for different features
$ git push origin master
$ git pull --rebase origin master
CONFLICT (content): Merge conflict in <some-file>
git
pauses rebasing until you resolve the merge conflicts$ git add <resolved file>
$ git rebase --continue
$ git rebase --abort
$ git checkout -b <feature> master
$ git checkout master
$ git pull
# the actual merge of the new feature
$ git pull origin <feature>
# pushing it back to origin
$ git push
# a new branch is merged into develop
$ git checkout develop
# create a new commit to retain historical infos
$ git merge --no-ff <feature>
# delete the branch after merging
$ git branch -d <feature>
$ git push origin develop
feature
branches$ git commit -m "$(curl -sL https://bit.ly/funny-mesg | sh)"
### o cell
#o# # neighbour
###
or die
advance
function in gksolite.plain
--no-ff
when mergingboard
provides a function for determining the number of neighbours for a cellTesting your software ensures
We focus on unit tests via the built-in unittest
module
gksolite
(you might also check your coding style with pylint)$ coverage run my_unit_test.py arg1 arg2
$ coverage report
# For nicer reports you can use
$ coverage html
# Heading
## Subheading
Your can include *italic* and **bold** texts easily.
TODO
: have a look at reStructuredText (ReST)"""
Dispatch a call to a :py:class:`RpcServer` at ``_host``
:param _host: host to connect to
:param _port: port on host the server is listening add
:param _name: name a payload is registered with the server
:param args: positional arguments for the payload
:param kwargs: keyword arguments for the payload
"""
Websites for you and your projects.
If you start to write a comment, stop and think about your design.
If you still want to write that comment, think harder!
If it contains a reference to a specific algorithm you are just implementing, everything is fine. Otherwise, get off the keyboard and try again ;)
Did you write proper documentation when you implemented your features in gksolite
?
.travis.yml
in repo)codecov.yml
in repo)Code I'm not afraid to modify
Instead, every time you look at a piece of code, improve it a bit
def daysInYear(year):
days = 365
if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
days += 1
return days
def generate_checksum(self):
nnc = 'PREFIX{0}{1}{2}{3}'.format("%04d" % int(self.account.id), datestr, num, self.sender.id)
checksum1 = nnc[-2]
checksum2 = 0 + (1 + 2 + int(nnc[4]) + int(nnc[6]) + int(nnc[8]) + int(nnc[10]) + int(nnc[12]) + int(nnc[14])+ int(nnc[16]) + int(nnc[18]) + int(nnc[20])) * 4
checksum3 = 0 + int(nnc[3]) + int(nnc[5]) + int(nnc[7]) + int(nnc[9]) + int(nnc[11]) + int(nnc[13]) + int(nnc[15]) + int(nnc[17]) + int(nnc[19] + int(nnc[21])) * 7
checksum4 = checksum2 + checksum3
checksum = 0
while (checksum4 + checksum) % 10:
checksum += 1
def calculator():
num1 = int(input('Please choose your first number: '))
sign = input('What do you want to do? +, -, /, or *: ')
num2 = int(input('Please choose your second number: '))
if num1 == 0 and sign == '+' and num2 == 0:
print("0+0 = 0")
if num1 == 0 and sign == '+' and num2 == 1:
print("0+1 = 1")
[...]
if num1 == 1 and sign == '+' and num2 == 0:
print("1+0 = 1")
if num1 == 1 and sign == '+' and num2 == 1:
print("1+1 = 2")
[...]
if num1 == 50 and sign == '*' and num2 == 49:
print("50*49 = 2450")
if num1 == 50 and sign == '*' and num2 == 50:
print("50*50 = 2500")