Skip to content

Instantly share code, notes, and snippets.

🌕
A Picture of Jupiter and 4 of its Moons Through Our Telescope.

melvyniandrag

🌕
A Picture of Jupiter and 4 of its Moons Through Our Telescope.
Block or report user

Report or block melvyniandrag

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@melvyniandrag
melvyniandrag / hog.py
Created Jan 2, 2019
Niceness Experiement
View hog.py
x = 1
while(True):
x+=1
@melvyniandrag
melvyniandrag / chromeFirefoxError.txt
Last active Jan 1, 2019
dmesg log from bad ubuntu 18.04 install
View chromeFirefoxError.txt
[ 517.882093] Chrome_~dThread[2514]: segfault at 0 ip 00007f4b0079f33d sp 00007f4b12404ae0 error 6 in libxul.so[7f4affa54000+65d3000]
[ 517.882114] Chrome_~dThread[2750]: segfault at 0 ip 00007f110249f33d sp 00007f111418cae0 error 6 in libxul.so[7f1101754000+65d3000]
[ 517.882141] Chrome_~dThread[2421]: segfault at 0 ip 00007f8d26c9f33d sp 00007f8d3893eae0 error 6 in libxul.so[7f8d25f54000+65d3000]
[ 517.882321] Chrome_~dThread[2555]: segfault at 0 ip 00007faa9509f33d sp 00007faaa6d69ae0 error 6 in libxul.so[7faa94354000+65d3000]
[ 615.445383] gnome-shell[1525]: segfault at 7fc31b162140 ip 00007fc31b162140 sp 00007ffe59220f48 error 15 in libxcb.so.1.1.0[7fc31b14f000+26000]
[ 797.476438] Web Content[3279]: segfault at 7 ip 0000000000000007 sp 00007fff8c29d4a8 error 14
@melvyniandrag
melvyniandrag / refs.cpp
Created Nov 18, 2018
Looking at reference parameters to functions
View refs.cpp
/**
* In this file we look at a couple of functions that accept an integer literal
* and one that won't.
*
* g++ -std=c++11 refs.cpp -o refs
*/
#include <iostream>
void f( const int& i ){
@melvyniandrag
melvyniandrag / pic32Timing.ino
Created Jun 26, 2018
Experimenting with memory access timing on pic32
View pic32Timing.ino
const unsigned long NUM_CACHE_LINES = 16;
const unsigned long CACHE_BITS = 128;
const unsigned long DATA_ELEMS_PER_LINE = CACHE_BITS / sizeof( unsigned long );
const unsigned long N = 1979;
const int N_ITER = 10000;
volatile unsigned long stride = NUM_CACHE_LINES * DATA_ELEMS_PER_LINE;
//volatile unsigned long STRIDE = DATA_ELEMS_PER_LINE;
volatile unsigned long multiplier = 1;
@melvyniandrag
melvyniandrag / weirdbehavior.ino
Created Jun 26, 2018
I get about 3* faster with the simpleStride. Seems like a compiler optimization.
View weirdbehavior.ino
unsigned long time;
const unsigned long N = 999;
const unsigned long N_sq = N * N;
unsigned long bigArr[N] = {0};
unsigned long sum;
unsigned long Cache = 128;
const unsigned long NumIter = 10000;
void init_arr() {
@melvyniandrag
melvyniandrag / pic32_cache_demo.ino
Created Jun 26, 2018
Demonstration of the impact of cache misses on a pic32 microcontroller. This should generate the same times on arduino, because arduino has no cache.
View pic32_cache_demo.ino
unsigned long time;
const unsigned long N = 1000;
int bigArr[N] = {0};
int sum;
int Cache = 128;
void init_arr(){
for( int i = 0; i < N; ++i){
bigArr[i] = 1;
}
@melvyniandrag
melvyniandrag / mouse.cpp
Created May 16, 2018
Read /dev/input/mouse0
View mouse.cpp
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char** argv)
{
int fd, bytes;
unsigned char data[3];
const char *pDevice = "/dev/input/mouse0";
@melvyniandrag
melvyniandrag / README.md
Created Apr 25, 2018 — forked from bewest/README.md
plea for GIO examples for python + gdbus servers#
View README.md
@melvyniandrag
melvyniandrag / README.md
Created Apr 25, 2018 — forked from bewest/README.md
plea for GIO examples for python + gdbus servers#
View README.md
@melvyniandrag
melvyniandrag / getVLCVolume.cpp
Created Apr 19, 2018
Get Volume of VLC over DBus
View getVLCVolume.cpp
/*
g++ thisFile.cpp -I/usr/include/glib-2.0 \
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ \
-lglib-2.0 -lgio-2.0 -lgobject-2.0
*/
#include <iostream>
#include <gio/gio.h>
static GMainLoop* loop = NULL;
You can’t perform that action at this time.