Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicolau Leal Werneck nlw0

View GitHub Profile
View sirfit.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:2ad73c71d561e9fe5ff102ce880a6941
https://brianbuccola.com/how-to-install-xmonad-and-xmobar-via-stack/
sudo apt install curl wget
sudo apt install libxrandr-dev libxrender-dev
sudo apt install libxft-dev libxss-dev libxinerama-dev
sudo apt install libiw-dev libxpm-dev
stack install --flag xmobar:all_extensions
@nlw0
nlw0 / mergemasks.jl
Last active Nov 30, 2019
UNet in Flux (work in progress!)
View mergemasks.jl
## Process data from https://www.kaggle.com/c/data-science-bowl-2018/
## Merge a bunch of binary masks into a single one
using Glob, Images
root = "/home/user/src/data/data-science-bowl-2018/train/"
for case in glob("*", root)
labels = glob("*png", case * "/masks")
mergedlabels = sum(map(load, labels))
save(case * "/mergedmasks.png", mergedlabels)
@nlw0
nlw0 / Eigvec2fromeigval.ipynb
Last active Jul 28, 2020
Eigenvectors from eigenvalues (Julia demo)
View Eigvec2fromeigval.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nlw0
nlw0 / Eig.ipynb
Created Nov 16, 2019
Eigenvectors from eigenvalues (Julia demo)
View Eig.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View SE3 Interpolation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We couldn’t find that file to show.
@nlw0
nlw0 / dirmap.c
Created Oct 12, 2019
Iterating over a directory contents with Julia and libuv's readdir
View dirmap.c
#include "uv.h"
typedef void (*callback)(const char *, int, void*);
void dirmap(const char path[], callback cb, void* thunk) {
uv_fs_t readdir_req;
uv_fs_opendir(NULL, &readdir_req, path, NULL);
uv_dirent_t dirent;
@nlw0
nlw0 / file-count.c
Last active Oct 10, 2019
Counting files based on libuv's readdir and scandir via C and Julia
View file-count.c
#include "uv.h"
#include "stdio.h"
#include "string.h"
#include <sys/time.h>
int min(int a, int b) { return (a < b)? a : b; }
int get_file_count_read(const char path[], int chunklen) {
uv_fs_t readdir_req;
@nlw0
nlw0 / MNIST CNN in Julia.ipynb
Last active Oct 8, 2019
Training a CNN on MNIST with Julia and Flux
View MNIST CNN in Julia.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.