Skip to content

Instantly share code, notes, and snippets.

@wllmtrng
wllmtrng / README.md
Last active September 5, 2016 19:13
Prosper Score Distribution

View at http://bl.ocks.org/wllmtrng/ff72bf455078448e5e40ece3bff15354

Design

The Prosper Marketplace provides an alternative avenue for people to invest and borrow money. When a potential borrower fills out an application, a Prosper Score from 1 to 11 is assigned. Lending to an individual of a lower score will have a better return on investment, but also have increased chances of defaulting. Lending to an individual of a higher score will have a lower chance of defaulting, but a lower return on investment.

@wllmtrng
wllmtrng / match.py
Created April 16, 2015 20:14
Regular Expression Implementation of * and ?
#!/usr/bin/env python3
# Given a pattern and a list of filenames, return the filenames which match the given pattern in a separate list.
# The pattern should support two wild card characters '?' and '*', in which '?' can match one or zero character and '*'
# can match any number of characters
WILDCARD = '*'
ZERO_OR_ONE = '?'
@wllmtrng
wllmtrng / timeit_boilerplate.py
Created March 8, 2015 18:33
python timeit boilerplate
def test():
"""Stupid test function"""
L = []
for i in range(100):
L.append(i)
if __name__ == '__main__':
import timeit
print(timeit.timeit("test()", setup="from __main__ import test"))
@wllmtrng
wllmtrng / MainActivity.java
Created December 29, 2014 16:27
OpenCV Camera Android Java Example
package com.example.helloopencvcamera;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Mat;
@wllmtrng
wllmtrng / UIComponent.cpp
Last active July 19, 2023 14:30
X11 Motif C++ Widget Base Class
/*
* BasicComponent.cpp
*
* Created on: Oct 4, 2014
* Author: wtruong
*/
#include <cstdio>
#include "UIComponent.h"