Skip to content

Instantly share code, notes, and snippets.

@balamuru
balamuru / gist:4726232
Last active December 12, 2015 05:59
scikit incremental vectorizer - debug
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# License: Simplified BSD
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import FeatureHasher
from sklearn.pipeline import Pipeline
@balamuru
balamuru / gist:4727614
Last active December 12, 2015 06:18
Gensim Clustering attempt
import logging
from scipy.odr import models
import unittest
import os
import os.path
import tempfile
import numpy
import gensim
import logging
@balamuru
balamuru / incremental_clustering.py
Created February 7, 2013 22:19
Incremental Mini KMeans Clustering
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# License: Simplified BSD
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import FeatureHasher
from sklearn.pipeline import Pipeline
@balamuru
balamuru / gensim_scikit_kmeans.py
Last active December 27, 2019 10:52
gensim + scikit clustering vs scipy clustering (DEBUG)
import logging
from scipy.odr import models
from sklearn import metrics
import unittest
import os
import os.path
import tempfile
import numpy
from matplotlib.pyplot import plot, show
var fs = require('fs'); // get the fs module
var EventEmitterVar = require('events').EventEmitter, util = require('util');
var exampleEventEmitterClass= function () {
console.log("emitter constructor");
}
util.inherits(exampleEventEmitterClass, EventEmitterVar); //register class as emitter
exampleEventEmitterClass.prototype.emitMethod1 = function () {
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java -Didea.launcher.port=7534 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13.app/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Li
org.springframework:gs-accessing-neo4j-data-rest:jar:0.1.0
+- org.springframework.boot:spring-boot-starter-web:jar:1.0.0.RC5:compile
| +- org.springframework.boot:spring-boot-starter:jar:1.0.0.RC5:compile
| | +- org.springframework.boot:spring-boot:jar:1.0.0.RC5:compile
| | | +- (org.springframework:spring-core:jar:4.0.2.RELEASE:compile - omitted for duplicate)
| | | \- (org.springframework:spring-context:jar:4.0.2.RELEASE:compile - omitted for duplicate)
| | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.0.0.RC5:compile
| | | \- (org.springframework.boot:spring-boot:jar:1.0.0.RC5:compile - omitted for duplicate)
| | +- org.springframework.boot:spring-boot-starter-logging:jar:1.0.0.RC5:compile
| | | +- org.slf4j:jcl-over-slf4j:jar:1.7.6:compile
package hello;
import javax.jms.*;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
<script src="stomp.js"></script>
<script type="text/javascript">
var myTopic = "/topic/greetings";
var client = Stomp.client("ws://localhost:61614/stomp", "v11.stomp");
console.log("start");
client.connect("", "",
function () {
client.subscribe(myTopic,
function (message) {
console.log("Ok....got the message jack!");
package hello;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.util.FileSystemUtils;
import java.io.File;
public class Receiver {