当前位置: 首页 > news >正文

c语言函数大全(C开头)

c语言函数大全(C开头)

There is no nutrition in the blog content. After reading it, you will not only suffer from malnutrition, but also impotence.
The blog content is all parallel goods. Those who are worried about being cheated should leave quickly.

函数名: cabs
功 能: 计算复数的绝对值
用 法: double cabs(struct complex z);
程序例:
#include
#include
int main(void)
{
struct complex z;
double val;
z.x = 2.0;
z.y = 1.0;
val = cabs(z);
printf("The absolute value of %.2lfi %.2lfj is %.2lf", z.x, z.y, val);
return 0;
}

函数名: calloc
功 能: 分配主存储器
用 法: void *calloc(size_t nelem, size_t elsize);
程序例:
#include
#include
int main(void)
{
char *str = NULL;
/* allocate memory for string */
str = calloc(10, sizeof(char));
/* copy "Hello" into string */
strcpy(str, "Hello");
/* display string */
printf("String is %s\n", str);
/* free memory */
free(str);
return 0;
}

函数名: ceil
功 能: 向上舍入
用 法: double ceil(double x);
程序例:
#include
#include
int main(void)
{
double number = 123.54;
double down, up;
down = floor(number);
up = ceil(number);
printf("original number %5.2lf\n", number);
printf("number rounded down %5.2lf\n", down);
printf("number rounded up %5.2lf\n", up);
return 0;
}

函数名: cgets
功 能: 从控制台读字符串
用 法: char *cgets(char *str);
程序例:
#include
#include
int main(void)
{
char buffer[83];
char *p;
/* There's space for 80 characters plus the NULL terminator */
buffer[0] = 81;
printf("Input some chars:");
p = cgets(buffer);
printf("\ncgets read %d characters: \"%s\"\n", buffer[1], p);
printf("The returned pointer is %p, buffer[0] is at %p\n", p, &buffer);
/* Leave room for 5 characters plus the NULL terminator */
buffer[0] = 6;
printf("Input some chars:");
p = cgets(buffer);
printf("\ncgets read %d characters: \"%s\"\n", buffer[1], p);
printf("The returned pointer is %p, buffer[0] is at %p\n", p, &buffer);
return 0;
}

函数名: chdir
功 能: 改变工作目录
用 法: int chdir(const char *path);
程序例:
#include
#include
#include
char old_dir[MAXDIR];
char new_dir[MAXDIR];
int main(void)
{
if (getcurdir(0, old_dir))
{
perror("getcurdir()");
exit(1);
}
printf("Current directory is: \\%s\n", old_dir);
if (chdir("\\"))
{
perror("chdir()");
exit(1);
}
if (getcurdir(0, new_dir))
{
perror("getcurdir()");
exit(1);
}
printf("Current directory is now: \\%s\n", new_dir);
printf("\nChanging back to orignal directory: \\%s\n", old_dir);
if (chdir(old_dir))
{
perror("chdir()");
exit(1);
}
return 0;
}


函数名: _chmod, chmod
功 能: 改变文件的访问方式
用 法: int chmod(const char *filename, int permiss);
程序例:
#include
#include
#include
void make_read_only(char *filename);
int main(void)
{
make_read_only("NOTEXIST.FIL");
make_read_only("MYFILE.FIL");
return 0;
}
void make_read_only(char *filename)
{
int stat;
stat = chmod(filename, S_IREAD);
if (stat)
printf("Couldn't make %s read-only\n", filename);
else
printf("Made %s read-only\n", filename);
}

函数名: chsize
功 能: 改变文件大小
用 法: int chsize(int handle, long size);
程序例:
#include
#include
#include
int main(void)
{
int handle;
char buf[11] = "0123456789";
/* create text file containing 10 bytes */
handle = open("DUMMY.FIL", O_CREAT);
write(handle, buf, strlen(buf));
/* truncate the file to 5 bytes in size */
chsize(handle, 5);
/* close the file */
close(handle);
return 0;
}


函数名: circle
功 能: 在给定半径以(x, y)为圆心画圆
用 法: void far circle(int x, int y, int radius);
程序例:
#include
#include
#include
#include
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
int radius = 100;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
/* draw the circle */
circle(midx, midy, radius);
/* clean up */
getch();
closegraph();
return 0;
}

