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 <iostream> | |
#include <time.h> | |
#include <stdio.h> | |
#include <string.h> | |
class TimeFormat | |
{ | |
struct { | |
time_t abs_ts; | |
time_t loc_ts; |
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 <string.h> | |
#include <stdlib.h> | |
void stlrot(char* str, int n); | |
void strrot(char* str, int n); | |
const char* strstrn(const char* orig, const char* pat, int 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
#include <stdio.h> | |
static int npow2(int x) | |
{ | |
x--; | |
x |= x >> 1; | |
x |= x >> 2; | |
x |= x >> 4; | |
x |= x >> 8; | |
x |= x >> 16; |
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
void split(const char* str, const char* delim, std::vector<std::string>& out) | |
{ | |
const char* begin = str; | |
const char* it = strstr(str, delim); | |
if (it != NULL) | |
{ | |
std::string data{begin, it}; | |
out.push_back(data); | |
it++; | |
split(it, delim, out); |
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> | |
static unsigned int flipb(unsigned int x) | |
{ | |
x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)); | |
x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2)); | |
x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4)); | |
x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8)); | |
return((x >> 16) | (x << 16)); | |
} |
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 <iostream> | |
using namespace std; | |
struct vec3d | |
{ | |
float data[3]; | |
vec3d() : data{0.0f} {} |
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
qemu-img create -f qcow2 winX.img 60G | |
qemu-kvm -m 2000 -hda win10.img -cdrom ../ISO/w7_sp1_ultimate_x86-x64_bg-en.iso -boot d | |
qemu-kvm -m 4500 -smp 2 -hda winX.img -netdev user,id=user.0 -device e1000,netdev=user.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
package main | |
import "fmt" | |
func main() { | |
fmt.Printf("Fact of 6 is %d\r\n", fact(6)) | |
for n := 1; n < 7; n++ { | |
fmt.Printf("\r\n") | |
for k := 1; k < 7; k++ { |
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 <iostream> | |
#include <time.h> | |
#include <math.h> | |
#include <map> | |
#define LOOPSIZE 100000 | |
union fract_u | |
{ | |
float dval; |
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 <iostream> | |
#include <assert.h> | |
#include <random> | |
#include <string.h> | |
union lu_val | |
{ | |
long long val; | |
struct |