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
defmodule LbEcharts do | |
@moduledoc """ | |
Library to use Echarts in LiveBook | |
""" | |
use Kino.JS | |
asset "main.js" do | |
""" | |
export async function init(ctx, chart_data) { |
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
<?php | |
while($line = fgets(STDIN)){ | |
$line = trim($line); | |
list($advertiserid, $ts, $balance_cents) = explode("\t", $line); | |
$date = date('Y-m-d', $ts); | |
echo "$date\t$advertiserid\t$ts\t$balance_cents\n"; | |
} |
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
package com.parthpatil | |
import com.lambdaworks.redis.output.{KeyStreamingChannel, KeyValueStreamingChannel} | |
import com.lambdaworks.redis.pubsub.{RedisPubSubConnection, RedisPubSubAdapter, RedisPubSubListener} | |
import com.lambdaworks.redis.{MapScanCursor, RedisFuture, RedisClient} | |
import rx.lang.scala.Observable | |
import scala.concurrent.{Promise, Future, Await, ExecutionContext} | |
import scala.concurrent.duration._ | |
//import scala.concurrent.ExecutionContext.Implicits.global | |
import com.google.common.util.concurrent._ |
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
/** | |
* Make sure you include the following in your build.sbt | |
"org.json4s" %% "json4s-core" % "3.2.10", | |
"org.json4s" %% "json4s-jackson" % "3.2.10" | |
*/ | |
import org.json4s._ | |
import org.json4s.jackson.JsonMethods._ | |
import org.json4s.JsonDSL._ | |
case class Candidate(name:Option[String], age:Option[Int], party:Option[String]) |
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
2014-01-08 18:06:17,749 INFO [main] io.druid.server.initialization.PropertiesModule - Loading properties from runtime.properties | |
2014-01-08 18:06:17,781 INFO [main] org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.0.1.Final | |
2014-01-08 18:06:18,208 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class io.druid.server.initialization.ExtensionsConfig] from props[druid.extensions.] as [ExtensionsConfig{searchCurrentClassloader=true, coordinates=[], localRepository='/Users/parth/.m2/repository', remoteRepositories=[http://repo1.maven.org/maven2/, https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local]}] | |
2014-01-08 18:06:18,833 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class com.metamx.emitter.core.LoggingEmitterConfig] from props[druid.emitter.logging.] as [LoggingEmitterConfig{loggerClass='com.metamx.emitter.core.LoggingEmitter', logLevel='info'}] | |
2014-01-08 18:06:18,895 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class io.drui |
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
➜ hadoop_cql3_word_count git:(cassandra-2.0) ✗ ./bin/word_count | |
DEBUG 14:35:30,741 java.io.IOException: config() | |
at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:227) | |
at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:214) | |
at WordCount.main(Unknown Source) | |
INFO 14:35:30,794 output reducer type: cassandra | |
DEBUG 14:35:30,801 java.io.IOException: config(config) | |
at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:260) | |
at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:341) |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
package com.parthpatil | |
import java.net.ServerSocket | |
import java.io.PrintWriter | |
import util.Random | |
/** Represents a page view on a website with associated dimension data. */ | |
class PageView(url : String, status : Int, country: String, browser: String, userID : Int) | |
extends Serializable { | |
override def toString() : String = { |
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.util.{ Future => TFuture, _} | |
object Tester extends App { | |
def test1(): Unit = { | |
implicit val timer: Timer = new ScheduledThreadPoolTimer() | |
val startTime = System.currentTimeMillis() | |
val longProcess: TFuture[String] = TFuture { Thread.sleep(1000); "done" } | |
longProcess.raiseWithin(Duration.fromMilliseconds(100)) | |
.onSuccess { _ => val elapsed = System.currentTimeMillis() - startTime; println(s"long process Success, elapsed = $elapsed")} |
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
package com.parthpatil | |
import com.lambdaworks.redis._ | |
import rx.lang.scala.Observable | |
import scala.concurrent.{Promise, Future, Await, ExecutionContext} | |
import scala.concurrent.duration._ | |
import com.google.common.util.concurrent._ | |
import java.util.concurrent.{TimeUnit, ExecutorService, Executors} |
NewerOlder