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 com.google.common.util.concurrent.*; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.Executors; |
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 sys | |
from pyspark.context import SparkContext | |
from numpy import array, random as np_random | |
from sklearn import linear_model as lm | |
from sklearn.base import copy | |
N = 10000 # Number of data points | |
D = 10 # Numer of dimensions | |
ITERATIONS = 5 |
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 matplotlib import pylab | |
def plot_confusion_matrix(cm, genre_list, name, title): | |
pylab.clf() | |
pylab.matshow(cm, fignum=False, cmap='Blues', vmin=0, vmax=1.0) | |
ax = pylab.axes() | |
ax.set_xticks(range(len(genre_list))) | |
ax.set_xticklabels(genre_list) | |
ax.xaxis.set_ticks_position("bottom") | |
ax.set_yticks(range(len(genre_list))) |
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
1. | |
sudo apt-get install pptpd | |
2.修改/etc/pptpd.conf | |
option /etc/ppp/pptpd-options | |
logwtmp | |
localip 192.168.0.1 | |
remoteip 192.168.0.2-3 | |
3.修改/etc/ppp/pptpd-options |
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
public class FixedSizePriorityQueue<E> extends TreeSet<E> { | |
private int elementsLeft; | |
public FixedSizePriorityQueue(int maxSize) { | |
super(new NaturalComparator()); | |
this.elementsLeft = maxSize; | |
} | |
public FixedSizePriorityQueue(int maxSize, Comparator<E> comparator) { |