Skip to content

Instantly share code, notes, and snippets.

@Jim-Lin
Jim-Lin / file0.java
Created September 13, 2017 09:25
[Spring Framework] Servlet streaming back pressure against blocking ref: http://qiita.com/SHUAI/items/298939b6d879037e8b45
@RestController
public class CarLocationController {
private final CarRepository repository;
public CarLocationController(CarRepository repository) {
this.repository = repository;
}
@Jim-Lin
Jim-Lin / DateExtensions.java
Last active September 19, 2017 07:51
interview-sample1
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
/**
* Created by Jim on 2017/9/15.
*/
public class DateExtensions {
@Jim-Lin
Jim-Lin / file0.py
Created October 2, 2017 05:24
[Linux] note of SO_REUSEADDR & SO_REUSEPORT ref: http://qiita.com/SHUAI/items/07573e8a2be37bf3e8d1
def listener_work(num):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, SO_REUSEPORT, 1) # set SO_REUSEPORT
s.bind(("", PORT))
...
@Jim-Lin
Jim-Lin / file0.txt
Last active January 5, 2018 04:19
[Keras] Digit Recognizer competition on Kaggle using Neural Network ref: https://qiita.com/SHUAI/items/25b7eb1919e944534a90
# Dockerfile
FROM gw000/keras:2.0.5-py3-tf-cpu
# install dependencies from debian packages
RUN apt-get update -qq \
&& apt-get install --no-install-recommends -y \
python-matplotlib \
python-pillow