Skip to content

Instantly share code, notes, and snippets.

View kanglicheng's full-sized avatar
🦜
LLMs ftw

Kang-Li (Stephen) Cheng kanglicheng

🦜
LLMs ftw
View GitHub Profile
@kanglicheng
kanglicheng / mxnet_viz.py
Created July 24, 2019 02:14 — forked from FX-STAR/mxnet_viz.py
Mxnet Viz
# Symbol
x = mx.sym.var('data')
y = net(x)
mx.viz.print_summary(y, shape={"data": (1, 3, 112, 112)})
graph=mx.viz.plot_network(y)
graph.render()
# SymbolBlock
x=mx.nd.random_normal(shape=(1,3,112,112))
net.summary(x)
# nThread 1 nGpus 1 minBytes 8 maxBytes 1073741824 step: 2(factor) warmup iters: 5 iters: 100 validation: 1
#
# Using devices
# Rank 0 Pid 97337 on ip-172-31-34-232 device 0 [0x00] Tesla V100-SXM2-32GB
# Rank 1 Pid 97338 on ip-172-31-34-232 device 1 [0x00] Tesla V100-SXM2-32GB
# Rank 2 Pid 97339 on ip-172-31-34-232 device 2 [0x00] Tesla V100-SXM2-32GB
# Rank 3 Pid 97340 on ip-172-31-34-232 device 3 [0x00] Tesla V100-SXM2-32GB
# Rank 4 Pid 97341 on ip-172-31-34-232 device 4 [0x00] Tesla V100-SXM2-32GB
# Rank 5 Pid 97342 on ip-172-31-34-232 device 5 [0x00] Tesla V100-SXM2-32GB
# Rank 6 Pid 97343 on ip-172-31-34-232 device 6 [0x00] Tesla V100-SXM2-32GB
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kanglicheng
kanglicheng / playground.rs
Created July 24, 2019 02:14 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn main() {
println!("Hello, world!");
}
@kanglicheng
kanglicheng / reset_id_column.sql
Created July 25, 2019 19:54 — forked from irazasyed/reset_id_column.sql
MySQL: Reset id column to auto increment from 1
-- your_table: The table to modify
-- id: The id field/column to reset
SET @num := 0;
UPDATE your_table SET id = @num := (@num+1);
ALTER TABLE your_table AUTO_INCREMENT =1;
@kanglicheng
kanglicheng / question1.md
Created July 27, 2019 21:25 — forked from thoroc/question1.md
Skyscanner HackerRank questions - Oct 2015 - Backend Developer

Find the Most Popular Destination:

Your task is to find the most popular holiday destination from a list of destinations searched for by users. You are given as standard input the integer size of the list, followed by the names of the destinations themselves. The input has the following format:

  • on the first line, the count of items in the list
  • on the subsequent lines, the name of each destination searched for, one per line (each destination is a single word with no spaces, destinations can be searched for and appear more than once) The input is correct. There is at least one destination in the input. Write a program that reads the input from stdin and then outputs out the name of the most searched for destination i.e. the destination that appears most in the list. One destination is guaranteed to be the outright winner in the input.
@kanglicheng
kanglicheng / decodeString.py
Created July 30, 2019 06:25
decode string
class Solution:
def decodeString(self, s: str) -> str:
stack = []
for c in s:
if c == ']':
cur_string = ""
num = ""
while stack:
temp = stack.pop()
if temp == '[':
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"posts": {
"notification": {
"title": "New Lead",
"body": "Dallas F1"
},
"username": "Hubspot Forms",
"username_icon": "http://s17.pdfconvertonline.com/convert/p3r68-cdx67/na9jp-jfl3s.png",
"attachments": [{
"author_name": "{first_name} {last_name}",

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would