收藏到CSDN网摘
2本跟机器学习有关的在线电子书,涉及线性回归、多项式拟合、模型阶数选择等概念,很详细,值得精读。
27 Jun 2022
2 Nov 2021
Get One Line or Count the Number of Lines, Words, Characters in PowerShell
收藏到CSDN网摘
PowerShell is replacing cmd.exe in the new Windows operating systems, it's more efficient and powerful than its predecessor. The only drawback might be that the commands are much longer than what we used to see in cmd.exe. Counting the lines, words, even the characters are very useful - well, sometimes at least. This task can be easily done using some GUI software such as MS Word, Notepad, or vim if you prefer. PowerShell is capable of doing these jobs as well. Here is how ~
PowerShell is replacing cmd.exe in the new Windows operating systems, it's more efficient and powerful than its predecessor. The only drawback might be that the commands are much longer than what we used to see in cmd.exe. Counting the lines, words, even the characters are very useful - well, sometimes at least. This task can be easily done using some GUI software such as MS Word, Notepad, or vim if you prefer. PowerShell is capable of doing these jobs as well. Here is how ~
20 Oct 2021
Upgrade PowerShell to the Latest Version
收藏到CSDN网摘
From time to time, the MS PowerShell prompts new version message as long as it was started. An usual way to upgrade would be dive into MS's github repository to download the latest release. Then, a standard installation process can be carried out the deploy the latest version on your system. However, as we are already inside the commandline there is another way of doing the same thing using one line of command.
From time to time, the MS PowerShell prompts new version message as long as it was started. An usual way to upgrade would be dive into MS's github repository to download the latest release. Then, a standard installation process can be carried out the deploy the latest version on your system. However, as we are already inside the commandline there is another way of doing the same thing using one line of command.
17 Jun 2021
Image 2 ASCII - ascii art generator
收藏到CSDN网摘
Converting images to ASCII, aka. ASCII art, has been explored by developers long time ago back to the time of DOS age. It is more about having fun but there are also some really good publications around this topic. Someone implemented online services to convert uploaded images to ASCII art like THIS one.
Converting images to ASCII, aka. ASCII art, has been explored by developers long time ago back to the time of DOS age. It is more about having fun but there are also some really good publications around this topic. Someone implemented online services to convert uploaded images to ASCII art like THIS one.
The first answer under THIS QUESTION has a very detailed explanation and experiments of different approaches to this problem.
A simple and straightforward approach is to do a pixel-2-text mapping from the image the the result ASCII text file. To avoid making the text file overcrowded, developers use to have some carefully selected character lists to reduce the intense level (number of chars used). So the process is more like a classification process:
(1) find out which category the current pixel falls into;
(2) pick up the character that represents the current category;
(3) walking through the image pixel by pixel and repeat the process to generate the result text file.
28 Apr 2021
How to test if a point is inside a sector?
收藏到CSDN网摘
If we have a sector (partial circle) defined by the centre C, radius R, starting angle point S, and ending angle point E. How can we test if a given point P is inside or outside the sector? The idea is to define 2 function: the one is to test if one vector can be obtained by rotating from another vector clockwise (or anti-clockwise if needed); the other is to test if the distance from the point to the centre is less than or equal to the radius. Then, the problem becomes 3 tests: (1) clockwise rotation from starting vector to the point; (2) anti-clockwise rotation from the ending vector to the point; and (3) the distance from P to C is less than R.
If we have a sector (partial circle) defined by the centre C, radius R, starting angle point S, and ending angle point E. How can we test if a given point P is inside or outside the sector? The idea is to define 2 function: the one is to test if one vector can be obtained by rotating from another vector clockwise (or anti-clockwise if needed); the other is to test if the distance from the point to the centre is less than or equal to the radius. Then, the problem becomes 3 tests: (1) clockwise rotation from starting vector to the point; (2) anti-clockwise rotation from the ending vector to the point; and (3) the distance from P to C is less than R.
How to test if a point is inside of a triangle?
收藏到CSDN网摘
To determine if a point P is inside or outside a given triangle defined by 3 vertices P1, P2, and P3. The edges can be calculated first as 3 vectors: P12 = P1-P2; P23 = P2-P3; P31 = P3-P1. Then, its a simple task.
To determine if a point P is inside or outside a given triangle defined by 3 vertices P1, P2, and P3. The edges can be calculated first as 3 vectors: P12 = P1-P2; P23 = P2-P3; P31 = P3-P1. Then, its a simple task.
Subscribe to:
Posts
(
Atom
)



