Skip to content

Instantly share code, notes, and snippets.

@suyash
suyash / LICENSE
Last active November 16, 2016 03:00
me
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016- Suyash Verma <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@suyash
suyash / .gitignore
Created March 20, 2016 18:39
Cassandra indexing using Thrift
### Java ###
*.class
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
@suyash
suyash / .gitignore
Created March 20, 2016 18:42
Cassandra to Cassandra over Hadoop MapReduce bindings
### Java ###
*.class
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
@suyash
suyash / Main.java
Created March 20, 2016 18:46
Spark SQL using SQLContext with a dynamically defined schema
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.RowFactory;
@suyash
suyash / Main.java
Created March 20, 2016 18:47
Cassandra Indexing using Spark Cassandra Connector
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Host;
import com.datastax.driver.core.Metadata;
import com.datastax.driver.core.PreparedStatement;
import com.datastax.driver.core.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Main {
@suyash
suyash / Main.java
Created March 20, 2016 18:49
Spark SQL using static schema
import java.io.Serializable;
import java.util.Arrays;
import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.SQLContext;
import com.datastax.spark.connector.japi.CassandraRow;
@suyash
suyash / Main.java
Created March 20, 2016 18:50
Spark SQL using CassandraSQLContext
import java.util.Arrays;
import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.cassandra.CassandraSQLContext;
public class Main {
@suyash
suyash / Makefile
Created March 20, 2016 18:51
OpenMPI
all: main.out
mpirun -n 4 ./$<
main.out: main.o
mpic++ -o $@ $<
main.o: main.cc
mpic++ -c -o $@ $<
clean:
@suyash
suyash / Main.java
Created March 20, 2016 18:53
Cassandra to STDOUT using Spark
import java.util.Arrays;
import java.util.Map;
import static com.datastax.spark.connector.japi.CassandraJavaUtil.*;
import com.datastax.spark.connector.japi.CassandraRow;
import com.datastax.spark.connector.japi.SparkContextJavaFunctions;
import com.datastax.spark.connector.japi.rdd.CassandraJavaRDD;
import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
@suyash
suyash / README.md
Last active April 5, 2016 12:35
Y fractal

Y fractal for a given number of levels

for 3 levels:

\ / \ / \ / \ /
 |   |   |   |
 \   /   \   /
  \ /     \ /
 | |