摘要: #include <iostream> #include <string> class Token { public: Token() : tok(INT), ival(0) {} ~Token() { if (tok == STR) { sval.~basic_string(); // 联合体中编 阅读全文
posted @ 2023-10-03 16:16 hacker_dvd 阅读(13) 评论(0) 推荐(0)
摘要: GCC 自动识别的常用扩展名 以c语言的方式编译当前文件(即为demo) gcc -xc demo GCC 常用编译选项 GCC 生成 a.out 的过程 1.预处理 预处理过程主要是处理那些源文件和头文件中以#开头的命令,比如 #include、#define、#ifdef 等。预处理的规则一般如 阅读全文
posted @ 2023-09-29 22:40 hacker_dvd 阅读(42) 评论(0) 推荐(0)
摘要: basename, dirname的用法 basename,dirname用法 atoi 函数 char* num = "12345"; printf("%d\n", atoi(num)); recv 函数 recv详解: 阅读全文
posted @ 2023-09-15 23:14 hacker_dvd 阅读(12) 评论(0) 推荐(0)
摘要: floyd 算法 template <typename T> struct Floyd { const T INF = std::is_same_v<T, long long> ? 1e18 : 1e9; int n; std::vector<std::vector<T>> dp; Floyd(in 阅读全文
posted @ 2023-09-13 20:28 hacker_dvd 阅读(19) 评论(0) 推荐(0)
摘要: 采用 socket 实现服务端和客户端通信 server.c #include <arpa/inet.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys 阅读全文
posted @ 2023-09-10 18:03 hacker_dvd 阅读(35) 评论(0) 推荐(0)
摘要: [机器翻译](https://www.luogu.com.cn/problem/P1540) ``` #include #include #include #include #include #include #include #include #define DEBUG using namespa 阅读全文
posted @ 2023-08-13 13:05 hacker_dvd 阅读(19) 评论(0) 推荐(0)
摘要: ```python ''' // 开头表示从根节点开始查找 / 表示从当前节点的直接子节点开始查找 . 表示当前节点 [] 修饰当前标签 @ 修饰当前标签的属性 text() 获取标签的文本内容 @* 获取当前标签的所有属性 /@href 获取当前标签的 href 属性 ''' from lxml 阅读全文
posted @ 2023-07-19 09:58 hacker_dvd 阅读(44) 评论(0) 推荐(0)
摘要: ```python import requests import re import time import hashlib import threading from pymysql.converters import escape_string from fake_useragent impor 阅读全文
posted @ 2023-07-18 10:30 hacker_dvd 阅读(25) 评论(0) 推荐(0)
摘要: ```python import requests import re url = 'https://www.baidu.com' # get 方法是发送一个 get 请求,url 是关键字参数,表示请求的地址 # response 是一个响应对象,包含了服务器返回的所有信息 headers = { 阅读全文
posted @ 2023-07-17 13:05 hacker_dvd 阅读(17) 评论(0) 推荐(0)
摘要: ```py class A: @staticmethod def mystatic(): # 静态方法无法调用普通方法 return '静态方法' @staticmethod def mymystatic2(): return A.mystatic() # 需要使用类名 def me(self): 阅读全文
posted @ 2023-07-07 13:10 hacker_dvd 阅读(11) 评论(0) 推荐(0)