[comics] JAVA Concurrent Programming ReentrantLock of J.U.C Lock package
Original statement: This article comes from the official account [fat pig programming]. Please indicate the source.
stay How to solve the atomicity problem in JAVA Concurrent Programming Finally, we sold a key. Mutex not only has synchronized keyword, but also can be implemented with Locks package in J.U.C. and it is very powerful! Let's find o ...
Posted by chet23 on Tue, 12 May 2020 10:28:12 -0700
Chapter 6 answer to question 21 (Phone keypads) - programming exercise
*6.21 (phone by keyboard) the international standard letter / number matching diagram is shown in the programming exercise 4.15. Write a method to return the number of a given capital letter, as follows:
int getNumber(char uppercaseLetter)
Write a test program to prompt the user to enter a phone number in the form of a string. The number you en ...
Posted by markmuir on Tue, 12 May 2020 09:04:42 -0700
Python example: one click bulk matting
Have you ever wanted to pick out the characters in one photo and then put them together in other pictures, so that even if you are in the end of the world, I can visit here?
Professional people can use PhotoShop's "magic wand" tool to matting, and non professional people can use a variety of beauty APP to achieve, but after all, their ...
Posted by goaman on Tue, 12 May 2020 01:09:48 -0700
Read by Unity3D -- read Excel file content
In the process of Unity3D development, reading excel table is a very frequent thing. It is mainly used to record various data. Various platforms may have many methods, such as Android, you can plug-in, or you can use third-party java to develop. dll package for Plugin, and then C ා and Java interact to realize Excel reading (it's troublesome, ...
Posted by jbille on Mon, 11 May 2020 09:08:14 -0700
Practical JavaScript functional programming
Recently, when chatting with a friend who is a technology maker, I found that I couldn't explain the idea of functional programming clearly, so I made a review
1, The function is "first class citizen"
It is often heard that in JavaScript, a function is a "first-class citizen". What does this mean?
In programming language, ...
Posted by tserbis on Mon, 11 May 2020 03:10:42 -0700
[experience sharing] the best practice of remote login server with Python
When using Python to write some scripts, in some cases, we need to log in to the remote service frequently to execute a command and return some results.
In a shell environment, this is what we do.
$ sshpass -p ${passwd} ssh -p ${port} -l ${user} -o StrictHostKeyChecking=no xx.xx.xx.xx "ls -l"
Then you will find that your output has a lot of ...
Posted by wakenbake on Mon, 11 May 2020 00:56:20 -0700
Spring boot Learning Series -- declarative transaction
1, Spring's transaction mechanism
All data access technologies have transaction processing mechanisms, which provide API s to enable transactions, commit transactions to complete data operations, or roll back data in case of errors.
Spring's transaction mechanism is to use a unified mechanism to handle transactions of different data a ...
Posted by fredi_bieging on Mon, 11 May 2020 00:00:46 -0700
Create the correct pose for thread pool, please give it a meaningful name
Why do we need to specify meaningful thread names when creating threads or thread pools?
The ultimate goal is to facilitate backtracking.
In our daily development, a project will create many thread pools for resource isolation, but if we do not have a good name, it will be difficult to locate when there is a problem.
public class Demo5 {
...
Posted by arn_php on Sun, 10 May 2020 22:11:34 -0700
Debugging artifact in jcmd:JDK14
brief introduction
Jcmd is the debugging tool that comes with JDK and has very powerful functions.Jcmd was officially introduced in JDK7. With jcmd, you can completely replace many other commonly used tools, such as jstak and jmap.
Jcmd can send specific diagnostic commands to the JVM.For security reasons, users using jcmd must have the same us ...
Posted by glassroof on Sun, 10 May 2020 15:57:28 -0700
Do you really know java class name?
In the object-oriented world, Class is the foundation of Java. java.lang.Class is actually inherited from java.lang.Object.
Class has a method called getName, which returns the class name of (class, interface, array class, primitive type, or void).
If you often debug the JVM, you will see the following strange things:
jcmd 1234 GC.class_histogr ...
Posted by Benaravo on Sun, 10 May 2020 07:22:24 -0700