Skip to content

Instantly share code, notes, and snippets.

View lanttern's full-sized avatar

Zhihui Xie lanttern

View GitHub Profile
@lanttern
lanttern / sed cheatsheet
Created March 30, 2018 22:36 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@lanttern
lanttern / interviewitems.MD
Created April 24, 2017 03:29 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@lanttern
lanttern / jupyter_shortcuts.md
Created December 16, 2016 22:50 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 20 16:51:16 2013
@author: zhihuixie
Frequent Words with Mismatches Problem (8_7 chapter1)
"""
import itertools
num_mismatch=2
new_list = [''.join(item) for item in itertools.product('ATCG', repeat=num_mismatch)]
@lanttern
lanttern / Frequent_Words_with_Mismatches_Problem_(8_7 chapter1).py
Last active December 27, 2015 08:29
Bioinformatics Algorithms Part I (coursera)
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 20 16:51:16 2013
@author: zhihuixie
Frequent Words with Mismatches Problem (8_7 chapter1)
"""
import itertools
num_mismatch=3
new_list = [''.join(item) for item in itertools.product('ATCG', repeat=num_mismatch)]