函数名: cleardevice
功 能: 清除图形屏幕
用 法: void far cleardevice(void);
程序例:
#include
#include
#include
#include
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
/* for centering screen messages */
settextjustify(CENTER_TEXT, CENTER_TEXT);
/* output a message to the screen */
outtextxy(midx, midy, "press any key to clear the screen:");
/* wait for a key */
getch();
/* clear the screen */
cleardevice();
/* output another message */
outtextxy(midx, midy, "press any key to quit:");
/* clean up */
getch();
closegraph();
return 0;
}

函数名: clearerr
功 能: 复位错误标志
用 法:void clearerr(FILE *stream);
程序例:
#include
int main(void)
{
FILE *fp;
char ch;
/* open a file for writing */
fp = fopen("DUMMY.FIL", "w");
/* force an error condition by attempting to read */
ch = fgetc(fp);
printf("%c\n",ch);
if (ferror(fp))
{
/* display an error message */
printf("Error reading from DUMMY.FIL\n");
/* reset the error and EOF indicators */
clearerr(fp);
}
fclose(fp);
return 0;
}

函数名: clearviewport
功 能: 清除图形视区
用 法: void far clearviewport(void);
程序例:
#include
#include
#include
#include
#define CLIP_ON 1 /* activates clipping in viewport */
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int ht;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
setcolor(getmaxcolor());
ht = textheight("W");
/* message in default full-screen viewport */
outtextxy(0, 0, "* <-- (0, 0) in default viewport");
/* create a smaller viewport */
setviewport(50, 50, getmaxx()-50, getmaxy()-50, CLIP_ON);
/* display some messages */
outtextxy(0, 0, "* <-- (0, 0) in smaller viewport");
outtextxy(0, 2*ht, "Press any key to clear viewport:");
/* wait for a key */
getch();
/* clear the viewport */
clearviewport();
/* output another message */
outtextxy(0, 0, "Press any key to quit:");
/* clean up */
getch();
closegraph();
return 0;
}

函数名: _close, close
功 能: 关闭文件句柄
用 法: int close(int handle);
程序例:
#include
#include
#include
#include
main()
{
int handle;
char buf[11] = "0123456789";
/* create a file containing 10 bytes */
handle = open("NEW.FIL", O_CREAT);
if (handle > -1)
{
write(handle, buf, strlen(buf));
/* close the file */
close(handle);
}
else
{
printf("Error opening file\n");
}
return 0;
}

函数名: clock
功 能: 确定处理器时间
用 法: clock_t clock(void);
程序例:
#include
#include
#include
int main(void)
{
clock_t start, end;
start = clock();
delay(2000);
end = clock();
printf("The time was: %f\n", (end - start) / CLK_TCK);
return 0;
}

函数名: closegraph
功 能: 关闭图形系统
用 法: void far closegraph(void);
程序例:
#include
#include
#include
#include
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int x, y;
/* initialize graphics mode */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error
occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
x = getmaxx() / 2;
y = getmaxy() / 2;
/* output a message */
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(x, y, "Press a key to close the graphics system:");
/* wait for a key */
getch();
/* closes down the graphics system */
closegraph();
printf("We're now back in text mode.\n");
printf("Press any key to halt:");
getch();
return 0;
}

函数名: clreol
功 能: 在文本窗口中清除字符到行末
用 法: void clreol(void);
程序例:
#include
int main(void)
{
clrscr();
cprintf("The function CLREOL clears all characters from the\r\n");
cprintf("cursor position to the end of the line within the\r\n");
cprintf("current text window, without moving the cursor.\r\n");
cprintf("Press any key to continue . . .");
gotoxy(14, 4);
getch();
clreol();
getch();
return 0;
}

函数名: clrscr
功 能: 清除文本模式窗口
用 法: void clrscr(void);
程序例:
#include
int main(void)
{
int i;
clrscr();
for (i = 0; i < 20; i++)
cprintf("%d\r\n", i);
cprintf("\r\nPress any key to clear screen");
getch();
clrscr();
cprintf("The screen has been cleared!");
getch();
return 0;
}

