Skip to content

Instantly share code, notes, and snippets.

int main()
{
printf("Hello\n");
// wtf???????????/
printf("World\n");
}
{
"metadata": {
"name": "How many CONSISTENT triplets are there?"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gcr
gcr / test.c
Created November 23, 2013 19:42
#include "stdio.h" // includes definiton of printf
#include "stdlib.h" // includes definiton of malloc
void copy_string(char *dest, char *src) {
// Copy bytes from src into dest
while ((*(dest++) = *(src++))) {};
}
int main(){
@gcr
gcr / gist:7553850
Last active December 28, 2015 19:59
import random
def plot_correspondence(points1, points2, fraction_of_lines):
fig,(ax1,ax2) = subplots(1,2,sharex=True,sharey=True,figsize=(10,8))
# Set plot boundaries
ax1.set_ylim(31,43)
ax1.set_xlim(-126,-112)
# Draw first points
ax1.scatter(points1[:,0],points1[:,1],s=0.5,color='b')
# Draw second points
ax2.scatter(points2[:,0],points2[:,1],s=0.5,color='r')
np.select(np.array([[1, 1, 0, 0],
[0, 0, 1, 1]]),
np.array([[1, 2, 3, 4],
[5, 6, 7, 8]]))
Truncated Traceback (Use C-c C-x to view full TB):
/usr/lib/python2.7/site-packages/numpy/core/fromnumeric.pyc in choose(a, choices, out, mode)
296 except AttributeError:
297 return _wrapit(a, 'choose', choices, out=out, mode=mode)
--> 298 return choose(choices, out=out, mode=mode)
{
"metadata": {
"name": "How many CONSISTENT triplets are there?"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@gcr
gcr / gist:7110776
Last active December 26, 2015 06:49
{ "metadata": { "name": "Untitled4" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "from skimage.io import Image\n", "\n", "picture = np.zeros((512,512))\n", "for y in xrange(512):\n", " for x in xrange(512):\n", " picture[y, x] += 2*np.clip(np.exp(- np.sqrt(((150.-x)**2+((150.-y)/4)**2)/50.)),\n", " 0, 0.5)\n", " picture[y, x] += 2*np.clip(np.exp(- np.sqrt(((350.-x)**2+((150.-y)/4)**2)/50.)),\n", " 0, 0.5) \n", " if 96<np.sqrt((y-270)**2+(x-256)**2)<160 and y>290:\n", " picture[y, x] += 0.4+0.4*np.cos(np.sqrt((y-270)**2+(x-256)**2)*0.1)\n", "Image(picture)" ], "language": "python", "outputs": [ { "jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a\nHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAIAAgABAREA/8QAHwAAAQUBAQEB\nAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1Fh\nByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZ\nWmNkZWZnaGlqc3R1dnd4eXq
{
"metadata": {
"name": "RANSAC similarity transform"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
http://www.cs.cornell.edu/phd/requirements
Cornell requires these courses:
* Competency requirement
- [ ] Artificial Intelligence: CS 4700
- [ ] Programming Languages: One of
CS 4110 (PL)
CS 4120 (Compilers)