- Get evaluation license key : http://my.datomic.com/eval/request
- Download pro version : http://downloads.datomic.com/pro.html
- Dev mode setup
Existing schema is below: | |
ActiveRecord::Schema.define(:version => 20120130161449) do | |
create_table "movies", :force => true do |t| | |
t.string "title" | |
t.string "rating" | |
t.text "description" | |
t.datetime "release_date" | |
t.datetime "created_at" |
export INSTANCE_NAME="my-tf2-instance" | |
export ZONE="us-central1-c" | |
export IMAGE_FAMILY="tf2-latest-gpu" | |
export INSTANCE_TYPE="n1-highmem-4" | |
export ACCELERATOR="type=nvidia-tesla-k80,count=1" | |
gcloud compute instances create $INSTANCE_NAME \ | |
--zone=$ZONE \ | |
--image-family=$IMAGE_FAMILY \ | |
--image-project=deeplearning-platform-release \ |
export IMAGE_FAMILY="tf2-latest-gpu" # or "tf2-latest-cpu" for non-GPU instances | |
export ZONE="us-west1-b" # budget: "us-west1-b", richer: us-west2-b | |
export INSTANCE_NAME="my-tf2-instance" | |
export INSTANCE_TYPE="n1-highmem-4" # budget: "n1-highmem-4", richer: n1-highmem-8 | |
# budget: type=nvidia-tesla-k80,count=1 | |
# richer: type=nvidia-tesla-p4,count=1 | |
export ACCELERATOR="type=nvidia-tesla-k80,count=1" | |
gcloud compute instances create $INSTANCE_NAME \ | |
--zone=$ZONE \ |
import java.util.ArrayList; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class CBTInserter { | |
private TreeNode root = null; | |
private List<TreeNode> memo = new ArrayList<>(); | |
public CBTInserter(TreeNode root) { | |
this.root = root; |
public class CBTCheck { | |
private int[] walk(TreeNode root) { | |
if (root == null) { return new int[]{0, 0, 1}; } // min, max, valid | |
int[] left = walk(root.left); | |
int[] right = walk(root.right); | |
int valid = left[2] & right[2]; | |
if (right[1] > left[1]) { | |
valid = 0; | |
} else if (right[1] + 1 < left[1]) { | |
valid = 0; |
public class TreeNode { | |
int val; | |
TreeNode left; | |
TreeNode right; | |
TreeNode(int x) { val = x; } | |
} | |
public class CBTNodeCount { | |
private int getHeight(TreeNode root) { | |
if (root == null) { return 0; } |
public class CatalanNumbers { | |
public int numPatterns(int n) { | |
double count = 1.0; | |
for (double i = 1.0; i <= n; i += 1.0) { | |
count *= ((i + n) / i); | |
} | |
return (int) Math.round(count / (n + 1)); | |
} | |
public int numPatternsDP(int n) { |
;; A solution and test code for https://www.hackerrank.com/challenges/30-dictionaries-and-maps/problem | |
;; test/thirty-days-code.core_test.clj | |
(ns thirty-days-code.core-test | |
(:require [clojure.java.io :as io] | |
[clojure.test :refer :all])) | |
(defn wrap-test [n f] | |
(with-open [rdr (io/reader (io/resource n))] | |
(binding [*in* rdr] |