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 java.lang.reflect.Field; | |
public class ReflectionUtils { | |
// least invasive method of obtaining protected/private field value | |
private static <T> T getPrivateFieldValue(Object object, String fieldName) throws Exception { | |
Field field = object.getClass().getDeclaredField(fieldName); | |
field.setAccessible(true); | |
T fieldValue = (T) field.get(object); | |
field.setAccessible(false); |
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
mahout clusterdump \ | |
-dt sequencefile \ # format: {Integer => String} | |
-d reuters-vectors/dictionary.file-* \ # dictionary: {id => word} | |
-i reuters-kmeans-clusters/clusters-3-final \ # input | |
-o clusters.txt \ # output (local filesystem) | |
-b 10 \ # format length | |
-n 10 # number of top terms to print | |
--distanceMeasure org.apache.mahout.common.distance.CosineDistanceMeasure # default is euclidean distance |
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
# simple http authentification with htpasswd | |
<Directory /var/www> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
AuthName "Restricted" | |
AuthGroupFile /dev/null | |
AuthType Basic | |
AuthBasicProvider file |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |