If you're interviewing in Python, learn how to code the following data structures / algorithms in python.
lists: a = [] or a = list()
| import numpy as np | |
| from time import time | |
| def getSaddlePoints(img_gray): | |
| img = np.array(img_gray, dtype=np.float32) | |
| gx, gy = np.gradient(img) # row / col -> y / x | |
| gxx, gxy = np.gradient(gx) | |
| gyx, gyy = np.gradient(gy) |
Following these Forking instructions
main/repo and fork it from the top right.your/repo (ex. Elucidation/repo) and get the clone address.git clone git@github.com:Elucidation/repo.git| def tetrate(a,n): | |
| out = a | |
| for i in range(n-1): | |
| out = out**a | |
| return out | |
| # tetrate(40,4) = | |
| # 690947404219008741222457800129817403411828583413419520419493111831295996413873594644805829445269007203995211615456663016683728495892887369173668195222901927225437605087145618916756687286387933281790174074684078938262974467604784504763521359034420653071639082548294385696121810109894690269688251211866942190570741018859207103333855549659655229457782352250042455188987961990124944566498789120284582054941823848464802195541126726348928999918099721485453487401380891755517663053038386565720934821567824791577310003251521417167426434629082475853747403599157286524656983883765627013038288978340142955459897974440740304697156024080272436830680911744557318966752684607298163681209415027914199719422248693063526880285790311725074566359149791435595982224008237251470592045469117925451215448215721571573814881052721875693562344721819290641270406459206087399926880360229424951866819559416133622268646706822678131045957565756209939994 |
| // Generate an SVG bar plot of temperatures with axes | |
| var dataset; // global dataset populated by d3.csv, used by plotData | |
| function plotData() | |
| { | |
| //Width and height | |
| var w = 800; | |
| var h = 400; | |
| var svg = d3.select("body") |
| // Define the TRIG and ECHO pins used by the ultrasonic sensor, in my case they were pins 4 and 5. | |
| #define TRIG 4 | |
| #define ECHO 5 | |
| void setup() { | |
| // Initialize the serial communication | |
| Serial.begin(9600); | |
| // Set up pins | |
| pinMode(TRIG, OUTPUT); |