Skip to content

Instantly share code, notes, and snippets.

View jbaek7023's full-sized avatar
👨‍💻

Jae-Min Baek jbaek7023

👨‍💻
  • Google
  • San Francisco Bay Area
View GitHub Profile
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
FROM ubuntu:bionic as build
RUN apt-get update && apt-get install -y openjdk-8-jdk maven python3 python3-venv
# Create a first layer to cache the "Maven World" in the local repository.
# Incremental docker builds will always resume after that, unless you update the pom
WORKDIR /mvn
COPY pom.xml /mvn/
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
FROM ubuntu:bionic as build
RUN apt-get update && apt-get install -y openjdk-8-jdk maven python3 python3-venv
# Create a first layer to cache the "Maven World" in the local repository.
# Incremental docker builds will always resume after that, unless you update the pom
WORKDIR /mvn
COPY pom.xml /mvn/
class Solution:
def findDiagonalOrder(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: List[int]
"""
# 00 (right: col+1) //0
# 01, 10 (left: row+1, col-1) -> (if col==0: row+1) //1
# 20, 11, 02 (right: row-1, col+1) -> if(row==0: col+1) //2
# 03, 12, 21, 30 (left_middle: row+1, col-1) -> if col==0: col+1 //3--> col+1, (right_middle,,, row+1) ::>
@jbaek7023
jbaek7023 / gist:662648adc69890ea6ad546fbe5ca9139
Created June 9, 2018 02:02
My solution (not working) - Rotate Image.
class Solution:
def rotate(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: void Do not return anything, modify matrix in-place instead.
"""
# S: Ceil Py without math
for level in range(len(matrix)//2):
# 4-> 2, 5 -> 2.
# SEarched floor
class Solution:
def productExceptSelf(self, nums):
output = []
product = 1
for index in range(len(nums)):
product = 1 if index == 0 else product * nums[index-1]
output.append(product)
product = 1
for index in range(len(nums)-1, -1, -1):
@jbaek7023
jbaek7023 / django custom signal
Created June 5, 2017 03:24 — forked from venkatesh22/django custom signal
django custom signals creation example
#signals.py
from django.dispatch import Signal
user_login = Signal(providing_args=["request", "user"])
#views.py
from foo import signals