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
self.ip = [ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][0] |
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
((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
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
g.setFont(new Font(AWPrefs.getEditorFont(), Font.PLAIN, 2 * AWPrefs.getEditorFontSize())); | |
((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
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
package org.apache.mahout.knn.experimental; | |
import com.google.common.collect.Lists; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.LongWritable; | |
import org.apache.hadoop.io.SequenceFile; | |
import org.apache.hadoop.io.Text; |
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 static org.junit.Assert.*; | |
import java.util.Set; | |
import org.junit.Test; | |
import com.google.common.collect.Sets; | |
public class AbstractSymbolTest { |
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
org.apache.mahout.knn.search.ProjectionSearch org.apache.mahout.common.distance.EuclideanDistanceMeasure | |
Total number of clusters 344 | |
java.lang.AssertionError: Maximum weight too large 1.4078472959685535 | |
at org.junit.Assert.fail(Assert.java:91) | |
at org.junit.Assert.assertTrue(Assert.java:43) | |
at org.apache.mahout.knn.cluster.StreamingKMeansTest.testClustering(StreamingKMeansTest.java:106) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) |
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
plot_skm <- function(infile) { | |
print(infile) | |
library(package=ggplot2) | |
skm <- read.table(infile, skip=1) | |
cur_dev <- dev.cur() | |
plot_file <- paste(infile, '-numDataPointSeen.png', sep='') |
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
// Project the vector. | |
Vector vectorValue = value.get().clone(); | |
Vector projectedVector = new DenseVector(3); | |
for (int i = 0; i < 3; ++i) { | |
projectedVector.set(i, vectorValue.dot(basisVectors.get(i))); | |
} | |
projectedVector = projectedVector.normalize(); | |
writer.printf("%f %f %f\n", projectedVector.get(0), projectedVector.get(1), | |
projectedVector.get(2)); |
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
ByteArrayOutputStream bs = new ByteArrayOutputStream(2048); | |
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); | |
lc.reset(); | |
lc.setName("context"); | |
lc.start(); | |
PatternLayoutEncoder encoder = new PatternLayoutEncoder(); | |
encoder.setContext(lc); | |
encoder.setPattern("%message\n"); |
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
@Override | |
public Vector clone() { | |
DelegatingVector r; | |
try { | |
r = (DelegatingVector) super.clone(); | |
} catch (CloneNotSupportedException e) { | |
throw new RuntimeException("Clone not supported for DelegatingVector, shouldn't be possible"); | |
} | |
// delegate points to original without this | |
r.delegate = delegate.clone(); |
OlderNewer