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
# 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 |
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
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)) | |
... |
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
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 { |
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
@RestController | |
public class CarLocationController { | |
private final CarRepository repository; | |
public CarLocationController(CarRepository repository) { | |
this.repository = repository; | |
} |
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
// Java | |
interface Collection<E> ... { | |
void addAll(Collection<E> items); | |
} | |
void copyAll(Collection<Object> to, Collection<String> from) { | |
to.addAll(from); // !!! Would not compile with the naive declaration of addAll | |
} |
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
public void add(java.lang.String); | |
Code: | |
Stack=2, Locals=2, Args_size=2 | |
0: aload_0 | |
1: getfield #15; //Field admin:Lcom/nhn/user/UserAdmin; | |
4: aload_1 | |
5: invokevirtual #23; //Method com/nhn/user/UserAdmin.addUser:(Ljava/lang/String;)Lcom/nhn/user/User; | |
8: pop | |
9: return LineNumberTable: | |
line 14: 0 |
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
$ mkdir <work_dir> | |
$ cd <work_dir> | |
$ git clone https://github.com/phacility/libphutil.git | |
$ git clone https://github.com/phacility/arcanist.git | |
$ git clone https://github.com/phacility/phabricator.git |
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
import java.util.concurrent.ForkJoinPool; | |
import java.util.concurrent.RecursiveTask; | |
public class Main { | |
public static void main(String[] args) { | |
int poolSize = Runtime.getRuntime().availableProcessors(); | |
System.out.println("poolSize: " + poolSize); | |
/** |
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
@RestController | |
public class AsyncCallableController { | |
private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |
private final TaskService taskService; | |
@Autowired | |
public AsyncCallableController(TaskService taskService) { | |
this.taskService = taskService; | |
} |
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
console.clear(); | |
var promise = new Promise((resolve) => { | |
setTimeout(() => { | |
resolve(42); | |
}, 500); | |
console.log('promise started'); | |
}); |
NewerOlder