Skip to content

Instantly share code, notes, and snippets.

@unmeshvrije
unmeshvrije / permutations.cpp
Created March 26, 2017 22:44
Recursive function to generate permutations of all elements of an array
void generate_all_permutations(vector<int>& toBePermuted, int nextIndex)
{
if (nextIndex == toBePermuted.size()){
print_vector(toBePermuted);
return;
}
for (int i = nextIndex; i < toBePermuted.size(); ++i) {
swap(toBePermuted[i], toBePermuted[nextIndex]);
generate_all_permutations(toBePermuted, nextIndex+1);
def sum_all(*args):
total = 0
for item in args:
total += item
return total
'''
some calls to test the function
>>> sum_all(1,2,3,4)
10
>>> sum_all(1,2,3,4,5,6)

On Friday the 24th of August, I had a chance to visit Copenhagen with HYF. I had asked Wouter and Noer whether I was required to prepare any speech or something. They said, "Naah, just come and participate". So I came and participated. Friday dinner along the docks by the harbour of Copenhagen was easy to participate in. Mostly involved eating and (re)connecting to altruistic people from all over Europe. Saturday was the busiest day of all three. Federico made an amazing brakfast for everyone :

## Expectations from Yousif:
### Best practices of Git
1 When and why to make branches
2 when to make commits
3 How to go back to a particular commit
4 Retrieving the deleted code
5 What companies do with Git
6 Mulitple people working on a single repository