This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(time2)] | |
use std::time::Instant; | |
use std::thread; | |
use std::sync::mpsc; | |
use std::io; | |
struct ScopedPerformanceBlock<'a> { | |
sender: &'a mpsc::Sender<u32>, | |
creation_time: Instant, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import argparse | |
import numpy as np | |
from sklearn.feature_extraction import DictVectorizer | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.preprocessing import LabelEncoder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from flask import Flask, url_for, redirect, session | |
from flask_login import (UserMixin, login_required, login_user, logout_user, current_user) | |
from flask_googlelogin import GoogleLogin | |
users = {} | |
app = Flask(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
Layout = null; | |
} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=9"/> | |
<title>Title</title> | |
<link href="@Url.Content("~/Content/bootstrap.css")" rel="stylesheet" type="text/css" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Minimal generic min heap and priority queue implementation in C#, in less than 100 lines of code | |
using System; | |
using System.Collections.Generic; | |
class MinHeap<T> where T : IComparable<T> | |
{ | |
private List<T> array = new List<T>(); | |
public void Add(T element) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
from scipy.sparse import * | |
from sklearn.decomposition import TruncatedSVD | |
import matplotlib.pyplot as plt | |
from matplotlib import cm as CM | |
import numpy as np | |
import time | |
class Timer(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class node: | |
def __init__(self): | |
self.is_end = False | |
self.table = {} | |
def add(self, c): | |
if c not in self.table: | |
self.table[c] = node() | |
return self.table[c] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Styling thing</title> | |
<style type="text/css"> | |
.riParent {border: 1px dotted gray} | |
.riTitle {font-size:larger} | |
.riText {font-size:smaller; font-style:italic; color: #AAAAAA; clear: both} | |
.riReject {} | |
.riAccept {} |