Skip to content

Instantly share code, notes, and snippets.

@PirosB3
PirosB3 / gist:7266409
Last active December 27, 2015 04:19
NEAURAL NETS NEARLY IN PARALLEL
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(cudaError_t code, char *file, int line, bool abort=true)
{
if (code != cudaSuccess)
{
@PirosB3
PirosB3 / gist:7301411
Created November 4, 2013 11:43
Game shit
//**************************************************************************//
// Start of an OBJ loader. By no means an end. This just creates //
// triangles. //
// //
// Look for the Nigel style comments, like these, for the bits you need to //
// look at. //
//**************************************************************************//
//**************************************************************************//
// Modifications to the MS sample code is copyright of Dr Nigel Barlow, //
@PirosB3
PirosB3 / gist:7530728
Created November 18, 2013 16:23
MNIST
import argparse
from collections import defaultdict
import cPickle, gzip
import multiprocessing
import sys
import Image
import numpy as np
from sklearn.datasets import fetch_mldata
import datetime
import json
import os
import time
import pymongo
from flask import Flask, render_template
from pymongo.uri_parser import parse_uri
@PirosB3
PirosB3 / gist:7895888
Created December 10, 2013 18:46
CUDA
#include <math.h>
#define WARP_SIZE 16
#define DEBUG false
/* ---------------- [[CUDA KERNELS]] ---------------- */
__global__ void updateWeightsCUDA(float *weights, float *changes, float *delta_outputs, float *inputs, int n_inputs, int n_outputs) {
int width = n_outputs;
int height = n_inputs;
@PirosB3
PirosB3 / gist:8047662
Last active December 31, 2015 21:29
LoadMesh function
SortOfMeshSubset *LoadMesh(LPSTR filename) {
std::wifstream fileStream;
std::wstring line;
// Instead of using VertexXYZ I am just using XMFLOAT3 and XMFLOAT2
std::vector <XMFLOAT3> vectorVertices(0);
std::vector <XMFLOAT2> vectorTextureVertices(0);
std::vector <XMFLOAT3> vectorNormalVertices(0);
std::vector<SimpleVertex> vertices;
[{"id":35,"user_id":36,"video_path":"6cc56475885fbdb83a536d78b16e1e0c/h264/play.mp4","description":null,"thumbnail_path":"6cc56475885fbdb83a536d78b16e1e0c/h264/play_1.jpg","created_at":"2014-01-14T21:47:10.137+01:00","updated_at":"2014-01-14T21:47:25.101+01:00","title":"jj","panda_video_id":"6cc56475885fbdb83a536d78b16e1e0c","panda_status":"complete","width":640,"height":480,"type":"video","video_url":"http://tascout.s3.amazonaws.com/6cc56475885fbdb83a536d78b16e1e0c/h264/play.mp4","thumbnail_url":"http://tascout.s3.amazonaws.com/6cc56475885fbdb83a536d78b16e1e0c/h264/play_1.jpg","likes":[],"comments":[{"id":62,"user_id":36,"user_name":"Daniel Pyrathon","profile_image_url":"http://graph.facebook.com/665044728/picture?type=large","body":"fuck off"},{"id":61,"user_id":36,"user_name":"Daniel Pyrathon","profile_image_url":"http://graph.facebook.com/665044728/picture?type=large","body":"fuck off"},{"id":60,"user_id":36,"user_name":"Daniel Pyrathon","profile_image_url":"http://graph.facebook.com/665044728/picture?ty
1 0 0 0
0 1 0 0
0 0 1 1/f
0 0 0 0
export FB_APP_ID=
export FB_APP_SECRET=
export TEST_DB_NAME=tascout_test
export TEST_DB_USERNAME=tascout
export TEST_DB_PASSWORD=
export DEV_DB_NAME=tascout
export DEV_DB_USERNAME=tascout
export DEV_DB_PASSWORD=
var g = this.svg
.selectAll('.arc path')
.data(pie(mappedData), function(e) {
return e.data.label;
})
g.enter()
.append('g')
.attr('class', 'arc')
.append('path')