Skip to content

Instantly share code, notes, and snippets.

View srli's full-sized avatar

Sophia Li srli

View GitHub Profile
@srli
srli / ros_simple_sample.py
Last active December 17, 2017 02:32
Simple implmentation of a ros node in python
#!/usr/bin/python
import rospy
from std_msgs.msg import String
from sensor_msgs.msg import Image
import cv2
import numpy as np
class FaceFinder:
def __init__(self):
@srli
srli / The Technical Interview Cheat Sheet.md
Created October 28, 2015 17:12 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@srli
srli / tour.py
Last active February 9, 2017 04:43
Better Knights Tour w/ visualizer
#!/usr/bin/env python
"""
This code generates the path required for a knight's tour
around a chessboard with user-specified dimensions
Written by Sophie Li, 2017
http://blog.justsophie.com/algorithm-for-knights-tour-in-python/
"""
import sys
@srli
srli / spi_tester.c
Last active October 26, 2016 00:18
Updated spi_tester.c
/******************************************************************************
*
* Copyright (C) 2009 - 2014 Xilinx, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
from random import *
from math import *
import random
from PIL import Image
def build_random_function(min_depth, max_depth):
""" Builds a random function of depth at least min_depth and depth
at most max_depth (see assignment writeup for definition of depth
in this context)
import random
import math
from PIL import Image
def lambda_function(min_depth, max_depth):
prod = lambda x,y: x*y
avg = lambda x,y: .5*(x+y)
cos_pi = lambda x,y: math.cos(math.pi*x)
sin_pi = lambda x,y: math.sin(math.pi*x)
sqr = lambda x,y: x**2