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
| cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 10 | head -n 1 |
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
| from sklearn.linear_model import LogisticRegression | |
| from sklearn.neighbors import KNeighborsClassifier | |
| from sklearn.svm import SVC | |
| from sklearn.gaussian_process import GaussianProcessClassifie | |
| from sklearn.ensemble import RandomForestClassifier | |
| from sklearn.neural_network import MLPClassifier | |
| from sklearn.ensemble import AdaBoostClassifier | |
| from sklearn.naive_bayes import GaussianNB | |
| from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis |
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 org.apache.hadoop.hbase.HRegionInfo | |
| import org.apache.hadoop.hbase.HBaseConfiguration | |
| import org.apache.hadoop.hbase.HConstants | |
| import org.apache.hadoop.hbase.client.ConnectionFactory | |
| import org.apache.hadoop.hbase.util.Bytes | |
| import org.apache.hadoop.hbase.filter.PrefixFilter | |
| import org.apache.hadoop.hbase.TableName | |
| import org.apache.hadoop.hbase.client.Scan | |
| import scala.util.Try | |
| import scala.collection.JavaConverters._ |
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.ArrayList | |
| import java.util.HashMap | |
| import scala.collection.JavaConverters.asScalaBufferConverter | |
| import scala.collection.mutable.{Map => MapMutable} | |
| object MapBenchmark { | |
| def main(args: Array[String]): Unit = { | |
| val hm = new HashMap[String, String]() | |
| hm.put("teste1", "ok1") |
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.ArrayList | |
| import java.util.HashMap | |
| import scala.collection.JavaConverters.asScalaBufferConverter | |
| import scala.collection.mutable.{Map => MapMutable} | |
| object MapBenchmark { | |
| def main(args: Array[String]): Unit = { | |
| val hm = new HashMap[String, String]() | |
| hm.put("teste1", "ok1") |
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.ArrayList | |
| import java.util.HashMap | |
| import scala.collection.JavaConverters.asScalaBufferConverter | |
| import scala.collection.mutable.{Map => MapMutable} | |
| object MapBenchmark { | |
| def main(args: Array[String]): Unit = { | |
| val hm = new HashMap[String, String]() | |
| hm.put("teste1", "ok1") |
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
| from PIL import Image, ImageDraw | |
| import math | |
| increment = 10 | |
| margin = 0 | |
| size = 640*2 | |
| angle_increment = 5 | |
| image = Image.new('RGBA', (size, size)) | |
| draw = ImageDraw.Draw(image) |
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
| object KryoExperiment { | |
| case class SomeClass(x: String, v: String) | |
| case class BigClass(x: String, v: Long, k: Double) | |
| def main(args: Array[String]): Unit = { | |
| val sparkConf1 = new SparkConf() | |
| .set("spark.serializer", "org.apache.spark.serializer.KryoSerializer") | |
| .registerKryoClasses(Array()) |
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
| require 'sprockets/directive_processor' | |
| class MiddleIncludeProcessor < Sprockets::DirectiveProcessor | |
| def prepare | |
| @pathname = Pathname.new(file) | |
| @header = '' | |
| @body = data | |
| @included_pathnames = [] | |
| @compat = false |
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 gevent | |
| from geventhttpclient.url import URL | |
| from geventhttpclient.client import HTTPClient | |
| url = URL("http://musica.com.br/artistas/a/") | |
| http = HTTPClient.from_url(url, connection_timeout=5, concurrency=5) | |
| def get(): | |
| print "Getting..." | |
| response = http.get(url.path) |