Log printing class -- LogUtils
In Android development, it is often necessary to print logs, but the system logs, first, need to write tags frequently, but tags often use the same, second, can't output the number of lines, third, the logs that may be printed are very long and can't be printed completely, so a simple log printing class is needed to write less ...
Added by php_dev_101 on Mon, 23 Dec 2019 00:25:05 +0200
leetcode notes - binary search
Dichotomy search
thinking
By maintaining the three indexes in the left, middle and right, we constantly lose half of the impossible search space, and continue to search in the other half until success
The basic dichotomous template is as follows:
def search(self, nums, target):
left = 0
right = len(nums) ...
Added by poisedforflight on Sun, 22 Dec 2019 21:03:03 +0200
Recursive cases of algorithms
Directory Introduction
01. What is recursion
02. Recursive Three Conditions
03. Fibonacci series
04. Find all files in the specified directory
05.Find 1+2+...+N and
06. Find a factorial of 100
07. Combination of Ordered Numbers
08. Find a multiplier
09. Backpack problem
10. Select a team
11. Hannotta Problem
12. Dichotomy Search
13. Watch out ...
Added by Corvin on Fri, 20 Dec 2019 03:56:33 +0200
Control remote data locally
Preface:
There is a Federated storage engine in MySQL. Data tables using this engine do not store any data locally, but all data are stored on remote servers.
1. See if Federated storage engine is supported
MariaDB [(none)]> show engines;
| FEDERATED | YES | FederatedX pluggable storage engine ...
Added by Todd88 on Thu, 19 Dec 2019 18:26:52 +0200
Abstract Retry as a tool class
Background introduction
We inevitably write repetitive code in our work, so we need to be abstract, such as extracting common logic into abstract classes, or avoiding redundant code through some tool classes.
This article today extracts a tool class from a retry function that invokes a service for reuse.For the sake of introduction, the calling ...
Added by nafarius1357 on Thu, 19 Dec 2019 06:00:39 +0200
Usaco Training Section 5.3 Big Barn
Find the largest square without obstacles in a square of n*n. (n < = 1000, number of obstacles < = 10000)
It seems that it is a little difficult to enumerate. But if you think about it carefully, you can see that at least one side of the largest square is against the obstacle. So we just need to enumerate the largest squ ...
Added by premracer on Tue, 17 Dec 2019 22:06:53 +0200
003. Analysis of thread pool application and implementation principle
1. Why use thread pool? Is the more thread pools the better?
Thread is an object in java, but also a resource of operating system. It takes time for thread creation and destruction. If create time + destroy time > execute task time, it is not cost-effective.
Java objects occupy heap memory, and operating system threads occupy system mem ...
Added by Miichael on Tue, 17 Dec 2019 13:53:25 +0200
Algorithm - bubble sorting
Bubble sort: sort arrays in ascending or descending order.
Principle: (take ascending order as an example)
Use double loop to compare the two adjacent numbers in the array in turn, putting the decimal first and the large number second.
The first time: first, compare the first and second numbers, put the decimal number before ...
Added by dw89 on Mon, 16 Dec 2019 23:12:26 +0200
Mark, let's start to learn data structure today
I'm very glad to be able to start learning the data structure in my spare time today. I use Mr. Deng Junhui's videos and books to teach more
The function of the code is to find the largest and the next largest number in the array. In the following code, as long as max2? 3 is not called, it can run correctly [funny]
#include & ...
Added by sockit2em on Mon, 16 Dec 2019 20:46:03 +0200
Fast platoon
(if you are a freshman, you should not panic and study patiently. In fact, it's not very difficult. What I regret most is that I felt it was very difficult when I was a freshman and didn't want to see it, but you should know these things sooner or later. Don't stick the code in the experiment class, and you must fight with your ...
Added by Sk8Er_GuY on Mon, 16 Dec 2019 16:33:10 +0200