Skip to content

Instantly share code, notes, and snippets.

View inhzus's full-sized avatar
🎯
Coding

Inhzus inhzus

🎯
Coding
  • Shopee
  • Beijing, China
View GitHub Profile
@maxtruxa
maxtruxa / Antonyms.md
Last active April 3, 2024 22:51
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active April 24, 2024 03:49
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@JaySon-Huang
JaySon-Huang / CodeLLDB_CentOS.md
Last active December 14, 2023 18:23
Get VSCode CodeLLDB plugin work on CentOS 7

I want to debug with CodeLLDB on CentOS 7, but get an error like this:

/home/xxx/.vscode/extensions/vadimcn.vscode-lldb-1.6.1/adapter/codelldb: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /home/xxx/.vscode/extensions/vadimcn.vscode-lldb-1.6.1/adapter/codelldb)

LLDB requires a higher version of glibc.

I get it work by the following steps: