自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(47)
  • 收藏
  • 关注

原创 qt源码链接&C++automic

qaction.cpp source code [qtbase/src/widgets/kernel/qaction.cpp] - Codebrowser

2023-12-15 15:43:53 359

原创 C++编程规范总结

2022-08-13 14:33:11 316 2

原创 协程相关记录

协程,英文Coroutines,是一种基于线程之上,但又比线程更加轻量级的存在,这种由程序员自己写程序来管理的轻量级线程叫做『用户空间线程』,具有对内核来说不可见的特性。因为是自主开辟的异步任务,所以很多人也更喜欢叫它们纤程(Fiber),或者绿色线程(GreenThread)。正如一个进程可以拥有多个线程一样,一个线程也可以拥有多个协程。协程的目的在传统的J2EE系统中都是基于每个请求占用一个线程去完成完整的业务逻辑(包括事务)。所以系统的吞吐能力取决于每个线程的操作耗时。如果遇到很耗

2022-02-23 14:25:53 125

原创 MySql面试题

目录索引1.什么是索引?索引1.什么是索引?索引是一种特殊的文件(InnoDB数据表上的索引是表空间的一个组成部分),它们包含着对数据表里所有记录的引用指针。索引是一种数据结构。数据库索引,是数据库管理系统中一个排序的数据结构,以协助快速查询、更新数据库表中数据。索引的实现通常使用B树及其变种B+树。更通俗的说,索引就相当于目录。为了方便查找书中的内容,通过对内容建立索引形成目录。索引是一个文件,它是要占据物理空间的。2.索引有哪些优缺点?索引的优点:可以大大加快

2022-02-22 17:18:56 153

原创 C/C++面试/笔试题2022

多态的实现 在基类的函数前加上virtual关键字,在派生类中重写该函数,运行时将会根据对象的实际类型来调用相应的函数。 如果对象类型是派生类,就调用派生类的函数;如果对象类型是基类,就调用基类的函数,此为多态的表现; Cpp四种强制类型转换 const_cast:从字面意思上就可以理解,去除变量的const属性。 static_cast:静态类型转换,一般用于基本类型间的转换,如char->int dynamic_cast:动态转换,同于多态之间的类型转换 reinterp..

2022-02-21 11:46:01 1649

原创 计算机网络部分面试题

1.TCP和UDP的区别用户数据报协议 UDP(User Datagram Protocol) 是无连接的,尽最大可能交付,没有拥塞控制,面向报文(对于应用程序传下来的报文不合并也不拆分,只是添加UDP首部),支持一对一、一对多、多对一和多对多的交互通信。传输控制协议 TCP(Transmission Control Protocol) 是面向连接的,提供可靠交付,有流量控制,拥塞控制,提供全双工通信,面向字节流(把应用层传下来的报文看成字节流,把字节流组织成大小不等的数据块),每一条 TCP 连接只能

2022-02-19 12:53:06 1150

原创 操作系统部分面试题

进程和线程间的通信方式 Linux进程:管道、有名管道、信号、信号量、共享内存、消息队列、套接字 Linux线程:互斥体、信号量、条件变量 Windows进程:管道、共享内存、消息队列、信号量、套接字 Windows线程:临界区、互斥量、信号量、事件 死锁产生的原因和死锁的条件 原因:系统资源的竞争、进程推进顺序非法 条件:互斥条件、不剥夺条件、请求和保持条件、循环等待条件 如何采用单线程处理高并发 采取I/O复用来提高单线程处理多请求的能力(epoll和select)..

2022-02-18 16:08:04 240

原创 PAT甲级1098 Insertion or Heap Sort (25 分)

1098 Insertion or Heap Sort (25 分)According to Wikipedia:Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the locatio...

2022-01-20 11:56:35 634

原创 PAT甲级1097 Deduplication on a Linked List (25 分)

1097 Deduplication on a Linked List (25 分)Given a singly linked listLwith integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each valueK, only the first node of which the value or absolute valu...

2022-01-19 10:46:08 180

原创 PAT甲级1096 Consecutive Factors (20 分)

1096 Consecutive Factors (20 分)Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, and 7 are the three consecutive numbers. Now given any positive N, you are

2022-01-17 11:50:11 174

原创 PAT甲级1094 The Largest Generation (25 分)

1094 The Largest Generation (25 分)A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population.Input Specification:Each

2022-01-13 11:39:08 71

原创 PAT甲级1093 Count PAT‘s (25 分)

1093 Count PAT's (25 分)The stringAPPAPTcontains twoPAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now given any string, you are suppo...

2022-01-12 10:43:11 87

原创 PAT甲级1092 To Buy or Not to Buy (20 分)

1092 To Buy or Not to Buy (20 分)Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sell the strings in whole

2022-01-11 10:44:56 133

原创 PAT甲级1090 Highest Price in Supply Chain (25 分)

1090 Highest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys

2022-01-08 15:11:16 291

原创 PAT甲级1089 Insert or Merge (25 分)

1089 Insert or Merge (25 分)According to Wikipedia:Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belo.

2022-01-07 11:41:58 326

原创 PAT甲级1088 Rational Arithmetic (20 分)

1088 Rational Arithmetic (20 分)For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.Input Specification:Each input file contains one test case, which gives in one

2022-01-06 11:55:10 193

原创 待解决@Import NoSuchBeanDefinitionException

@Import({User.class,ch.qos.logback.core.db.DBHelper.class})不会报错@Import({User.class,DBHelper.class})会报NoSuchBeanDefinitionException,但雷神就不会报这个错误,奇怪-^-记录一下

2022-01-06 10:13:18 257

原创 PAT甲级1087 All Roads Lead to Rome (30 分)

1087 All Roads Lead to Rome (30 分)Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.Input Specification:Each input file contains

2022-01-05 16:13:13 398

原创 PAT甲级1085 Perfect Sequence (25 分)

1085 Perfect Sequence (25 分)Given a sequence of positive integers and another positive integerp. The sequence is said to be aperfect sequenceifM≤m×pwhereMandmare the maximum and minimum numbers in the sequence, respectively.Now given a sequenc...

2022-01-03 14:46:41 514

原创 PAT甲级1084 Broken Keyboard (20 分)

1084 Broken Keyboard (20 分)On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that you are supposed to type, and the string that

2022-01-02 15:46:30 148

原创 操作系统——内存映射文件

内存映射文件1.定义内存映射文件,是由一个文件到一块内存的映射。Win32提供了允许应用程序把文件映射到一个进程的函数 (CreateFileMapping)。内存映射文件与虚拟内存有些类似,通过内存映射文件可以保留一个地址空间的区域,同时将物理存储器提交给此区域,内存文件映射的物理存储器来自一个已经存在于磁盘上的文件,而且在对该文件进行操作之前必须首先对文件进行映射。使用内存映射文件处理存储于磁盘上的文件时,将不必再对文件执行I/O操作,使得内存映射文件在处理大数据量的文件时能起到相当重要的作用。

2021-09-24 16:06:45 306

原创 操作系统——内存映射文件

内存映射文件1.定义:内存映射文件,是由一个文件到一块内存的映射。Win32提供了允许应用程序把文件映射到一个进程的函数 (CreateFileMapping)。内存映射文件与虚拟内存有些类似,通过内存映射文件可以保留一个地址空间的区域,同时将物理存储器提交给此区域,内存文件映射的物理存储器来自一个已经存在于磁盘上的文件,而且在对该文件进行操作之前必须首先对文件进行映射。使用内存映射文件处理存储于磁盘上的文件时,将不必再对文件执行I/O操作,使得内存映射文件在处理大数据量的文件时能起到相当重要的作用

2021-09-24 15:58:22 1992

转载 计算机组成原理——选择结构语句的机器级表示

1.if~else语句的机器级表示例:int get_cont( int *p1, int *p2 ){ if ( p1 > p2 ) return *p2; else return *p1;}p1和p2对应实参的存储地址分别为R[ebp]+8、R[ebp]+12,EBP指向当前栈帧底部,结果存放在EAX。汇编代码解释:把ebp+8的内容赋值给eax 把ebp+12的内容...