函数名: coreleft
功 能: 返回未使用内存的大小
用 法: unsigned coreleft(void);
程序例:
#include
#include
int main(void)
{
printf("The difference between the highest allocated block and\n");
printf("the top of the heap is: %lu bytes\n", (unsigned long) coreleft());
return 0;
}

函数名: cos
功 能: 余弦函数
用 法: double cos(double x);
程序例:
#include
#include
int main(void)
{
double result;
double x = 0.5;
result = cos(x);
printf("The cosine of %lf is %lf\n", x, result);
return 0;
}

函数名: cosh
功 能: 双曲余弦函数
用 法: dluble cosh(double x);
程序例:
#include
#include
int main(void)
{
double result;
double x = 0.5;
result = cosh(x);
printf("The hyperboic cosine of %lf is %lf\n", x, result);
return 0;
}

函数名: country
功 能: 返回与国家有关的信息
用 法: struct COUNTRY *country(int countrycode, struct country *country);
程序例:
#include
#include
#define USA 0
int main(void)
{
struct COUNTRY country_info;
country(USA, &country_info);
printf("The currency symbol for the USA is: %s\n",
country_info.co_curr);
return 0;
}

函数名: cprintf
功 能: 送格式化输出至屏幕
用 法: int cprintf(const char *format[, argument, ...]);
程序例:
#include
int main(void)
{
/* clear the screen */
clrscr();
/* create a text window */
window(10, 10, 80, 25);
/* output some text in the window */
cprintf("Hello world\r\n");
/* wait for a key */
getch();
return 0;
}

函数名: cputs
功 能: 写字符到屏幕
用 法: void cputs(const char *string);
程序例:
#include
int main(void)
{
/* clear the screen */
clrscr();
/* create a text window */
window(10, 10, 80, 25);
/* output some text in the window */
cputs("This is within the window\r\n");
/* wait for a key */
getch();
return 0;
}

函数名: _creat creat
功 能: 创建一个新文件或重写一个已存在的文件
用 法: int creat (const char *filename, int permiss);
程序例:
#include
#include
#include
#include
int main(void)
{
int handle;
char buf[11] = "0123456789";
/* change the default file mode from text to binary */
_fmode = O_BINARY;
/* create a binary file for reading and writing */
handle = creat("DUMMY.FIL", S_IREAD | S_IWRITE);
/* write 10 bytes to the file */
write(handle, buf, strlen(buf));
/* close the file */
close(handle);
return 0;
}

函数名: creatnew
功 能: 创建一个新文件
用 法: int creatnew(const char *filename, int attrib);
程序例:
#include
#include
#include
#include
#include
int main(void)
{
int handle;
char buf[11] = "0123456789";
/* attempt to create a file that doesn't already exist */
handle = creatnew("DUMMY.FIL", 0);
if (handle == -1)
printf("DUMMY.FIL already exists.\n");
else
{
printf("DUMMY.FIL successfully created.\n");
write(handle, buf, strlen(buf));
close(handle);
}
return 0;
}

函数名: creattemp
功 能: 创建一个新文件或重写一个已存在的文件
用 法: int creattemp(const char *filename, int attrib);
程序例:
#include
#include
#include
int main(void)
{
int handle;
char pathname[128];
strcpy(pathname, "\\");
/* create a unique file in the root directory */
handle = creattemp(pathname, 0);
printf("%s was the unique file created.\n", pathname);
close(handle);
return 0;
}

函数名: cscanf
功 能: 从控制台执行格式化输入
用 法: int cscanf(char *format[,argument, ...]);
程序例:
#include
int main(void)
{
char string[80];
/* clear the screen */
clrscr();
/* Prompt the user for input */
cprintf("Enter a string with no spaces:");
/* read the input */
cscanf("%s", string);
/* display what was read */
cprintf("\r\nThe string entered is: %s", string);
return 0;
}

函数名: ctime
功 能: 把日期和时间转换为字符串
用 法: char *ctime(const time_t *time);
程序例:
#include
#include
int main(void)
{
time_t t;
time(&t);
printf("Today's date and time: %s\n", ctime(&t));
return 0;
}

