Arguments pushed on stack, right-to-left.
Caller-saved: eax, ecx, edx. All others are callee-saved.
Return value in eax.
General purpose registers:
- EAX (Accumulator)
#include <vector> | |
#include <cstdint> | |
#include <iostream> | |
#include <cassert> | |
#include <bit> | |
struct popcnt_array | |
{ | |
uint32_t len; // length of array in 64-bit words |
library(tidyverse) | |
# find duplicates by col | |
df %>% filter(n() > 1, .by = "col") | |
# drop duplicates by col | |
df %>% distinct(col) | |
# summarize per group by | |
mtcars %>% |
#include <vector> | |
#include <iostream> | |
struct fenwick_tree { | |
size_t len; // 0-based len | |
std::vector<long long> t; // 1-based tree, indexes [1:len] | |
fenwick_tree(std::vector<long long> const &a) | |
{ | |
len = a.size(); |
Kipling | |
Stirling | |
Viking | |
bidding | |
biding | |
biffing | |
biking | |
bilking | |
billing | |
binding |
# Horizontal bar chart, ordered by value | |
ggplot(df, aes(x = reorder(name, value), y = value)) + | |
geom_bar(stat = "identity") + | |
labs(title = "Title", x = "Name", y = "Value") + | |
scale_y_continuous(expand = c(0,0)) + | |
coord_flip() + | |
theme_light() |
import pandas as pd | |
### Data import ### | |
# https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html | |
df = pd.read_csv("file.csv") | |
### Data types ### |
grep -Pi '^(?=.*u)[bluntam]{4,}$' /usr/share/dict/words |
-- Syntax order | |
-- https://learn.microsoft.com/en-us/sql/t-sql/queries/select-transact-sql | |
WITH cte AS (cte_query) | |
SELECT cols | |
FROM table | |
WHERE cond | |
GROUP BY col | |
HAVING cond | |
WINDOW window_expr |
# push to new github repo | |
git remote add origin [email protected]:jxu/repo.git # use set-url if already set | |
git push -u origin master | |
# check out a remote branch | |
git fetch | |
git branch -v -a # list all branches | |
git switch branchname | |
# change remote a branch is tracking |