2021-09-24 15:36:29 1187

原创 计算机组成原理——编译器、汇编器和链接器的基本概念

编译器:编译器把高级语言翻译为机器语言 得到hello.s文件,这个是汇编语言程序 不同的高级语言翻译的汇编语言相同汇编器:汇编器将hello.s翻译成机器语言指令,把这些指令打包成可重定位目标程序。 得到.o文件,是一个二进制文件,它的字节码是机器语言指令,不再是字符。前面两个阶段都还有字符。链接器:链接器负责 .o 文件的合并。得到的是可执行目标文件。 gcc会到系统默认的搜索路径”/usr/lib”下进行查找,也就是链接到libc.so.6库函数中去。 函数库一般分为静态库和动

2021-09-24 15:25:15 2080

原创 PAT甲级1083 List Grades (25 分)

1083 List Grades (25 分)Given a list ofNstudent records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interval.Input..

2021-09-17 17:36:44 274

原创 PAT甲级1081 Rational Sum (20 分)

1081 Rational Sum (20 分)GivenNrational numbers in the formnumerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case starts with a positive integerN(≤100), followed in the...

2021-09-15 18:15:38 80

原创 PAT甲级1080 Graduate Admission (30 分)

1080 Graduate Admission (30 分)It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure.Each applic

2021-09-14 17:49:09 54

原创 PAT甲级1079 Total Sales of Supply Chain (25 分)

1079 Total Sales of Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys pr

2021-09-13 18:56:22 67

原创 PAT甲级1078 Hashing (25 分)

1078 Hashing (25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to beH(key)=key%TSizewhereTSizeis the maximum size o...

2021-09-09 18:36:30 89

原创 PAT甲级1077 Kuchiguse (20 分)

1077 Kuchiguse (20 分)The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such a preference is called "Kuchiguse" and is often exaggera

2021-09-08 18:14:11 68

原创 PAT甲级1076 Forwards on Weibo (30 分)

1076 Forwards on Weibo (30 分)Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a user makes a post on Weib

2021-09-07 09:35:56 58

原创 PAT甲级1075 PAT Judge (25 分)

1075 PAT Judge (25 分)The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specification:Each input file contains one test case. For each ca

2021-09-06 17:52:05 77

原创 PAT甲级1074 Reversing Linked List (25 分)

1074 Reversing Linked List (25 分)Given a constantKand a singly linked listL, you are supposed to reverse the links of everyKelements onL. For example, givenLbeing 1→2→3→4→5→6, ifK=3, then you must output 3→2→1→6→5→4; ifK=4, you must output 4→3→...

2021-09-05 19:41:11 71

原创 PAT甲级1073 Scientific Notation (20 分)

1073 Scientific Notation (20 分)Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-][0-9]+ which means that the integer portion has exactly

2021-09-04 13:15:33 66

原创 PAT甲级1072 Gas Station (30 分)

1072 Gas Station (30 分)A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the houses are in its service range.

2021-09-03 12:35:15 83

原创 C++函数isalnum(),tolower()

isalnum():判断一个字符是否是字母或者(十进制)数字,若为字母或者数字,则返回True(非0值),否者返回False(0)tolower():将大写转换成小写,A->a. 小写和非字母不变。...

2021-08-31 20:37:44 140

原创 PAT甲级1071 Speech Patterns (25 分)

1071 Speech Patterns (25 分)People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker's identity, which is usefu

2021-08-31 20:34:36 101

原创 PAT甲级 1070 Mooncake (25 分)

1070 Mooncake (25 分)Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now given the inventory amounts and th

2021-08-31 07:45:53 80

原创 PAT甲级 1069 The Black Hole of Numbers (20 分)

1069 The Black Hole of Numbers (20 分)For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by taking the second numb

2021-08-29 16:15:30 47

原创 PAT甲级1067 Sort with Swap(0, i) (25 分)

1067 Sort with Swap(0, i) (25 分)Given any permutation of the numbers {0, 1, 2,...,N−1}, it is easy to sort them in increasing order. But what ifSwap(0, *)is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2, 1, 3} we may apply t...

2021-08-27 07:54:01 67

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除