This file contains 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 <stdint.h> | |
#include <stdlib.h> | |
#include <arpa/inet.h> | |
#include <errno.h> | |
#include <string.h> | |
static void | |
print_cidr(uint32_t addr, int mask) | |
{ |
This file contains 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
# as --32 hello.s -o hello.o | |
# ld -melf_i386 -Ttext=0x100 --oformat=binary hello.o -o hello.com | |
.code16 | |
.globl _start | |
.section .text | |
_start: | |
# print question | |
movw $ask, %dx |
This file contains 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
; nasm hello.asm -fbin -o hello.com | |
; to run in DosBox: dosbox hello.com | |
org 100h | |
section .text | |
start: | |
mov ax, 13h | |
int 10h |
This file contains 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
/* | |
* $ cc -O3 -Wall -pedantic -Wextra fact.c -lgmp | |
*/ | |
#include <stdio.h> | |
#include <gmp.h> | |
static void | |
factorial(long n, mpz_t r) | |
{ |
This file contains 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
/* | |
* To compile and link: | |
* | |
* $ gcc -Wall -pedantic -Wextra fizzbuzz.s -no-pie -o fizzbuzz | |
*/ | |
.data | |
/* Strings to print */ | |
fizz: .asciz "fizz\n" |
This file contains 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
/* | |
* $ cc -O3 -Wall -pedantic -Wextra qtst.c -o qtst | |
* $ time ./qtst | |
real 0m39,543s | |
user 0m37,288s | |
sys 0m0,732s | |
*/ | |
#include <stdio.h> |
This file contains 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
/* | |
* Compile: | |
* $ gcc -O3 -g -Wall -pedantic -Wextra atest.cc -o atest -lstdc++ -pthread | |
*/ | |
#include <atomic> | |
#include <cinttypes> | |
#include <iostream> | |
#include <thread> | |
#include <chrono> | |
#include <cstdlib> |
This file contains 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
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <limits.h> | |
#include <string.h> | |
#include <errno.h> | |
/* ========================================================================= */ | |
static int indent_level = 0; |
This file contains 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 <png.h> | |
#include <stdint.h> | |
#include "t1ha.h" | |
#define STRLEN 10 | |
#define NITER 1000000 | |
/*#define SQRSIDE 842*/ |
This file contains 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
#!/bin/bash | |
USAGE="Usage: | |
$0 \"так говорил кулинксао\" | |
" | |
if [ "$#" == "0" ]; then | |
echo "$USAGE" | |
exit 1 | |
fi |
NewerOlder