函数名: ctrlbrk
功 能: 设置Ctrl-Break处理程序
用 法: void ctrlbrk(*fptr)(void);
程序例:
#include
#include
#define ABORT 0
int c_break(void)
{
printf("Control-Break pressed. Program aborting ...\n");
return (ABORT);
}
int main(void)
{
ctrlbrk(c_break);
for(;;)
{
printf("Looping... Press to quit:\n");
}
return 0;
}

相关文章:

c语言函数大全(C开头)

c语言函数大全(C开头) There is no nutrition in the blog content. After reading it, you will not only suffer from malnutrition, but also impotence. The blog content is all parallel goods. Those who are worried about being cheated should leave quickly. 函数名…...

初始Redis关联和非关联

基础篇Redis 3.初始Redis 3.1.2.关联和非关联 传统数据库的表与表之间往往存在关联&#xff0c;例如外键&#xff1a; 而非关系型数据库不存在关联关系&#xff0c;要维护关系要么靠代码中的业务逻辑&#xff0c;要么靠数据之间的耦合&#xff1a; {id: 1,name: "张三…...

Redis 更新开源许可证 - 不再支持云供应商提供商业化的 Redis

原文&#xff1a;Rowan Trollope - 2024.03.20 未来的 Redis 版本将继续在 RSALv2 和 SSPLv1 双许可证下提供源代码的免费和宽松使用&#xff1b;这些版本将整合先前仅在 Redis Stack 中可用的高级数据类型和处理引擎。 从今天开始&#xff0c;所有未来的 Redis 版本都将以开…...

生产者Producer往BufferQueue中写数据的过程

In normal operation, the producer calls dequeueBuffer() to get an empty buffer, fills it with data, then calls queueBuffer() to make it available to the consumer 代码如下&#xff1a; // XXX: Tests that fork a process to hold the BufferQueue must run bef…...

使用 Vite 和 Bun 构建前端

虽然 Vite 目前可以与 Bun 配合使用&#xff0c;但它尚未进行大量优化&#xff0c;也未调整以使用 Bun 的打包器、模块解析器或转译器。 Vite 可以与 Bun 完美兼容。从 Vite 的模板开始使用吧。 bun create vite my-app ✔ Select a framework: › React ✔ Select a variant:…...

如何设置IDEA远程连接服务器开发环境并结合cpolar实现ssh远程开发

文章目录 1. 检查Linux SSH服务2. 本地连接测试3. Linux 安装Cpolar4. 创建远程连接公网地址5. 公网远程连接测试6. 固定连接公网地址7. 固定地址连接测试 本文主要介绍如何在IDEA中设置远程连接服务器开发环境&#xff0c;并结合Cpolar内网穿透工具实现无公网远程连接&#xf…...

【项目管理后台】Vue3+Ts+Sass实战框架搭建二

Vue3TsSass搭建 git cz的配置mock 数据配置viteMockServe 建立mock/user.ts文件夹测试一下mock是否配置成功 axios二次封装解决env报错问题&#xff0c;ImportMeta”上不存在属性“env” 统一管理相关接口新建api/index.js 路由的配置建立router/index.ts将路由进行集中封装&am…...

制作一个RISC-V的操作系统六-bootstrap program(risv 引导程序)

文章目录 硬件基本概念qemu-virt地址映射系统引导CSR![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/86461c434e7f4b1b982afba7fad0256c.png)machine模式下的csr对应的csr指令csrrwcsrrs mhartid引导程序做的事情判断当前hart是不是第一个hart初始化栈跳转到c语言的…...

haproxy和keepalived的区别与联系

HAProxy&#xff08;High Availability Proxy&#xff09; 是一个开源的、高效且可靠的解决方案&#xff0c;主要用于负载均衡。它工作在应用层&#xff08;第七层&#xff09;&#xff0c;支持多种协议&#xff0c;如HTTP、HTTPS、FTP等。HAProxy通过健康检查机制持续监控后…...

云效 AppStack + 阿里云 MSE 实现应用服务全链路灰度

作者&#xff1a;周静、吴宇奇、泮圣伟 在应用开发测试验证通过后、进行生产发布前&#xff0c;为了降低新版本发布带来的风险&#xff0c;期望能够先部署到灰度环境&#xff0c;用小部分业务流量进行全链路灰度验证&#xff0c;验证通过后再全量发布生产。本文主要介绍如何通…...

