• C language programming beginner basic knowledge learning: file reading and writing operation!


    The correct process for operating files is: open file — > read / write file — > close file. The file should be opened before reading and writing, and closed after use. We should know the operation process of documents well at any time. Today we will talk about the reading and writing of documents. […]

  • Addition and subtraction of datetime in C #


    In. Net framework 4.0, there is a difference between datetime type and datetime typeCannot add, but subtraction can be performed. The subtracted results can be stored by timespan type. The timespan class has members that directly obtain the subtraction results. The code is as follows: using System; TimeSpan ts = Convert.ToDateTime(“2019-11-15 14:00:00”) – Convert.ToDateTime(“2019-11-14 14:00:00”); […]

  • Redis centralized cache of sprinboot


    Redis centralized cache of sprinboot How to use redis to implement data caching in spring boot cache support. Add related dependencies in pom.xml <!– redis –> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </dependency> <!– redis end–> be careful staySpring Boot 1.xIn previous versions of, the dependency was namedspring-boot-starter-redis Add configuration information to the configuration […]

  • Good looking loading


    1. Small circular loading with different sizes <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <title>Document</title> </head> <body> <div style=”width:100%;height:100vh;display: flex;justify-content: center;background-color: rgb(195, 191, 191);”> <div class=”d1″> <p></p> <p></p> <p></p> <p></p> </div> <div class=”d1″> <p></p> <p></p> <p></p> <p></p> </div> </div> </body> <style> *{ margin: 0; padding: 0; } .d1{ […]

  • How do computers represent integers


    [TOC] In a computer, any data is represented by binary: 0 and 1. Integers are no exception. In life10, expressed in an 8-byte integer as00001010。 But this can only represent positive numbers and zero. How to express negative numbers? So there is the concept of sign bit. In an 8-byte integer, the highest bit is […]

  • The trouble caused by translation: the checksum of IP, ICMP, TCP and UDP packets


    1、 Network protocol checksum definition RFC 1071The definition of checksum in: (1) Adjacent octets to be checksummed are paired to form 16-bit integers, and the 1’s complement sum of these 16-bit integers is formed.(2) To generate a checksum, the checksum field itself is cleared, the 16-bit 1’s complement sum is computed over the octets concerned, […]

  • [activities that babies can understand] [30 day leetcoding challenge] day 3


    Hi, everyone, I’m Zhang Xiaozhu. Welcome to the 30 day leetcoding challenge, a special article in the “baby can understand” series. This is an official little activity of leetcode. It can be seen on the official website that from April 1, the official will choose a question every day, and you can get a little […]

  • Greedy algorithm – Maximum suborder sum


    Problem description Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Link: https://leetcode-cn.com/probl… Problem solving ideas Loop through the array to determine whether each element can be added to a subsequence that may become the largest subsequence sum.The judgment condition is that […]

  • Front end basics — CSS


    1. Box model width calculationA: the default box model of IE browser is border box, and the default box model of other browsers is content box. The actual model width and height of the element are offsetwidth and offsetHeight. Offsetwidth = width of border box,Offsetwidth = width + padding + border of content box.2. Margin […]

  • Hey! Don’t forget this C language knowledge~ 0 = = – 1 (problem)


    Today, I’ll take you to review a forgotten C language knowledge point, the storage of negative numbers and a typical investigation form. Let’s look at a topic first #include  int main()  {  int   a,b,c,d;    // perhaps     int   a,b,c,d;  a=0x8;   b=a>>1;   c=~(~0<<1);   d=b&c;   printf(“c is %d\n”,c);   printf(“d is %d\n”,d);  }    Resolution: Suppose the computer is storing eight […]

  • Advanced skills of CSS (7)


    Display and hide of elements Display show (hide) Show and hide Display: none (hidden) Display: block (display) characteristic Hide elements first <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <title>Document</title> <style> * { margin: 0; padding: 0; } div { width: 200px; height: 200px; margin: 20px 20px; background-color: blue; } .box1 { […]

  • Simple dynamic effect of stroke dashuffset in SVG


    Property introductionstroke-dashoffsetThe stroke dashoffset property specifies the distance from the dash pattern to the beginning of the pathIf a < percentage > value is used, this value represents a percentage of the current viewport.The value can be negativeLet’s see the effect first <button class=”menu__item” style=”–bgColorItem: #f54888;”> <svg class=”icon” viewBox=”0 0 24 24″> <path d=”M6.7,4.8h10.7c0.3,0,0.6,0.2,0.7,0.5l2.8,7.3c0,0.1,0,0.2,0,0.3v5.6c0,0.4-0.4,0.8-0.8,0.8H3.8 C3.4,19.3,3,19,3,18.5v-5.6c0-0.1,0-0.2,0.1-0.3L6,5.3C6.1,5,6.4,4.8,6.7,4.8z”/> […]