Skip to content

Instantly share code, notes, and snippets.

@Hasenpfote
Hasenpfote / main.cpp
Created November 16, 2016 05:53
this is a test.
#include <iostream>
int main()
{
std::cout << "Hello, world" << std::endl;
return 0;
}
@Hasenpfote
Hasenpfote / take_inner_snapshot.ipynb
Created August 2, 2018 04:03
Take a snapshot in a function.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hasenpfote
Hasenpfote / take_inner_snapshot2.ipynb
Last active August 3, 2018 07:38
Take a snapshot in a function.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hasenpfote
Hasenpfote / main.py
Created August 4, 2018 06:15
Take a snapshot in a function.
import numpy as np
from memory_profiler import *
def foo(x, y, z):
dataset1 = np.random.uniform(low=-1., high=1., size=100).astype(np.float64)
print('x', x)
dataset1 = np.random.uniform(low=-1., high=1., size=1000).astype(np.float64)
l = [i for i in range(100000)]
@Hasenpfote
Hasenpfote / foo.py
Created August 6, 2018 08:57
malloc_tracer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
class Klass(object):
def __init__(self, value):
self._value = value
def func(self, x):
@Hasenpfote
Hasenpfote / display_code_blocks.py
Created August 11, 2018 08:27
Display code blocks.
import inspect
import ast
import textwrap
def function(x):
'''function.'''
return x
@Hasenpfote
Hasenpfote / delaunay.py
Created November 10, 2018 05:37
Delaunay tesselation in 2 dimensions.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import sys
from enum import Enum
logger = logging.getLogger(__name__)
@Hasenpfote
Hasenpfote / main.cpp
Created July 23, 2019 00:47
Bitonic sort.
#include <iterator>
#include <iostream>
#include <cstdlib>
#include <cassert>
#include <array>
#include <cmath>
#include <vector>
#include <numeric>
#include <random>
#include <algorithm>
@Hasenpfote
Hasenpfote / main.cpp
Last active August 9, 2019 01:30
debugging enums in c++17
#include <iostream>
#include "util.h"
struct Foo
{
enum class Color
{
Red = 2, Green = 5, Blue = 10,
};
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.