docker exec -it [container-id] bash
docker cp :/file/path/within/container /host/path/target
sudo docker update --restart=no <container_id> to update --restart flag of the container.
| /* | |
| * Do not change Module name | |
| */ | |
| module FSM(input clk, input [1:0] w, output [3:0] z); | |
| localparam A=4'b0001, B=4'b0010, C=4'b0100, D=4'b1000; | |
| reg [3:0] state, next_state; | |
| initial state = A; | |
| always @(posedge clk) |
docker exec -it [container-id] bash
docker cp :/file/path/within/container /host/path/target
sudo docker update --restart=no <container_id> to update --restart flag of the container.
| import matplotlib.pyplot as plt | |
| from math import * | |
| import numpy as np | |
| import matplotlib.patches as patches | |
| # reference https://dingyan89.medium.com/simple-understanding-of-kinematic-bicycle-model-81cac6420357 | |
| class Bicycle(object): | |
| def __init__(self): | |
| self._length =0.1 # m | |
| self._width = 0.01 |
| from math import sqrt | |
| def solution(N): | |
| # write your code in Python 2.7 | |
| minperimeter = 2*(N + 1) | |
| if N == 1: | |
| return minperimeter | |
| denominator = 2 |
| void tryBT() | |
| { | |
| delay(20000); | |
| led_green_flash(); | |
| long baudrates[5] = {9600, 19200, 38400, 57600, 115200}; | |
| String inputString=""; | |
| for (int i =0; i< 5; i++) | |
| { | |
| DebugSerial.begin(baudrates[i]); // debug output |
| def solution(A): | |
| # write your code in Python 2.7 | |
| s = [] | |
| tmp = 0 | |
| n = len(A) | |
| for a in A: | |
| tmp = a + tmp | |
| s.append(tmp) | |
| s.append(0) |
| def solution(A): | |
| # write your code in Python 2.7 | |
| n = len(A) | |
| if n <=3: | |
| return 0 | |
| leftMax = [0]*n | |
| rightMax = [0]*n | |
| for i in xrange(2,n-1): | |
| leftMax[i] = max(0,leftMax[i-1]+A[i-1]) | |
| for i in xrange(n-3,0,-1): |
| def solution(A): | |
| # write your code in Python 2.7 | |
| B = [] | |
| for i in xrange(len(A)): | |
| B.append((i-A[i],i+A[i])) | |
| B = sorted(B, key=lambda x:x[0]) | |
| cnt = 0 | |
| for i in xrange(len(A)-1): | |
| right = B[i][1] | |
| start = i+1 |
| def solution(A): | |
| # write your code in Python 2.7 | |
| A.sort() | |
| for i in xrange(len(A)-2): | |
| if (((A[i] + A[i+1]) > A[i+2]) and ((A[i+2] + A[i+1]) > A[i]) and ((A[i+2] + A[i]) > A[i+1])): | |
| return 1 | |
| return 0 |
| def solution(A, B): | |
| # write your code in Python 2.7 | |
| pre = -1 | |
| N = len(A) | |
| ans=0 | |
| for i in xrange(N): | |
| if A[i] > pre: | |
| ans+=1 | |
| pre = B[i] | |
| return ans |