This file contains hidden or 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
{"archived":true,"downs":0,"link_id":"t3_etyqc","score_hidden":false,"id":"c1b06fp","author_flair_css_class":null,"body":"They should add that to the instructions on the box :p","ups":1,"distinguished":null,"gilded":0,"edited":false,"retrieved_on":1426664469,"parent_id":"t1_c1azvxa","created_utc":"1293840000","subreddit":"sex","controversiality":0,"author_flair_text":null,"score":1,"name":"t1_c1b06fp","author":"SandRider","subreddit_id":"t5_2qh3p"} | |
{"name":"t1_c1b06fq","score":2,"author":"throwaway-o","subreddit_id":"t5_2r0cn","parent_id":"t1_c1az6tm","created_utc":"1293840001","subreddit":"relationship_advice","controversiality":0,"author_flair_text":null,"edited":false,"retrieved_on":1426664469,"distinguished":null,"gilded":0,"body":"Beta has nothing to do with lack of muscles. It has everything to do with an inability to lead and assert yourself peacefully but firmly in the relationship.","ups":2,"id":"c1b06fq","author_flair_css_class":null,"archived":true,"link_id":"t3_eu4fk","downs":0,"score_hidden":fal |
This file contains hidden or 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
// Copyright 2013 Google Inc. All Rights Reserved. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or 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
-- The tables I assume you have: | |
CREATE TABLE articles | |
( | |
"Id" serial NOT NULL, | |
"Date" date, | |
"Article" text, | |
"Author" text, | |
"Title" text, | |
"Points" integer, | |
"NumComments" integer, |
This file contains hidden or 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
-- | |
-- Not optimized -> I only run it once and it's fast enough not to be worth optimizing ^.^ | |
-- | |
SELECT | |
mt.topic, | |
'{' || | |
'"d":"' || mt.year || '-' || mt.month || '-01"' || | |
',"p":' || CASE WHEN r.points is NULL THEN 0 ELSE r.points END || | |
',"c":' || CASE WHEN r.comments is NULL THEN 0 ELSE r.comments END || |
This file contains hidden or 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
{ | |
"courseId":10, | |
"settings":{ | |
"diverse":true, | |
"numStartPoints": 25, | |
"numIterations": 50 | |
}, | |
"students":[ | |
{ | |
"id":1, |
This file contains hidden or 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
{ | |
"courseId":10, | |
"settings":{ | |
"diverse":true | |
}, | |
"students":[ | |
{ | |
"id":1, | |
"name":"Bram", | |
"groupPreferences":[ |
This file contains hidden or 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
package hackernewstrends | |
import edu.arizona.sista.processors.fastnlp.FastNLPProcessor | |
import org.apache.spark.SparkContext | |
import org.apache.spark.mllib.clustering.LDA | |
import org.apache.spark.mllib.linalg.{Vector, Vectors} | |
import org.apache.spark.rdd.RDD | |
import org.json4s.jackson.JsonMethods._ | |
import org.json4s.{DefaultFormats, _} | |
import org.apache.log4j.{Logger, Level} |
This file contains hidden or 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
/* | |
To set the correct locations: | |
$ LD_LIBRARY_PATH=/usr/local/lib | |
$ export LD_LIBRARY_PATH | |
Example run | |
$ gcc mstfinder.c -lgsl -lgslcblas -lm | |
$./a.out -fast -v Running | |
75000 in fast mode; results can not be guaranteed to be correct. | |
Reserved space for 400000000 edges. |
This file contains hidden or 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
// De eisen voor de codewoorden | |
var codeLength = 15, | |
hamDist = 7; | |
// Creeër het eerste codewoord; 0 | |
var firstCode = []; | |
for(var i = 0; i < codeLength; i++) { | |
firstCode[i] = 0; | |
} |
This file contains hidden or 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
function createResponse(name) { | |
this.name = name, | |
this.sayHi = function() { | |
return 'Hi!'; | |
}, | |
this.getName = function() { | |
return this.name; | |
}, |
NewerOlder