identical mmap programs in C and go
This file contains hidden or 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 main | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "flag" | |
| "io/ioutil" | |
| "os" | |
| "regexp" | |
| "strings" |
This file contains hidden or 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 main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "path/filepath" | |
| ) | |
| func replace(s string) string { |
Y fractal for a given number of levels
for 3 levels:
\ / \ / \ / \ /
| | | |
\ / \ /
\ / \ /
| |
This file contains hidden or 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.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; |
This file contains hidden or 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
| all: main.out | |
| mpirun -n 4 ./$< | |
| main.out: main.o | |
| mpic++ -o $@ $< | |
| main.o: main.cc | |
| mpic++ -c -o $@ $< | |
| clean: |
This file contains hidden or 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.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 { |
This file contains hidden or 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.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; |
This file contains hidden or 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.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 { |