Stone Gao stonegao

View avgkvsz.scala
1 2 3 4 5 6 7 8 9 10
import java.util.ArrayList
import scala.collection.JavaConversions._
import com.stumbleupon.async.{Callback, Deferred}
import org.hbase.async.{HBaseClient, KeyValue, Scanner}
import com.twitter.util.{Future, Promise, Return, Throw}
 
/** Converts a Deferred into a Future. */
implicit def futureFromDeferred[A](d: Deferred[A]): Future[A] = {
val promise = new Promise[A]
View mysqlpool.scala
1 2 3 4 5 6 7 8 9 10
// Copyright (C) 2012 Benoit Sigoure
// Copyright (C) 2012 StumbleUpon, Inc.
// This library is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2.1 of the License, or (at your
// option) any later version. This program is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
// General Public License for more details. You should have received a copy
// of the GNU Lesser General Public License along with this program. If not,
View analytics.md

Analytics

Google Analytics

JavaScript

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
View mapreduce_akka.scala
1 2 3 4 5 6 7 8 9
package net.addictivesoftware.scala.akkaactors
 
import akka.actor.{Actor, PoisonPill}
import Actor._
import akka.routing.{Routing, CyclicIterator}
import Routing._
 
import collection.mutable.{HashMap, Map}
import java.util.concurrent.CountDownLatch
View clojure-match.clj
1 2 3 4 5 6 7 8 9 10
(use '[clojure.core.match :only [match]])
 
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
View ColumnPaginationFilterTest.java
1 2 3 4 5 6 7 8 9 10
import static org.apache.hadoop.hbase.util.Bytes.toBytes;
 
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
View Main.scala
1 2 3 4 5 6 7 8 9 10
package se.yobriefca
 
import com.twitter.ostrich.admin.{AdminServiceFactory, RuntimeEnvironment}
import com.twitter.finagle.builder.{ServerBuilder, Server}
import com.twitter.finagle.http.Http
import java.net.InetSocketAddress
import com.twitter.finagle.stats.OstrichStatsReceiver
import com.twitter.finagle.Service
import org.jboss.netty.handler.codec.http._
import com.twitter.util.{Eval, Config, Future}
View App.scala
1 2 3 4 5 6 7 8 9
package com.twitter.dumproxy
 
import com.twitter.finagle.Service
import org.jboss.netty.handler.codec.http._
import java.net.InetSocketAddress
import com.twitter.finagle.builder.{ClientBuilder, Server, ServerBuilder}
import com.twitter.finagle.http.Http
 
object App {
View CakePatternIm.scala
1 2 3 4 5 6 7 8 9 10
// You create the trait.
trait JavaScriptCompilerComponent {
def compiler: JavaScriptCompiler
 
trait JavaScriptCompiler {
def compile(files: Seq[Source]): String
}
}
 
// You implement it.
View EdnPickleFormat.scala
1 2 3 4 5 6 7 8 9
import scala.pickling._
 
import scala.reflect.runtime.universe._
import scala.util.parsing.json._
import scala.collection.mutable.{StringBuilder, Stack}
 
package object edn {
implicit val pickleFormat: EdnPickleFormat = new EdnPickleFormat
}
Something went wrong with that request. Please try again.