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
#include <iostream> | |
#include <stdio.h> | |
#include <curl/curl.h> | |
using std::cout; | |
int main(void) | |
{ | |
CURL *curl; | |
CURLcode res; | |
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
//Java Class | |
public class S3InputSupplier implements com.google.common.io.InputSupplier<java.io.InputStream> | |
//contents of the class | |
//Scala code | |
val mapper = new ObjectMapper() | |
val is = new S3InputSupplier(s3, metadataFile) | |
val json = CharStreams.toString(CharStreams.newReaderSupplier(is, Charsets.UTF_8)); | |
mapper.readValue(json, classOf[CombinedGroup]) |
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
#!/usr/bin/env bash | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you 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 | |
# |
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
"properly parse expression" in { | |
val expected = (5L, DateTime.parse("2008-03-01T13:00:00Z"), new Period(Days.ONE)) | |
val tuple = Iso8601ExpressionParser.parseExpression("R5/2008-03-01T13:00:00Z/P1D") | |
tuple must be_== (expected) | |
} | |
.... | |
Error | |
'(5,2008-03-01T13:00:00.000Z,P1D)': anon is not equal to '(5,2008-03-01T13:00:00.000Z,P1D)': scala.Tuple3 |
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
case class BaseJob(@JsonProperty @BeanProperty val name: String, | |
@JsonProperty @BeanProperty val command: String, | |
@JsonProperty @BeanProperty val epsilon: Period = Minutes.minutes(5).toPeriod) { | |
def this(command: String, epsilon: Period) { | |
this("", command, epsilon) | |
} | |
} | |
case class ScheduleBasedJob(@JsonProperty @BeanProperty val schedule: 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
object Protobufs { | |
def newBuilder() : Builder = { | |
return new Builder() | |
} | |
class Builder { | |
private val desBuilder : DescriptorProtos.DescriptorProto.Builder = DescriptorProtos.DescriptorProto.newBuilder() | |
private val values = new mutable.HashMap[String, Any]() |
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
Florians-MacBook-Pro:commons florian$ ./pants idea tests/java/com/twitter/common:all-tests! | |
/usr/bin/python2.6 | |
Installing virtualenv | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 2087k 100 2087k 0 0 756k 0 0:00:02 0:00:02 --:--:-- 777k | |
Running virtualenv with interpreter /usr/bin/python2.6 | |
New python executable in ./build-support/python/../../.python/bootstrap/bin/python2.6 | |
Also creating executable in ./build-support/python/../../.python/bootstrap/bin/python | |
Installing distribute.............................................................................................................................................................................................done. |
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
tell application "iTerm" | |
activate | |
make new terminal | |
set Names to paragraphs of (read (choose file with prompt "File with hostnames") ) | |
repeat with nextLine in Names | |
if length of nextLine is greater than 0 then | |
set cmd to "ssh ubuntu@" & nextLine | |
my open_tab(nextLine, cmd) | |
end if |
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 | |
set -o nounset | |
set -o errexit | |
set -o pipefail | |
declare -r max=4 | |
declare i=0 | |
function wrap() { | |
local cmd=$1 ; shift |
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
scala> case class Foo(val name : String) | |
defined class Foo | |
scala> case class Bar(override val name : String, val age : Int) extends Foo(name : String) | |
warning: there were 1 deprecation warnings; re-run with -deprecation for details | |
defined class Bar | |
scala> val a = Bar("foo", 1) | |
a: Bar = Foo(foo) |
OlderNewer