Skip to content

Instantly share code, notes, and snippets.

Avatar

azapen6 azapen6

View GitHub Profile
@azapen6
azapen6 / Fl_create_context.cxx
Last active May 5, 2021
Creates an OpenGL context >= 3.3 in FLTK 1.3.4
View Fl_create_context.cxx
// This code is based on the following tips:
// https://www.khronos.org/opengl/wiki/Tutorial:_OpenGL_3.0_Context_Creation_(GLX)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/gl.h>
View acceldif.jl
#acceldif.jl
R = 1:20
h = [2.0^(-k) for k in R + 2]
f(x) = exp(x)
err(x) = abs(x - f(1)) / f(1)
dif_f(h) = (f(1 + h) - f(1)) / h
dif(h) = (f(1 + h) - f(1 - h)) / 2h
View bfi.plt
#bfi.plt
load "bfi_init.plt"
load "bfi_run.plt"