// at the copying repo
// move the files into another folder to prevent merge conflicts
git add .
git commit -m "Project move in progress"
// on the destionation repo
// the name `temp` could be changed for anything else
// locations are like in the shell, but the `\` should be replaced to `/`
git remote add temp *location*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Matrix Chain Multiplication Optimization | |
# size of the matrix in the matrix chain | |
# A_1 is a p[0] by p[1] matrix, A_2 is a p[1] by p[2] matrix | |
p = [10, 20, 12, 17, 22, 19, 50] | |
# length of the matrix chain + 1 | |
matrix_size = len(p) | |
# initialize matrix with zeros |
// at the copying repo // move the files into another folder to prevent merge conflicts git add . git commit -m "Project move in progress"
// on the destionation repo
// the name temp
could be changed for anything else
// locations are like in the shell, but the \
should be replaced to /
git remote add temp location
git fetch temp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(0, 6): | |
print i | |
j = 0 | |
while j < 5: | |
print j | |
j += 1 | |
k = 0 | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { | |
int i = 0, j = 0, k = 0; | |
// for statement | |
for (i = 0; i < 5; i++) { | |
print(i); | |
} | |
// while statement | |
while (j < 5) { | |
print(j++); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String args[]) { | |
int i = 0, j = 0, k = 0; | |
// for statement | |
for (i = 0; i < 5; i++) { | |
print(i); | |
} | |
// while statement | |
while (j < 5) { | |
print(j++); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "FILENAME", line 12, in <module> | |
repeat_lyrics() | |
NameError: name 'repeat_lyrics' is not defined | |
Process finished with exit code 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_lyrics(): | |
print "I'm a lumberjack, and I'm okay" | |
print "I sleep all night and I work all day" | |
# repeat_lyrics() | |
# return an error: "NameError: name 'repeat_lyrics' is not defined" | |
def repeat_lyrics(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
void swap(int *n1, int *n2); | |
void swap(char *n1, char *n2); | |
void swap(double *n1, double *n2); | |
int main() { | |
int num1 = 20, num2 = 30; | |
swap(&num1, &num2); | |
std::cout << num1 << ' ' << num2 << std::endl; |