Exception handling mechanism in Java thread pool
Preface
When using the thread pool, I was always confused about the handling of exceptions. Sometimes, there is an exception output, sometimes not. I made a summary today.
practice
ExecutorService exec1 = Executors.newFixedThreadPool(1);
exec1.submit(()->{
Object obj = null;
System.out.println(obj.toStr ...
Posted by carlheaton on Sun, 05 Jan 2020 16:45:00 -0800
switch multi value match Sao operation, take you up posture!
We all know that switch is used to go through process branches, and in most cases to match a single value, as shown in the following example:
/**
* @from WeChat public address: Java technology stack
* @author Stack length
*/
private static void test(int value) {
switch (value) {
case 1:
System.out.println("1");
...
Posted by All4172 on Sat, 04 Jan 2020 15:11:47 -0800
TensorFlow rnn analog binary subtracter
Convert two numbers to binary arrays
Also convert the result to a binary array
Two input and one output subtracters simulated by rnn
Where i is the binary array of two numbers, j is the array after subtraction, and k is the simulation result
i: [[0. 0. 1. 0. 0. 1. 0. 1.]
[0. 0. 1. 0. 0. 0. 0. 0.]]
j [0. 0. 0. 0. 0. 1. 0. 1.]
k [0. 0. 0. ...
Posted by something on Sat, 04 Jan 2020 05:40:31 -0800
Is there a better way to implement INotifyPropertyChanged?
Microsoft should implement some simple functions for INotifyPropertyChanged. For example, in automatic properties, you only need to specify {get; set; notify;} {get; set; notify;} {get; set; notify;}. I think it makes sense to do so. Or do you have any complications?
Can we implement "notification" and other functions in propertie ...
Posted by bnmng on Fri, 03 Jan 2020 16:59:39 -0800
Daniel will take you 5 minutes to create a Flask project!
Get ready
Install: pip install flaskFlask
Quick start: http://docs.jinkan.org/docs/flash/quickstart.html "QuickStart"
Rapid construction
Build in the project root directory:
webapp package directory, where the flash code is stored. There is a "init. Py" file in the package
templates directory to store template files
Stati ...
Posted by blueman on Fri, 03 Jan 2020 12:51:48 -0800
[python learning] don't worry about the progress and contents of python learning
Catalog
Python Basics
install
install
Basic use
print function
Basic mathematical operation
variable
while and for loops
while cycle
for cycle
if judgement
if judgement
if else judgment
if elif else judgment
Defining function
def function
Function parameter
Function default parameters
Variable form
...
Posted by mykmallett on Thu, 02 Jan 2020 23:36:29 -0800
Rolling sequence and reverse sequence of tf rnn delay sequence
Using rnn to fit delay and inversion sequences
In fact, the rnn of this layer is not as good as full connection. When the sequence length is too long, the number of last full connection nodes needs to be increased. However, if the sequence is relatively short, there are too many parameters and the result is very accurate....
Scroll the sequen ...
Posted by brainardp on Thu, 02 Jan 2020 14:57:36 -0800
Date and time API - reading Java 8 practice
Date and time
LocalDate
Create a LocalDate object and read its value
// According to the date of establishment
LocalDate date1 = LocalDate.of(2014, 3, 18);
// read
System.out.println(date1.getYear()); // 2014
System.out.println(date1.getMonth()); // MARCH
System.out.println(date1.getMonth().getValue()); // 3
System.out.println(date1.getDayOfM ...
Posted by phpnewbie1979 on Thu, 02 Jan 2020 04:37:20 -0800
Java8 - sorting with Comparator.comparing
Java8 - using Comparator.comparing for comparison sorting
Sorting with external Comparator comparator
When we need to sort the elements of the collection, we can use java.util.Comparator to create a comparator for sorting. The comparator interface is also a functional interface. We can use lambda expressions. Here is an example,
package com ...
Posted by Pyro on Wed, 01 Jan 2020 13:55:51 -0800
[Java learning] get to know Stream API
Preface
Stream is a new feature added in Java 1.8, which greatly simplifies the processing of collection objects and so on.
As the name implies, Stream is a Stream. It regards the input set elements as a Stream. Like pipeline processing, it can filter, sort, aggregate and other operations on set elements.
Stream detailed e ...
Posted by hand on Tue, 31 Dec 2019 19:07:13 -0800