This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ramsayleung.github.io.ood; | |
// Problem statement: | |
// Design Unix File Search API to search file with different arguments as "extension", "name", "size" ... | |
// The design should be maintainable to add new contraints. | |
// | |
// Follow up: How would you handle if some contraints should support AND, OR conditionals. | |
import java.util.ArrayList; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Problem statement: | |
Designed and implemet a search criteria model library, leverage proper OO principles and construct. | |
Your model should be able to handle criteria such as the following expression: | |
name == "foo" | |
age > 100 | |
(age > 100 & age < 100) | |
(age > 100 & age < 100) or (name == "foo" and not(age == 50 or age == 51)) | |
etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -ex | |
remove_heading_tag () { | |
# ## <span class="section-num">1</span> 前言 {#前言} => ## <span class="section-num">1</span> 前言 | |
# 删除 {#前言} | |
sed 's/{#.*}//' $1 | |
} | |
remove_meta_info () { | |
# 删除下列信息 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# JMH version: 1.19 | |
# VM version: JDK 1.8.0_171, VM 25.171-b11 | |
# VM invoker: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre/bin/java | |
# VM options: -Dvisualvm.id=214723528752700 -javaagent:/Users/samray/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/192.7142.36/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=61627:/Users/samray/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/192.7142.36/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 | |
# Warmup: 5 iterations, 1 s each | |
# Measurement: 10 iterations, 5 s each | |
# Timeout: 10 min per iteration | |
# Threads: 1 thread, will synchronize iterations | |
# Benchmark mode: Throughput, ops/time | |
# Benchmark: beanutils.BeanUtilsBenchmark.testApacheBeanUtils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author RamsayLeung/ramsayleung@gmail.com | |
* @version : AlphaNum.java, v 0.1 2019年11月18日 14:33 samray Exp $ | |
*/ | |
public class AlphaNum { | |
private String _A; | |
private String _B; | |
private String _C; | |
private String _D; | |
private String _E; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-05-16T14:10:08.466Z","extensionVersion":"v3.2.9"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |