- Stage files with confirmation (commit only part of a file)
- git add --patch (git add -p)
- Delete local branch if it has already been fully merged in its upstream branch
- git branch -d <branch_name>
- Delete local branch, irrespective of its merged status
- git branch -D <branch_name>
Definition: assembly routines written as an inline function. Allows one to access architecture dependent instructions not available in C.
Form: must be inside of a function beginning with either 'asm' or '__asm__'
int main(){
// volatile keyword tells the compiler to not optimize this area of code. The compiled binary will contain this exact sequence of code
// optional: output operands, input operands, or clobbered registers
__asm__ __volatile__ (
<assembler template>
;
This file contains hidden or 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
// how to compile: gcc dynamic_loading.c -o dynamic_loading -ldl | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <dlfcn.h> | |
#include <string.h> | |
int main(int argc, char **argv) { | |
void *handle; | |
void (*go)(char *); | |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int main(){ | |
// use current time to seed the prng used by rand() | |
// if srand is not called (default: srand(1)), rand() will always generate the same sequence | |
srand(time(0)); | |
for(int i=0; i<3; i++) | |
printf("%d\n", rand()); |