start new:
tmux
start new with session name:
tmux new -s myname
| <property> | |
| <name>yarn.application.classpath</name> | |
| <value>/usr/lib/hadoop-0.23-tm-6/share/hadoop/common/*:/usr/lib/hadoop-0.23-tm-6/share/hadoop/mapreduce/*:/usr/lib/hadoop-0.23-tm-6/share/hadoop/common/lib/*:/usr/lib/hadoop-0.23-tm-6/share/hadoop/hdfs/*:/usr/lib/hadoop-0.23-tm-6/share/hadoop/mapreduce/lib/*</value> | |
| </property> |
| val BaseBuildURL = "https://build.phonegap.com/api/v1" | |
| val UTF8Charset = Charset.forName("UTF-8") | |
| case class MultipartInfo(contentType: Header, contentEncoding: Option[Header]) | |
| val baseHeaders: List[Header] = { | |
| val authRaw = "%s:%s".format(phoneGapCreds.username, phoneGapCreds.password) | |
| val authBase64 = Base64.encodeBase64(authRaw.getBytes(UTF8Charset)) | |
| val authString = new String(authBase64, UTF8Charset) | |
| List( | |
| new BasicHeader(HttpHeaders.AUTHORIZATION, "Basic %s".format(authString)), | |
| new BasicHeader(HttpHeaders.ACCEPT, "*/*"), |
| -- Kevin Cantu | |
| -- April 2012 | |
| import Control.Monad (when) | |
| import Data.Map (Map) | |
| import Data.List | |
| import Data.List.Split | |
| import qualified Data.Map as M | |
| import System.Environment | |
| import System.IO |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| import java.lang.Character.{ LETTER_NUMBER => CR,LINE_SEPARATOR => LF } | |
| import java.net.InetSocketAddress | |
| import java.nio.channels.AsynchronousChannelGroup._ | |
| import java.nio.channels.AsynchronousServerSocketChannel._ | |
| import java.nio.channels.{ AsynchronousSocketChannel => ASC } | |
| import java.nio.channels.CompletionHandler | |
| import java.nio.ByteBuffer._ | |
| import java.util.concurrent.Executors._ | |
| import scala.annotation.implicitNotFound | |
| import scala.collection.mutable.ListBuffer |
| /** | |
| * D Holbrook | |
| * | |
| * Code Club: PO1 | |
| * | |
| * (*) Define a binary tree data structure and related fundamental operations. | |
| * | |
| * Use whichever language features are the best fit (this will depend on the language you have selected). The following operations should be supported: | |
| * | |
| * Constructors |
| #!/usr/bin/env ruby | |
| # How about an awesome command-line script | |
| # that replaces your usage of "awk -F, ..." | |
| # for like 99% of cases. | |
| # | |
| # Also, importantly, it supports CSV features | |
| # like escaping commas when quoted | |
| # | |
| # Usage: csv.rb [options] <filename> |
| package recfun | |
| import scala.collection.mutable.ListBuffer | |
| import common._ | |
| /** https://class.coursera.org/progfun-2012-001/assignment/view?assignment_id=4 */ | |
| object Main { | |
| def main(args: Array[String]) { | |
| println("Pascal's Triangle") | |
| for (row <- 0 to 10) { |
Typically, you can't use a 'new' operator on a generic type. This is because of type erasure.
scala> def create[T] = new T
<console>:7: error: class type required but T found
def create[T] = new T
^
Scala gives a way of getting around this problem, with the Manifest class.
scala> def create[T](implicit m:Manifest[T]) = m.erasure.newInstance