Skip to content

Instantly share code, notes, and snippets.

View codistwa's full-sized avatar

Codistwa codistwa

View GitHub Profile
# ============================================================
# Display of the function
# ============================================================
x = np.linspace(-3,3,100)
plt.plot(x,np.exp(x))
plt.xlabel('x')
plt.ylabel('$e^x$')
// ============================================================
// Definition of an object / dictionary
// ============================================================
const fruits = {
color: 'red',
length: 3
}
// ============================================================
# ============================================================
# Definition of an array
# ============================================================
empty = []
print(empty) # []
fruits = ['apple', 'lemon']
print(fruits) # [ 'apple', 'lemon' ]
-- ============================================================
-- SELECT
-- ============================================================
SELECT *
FROM humanresources.employee;
SELECT jobtitle
FROM humanresources.employee;
// ============================================================
// 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
// ============================================================
// O(1) : constant complexity
// ============================================================
function constantO(num) {
return num;
}
console.log(constantO(10)); // 10