Skip to content

Instantly share code, notes, and snippets.

View AbhiAgarwal's full-sized avatar
:shipit:
heeeey

Abhi Agarwal AbhiAgarwal

:shipit:
heeeey
View GitHub Profile
package main
import (
"log"
"net/http"
)
func main() {
fs := http.FileServer(http.Dir("staticfiledirectory"))
http.Handle("/", fs)

The idea for this is that there are two resources: one is Feedback and the other is FeedbackType

FeedbackType just consists of all questions that we can ask. The questions relate to resources. The feedback be for a person, event, team, etc.

The seperation of FeedbackType from Feedback is to reduce duplication of questions. The Intranet will easily be able to load all the questions.

A particular feedback would consist of:

Feedback {
{
"AddressValidateResponse": {
"Address": {
"Address2": "6406 IVY LN",
"City": "GREENBELT",
"State": "MD",
"Zip5": "20770",
"Zip4": "1441"
}
}
cl user()
string Username
string password
end
fn frontPage(res, req)
res.Template("index.html", nil)
end
fn main()

First take a look at this particular post:

Now that you have some understanding take a look at this one:

A Gentle Introduction to Scikit-Learn: A Python Machine Learning Library - http://machinelearningmastery.com/a-gentle-introduction-to-scikit-learn-a-python-machine-learning-library/

It introduces Scikit-Learn, which is the go-to Machine Learning library in Python. You can probably learn a lot from this particular library because it does a lot of practical things that you would take a while to code easily. It also has a couple sample data-sets, which allow you to start testing and learning Machine Learning straight away.

import csv
ebola = open('Ebola_frequencies.csv')
csv_ebola = csv.reader(ebola)
for i in csv_ebola:
# Basically csv_ebola contains an array of items
# The first index: i[0] is the word
# And the rest i[1] i[2] i[3] i[4] correspond to the dates
print 'Word', i[0], '2014-10-20', i[1], '2014-10-27', i[2], '2014-10-06', i[3], '2014-10-13', i[4]
{
"_id": "5466b5a438f0d87f029cd0d5",
"abstract": null,
"allText": "By KEN BELSONNOV. 14, 2014\n\nThere is no shortage of ways for fans to bet on sports, even though federal law forbids gambling on games in almost all states: Fantasy leagues, state-run lotteries and neighborhood bookies, as well as online offshore ones, will take a fan’s action.\nFor decades, professional sports leagues have steadfastly opposed gambling and backed the prohibition of betting on games because they claimed it would undermine their sports’ integrity and lead to questions about the honesty of players and referees.\nBut the leagues, eager for a slice of a multibillion-dollar moneymaker, have also tiptoed around their own opposition. N.F.L. teams have licensing deals with state lotteries and have pushed to establish a franchise in London, where betting shops are ubiquitous.\nMajor League Baseball, the N.B.A. and the N.H.L. all work with fantasy sports companies. This year, the Devils and the Philadelphia 76ers partnered w
import numpy as np
import sklearn
from sklearn.tree import *
from sklearn.datasets import *
iris = load_iris()
X = iris.data
y = iris.target
#!/usr/bin/env python
import sys
import os.path
if __name__ == "__main__":
if len(sys.argv) != 2:
print "usage: create_csv <base_path>"
sys.exit(1)
// run using g++-mp-4.7 -fopenmp -std=c++11 openmp_example.cpp -o openmp_example
// on my mac. Not sure about everyone elses, but my g++ version doesn't have openp
// so I have to use that one
#include <iostream>
using namespace std;
#include <omp.h>
int main(int argc, char *argv[])