pta L1-004 计算摄氏温度

L1-004 计算摄氏温度 分数 5 全屏浏览 切换布局 作者 陈建海 单位 浙江大学 给定一个华氏温度F&#xff0c;本题要求编写程序&#xff0c;计算对应的摄氏温度C。计算公式&#xff1a;C5(F−32)/9。题目保证输入与输出均在整型范围内。 输入格式: 输入在一行中给出一个华氏…...

毕业论文降重(gpt+完美降重指令),sci论文降重gpt指令——超级好用,重复率低于4%

1. 降重方法&#xff1a;gpt降重指令 2. gpt网站 https://yiyan.baidu.com/ https://chat.openai.com/ 3. 降重指令——非常好用&#xff01;&#xff01;sci论文&#xff0c;本硕大论文都可使用&#xff01; 请帮我把下面句子重新组织&#xff0c;通过调整句子逻辑&#xff0…...

Qt 多元素控件

Qt开发 多元素控件 Qt 中提供的多元素控件有: QListWidgetQListViewQTableWidgetQTableViewQTreeWidgetQTreeView xxWidget 和 xxView 之间的区别 以 QTableWidget 和 QTableView 为例. QTableView 是基于 MVC 设计的控件. QTableView 自身不持有数据. 使用QTableView 的 …...

LeetCode热题Hot100-两数相加

一刷一刷 给你两个 非空 的链表&#xff0c;表示两个非负的整数。它们每位数字都是按照 逆序 的方式存储的&#xff0c;并且每个节点只能存储 一位 数字。 请你将两个数相加&#xff0c;并以相同形式返回一个表示和的链表。 你可以假设除了数字 0 之外&#xff0c;这两个数都不…...

Selenium 自动化 —— 浏览器窗口操作

更多内容请关注我的专栏&#xff1a; 入门和 Hello World 实例使用WebDriverManager自动下载驱动Selenium IDE录制、回放、导出Java源码 当用 Selenium 打开浏览器后&#xff0c;我们就可以通过 Selenium 对浏览器做各种操作&#xff0c;就像我们日常用鼠标和键盘操作浏览器一…...

二、Kubernetes(k8s)中部署项目wordpress(php博客项目,数据库mysql)

前期准备 1、关机顺序 2、开机顺序 (1)、k8s-ha1、k8s-ha2 (2)、master01、master02、master03 (3)、node01、node02 一、集群服务对外提供访问&#xff0c;需要通过Ingress代理发布域名 mast01上传 ingress-nginx.yaml node01、node02 上传 ingress-nginx.tar 、kube-webh…...

linux系统Kubernetes工具Service暴露服务

Service ServiceService创建service页面请求测试pod内部请求测试端口解析kube-proxy 使用ipvs 意义pod和Service的关系常用类型ClusterIpNodePortLoadBalancernode内网部署应用&#xff0c;外网访问不到 Service 服务基于ip端口的虚拟主机&#xff0c;定义一组pod的访问规则 Se…...

【算法篇】逐步理解动态规划1(斐波那契数列模型)

目录 斐波那契数列模型 1. 第N个泰波那契数 2.使用最小花费爬楼梯 3.解码方法 学过算法的应该知道&#xff0c;动态规划一直都是一个非常难的模块&#xff0c;无论是状态转移方程的定义还是dp表的填表&#xff0c;都非常难找到思路。在这个算法的支线专题中我会结合很多力…...

软件测试 - postman高级使用

断言 概念&#xff1a;让程序代替人判断测试用例执行的结果是否符合预期的一个过程 特点&#xff1a; postman断言使用js编写&#xff0c;断言写在postman的tests中 tests脚本在发送请求之后执行&#xff0c;会把断言的结果最终在testresult中进行展示 常用的postman提供的…...

数据交换技术

目录 <线路交换> <报文交换> <分组交换> 1.数据报分组交换 2.虚电路分组交换 计算机网络是以数据交换为目的的技术&#xff0c;从交换技术的发展过程来看&#xff0c;主要经历了线 路交换、报文交换、分组交换的过程。 <线路交换> 线路交换又称为…...

别再乱用Bool和Enum了!用UE5的Gameplay Tags重构你的角色状态机(GAS避坑指南)

