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
package btree | |
import ( | |
"fmt" | |
) | |
type BinaryTree struct { | |
Root *Node | |
NumberOfIterations int | |
} |
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
class Node | |
attr_accessor :value, :left, :right | |
def initialize(value=nil) | |
@value = value | |
end | |
end | |
class BinaryTree | |
attr_accessor :root, :num_loops |
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 <stdio.h> | |
#include <stdlib.h> | |
typedef struct node { | |
int value; | |
struct node* next; | |
} node_t; | |
typedef struct list { | |
node_t* head; |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"net" | |
"io" | |
) |
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 | |
for f in *; do mv -- "$f" "$(stat -f "%Sm_%N" -t "%Y%m%d" "$f")"; 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
FROM openjdk:8 | |
RUN mkdir -p /usr/local/spark && \ | |
cd /usr/local/spark && \ | |
curl -O http://d3kbcqa49mib13.cloudfront.net/spark-2.1.0-bin-hadoop2.7.tgz && \ | |
tar -vxf spark-2.1.0-bin-hadoop2.7.tgz | |
ENV SPARK_HOME /usr/local/spark/spark-2.1.0-bin-hadoop2.7 | |
COPY ./docker-entrypoint.sh /etc/docker-entrypoint.sh |
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 | |
# Usage: script [project name] | |
PROJECT_NAME=$1 | |
mkdir -p $PROJECT_NAME | |
cd $PROJECT_NAME | |
touch build.sbt |
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
import java.util.concurrent.atomic.AtomicReference | |
import scala.collection.mutable | |
import scala.concurrent.ExecutionContext | |
import scala.util.{Failure, Success, Try} | |
trait Eventual[A] { | |
def get: Try[A] | |
def onComplete(f: Try[A] => Unit): Unit |
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
import scala.collection.mutable | |
object SortedRelation { | |
def apply[A, B](seq: Seq[A], key: (A) => B)(implicit ordering: Ordering[B]): SortedRelation[A, B] = new SortedRelation(seq, key) | |
} | |
class SortedRelation[A, B](val seq: Seq[A], val key: (A) => B)(implicit ordering: Ordering[B]) { | |
private val sorted = seq.sortBy(key) |
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
import threading | |
from threading import Thread, Lock | |
import sys | |
import time | |
class Q: | |
def __init__(self): | |
self._items = [] |
OlderNewer