Vector v1 = Vectors.dense(1.0, 0.0, 3.0);
Vector v2 = Vectors.dense(2.0, 3.0, 3.0);
ArrayList<Vector> listVector = new ArrayList<Vector>();
listVector.add(v1); listVector.add(v2);
JavaRDD<Vector> rddVector = jsc.parallelize(listVector);
RowMatrix r = new RowMatrix(rddVector.rdd());
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
/* Getopt for GNU. | |
NOTE: getopt is now part of the C library, so if you don't know what | |
"Keep this file name-space clean" means, talk to [email protected] | |
before changing it! | |
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 | |
Free Software Foundation, Inc. | |
This file is part of the GNU C Library. | |
The GNU C Library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public |
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
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
# http://stackoverflow.com/questions/30487010/recursively-apply-function-to-list-elements
recursive_browse_list <- function(x) {
if(is.list(x)) {
# (OPTIONAL) DO HERE SOME OPERATION ON LIST
# example here : add names to list which do not have name
if(is.null(names(x))) {
if(length(x)>0) names(x) <- as.list(1:length(x))
}
- Install Virtual Box (https://www.virtualbox.org)
- Install Oracle VM VirtualBox Extension Pack (https://www.virtualbox.org)
- Install Vagrant
mkdir osxvm
cd osxvm
vagrant init jhcook/osx-elcapitan-10.11
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
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $numArgs = $#ARGV + 1; | |
my @types = qw/nat mangle filter/; | |
if ($numArgs > 0) {@types = @ARGV;} | |
$SIG{INT} = sub{print "\e[?25h\e[u"; exit}; |
# from https://github.com/WonderBeat/docker-archive/blob/master/firehol.conf
# FireHOL config file with docker tunnel
#
# eth0 (World) <-> FireHOL <->
# <-> Docker
# tun0 (Internal VPN) <->
#
version 5
server_ssh_ports="tcp/222"
server {
listen 8000;
index index.html index.htm;
# this map is defined in http section
# in /etc/nginx/nginx.conf
# map $uri $custom_content_type {
# default "text/html";
# ~(.*\.html)$ "text/html";
OlderNewer