(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /** | |
| * Takes a camel cased identifier name and returns an underscore separated | |
| * name | |
| * | |
| * Example: | |
| * camelToUnderscores("thisIsA1Test") == "this_is_a_1_test" | |
| */ | |
| def camelToUnderscores(name: String) = "[A-Z\\d]".r.replaceAllIn(name, {m => | |
| "_" + m.group(0).toLowerCase() | |
| }) |
| /** | |
| * Takes a camel cased identifier name and returns an underscore separated | |
| * name | |
| * | |
| * Example: | |
| * camelToUnderscores("thisIsA1Test") == "this_is_a_1_test" | |
| */ | |
| def camelToUnderscores(name: String) = "[A-Z\\d]".r.replaceAllIn(name, {m => | |
| "_" + m.group(0).toLowerCase() | |
| }) |
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import base64 | |
| import sys | |
| PEM = ("""-----BEGIN RSA PRIVATE KEY----- | |
| MIIEogIBAAKCAQEAgK1Q6Ydi8UUheJLvnTYJE65NOZtAtjDdDSxS+6b4x9EakjIylljSzs5uLEJn |
| package main | |
| import ( | |
| "github.com/gin-gonic/gin" | |
| "github.com/jinzhu/gorm" | |
| _ "github.com/mattn/go-sqlite3" | |
| ) | |
| type Users struct { | |
| Id int `gorm:"AUTO_INCREMENT" form:"id" json:"id"` |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # Wes Floyd April 2015 | |
| import sys | |
| import requests | |
| import json | |
| import argparse | |
| import pprint | |
| import time | |
| pp = pprint.PrettyPrinter(indent=4) |
#Kafka - Messaging Basics This assumes you are starting fresh and have no existing Kafka or ZooKeeper data. See http://kafka.apache.org/documentation.html#quickstart for more details.
##Install Java
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
| kawasaki@hadoop11:~$ hdfs cacheadmin -listDirectives | |
| Found 0 entries | |
| kawasaki@hadoop11:~$ hdfs cacheadmin -listDirectives stats | |
| Can't understand argument: stats | |
| kawasaki@hadoop11:~$ hdfs cacheadmin -listDirectives -stats | |
| Found 0 entries | |
| kawasaki@hadoop11:~$ hadoop fs -ls dir1 | |
| Found 4 items | |
| drwxr-xr-x - kawasaki kawasaki 0 2014-04-09 06:38 dir1/a | |
| -rw-r--r-- 3 kawasaki kawasaki 75288655 2014-04-09 06:44 dir1/bigfile |
| Producer | |
| Setup | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
| Single thread, no replication | |
| bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
| #!/usr/bin/env bash | |
| # | |
| # =================================== | |
| # Experiments with the HBase REST API | |
| # =================================== | |
| # | |
| # <http://hbase.apache.org/docs/r0.20.4/api/org/apache/hadoop/hbase/rest/package-summary.html> | |
| # | |
| # Usage: | |
| # |