Skip to content

Instantly share code, notes, and snippets.

View superfunc's full-sized avatar
🎟️
play dodonpachi

superfunc

🎟️
play dodonpachi
View GitHub Profile
#!/bin/sh
mkdir ./inst
python ../build_scripts/build_usd.py --no-python --no-tools --no-examples \
--no-imaging --no-tests --no-docs \
--no-ptex --no-openvdb --no-tutorials `pwd`/inst/
@superfunc
superfunc / test.cc
Created August 11, 2019 21:31
STLCost/GBench
// Code by https://github.com/Atrix256/STLCost
// Blog at: https://blog.demofox.org/2019/08/10/measuring-debug-stl-container-perf-cost-in-msvc/
// Modified to run under google benchmark
#include <benchmark/benchmark.h>
#include <chrono>
#include <cstdio>
#include <iostream>
#include <string>
@superfunc
superfunc / menu
Created May 3, 2015 15:55
menu example
{
"menu": {
"elements": [
{
"image": "mainmenubg.png",
"pos": {
"xcoord": 0,
"ycoord": 0
},
"selectable": false

DPLL Algorithm

Input: A formula in CNF

Output: Either "satisfiable" or "unsatisfiable".

Performance: O(2n), Space: O(n)

image

@superfunc
superfunc / gist:f98c09be26f195f05ab6
Created December 10, 2014 23:42
Java file io example
import java.io.BufferedReader;
import java.io.FileReader;
public class test {
public static void main(String[] args) {
// We must put bufferedIO type work in a try-catch block
// because it could throw an exception.
try {
// Create a new buffered reader object,
@superfunc
superfunc / bubble.java
Created November 17, 2014 16:39
Bubble sort example
// Sample algorithm, lab 11: bubble sort
// Josh Filstrup, GTA EECS Dept @ KU
// November 17th, 2014
public class bubble {
// A function to swap two elements of an array
public static void swap(int[] xs, int i, int j) {
// Create a temporary value so we don't lose
// it when assigning to xs[i] in the next line.
int tmp = xs[i];
@superfunc
superfunc / conkyrc
Created November 14, 2014 05:09
conkyrc
# Use Xft?
use_xft yes
xftfont Trebuchet MS:size=8
xftalpha 0.8
text_buffer_size 2048
# Up interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
@superfunc
superfunc / labexamreview.md
Last active August 29, 2015 14:08
EECS 168 Lab Exam Review

EECS 168, Lab Exam Review

Disclaimer: This is not a comprehensive review. It is to help you emphasize important sections, but it is your responsibility to review all previous labs and relevant chapters in the text.

Format of the exam

  • You will be allowed to use your textbooks, and eclipse. But you will not be able to discuss with one another, use your old labs, or access the internet.
@superfunc
superfunc / gist:36242904c2b7b10b0bd5
Created October 29, 2014 06:58
Maybe type in Nim
# An implementation of the Maybe monad for Nim
# This implements the traditional operations, bind(called chain)
# and return(called box) as well as a few useful operators for
# cleaning up usage of the monad. Also implemented the functor
# operation fmap(called map) which allows a procedure to be called
# on a wrapped value
type
Maybe*[T] = object
case valid*: bool
{-# LANGUAGE GADTs, KindSignatures #-}
data Tree :: * where
Leaf :: Int -> Tree
Node :: Tree -> Tree -> Tree
deriving (Show,Eq,Ord)
-- Write a function that sums the leaf values in a tree
summation :: Tree -> Int
summation (Leaf v) = v
summation (Node l r) = (summation l) + (summation r)