别再乱用Bool和Enum了&#xff01;用UE5的Gameplay Tags重构你的角色状态机&#xff08;GAS避坑指南&#xff09;当你的ARPG角色同时陷入眩晕、灼烧和减速状态时&#xff0c;传统状态机往往会暴露出致命缺陷——布尔值互相覆盖、枚举组合爆炸、条件判断嵌套成灾。而UE5的Gamepl…...

终极指南:如何在Windows上直接访问Linux RAID阵列数据

终极指南&#xff1a;如何在Windows上直接访问Linux RAID阵列数据 【免费下载链接】winmd WinMD 项目地址: https://gitcode.com/gh_mirrors/wi/winmd 你是否曾面临这样的困境&#xff1a;企业Linux服务器上存储着重要的业务数据&#xff0c;使用mdadm创建的RAID阵列运行…...

Arm Cortex-M的FP和MVE

Floating-point Support目前Arm architecture支持的floating-point extension版本是FPv5。FPv5提供了以下功能&#xff1a;单精度算术运算&#xff1b;可选的双精度算术运算&#xff1b;整数、双精度、单精度、和半精度格式之间的转换&#xff1b;用于浮点处理的寄存器&#xf…...

Android 13 HTTPS抓包失效原因与Proxyman实战解决方案

1. 为什么Android 13上抓HTTPS包突然变难了&#xff1f;从Fiddler/Charles失效说起 你是不是也遇到过&#xff1a;上周还能用Fiddler在Android 12真机上稳稳抓到某电商App的登录接口&#xff0c;升级到Android 13后&#xff0c;所有HTTPS请求全变成“Connection refused”或直接…...

数据集上新:柬埔寨环境健康入户调查

本数据集基于柬埔寨马德望省约400户家庭的环境健康入户调查而成&#xff0c;包括基本社会经济信息、家庭成员结构、呼吸道健康信息、其他健康信息&#xff08;包括部分测量信息&#xff09;、营养信息、清洁炉灶和燃料使用、风险和时间偏好、调查员自观察信息等数百条子数据。如…...

5分钟上手:用LeaguePrank打造专属英雄联盟客户端

5分钟上手&#xff1a;用LeaguePrank打造专属英雄联盟客户端 【免费下载链接】LeaguePrank 项目地址: https://gitcode.com/gh_mirrors/le/LeaguePrank 想要让你的英雄联盟客户端界面变得与众不同吗&#xff1f;LeaguePrank是一款基于官方LCU API开发的英雄联盟客户端美…...

PagedAttention 源码解析:KV Cache 怎么管理

前言 长序列推理的瓶颈不是计算&#xff0c;是显存。KV Cache 随序列长度线性增长&#xff0c;一个 LLaMA-7B 的请求&#xff0c;序列 4096 就要吃掉 2GB 显存。PagedAttention 的做法是把 KV Cache 切成小块按需分配&#xff0c;显存利用率从 40% 提到 90%。 下面从源码层面解…...

RAGFlow源码解析-4、文档处理(deepdoc)(第二周)

一、文档解析器工厂架构详解 1.1 deepdoc/parser/init.py解析器工厂完整解析 代码完整解析(40行) # Licensed under the Apache License, Version 2.0 (the "License"); # you may obtain a copy of the License at # # http://www.apache.org/licenses/LIC…...

祖玛游戏开发:状态机与路径拓扑的工程实践

1. 祖玛游戏到底在考什么&#xff1a;不是炫技&#xff0c;而是对状态机与碰撞逻辑的精准拿捏祖玛&#xff08;Zuma&#xff09;看起来只是几颗彩球连成线就爆炸的休闲游戏&#xff0c;但真正动手实现时&#xff0c;你会发现它像一块试金石——C#、C 和 Java 三门语言各自最常被…...

Shannon AI:面向业务流的自动化渗透测试工具

1. 这不是“AI替代人”&#xff0c;而是把渗透测试工程师从重复劳动里解救出来我第一次在客户现场用Shannon AI跑完Juice Shop靶场&#xff0c;盯着终端里滚动的日志&#xff0c;心里想的不是“哇这工具真快”&#xff0c;而是“原来我过去三年有将近200小时&#xff0c;都花在…...