Tag：integer

Time：20201028
Stack has great advantages in some matching scenarios and is very computerfriendly Question surface Calculate the value of inverse Polish (suffix expression), integer division only retains the integer partOperator contains only”+”,”“,”*”and”/”The operands may be integers or other expressions [“20”, “10”, “+”, “30”, “*”] > ((20 + 10) * 30) > 900 [“40”, “130”, “50”, “/”, […]

Time：20201026
Why can Python support arbitrary truth value judgment? 》In this paper, we analyze the underlying implementation of Python in truth value judgment, and we can see that Python adopts a relatively broad attitude towards Boolean value. What is the official thinking about this? The following article is pep285, written by Guido van Rossum, the father […]

Time：20201022
Get element width 1. Only inline styles can be obtained var ele = document.getElementById(‘element’); console.log ( ele.style.width ）; // empty string console.log(ele.style.height); // ‘100px’ 2. Real time style MDN data var ele = document.getElementById(‘element’); console.log(window.getComputedStyle(ele).width); // ‘100px’ console.log(window.getComputedStyle(ele).height); // ‘100px’ 3、Element.currentStyle.width/height The function is the same as the second point. It only exists in the […]

Time：20201021
public class TimeTool { //Calculate the whole number of days according to the date of birth private static int GetAgeByBirthdate(DateTime birthdate) { DateTime now = DateTime.Now; int age = now.Year – birthdate.Year; if (now.Month < birthdate.Month  (now.Month == birthdate.Month && now.Day < birthdate.Day)) { age–; } return age < 0 ? 0 : age; […]

Time：20201021
Title:Decompose a positive integer into prime factors. For example: input 90 and print 90 = 2 * 3 * 3 * 5. Program analysis:To decompose the prime factor of N, we should first find a minimum prime number k, and then complete it according to the following steps: (1) If the prime number is exactly […]

Time：20201020
preface There are five kinds of functions in SQL Server: string function, date function, mathematical function, system function and aggregate function. String function –Common string functions 1. Charindex() — character index 2. Len () — length 3. Upper () — upper case 4. Ltrim () — left trim 5. Rtrim () — right trim 6. […]

Time：20201019
Read some IEEE 754 implementation of floatingpoint arithmetic related articles IEEE 754 (IEEE 7542019) Floatingpoint arithmetic Significand JavaScript floating point number trap and solution Basic field: on floating point numbers In depth analysis of floating point numbers What is the difference between quiet NaN and signaling NaN? Why is the most secure integer in JavaScript […]

Time：20201018
1317. Convert an integer to the sum of two nonzero integers Hi, everyone. I’m a pig. Welcome to the weekly leetcode quiz of the “baby can understand” series. This is the first question in issue 171 and 1317 in the list of topics – “converting an integer into the sum of two nonzero integers.” Title […]

Time：20201012
Leetcode7. Integer inversion. Given a 32bit signed integer, you need to reverse the number on each of the integers. Example 1: Input: 123 Output: 321 Example 2: Input: – 123 Output: – 321 Example 3: Input: 120 Output: 21 be careful:Assuming that the environment can only store the lower 32bit signed integers, the value range […]

Time：20201010
11 Two ways to run code pressF5Or click Run (right arrow) 12 In the process of programming, pay attention to write notes and appropriate names (notes–Easy to find the wrong name–Easy to find) 13 “//”Represents a comment symbol 14 The annotator plays two roles: cancellation and interpretation. First, the line of code will not be […]

Time：20201010
Leetcode8. String conversion integer (ATOI). Please implement an ATOI function to convert a string to an integer. First, the function discards the useless beginning space character as needed until the first non space character is found. The following conversion rules are as follows: If the first non empty character is a positive or negative sign, […]

Time：2020109
1. Immutable pyintobject Python source analysis – object exploration we have a preliminary understanding of pyintobject. Objects in Python can be divided into fixed length and variable length. In addition, it can be divided into variable and immutable. Pyintobject is a fixed length and immutable object. Compared with other objects, it is the simplest and […]