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
// ============================================================ | |
// O(1) : constant complexity | |
// ============================================================ | |
function constantO(num) { | |
return num; | |
} | |
console.log(constantO(10)); // 10 |
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
// ============================================================ | |
// Comparison operators | |
// ============================================================ | |
console.log(3 < 2); // false | |
console.log(1 == '1'); // true | |
console.log('Banana' === 'Banana'); // true | |
console.log('Banana' !== 'Apple'); // true | |
console.log('Banana' != 'Apple'); // true | |
console.log(2 <= 3); // 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
-- ============================================================ | |
-- SELECT | |
-- ============================================================ | |
SELECT * | |
FROM humanresources.employee; | |
SELECT jobtitle | |
FROM humanresources.employee; |
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
# ============================================================ | |
# Definition of an array | |
# ============================================================ | |
empty = [] | |
print(empty) # [] | |
fruits = ['apple', 'lemon'] | |
print(fruits) # [ 'apple', 'lemon' ] |
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
// ============================================================ | |
// Definition of an object / dictionary | |
// ============================================================ | |
const fruits = { | |
color: 'red', | |
length: 3 | |
} | |
// ============================================================ |
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
# ============================================================ | |
# Display of the function | |
# ============================================================ | |
x = np.linspace(-3,3,100) | |
plt.plot(x,np.exp(x)) | |
plt.xlabel('x') | |
plt.ylabel('$e^x$') |
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
// ============================================================ | |
// Without parameter | |
// ============================================================ | |
function double () { | |
console.log('Hello world') | |
} | |
console.log(double()) // Hello world |
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
# ============================================================ | |
# Definition of fonction | |
# ============================================================ | |
def area(x): | |
return 2 * x | |
print(area(4)) | |
x = np.linspace(-6,6) |
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
# ============================================================ | |
# What is a vector? | |
# ============================================================ | |
scalar = [3] # scalar | |
row = np.array([2,1], dtype=object) # row matrice / vector | |
col = np.array([ [3], [-1] ], dtype=object) # column matrice / vector | |
display(Math(sym.latex(sym.sympify(scalar)))) | |
display(Math(sym.latex(sym.sympify(row)))) |
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
# ============================================================ | |
# The 3 types of logarithms | |
# ============================================================ | |
x = np.linspace(-3,3,100) | |
ln = np.log(x) | |
decimal = np.log10(x) | |
binary = np.log2(x) |
OlderNewer