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
class Solution: | |
def searchRange(self, nums, target): | |
""" | |
:type nums: List[int] | |
:type target: int | |
:rtype: List[int] | |
""" | |
def searchOccurrence(nums, target, isFirst): | |
N = len(nums) | |
if N == 1: |
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
class Solution(object): | |
def search(self, nums, target): | |
""" | |
:type nums: List[int] | |
:type target: int | |
:rtype: int | |
""" | |
start, end = 0, len(nums)-1 | |
while start <= end: | |
mid = (start+end)//2 |
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
class Solution: | |
def maxSlidingWindow(self, nums, k): | |
""" | |
:type nums: List[int] | |
:type k: int | |
:rtype: List[int] | |
""" | |
output = [] | |
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
class Solution: | |
def lengthLongestPath(self, input): | |
""" | |
:type input: str | |
:rtype: int | |
""" | |
def is_dir(val): | |
return False if '.' in val else True |
This file has been truncated, but you can view the full file.
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
Go. Va ! | |
Run! Cours ! | |
Run! Courez ! | |
Wow! Ça alors ! | |
Fire! Au feu ! | |
Help! À l'aide ! | |
Jump. Saute. | |
Stop! Ça suffit ! | |
Stop! Stop ! | |
Stop! Arrête-toi ! |
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
# reference: https://hub.docker.com/_/ubuntu/ | |
FROM ubuntu:16.04 | |
# Adds metadata to the image as a key value pair example LABEL version="1.0" | |
LABEL maintainer="Hamel Husain <youremail@gmail.com>" | |
# Set environment variables | |
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 | |
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \ |
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
# coding: utf-8 | |
import numpy as np | |
def load_glove_embeddings(fp, embedding_dim, include_empty_char=True): | |
""" | |
Loads pre-trained word embeddings (GloVe embeddings) | |
Inputs: - fp: filepath of pre-trained glove embeddings | |
- embedding_dim: dimension of each vector embedding |
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
sudo du -h --max-depth=1 /home |
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
<!DOCTYPE html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<script>L_PREFER_CANVAS = false; L_NO_TOUCH = false; L_DISABLE_3D = false;</script> | |
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.2.0/dist/leaflet.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.2.0/dist/leaflet.css" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" /> |
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
#! /usr/bin/python | |
import math | |
class SVY21: | |
# Ref: http://www.linz.govt.nz/geodetic/conversion-coordinates/projection-conversions/transverse-mercator-preliminary-computations/index.aspx | |
# WGS84 Datum | |
a = 6378137 | |
f = 1 / 298.257223563 |