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 <cstdlib> | |
#include <iostream> | |
#include <cstring> | |
#include <time.h> | |
int | |
main( int argc, char **argv ) | |
{ | |
struct timespec curr_time; | |
std::memset( &curr_time, |
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 <cstdlib> | |
#include <iostream> | |
#include <cstring> | |
#include <mach/mach.h> | |
#include <mach/mach_time.h> | |
int | |
main( int argc, char **argv ) | |
{ | |
auto curr_time( mach_absolute_time() ); |
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
/** | |
* pin the current thread | |
*/ | |
cpu_set_t *cpuset( nullptr ); | |
size_t cpu_allocate_size( -1 ); | |
#if (__GLIBC_MINOR__ > 9 ) && (__GLIBC__ == 2 ) | |
const int8_t processors_to_allocate( 1 ); | |
cpuset = CPU_ALLOC( processors_to_allocate ); | |
assert( cpuset != nullptr ); | |
cpu_allocate_size = CPU_ALLOC_SIZE( processors_to_allocate ); |
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
std::uint64_t cycles( 0 ); | |
/** begin assembly section to init previous **/ | |
#ifdef __x86_64 | |
__asm__ volatile( | |
#if RDTSCP | |
"\ | |
rdtscp \n\ | |
shl $32, %%rdx \n\ | |
orq %%rax, %%rdx \n\ | |
movq %%rdx, %[cyc]" |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
## | |
# getProcessList - returns an array of an arrays | |
# first index is the pid, second the executable | |
# it refers to | |
## | |
sub getProcessList(); |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
## | |
# Stupid simple wrapper around ghostscript to join pdf's | |
## | |
## | |
# check for args < 2, just assume |
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
/* vim: set shiftwidth=3 set tabstop=3 set number set ai set aw set expandtab : */ | |
/* you need to have 'set modeline' within your vimrc for the above to work */ | |
#include <cstdint> | |
#include <iostream> | |
#include <cstdlib> | |
struct foo <% std::int32_t k; %>; | |
static std::int32_t count = 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 <iostream> | |
#include <cstdlib> | |
#include <cstdlib> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <iomanip> | |
int | |
main( int argc, char **argv ) | |
{ |
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 <cstdlib> | |
/** | |
* low level programming question, exp. C/C++ programmer | |
* should know: | |
* How are struct and ptr related? How is this | |
* different if all the named variables in the struct | |
* are homogeneous in type? How about when the struct | |
* has many types? | |
*/ |
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 <iomanip> | |
#include <cstdlib> | |
/** try with -O0 then -O3 **/ | |
struct foo | |
{ | |
/** | |
* remember, this should be undetermined.... | |
* never leave a class var like this |
OlderNewer