This file contains 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
// this section rewrites the each file byte by byte back to new zip file | |
while (e.hasMoreElements()) { | |
val entryIn = e.nextElement().asInstanceOf[ZipEntry] | |
if (!entryIn.getName.equalsIgnoreCase("abc.txt")) { | |
zos.putNextEntry(entryIn) | |
val is = zipFile.getInputStream(entryIn) | |
val buf = Array.ofDim[Byte](10) | |
var len: Int = 0 |
This file contains 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
case class OutsideServer(val ipAddress: String, val LoginsPerMinute: Int) extends Ordered[OutsideServer] { | |
def compare(that: OutsideServer): Int = { | |
val count = this.LoginsPerMinute - that.LoginsPerMinute | |
if (count == 0) this.ipAddress.compareTo(that.ipAddress) else count | |
} | |
} | |
case class InsideServer(val ipAddress: String, val LoginsPerMinute: Int) extends Ordered[InsideServer] { | |
def compare(that: InsideServer): Int = { | |
val count = this.LoginsPerMinute - that.LoginsPerMinute |
This file contains 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 tweepy import Stream | |
from tweepy import OAuthHandler | |
from tweepy.streaming import StreamListener | |
consumer_key = "HsYoJa0sdf980as8fbFh0w" | |
consumer_secret = "k698asdf9870sdf09a7s8df908a7sdf6A7m4" | |
access_token = "364asdf987asdfuiytsdaf765sdfasdfoiyLgS" | |
access_token_secret = "SFasdf9807asd09f87asf9087asdfbik5D" | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) |
This file contains 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
[info] Including: scala-library-2.10.4.jar | |
[info] Including: netty-all-4.0.17.Final.jar | |
[info] Including: jetty-server-8.1.14.v20131031.jar | |
[info] Including: javax.servlet-3.0.0.v201112011016.jar | |
[info] Including: jetty-continuation-8.1.14.v20131031.jar | |
[info] Including: jetty-http-8.1.14.v20131031.jar | |
[info] Including: jetty-io-8.1.14.v20131031.jar | |
[info] Including: jetty-util-8.1.14.v20131031.jar | |
[info] Including: jetty-plus-8.1.14.v20131031.jar | |
[info] Including: javax.transaction-1.1.1.v201105210645.jar |
This file contains 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
'[info] Including: JavaEWAH-0.6.6.jar\n', | |
'[info] Including: ST4-4.0.4.jar\n', | |
'[info] Including: activation-1.1.jar\n', | |
'[info] Including: akka-actor_2.10-2.2.3-shaded-protobuf.jar\n', | |
'[info] Including: akka-remote_2.10-2.2.3-shaded-protobuf.jar\n', | |
'[info] Including: akka-slf4j_2.10-2.2.3-shaded-protobuf.jar\n', | |
'[info] Including: akka-zeromq_2.10-2.2.3-shaded-protobuf.jar\n', | |
'[info] Including: algebird-core_2.10-0.1.11.jar\n', | |
'[info] Including: ant-1.9.0.jar\n', | |
'[info] Including: ant-launcher-1.9.0.jar\n', |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 ubuntu:14.04 | |
MAINTAINER test@test.com | |
# need to run to make sure the apt-get installs work | |
RUN apt-get update | |
RUN apt-get install -y wget | |
WORKDIR /tmp |
This file contains 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.http.client.methods.HttpGet | |
object Weather { | |
private val locations = List( | |
"Berlin,Germany", | |
"Cologne,Germany", | |
"Hamburg,Germany", | |
"Munich,Germany", | |
"Nuremberg,Germany", |
This file contains 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
antigensAir:bin antigen$ ./scala -cp /Users/antigen/Downloads/algebird-core_2.10-0.7.0.jar | |
Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_60). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import com.twitter.algebird._ | |
import com.twitter.algebird._ | |
scala> import HyperLogLog._ | |
import HyperLogLog._ |
This file contains 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.twitter.algebird._ | |
import HyperLogLog._ | |
import com.twitter.algebird.Monoid | |
import com.twitter.algebird.DecayedValue | |
import com.twitter.algebird.Operators._ | |
val hll = new HyperLogLogMonoid(4) |
OlderNewer