GNU/Linux factor
Bash tool and python3.
# bash shell
$ factor 101
//header | |
#pragma GCC target ("avx2") | |
#pragma GCC optimize ("O3") | |
#pragma GCC optimize ("unroll-loops") | |
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long int ll; | |
typedef long double ld; |
# update system
sudo apt update && sudo apt upgrade -y
# install build tools and python prerequisites
sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev
# download and extract python
// Link to the original: http://www.jsoftware.com/jwiki/Essays/Incunabulum | |
// Found at https://news.ycombinator.com/item?id=8533843 | |
typedef char C; | |
typedef long I; | |
typedef struct a { | |
I t,r,d[3],p[2]; | |
}* A; |
Below are the Big O performance of common functions of different Java Collections. | |
List | Add | Remove | Get | Contains | Next | Data Structure | |
---------------------|------|--------|------|----------|------|--------------- | |
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array |
% Source of the particles.pl: https://github.com/mlliarm/particleslogic/blob/master/src/particles.pl | |
:- object(particle). | |
% common properties to all particles | |
:- public([ | |
boson/0, fermion/0, | |
mass/1, spin/1, lifetime/1, charge/1 | |
]). |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
Bob Martin's book in Amazon.
-- Authors: Mike Spivey and Silvija Seres | |
-- Taken from: https://www.cs.ox.ac.uk/publications/books/fop/dist/fop/chapters/9/Logic.hs, | |
-- "The fun of programming book", https://www.cs.ox.ac.uk/publications/books/fop/, | |
-- Chapter 9, Combinators for logic programming | |
-- Haskell 98 compliant. | |
module Logic where | |
import List | |
-- Section 9.2 |