Monthly Archives: March 2016

Lex and Yacc example in Python

PLY is a parser implemented using Lex and Yacc. It can be downloaded from here: http://www.dabeaz.com/ply/ Note: – Lex (a lexer) does lexical analysis, which separating a stream of characters into different words (tokens). Lexer works at the word level. … Continue reading

Posted in Compiler, Python | Leave a comment

Dedupe a list without changing item order in Python

In Python, if one wants to remove duplicates items in a given list. The simplest approach would be feed the list in to a set function, and only the unique elements will remain in the output result. However, the side … Continue reading

Posted in Python | Leave a comment

My Bookshelf

2024 6. (4/13) 价值 5. (3/10) Peak 4. (3/1) Engineers Survival Guide 3. (2/24) Blue Ocean Strategy 2. (2/4) An Elegant Puzzle (1/15) 激荡三十年 (上) 2023 1. (1/31) Do the Hard Things First 2. (3/28) Working Backwards 3. (4/5) The … Continue reading

Posted in Miscellaneous | Leave a comment