Skip to content

Instantly share code, notes, and snippets.

@ngopal
ngopal / sgdlinreg.java
Created March 24, 2017 17:06
Stochastic Gradient Descent, but this time in Java.
package com.nikhilgopal.spark;
/**
* Created by nikhilgopal on 3/24/17.
*/
public class SGDLinReg {
public static void main(String[] args) {
double[] coefficients = {0.4, 0.8};
double[][] dataset = {
{1.0, 1.0},
@vittorioromeo
vittorioromeo / hello_triangle.cpp
Created October 10, 2015 11:07
SDL2 + OpenGL ES 2.0 - "Hello triangle" example that works both on X11 and Emscripten
#include <exception>
#include <functional>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
@graphific
graphific / 1_install_cuda.sh
Last active December 29, 2017 09:39
Installation script for Cuda and drivers on Ubuntu 14.04
#!/usr/bin/env bash
# Installation script for Cuda and drivers on Ubuntu 14.04, by Roelof Pieters (@graphific)
# BSD License
if [ "$(whoami)" == "root" ]; then
echo "running as root, please run as user you want to have stuff installed as"
exit 1
fi
###################################
# Ubuntu 14.04 Install script for:
# - Nvidia graphic drivers for Titan X: 352
@theburningmonk
theburningmonk / gist:1188378
Created September 2, 2011 10:57
Nancy self-hosting example
// a simple module to be hosted in the console app
public class MainModule : NancyModule
{
public MainModule()
{
Get["/"] = x => { return "Hello World"; };
}
}
static void Main(string[] args)