Skip to content

Instantly share code, notes, and snippets.

View keizerzilla's full-sized avatar
💯
🏁

Artur Rodrigues keizerzilla

💯
🏁
  • Brasil
  • 19:40 (UTC -03:00)
View GitHub Profile
@ChuaCheowHuan
ChuaCheowHuan / mvg_KL.py
Created April 20, 2020 06:38
KL divergence for multivariate normal distributions
def kl_mvn(m0, S0, m1, S1):
"""
https://stackoverflow.com/questions/44549369/kullback-leibler-divergence-from-gaussian-pm-pv-to-gaussian-qm-qv
The following function computes the KL-Divergence between any two
multivariate normal distributions
(no need for the covariance matrices to be diagonal)
Kullback-Liebler divergence from Gaussian pm,pv to Gaussian qm,qv.
Also computes KL divergence from a single Gaussian pm,pv to a set
@russfeld
russfeld / picam-stream.sh
Last active April 1, 2024 14:50
Stream Raspberry Pi Camera to Twitch
#!/bin/bash
# =================================================================
# Stream configuration file for Raspberry Pi Camera
#
# @author Russell Feldhausen (russfeldh@gmail.com)
# @version 2019-06-05
#
# This set of commands should allow you to stream video from your
# Raspberry Pi Camera to Twitch and Youtube (and possibly other
@Ajk4
Ajk4 / point_cloud_to_depth_map.py
Last active January 26, 2024 12:25
Convert point cloud to depth map
import numpy as np
def pointcloud_to_depth_map(pointcloud: np.ndarray, theta_res=150, phi_res=32, max_depth=50, phi_min_degrees=60,
phi_max_degrees=100) -> np.ndarray:
"""
All params are set so they match default carla lidar settings
"""
assert pointcloud.shape[1] == 3, 'Must have (N, 3) shape'
assert len(pointcloud.shape) == 2, 'Must have (N, 3) shape'
  1. PRE-INSTALL

    First make sure that ubuntu (and drivers) are fully installed. If it crashes at start-up, try disableing dedicated GPUs and installing those drivers afterwards

  2. BASICS

    Install i3-wm using sudo apt-get install i3 Also install i3llock, i3status, nitrogen (bacground wallpaper), Also: sudo apt-get install lxappearance gtk-chtheme qt4-qtconfig to de-uglify gnome

@tpaschalis
tpaschalis / np2lat.py
Last active March 13, 2021 08:33
Convert a Numpy ndarray to LaTeX table/tabular environment.
import numpy as np
def np2lat(A):
filename = 'table.tex'
f = open(filename, 'a')
cols = A.shape[1]
# Change alignment and format of your output
tabformat = '%.3f'
tabalign = 'c'*cols
@ramiabraham
ramiabraham / rom_suffix_codes.md
Last active April 27, 2024 13:28
Video game rom suffix codes (decoded)

Video game rom codes

You wouldn't download a car...


Primary rom codes

Probably what you're looking for

  • [a] Alternate (alternate version of the game, usually trying a different output method)
  • [p] Pirate
@wenchy
wenchy / Makefile
Last active January 16, 2024 15:36
Compile all .cpp files into one target under the current directory.
CC := g++
CFLAGS := -Wall -g
TARGET := test
# $(wildcard *.cpp /xxx/xxx/*.cpp): get all .cpp files from the current directory and dir "/xxx/xxx/"
SRCS := $(wildcard *.cpp)
# $(patsubst %.cpp,%.o,$(SRCS)): substitute all ".cpp" file name strings to ".o" file name strings
OBJS := $(patsubst %.cpp,%.o,$(SRCS))
all: $(TARGET)
@vladignatyev
vladignatyev / progress.py
Last active March 31, 2024 22:54
Python command line progress bar in less than 10 lines of code.
# The MIT License (MIT)
# Copyright (c) 2016 Vladimir Ignatev
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject to the following conditions:
#
@jasonsperske
jasonsperske / MIT-LICENSE
Last active March 1, 2023 03:06
A simple Python program that can read DOOM.Hexen IWAD and PWAD files and render them as SVG see examples at http://jason.sperske.com/wad/
MIT License
Copyright (c) 2018 Jason Sperske
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: