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
/** | |
* Copyright 2013 Netflix, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 rx.android.observables; | |
import rx.Observable; | |
import rx.Observable.OnSubscribe; | |
import rx.Subscriber; | |
import rx.android.subscriptions.AndroidSubscriptions; | |
import rx.functions.Action0; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; |
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 rx.lang.scala.Observable._ | |
import rx.lang.scala.JavaConversions._ | |
import rx.lang.scala.ImplicitFunctionConversions._ | |
import rx.util.async.Async | |
import java.util.concurrent.Executors | |
import rx.schedulers.Schedulers | |
object Test extends App { | |
val executor = Executors.newFixedThreadPool(10) |
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
apply plugin: 'scala' | |
apply plugin: 'eclipse' | |
sourceCompatibility = JavaVersion.VERSION_1_6 | |
targetCompatibility = JavaVersion.VERSION_1_6 | |
eclipse { | |
classpath { | |
downloadSources = true | |
downloadJavadoc = 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
#!/bin/bash -e | |
set -e |
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
CREATE EXTERNAL TABLE IF NOT EXISTS access ( | |
ip STRING) | |
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' | |
LOCATION '/user/mstr/access'; |
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
# Installing CDH4 on a Single Linux Node in Pseudo-distributed Mode | |
# https://ccp.cloudera.com/display/CDH4DOC/Installing+CDH4+on+a+Single+Linux+Node+in+Pseudo-distributed+Mode | |
# Installing CDH4 with MRv1 on a Single Linux Node in Pseudo-distributed mode | |
# On Ubuntu and other Debian systems | |
nipra@lambda:Downloads$ wget -cv http://archive.cloudera.com/cdh4/one-click-install/precise/amd64/cdh4-repository_1.0_all.deb | |
nipra@lambda:Downloads$ sudo dpkg -i cdh4-repository_1.0_all.deb # Adds /etc/apt/sources.list.d/cloudera-cdh4.list ?? | |
nipra@lambda:Downloads$ dpkg -L cdh4-repository # To view the files on Ubuntu systems | |
# Install CDH4 |
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
Pig: | |
org.apache.pig.newplan.logical.relational.LogicalPlan | |
org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan | |
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.plans.MROperPlan | |
org.apache.pig.parser.QueryParserDriver.parse(String) | |
org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.compile(LogicalPlan,Properties) | |
org.apache.pig.PigServer.launchPlan(PhysicalPlan,String) | |
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.compile(PhysicalPlan,PigContext) | |
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(MROperPlan,MapReduceOper,Configuration,PigContext) | |
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(MROperPlan,String) |
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 scala.math.BigInt | |
lazy val fibs: Stream[BigInt] = BigInt(0) #:: | |
BigInt(1) #:: | |
fibs.zip(fibs.tail).map { n => n._1 + n._2 } |
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 CurryTest { | |
def modN(n: Int)(x: Int) = x % n == 0 //> modN: (n: Int)(x: Int)Boolean | |
val nums = List(1, 2, 3, 4, 5, 6, 7, 8) //> nums : List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8) | |
println(nums.filter(modN(2))) //> List(2, 4, 6, 8) | |
println(nums.filter(modN(3))) //> List(3, 6) | |
} |