Skip to content

Instantly share code, notes, and snippets.

View Subv's full-sized avatar

Sebastian Valle Subv

  • Barranquilla, Colombia
View GitHub Profile
@Subv
Subv / test.c
Created September 6, 2020 15:59
enet test
#include <enet.h>
#include <stdio.h>
int main() {
if (enet_initialize () != 0) {
printf("An error occurred while initializing ENet.\n");
return 1;
}
ENetAddress address = {0};
STREX_INST : {
if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) {
generic_arm_inst* inst_cream = (generic_arm_inst*)inst_base->component;
unsigned int write_addr = cpu->Reg[inst_cream->Rn];
if (cpu->IsExclusiveMemoryAccess(write_addr)) {
cpu->UnsetExclusiveMemoryAddress();
cpu->WriteMemory32(write_addr, RM);
RD = 0;
} else {
@Subv
Subv / topological_order.py
Created May 7, 2019 01:22
Algorithm to determine a topological ordering of a DAG.
import itertools
import re
def UniqueList(data):
return list(set(data))
class Graph:
def __init__(self, vertices, edges):
@Subv
Subv / chromatic_number.py
Created April 23, 2019 16:41
Algorithm to (greedily) approximate the chromatic number of a graph.
import itertools
import re
def UniqueList(data):
return list(set(data))
class Graph:
def __init__(self, vertices, edges):
@Subv
Subv / PKGBUILD
Created February 8, 2019 00:24
Switch Piglit PKGBUILD
pkgname=switch-piglit
pkgver=r1223.1ded029
pkgrel=1
pkgdesc='Piglit'
arch=('any')
url='https://github.com/mesa3d/piglit'
license=('GPL')
options=(!strip libtool staticlibs)
makedepends=('git' 'switch-pkg-config' 'devkitpro-pkgbuild-helpers' 'switch-waffle')
source=(${pkgname}::"git+https://github.com/subv/piglit#commit=3c20fb3e60b656b4b39da36e19c33a610e895173")
@Subv
Subv / PKGBUILD
Created February 8, 2019 00:24
Switch Waffle PKGBUILD
pkgname=switch-waffle
pkgver=r1224.0608693
pkgrel=1
pkgdesc='Waffle'
arch=('any')
url='http://www.waffle-gl.org/'
license=('BSD')
options=(!strip libtool staticlibs)
makedepends=('git' 'switch-pkg-config' 'devkitpro-pkgbuild-helpers')
source=(${pkgname}::"git+https://github.com/subv/waffle#commit=060869315480cb4e159e4a2283de0fecc4667095")
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig, ax = plt.subplots()
x = np.arange(0, 2*np.pi, 0.01)
line, = ax.plot(x, np.sin(x))
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindOpenGL
# ----------
#
# FindModule for OpenGL and GLU.
#
# Optional COMPONENTS
@Subv
Subv / .diff
Created September 13, 2018 15:30
diff --git a/src/egl/drivers/switch/egl_switch.c b/src/egl/drivers/switch/egl_switch.c
index f3c6e95cda..1b6df17516 100644
--- a/src/egl/drivers/switch/egl_switch.c
+++ b/src/egl/drivers/switch/egl_switch.c
@@ -432,6 +432,8 @@ switch_initialize(_EGLDriver *drv, _EGLDisplay *dpy)
dpy->DriverData = display;
dpy->Version = 14;
+ dpy->Extensions.KHR_create_context = EGL_TRUE;
+
msys apr 1.6.3-1
msys apr-devel 1.6.3-1
msys apr-util 1.6.1-1
msys apr-util-devel 1.6.1-1
msys asciidoc 8.6.10-1 [installed]
msys aspell 0.60.6.1-1
msys aspell-devel 0.60.6.1-1
msys aspell6-en 2018.04.16-1
msys atool 0.39.0-1
msys autoconf 2.69-5 [installed]