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
ARG GOCD_VERSION=19.5.0 | |
FROM gocd/gocd-agent-centos-7:v$GOCD_VERSION | |
# install java and friends | |
RUN yum -y update && \ | |
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ | |
yum install -y java-1.8.0-openjdk-devel xmlstarlet which |
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
# setup for the hadoop + spark env for airflow | |
remote_file "/home/airflow/spark.tgz" do | |
source "/remote/spark/download/url" | |
owner "airflow" | |
group "airflow" | |
mode '0755' | |
not_if { File.exists?("/home/airflow/spark.tgz") } | |
end |
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
version: '2' | |
services: | |
zk: | |
image: jplock/zookeeper | |
network_mode: "host" | |
master: | |
image: mesosphere/mesos-master:0.27.0-0.2.190.ubuntu1404 | |
network_mode: "host" | |
privileged: true |
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
curl -H 'x-auth-token: AUTH_tk8830063c201c4bf7bd60b1dcce7b0f04' -H 'accept: application/json' http://127.0.0.1:8080/v1/AUTH_test/test/monkies -XPUT -v | |
* Hostname was NOT found in DNS cache | |
* Trying 127.0.0.1... | |
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0) | |
> PUT /v1/AUTH_test/test/monkies HTTP/1.1 | |
> User-Agent: curl/7.35.0 | |
> Host: 127.0.0.1:8080 | |
> x-auth-token: AUTH_tk8830063c201c4bf7bd60b1dcce7b0f04 | |
> accept: application/json | |
> |
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
tamizhgeek@pettai:/var/log/swift$ curl -v -X DELETE -H 'X-Auth-Token: AUTH_tk8830063c201c4bf7bd60b1dcce7b0f04' -H "Accept: application/json" http://127.0.0.1:8080/v1/AUTH_test/dummy/nonexistent | |
* Hostname was NOT found in DNS cache | |
* Trying 127.0.0.1... | |
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0) | |
> DELETE /v1/AUTH_test/dummy/nonexistent HTTP/1.1 | |
> User-Agent: curl/7.35.0 | |
> Host: 127.0.0.1:8080 | |
> X-Auth-Token: AUTH_tk8830063c201c4bf7bd60b1dcce7b0f04 | |
> Accept: application/json | |
> |
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
tamizhgeek@pettai:~/swift$ curl -X DELETE -H 'X-Auth-Token: AUTH_tk8830063c201c4bf7bd60b1dcce7b0f04' http://127.0.0.1:8080/v1/AUTH_test/dummy/notexisting | |
tamizhgeek@pettai:~/swift$ <html><h1>Not Found</h1><p>The resource could not be found.</p></html> | |
-------------------- | |
tamizhgeek@pettai:~/swift$ curl -X DELETE -H 'X-Auth-Token: AUTH_tk8830063c201c4bf7bd60b1dcce7b0f04' -H "Accept: application/json" http://127.0.0.1:8080/v1/AUTH_test/dummy/nonexistent | |
tamizhgeek@pettai:~/swift$ {"status": 404, "description": "The resource could not be found.", "title": "Not Found"} | |
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 assignments.NumberToWords | |
import org.scalatest.{ShouldMatchers, FlatSpec} | |
class NumberToWordsTest extends FlatSpec with ShouldMatchers{ | |
it should "convert numbers to words in required format" in { | |
val number = new NumberToWords(104536) | |
number.numForWords shouldBe "one-zero-four-five-three-six" | |
} | |
} |
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 assignments | |
class NumberToWords(number : Int) { | |
val digitToWord = Map( | |
0 -> "zero", | |
1 -> "one", | |
2 -> "two", | |
3 -> "three", | |
4 -> "four", |
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 assignments.Lattice | |
import org.scalatest.{FlatSpec, ShouldMatchers} | |
class LatticePathFinderTest extends FlatSpec with ShouldMatchers{ | |
it should "find the lattice path correctly using memoization" in { | |
new Lattice(2).findNoOfPathsTrivialWay shouldBe 6 | |
new Lattice(4).findNoOfPathsTrivialWay shouldBe 56 |
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 assignments | |
// m! / n!(n - m)! | |
// m = row, n = element | |
class Lattice(size : Int) { | |
val cache : scala.collection.mutable.Map[(Int, Int), BigInt] = scala.collection.mutable.Map.empty | |
/* |
NewerOlder