Add ubuntugis PPA:
$ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstableAdd POSTGIS repository:
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -| #!/usr/bin/osascript | |
| # <bitbar.title>Mute/Video/Screen State for Zoom</bitbar.title> | |
| # <bitbar.version>v1.0</bitbar.version> | |
| # <bitbar.author>nickjvturner</bitbar.author> | |
| # <bitbar.author.github>nickjvturner</bitbar.author.github> | |
| # <bitbar.desc>Mute/Video/Screen State for Zoom</bitbar.desc> | |
| # <bitbar.dependencies>Applescript</bitbar.dependencies> | |
| # <swiftbar.hideAbout>true</swiftbar.hideAbout> |
| # | |
| # | |
| # Implement a LRU cache | |
| # key, value | |
| # bounded -> not more than 'n' entries | |
| # If cache is full, and you want to add another key value pair, | |
| # oldest accessed entry will be removed | |
| # | |
| # Operations like get, put, remove are constant time. | |
| # |
| -- Create a group | |
| CREATE ROLE readaccess; | |
| -- Grant access to existing tables | |
| GRANT USAGE ON SCHEMA public TO readaccess; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
| -- Grant access to future tables | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
Add ubuntugis PPA:
$ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstableAdd POSTGIS repository:
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -| package com.rohankar.tourist; | |
| import io.vavr.Tuple3; | |
| import io.vavr.collection.Stream; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.nio.file.Files; | |
| import java.util.Arrays; | |
| import java.util.List; |
| #!/bin/bash | |
| # install CUDA Toolkit v8.0 | |
| # instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
| CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb" | |
| wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
| sudo dpkg -i ${CUDA_REPO_PKG} | |
| sudo apt-get update | |
| sudo apt-get install cuda-8-0 |
| package com.rohankar.problem; | |
| public class WallAndWater { | |
| public static int findWaterFilled(int[] walls) { | |
| int maxWallIndex = findMaxWallHeightIndex(walls); | |
| int volOnLHS = findWaterFilledOnLHS(walls, maxWallIndex); | |
| int volOnRHS = findWaterFilledOnRHS(walls, maxWallIndex); | |
| return volOnLHS + volOnRHS; |