HashMap source code analysis in JDK 1.7

We take jdk1.7.0_80 as an example to analyze the HashMap source code. Catalog 1, Source code analysis 1.1 important properties of HashMap 1.2 analytical PUT method 1.3 analyze resize method 1.4 parse GET method 2, Problem summary 2.1 how does the rounduptopower of 2 (toSize) method realize to find ...

Posted by Teck on Mon, 20 Jan 2020 02:07:08 -0800

How to determine if 2D points are in polygons?

I'm trying to create a fast 2D point inside the polygon algorithm for hit testing (for example, Polygon.contains(p:Point)). Suggestions for effective technology will be appreciated. #1 building The C version of nirg's answer is here: I only share the code. This can save some time. public static bool IsPointInPolygon(IList<Point> ...

Posted by kaitan on Mon, 20 Jan 2020 01:57:05 -0800

vue component classification

vue component classification I. Introduction The reason why I wrote this article is that I interviewed dozens of people as an interviewer some time ago. One of the questions is "what are the component classifications of vue? ", it's surprising that most people only answer global components ...

Posted by CBaZ on Sun, 19 Jan 2020 20:35:58 -0800

A * search algorithm of Routing module

A * search algorithm of Routing module The result of Routing module is the basis of generating reference line in Planning module, which is generally referred to as global path Planning. In Routing module, the core algorithm is to generate global path through A * algorithm, besides abstracting the map ...

Posted by sades on Sun, 19 Jan 2020 06:37:54 -0800

[Python notes] conditions, loops and other statements

Conditional control statement if else First, let's take A simple example: design A program to compare the sizes of two numbers A and B. If A and B are not equal, print the values of the larger numbers. If they are equal, print A. The Python code is as follows: if A >= B: print('The larger n ...

Posted by goodluck4287 on Sun, 19 Jan 2020 05:51:34 -0800

Discussion on cache, buffer and swap caused by free

Discussion on cache, buffer and swap caused by free $ free total used free shared buffers cached Mem: 8062624 7910056 152568 0 5232 964468 -/+ buffers/cache: 6940356 1122268 Swap: 4194296 2592660 1601636 total: the ...

Posted by abx_2112 on Sun, 19 Jan 2020 00:40:57 -0800

throw/throws keyword and custom exception in Java

throw Throw is used to throw objects of specific exception classes, generally used in method bodies. When to use: throw an exception object to remind the programmer when the written code does not meet certain conditions and the program cannot run. Python like raise public class Student { private int ...

Posted by webpoet on Sun, 19 Jan 2020 00:05:40 -0800

Teaching you the python 26 KNN approach algorithm

KNN overview K-nearest neighbor algorithm is a basic classification and regression method. We only discuss k-nearest neighbor algorithm in classification. A word summary: near Zhu is red, near Mo is black! Working principle: there is a sample data set, also known as a training sample set, and eac ...

Posted by sri2002 on Sat, 18 Jan 2020 23:04:52 -0800

Webpack practice: how to use style CSS preprocessing gracefully

In the last article, I mainly shared< How Webpack separates style files >css preprocessor is a program that allows you to generate css through preprocessor's own unique syntax. css preprocessing refers to that we often use some style precompiled languages in development, and then convert these pr ...

Posted by snowrhythm on Sat, 18 Jan 2020 20:05:38 -0800

Android Edittext limits the number of decimal places, the size of input numbers and style attributes

Everyone is not new to Edittext. I won't say much here. I'll go straight to the topic. I'm just writing this article to record some tips for using Edittext: 1. Limit input range method 1: /** * Limit the range of input numbers */ public class RegionNumberEditText extends EditText { private Context context; private i ...

Posted by riyaz on Sat, 18 Jan 2020 07:24:38 -0800