Skip to content

Instantly share code, notes, and snippets.

% Some predefined strings for conferences & journals
@string{AAAI = "Conference on Artificial Intelligence (AAAI)"}
@string{AISTATS = "International Conference on Artificial Intelligence and Statistics (AISTATS)"}
@string{Bernoulli = "Bernoulli"}
@string{Biometrika = "Biometrika"}
@string{CandG = "Computers \& Graphics"}
@string{CACM = "Commun. ACM"}
@string{CG_SIGGRAPH = "Comput. Graph. (Proc. SIGGRAPH)"}
@string{CGA = "IEEE Comput. Graph. Appl."}
@string{CGF = "Comput. Graph. Forum"}
@chsasank
chsasank / ipynb_to_gallery.py
Last active February 21, 2024 14:29
Convert jupyter notebook to sphinx gallery notebook styled examples.
@fschr
fschr / main.cpp
Last active August 14, 2023 07:36
SDL2 Hello World | SDL2 Getting Started | SDL | OpenGL
// SDL2 Hello, World!
// This should display a white screen for 2 seconds
// compile with: clang++ main.cpp -o hello_sdl2 -lSDL2
// run with: ./hello_sdl2
#include <SDL2/SDL.h>
#include <stdio.h>
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
@shagunsodhani
shagunsodhani / CurriculumLearning.md
Created May 8, 2016 17:14
Notes for Curriculum Learning paper

Curriculum Learning

Introduction

  • Curriculum Learning - When training machine learning models, start with easier subtasks and gradually increase the difficulty level of the tasks.
  • Motivation comes from the observation that humans and animals seem to learn better when trained with a curriculum like a strategy.
  • Link to the paper.

Contributions of the paper

@eerwitt
eerwitt / load_jpeg_with_tensorflow.py
Created January 31, 2016 05:52
Example loading multiple JPEG files with TensorFlow and make them available as Tensors with the shape [[R, G, B], ... ].
# Typical setup to include TensorFlow.
import tensorflow as tf
# Make a queue of file names including all the JPEG images files in the relative
# image directory.
filename_queue = tf.train.string_input_producer(
tf.train.match_filenames_once("./images/*.jpg"))
# Read an entire image file which is required since they're JPEGs, if the images
# are too large they could be split in advance to smaller files or use the Fixed
@Jerdak
Jerdak / screenshotty.py
Created November 8, 2013 01:22
OpenGL screenshots using python
#! /usr/bin/env python
'''
Simple example demonstrating how to take a screenshot
'''
import time
import sys
import os
import argparse
#OpenGL
@misterbrownlee
misterbrownlee / jenkins-notes.md
Created September 12, 2012 18:10
Jenkins setup

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@wilsaj
wilsaj / flaskplotlib.py
Created March 9, 2011 13:09
Example of rendering a matplotlib image directly to Flask view
from flask import Flask, make_response
app = Flask(__name__)
@app.route("/simple.png")
def simple():
import datetime
import StringIO
import random
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
@miku
miku / mysqldump2sqlite3.sh
Created December 14, 2010 20:28
Convert a mysql database dump into something sqlite3 understands.
#!/bin/sh
# ================================================================
#
# Convert a mysql database dump into something sqlite3 understands.
#
# Adapted from
# http://stackoverflow.com/questions/489277/script-to-convert-mysql-dump-sql-file-into-format-that-can-be-imported-into-sqlit
#
# (c) 2010 Martin Czygan <martin.czygan@gmail.com>