diff --git a/docs/final/2023221402004FengRj.md b/docs/final/2023221402004FengRj.md new file mode 100644 index 0000000000000000000000000000000000000000..d4685f7f2bd14f3f86669c4cfb6cd6e07da0c935 --- /dev/null +++ b/docs/final/2023221402004FengRj.md @@ -0,0 +1,74 @@ +# LightProxy Usage Tutorial + +## Concept + +image-20241125210249118 + +LightProxy is a powerful proxy tool that can intercept, modify, and forward network requests, making it convenient for developers and non developers to debug, analyze, and customize network data. It is like a "middleman" for network requests, allowing users to clearly see the detailed information of requests and responses, and adjust them as needed. + +## Applicable objects + +### (I)Developer + +For developers, LightProxy is an indispensable development tool. + +- Debugging Interface: Quickly locate issues that arise during interface calls, such as parameter errors, abnormal response data, etc. +- Simulate different network environments: Test the performance of applications under different network conditions, including latency, bandwidth limitations, etc., to optimize the network adaptability of applications. +- Validate security strategy: Check for network security vulnerabilities in the application, such as data leakage risks, by intercepting and analyzing request and response data to ensure that the application complies with security standards. + +### (II)Non developer + +Non developer users can also benefit from LightProxy. For example: + +- Ordinary network users can use LightProxy to view the network request status of applications on their devices, understand the data interaction behavior of applications in the background, and better protect personal privacy and data security. +- Internet enthusiasts: Those who are interested in the principles of network requests and want to gain a deeper understanding of network data transmission mechanisms can use LightProxy to learn and explore, and visually observe the entire process of network requests. + +## How to use LightProxy + +### (I)How to download and install + +1. Firstly, download the corresponding installation package from LightProxy's official website based on your operating system type (such as Windows, Mac, or Linux). + - Download URL MAC: https://gw.alipayobjects.com/os/LightProxy/LightProxy.dmg + - Windows:https://gw.alipayobjects.com/os/LightProxy/LightProxy-Setup.exe + +2. After downloading, run the installation program and follow the prompts to gradually complete the installation process. During the installation process, you may need to agree to some software license agreements and select basic settings such as installation paths. + +After successful download, you need to follow the prompts to install the command on the terminal. + +### (II)User interface and functional operation + +#### Rule module + +In this rule interface, corresponding rules can be configured, allowing users to define and manage various proxy rules as needed. Whether it's request interception, response modification, API simulation, or cross domain problem troubleshooting, LightProxy can provide flexible solutions. By configuring rules, users can efficiently develop and test, improving work efficiency. + +![image-20241125210700084](./pictures/image-20241125210700084.png) + +#### Whistle module + +![image-20241125211547621](./pictures/image-20241125211547621.png) + +For developers, the Whistle module is a powerful HTTP debugging proxy tool that can intercept, modify, and redirect requests and responses through configuration rules. Whether it's front-end development, API testing, or performance optimization, Whistle can provide flexible solutions to help developers improve development and testing efficiency. + +For non developers: With Whistle, you can view, modify, and redirect network requests for privacy protection, ad blocking, cross domain troubleshooting, API debugging, and performance optimization. + +## Specific applications + +In certain specific scenarios, for example, website A cannot be accessed normally due to certain restrictions (such as geographical limitations, access restrictions, etc.), while website B has similar functions or data resources. We can use LightProxy to achieve the goal of accessing website B through the appearance of accessing website A. + +### Agent Configuration + +Firstly, start LightProxy and complete the relevant device proxy configuration as described earlier. Here is an example (www.google.com requires scientific access, which is difficult to access normally, so configure access to www.baidu.com) + +![image-20241127220108000](./pictures/image-20241127220108000.png) + +### Specific implementation + +![image-20241127220459555](./pictures/image-20241127220459555.png) + +![image-20241127220543156](./pictures/image-20241127220543156.png) + +By doing so, it is easy to redirect to www.baidu.com when accessing www.google.com + +### Principle + +When entering the URL of website A in the browser to initiate an access request, LightProxy will intercept the request. Then, in the request modification function module of LightProxy, modify the target URL of the request (originally pointing to website A) to the URL of website B. After the modification is completed, click the "Resend" button, and LightProxy will forward the modified request to the B website server. The B website server will process the request and return response data, and LightProxy will then return this response data to the browser. This will present the effect on the browser side as if the A website has been successfully accessed, but in reality, all data interactions are conducted with the B website. diff --git a/docs/final/pictures/image-20241125210249118.png b/docs/final/pictures/image-20241125210249118.png new file mode 100644 index 0000000000000000000000000000000000000000..e061754ade16a851597cb46632be1b59f4b852d4 Binary files /dev/null and b/docs/final/pictures/image-20241125210249118.png differ diff --git a/docs/final/pictures/image-20241125210700084.png b/docs/final/pictures/image-20241125210700084.png new file mode 100644 index 0000000000000000000000000000000000000000..a08a27eb54bf785a09aea2f1541b92d46e4dce18 Binary files /dev/null and b/docs/final/pictures/image-20241125210700084.png differ diff --git a/docs/final/pictures/image-20241125211547621.png b/docs/final/pictures/image-20241125211547621.png new file mode 100644 index 0000000000000000000000000000000000000000..c7102e216205a96ba25d345cfc480ef70c14d139 Binary files /dev/null and b/docs/final/pictures/image-20241125211547621.png differ diff --git a/docs/final/pictures/image-20241127220108000.png b/docs/final/pictures/image-20241127220108000.png new file mode 100644 index 0000000000000000000000000000000000000000..c2fd8fe7cb7c4142ad5cb11e93cefd9621aad7aa Binary files /dev/null and b/docs/final/pictures/image-20241127220108000.png differ diff --git a/docs/final/pictures/image-20241127220459555.png b/docs/final/pictures/image-20241127220459555.png new file mode 100644 index 0000000000000000000000000000000000000000..fca4572b5489160a440cb64558cceccfb62d0096 Binary files /dev/null and b/docs/final/pictures/image-20241127220459555.png differ diff --git a/docs/final/pictures/image-20241127220543156.png b/docs/final/pictures/image-20241127220543156.png new file mode 100644 index 0000000000000000000000000000000000000000..df48bdef6872a271acd6984a3f7517a7c9cd6129 Binary files /dev/null and b/docs/final/pictures/image-20241127220543156.png differ diff --git a/docs/for-loop/2023221402004FengRj.md b/docs/for-loop/2023221402004FengRj.md new file mode 100644 index 0000000000000000000000000000000000000000..88eaa9376f8bf27e09e396094f68451377b5aa38 --- /dev/null +++ b/docs/for-loop/2023221402004FengRj.md @@ -0,0 +1,94 @@ +# Technical Documentation: for Loop and Conditional Statements + +## 1. Overview + +This technical documentation will provide a detailed explanation of a Java code example that uses a `for` loop and conditional statements. The example selects specific elements from a string array and concatenates them into a new string. + +## 2. Code Example + +```java +String[] input = {"我", "你", "今天", "热爱", "生活"}; +String res = ""; +for (int i = 0; i < input.length; i = i + 1) { + if (i == 0) { + res = res + input[i]; + } + if (i == 3) { + res = res + input[i]; + } + if (i == 4) { + res = res + input[i]; + } +} +System.out.print(res); +``` + +## 3. Code Explanation + +### 3.1 Initialization + +- **String Array**: `String[] input = {"我", "你", "今天", "热爱", "生活"};` + - Defines an array containing five string elements. +- **Result String**: `String res = "";` + - Initializes an empty string `res` to store the final result. + +### 3.2 for Loop + +```java +for (int i = 0; i < input.length; i = i + 1) { + // Loop body +} +``` + +- **Initialization**: `int i = 0;` + - Initializes the loop variable `i` to 0, indicating the start from the first element of the array. +- **Condition**: `i < input.length;` + - The loop continues as long as `i` is less than the length of the array. `input.length` is 5, so the loop will execute 5 times. +- **Iteration**: `i = i + 1;` + - After each loop iteration, `i` is incremented by 1, until `i` reaches 5, at which point the loop ends. + +### 3.3 Conditional Statements + +Within each loop iteration, different operations are performed based on the value of `i`: + +- **When `i` is 0**: + + ```java + if (i == 0) { + res = res + input[i]; + } + ``` + + - Concatenates the first element `"我"` of the array to `res`. + +- **When `i` is 3**: + + ```java + if (i == 3) { + res = res + input[i]; + } + ``` + + - Concatenates the fourth element `"热爱"` of the array to `res`. + +- **When `i` is 0**: + + ```java + if (i == 4) { + res = res + input[i]; + } + ``` + + - Concatenates the fifth element `"生活"` of the array to `res`. + +### 3.4 Output Result + +```java +System.out.print(res); +``` + +- Finally, outputs the concatenated string `"我热爱生活"`. + +## 4. Summary + +By using a `for` loop and conditional statements, we can select specific elements from an array and concatenate them into a new string. This technique is very useful when processing data, especially when you need to filter data based on specific conditions.