Skip to content

Instantly share code, notes, and snippets.

@kenzhaoyihui
kenzhaoyihui / list.java
Created June 9, 2018 07:16
java list remove
package yzhao.blog.bean;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ArrayTest{
public static void main (String[] args) {
List<String> list = new ArrayList<>(4);
list.add("1");
public void execute(Runnable command) {
if (command == null)
throw new NullPointerException();
/*
* Proceed in 3 steps:
*
* 1. If fewer than corePoolSize threads are running, try to
* start a new thread with the given command as its first
* task. The call to addWorker atomically checks runState and
* workerCount, and so prevents false alarms that would add
class Singleton(object):
def __new__(cls):
_instance = None
if not hasattr(cls, '_instance'):
cls._instance = super(Singleton, cls).__new__(cls, *args, **kwarg)
return cls._instance
@kenzhaoyihui
kenzhaoyihui / index.html
Created April 6, 2018 10:15
Inline If-Else with Logical && Operator
<div id="root"></div>
<div id="root">
</div>
@kenzhaoyihui
kenzhaoyihui / container_with_most_water.py
Created November 9, 2017 09:10
Container With Most Water
__author__ = "kenzhaoyihui"
class Solution(object):
def maxArea(self, height):
"""
:type: height: List[int]
:rtype: int
"""
size = len(height)
@kenzhaoyihui
kenzhaoyihui / react_ajax.txt
Last active November 9, 2017 09:08
React Ajax
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title> React </title>
<script src="https://cdn.bootcss.com/react/15.4.2/react.min.js"></script>
<script src="https://cdn.bootcss.com/react/15.4.2/react-dom.min.js"></script>
<script src="https://cdn.bootcss.com/babel-standalone/6.22.1/babel.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
</head>