Skip to content

Instantly share code, notes, and snippets.

#ifndef __SPARSE_H
#define __SPARSE_H
#include "util.h"
typedef struct C
{
int col;
int val;
struct C* next;
#include "sparse.h"
void sparse_debug(sparse_matrix* m)
{
for(int r = 0; r < m->rows; r++)
{
printf("row %d:\n", r);
sparse_cell* c = m->row[r];
while(c != NULL)
{
import java.io.*;
import java.util.Scanner;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.ArrayList;
import java.util.Collections;
import java.lang.Math;
public class filter {
import java.util.*;
import java.lang.Math;
public class NaiveBayesClassifier implements java.io.Serializable {
// the number of spam and ham documents
private int numSpam = 0;
private int numHam = 0;
// total number of words we've seen
import java.io.*;
import java.util.*;
public class TrainClassifier {
private static ArrayList<String> stopWords;
public static void main(String[] args) {
// based on word list from http://www.ranks.nl/resources/stopwords.html
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace cv;
-- 19. List the 10 best directors (use the average score of their films to determine who is best) in descending
-- order along with the number of films they've made and the average score for their films. Only consider
-- directors who have made at least five films (4 marks)
SELECT * FROM (
SELECT * FROM (
SELECT name, COUNT(*) AS "NUM_FILMS", AVG(score) as "AVERAGE" FROM shared.MOVIE, shared.ACTOR
WHERE shared.actor.id = director
GROUP BY name)
WHERE NUM_FILMS > 4
ORDER BY AVERAGE DESC)

My Experiences Coding in Unity

GUI

While there are [several][1] [question][2] [topics][3] dealing with how to program GUIs in Unity, none of them really answer the question I wanted to know: How to lay out the actual code. After my first project in Unity, here are the thoughts I have on how to build a non-trivial GUI in Unity

Handling Button Clicks

@charlieda
charlieda / bootstrap-carousel.js
Created January 2, 2016 12:07
Automatically decorate bootstrap carousel elements with navigation arrows and slide indicators
{
"ignored_packages":
[
"Vintage"
],
"ensure_newline_at_eof_on_save": true,
"trim_trailing_white_space_on_save": true,
"translate_tabs_to_spaces": true
}