项目相关内容 ----- 2实现打印 ---- 图片与字符

news2024/9/20 10:28:01

目录

 1 . 实现图图片的打印

1)结构体定义

          2)画点线

 3)清屏

 4)图片显示

 5)主函数部分

2 . 实现字符的打印 

1)  定义BMP位图文件的头部信息以及信息头​

 2)实现打印字符的绘制​

3 . 打印文本内容​

附录


 1 . 实现图图片的打印

1)结构体定义

 2)画点线

 3)清屏

 4)图片显示

从给定的BMP文件路径(pathname)中读取图像数据,并在一个图形界面上(通过draw_point函数)以某种方式显示这些图像数据

 部分解释:

分配内存并读取图像数据

这里表示代码假定的图像尺寸(400x320像素,每个像素3个字节)计算了图像数据的大小,并分配了足够的内存来存储这些数据。然后,它从文件中读取了这些数据。

遍历并绘制图像

这部分代码遍历了图像数据的每个像素。它首先定义了一个col结构体,用于存储当前像素的颜色值。然后,它逐个字节地从data指针指向的数组中读取蓝色、绿色、红色的值,并将它们存储在c结构体中。

(y0 + 320 - j - 1)来计算y坐标,这通常是因为图像在BMP文件中是以“倒序”存储的(第一行是图像的底部从左下角开始,最后一行是图像的顶部)为了正确地在屏幕上显示图像,需要对y坐标进行这样的调整

 从左下角开始一行一行往上走

 5)主函数部分

show_bmp("./2.bmp", 100, 200); // 确定图片以及坐标

2 . 实现字符的打印 

1)  定义BMP位图文件的头部信息以及信息头

  1. 预处理指令 #pragma pack(2) 和 #pragma pack(4)
    • #pragma pack(n) 是一个编译器指令,用于控制结构体成员的对齐方式。n 指定了每个成员在内存中的对齐字节数在这个例子中,首先使用 #pragma pack(2) 来设置结构体成员的对齐为2字节(这通常是为了确保结构体在文件中占用的空间与文件格式规范相匹配),然后在定义完 _tag_bmp_file_head 结构体后,使 #pragma pack(4) 恢复到默认的对齐方式(或指定为4字节对齐,这取决于编译器的默认行为)。

 2)实现打印字符的绘制



3 . 打印文本内容

 部分代码解释

void draw_string(char *str, int x0, int y0, col f)  
{  
    int len = strlen(str); // 获取字符串的长度  
    int i; // 声明循环变量    
    for (i = 0; i < len; i++) // 遍历字符串中的每个字符  
    {  
        switch (*str) // 这里的问题在于它总是检查字符串的第一个字符(*str)  
        {  
            case '\r': // 遇到回车符,将x0重置为0  
                x0 = 0;  
                break;  
            case '\n': // 遇到换行符,将x0重置为0并增加y0  
                x0 = 0;  
                y0 += 16; // 假设每个字符/行高为16像素  
                break;  
            case '\t': // 遇到制表符,这里没有实现任何功能  
                break;  
            case '\b': // 遇到退格符,这里也没有实现任何功能  
                break;  
            default: // 默认情况下,绘制当前字符并更新x0  
                draw_a_ascii(x0, y0, *str, f); // 调用假设存在的绘图函数  
                x0 += 8; // 假设每个字符宽度为8像素  
                str++; 
                break;  
        }        
    }    
}

 

unsigned char *pzimo = (void *)(font_8x16 + (int)ch * 16UL);(int)ch * 16UL计算出ch字符在font_8x16数组中的偏移量(假设每个字符占用16字节)。然后,它使用这个偏移量从font_8x16数组的起始地址加上这个偏移量,得到指向该字符8x16位图数据的指针pzimo

 运行 linux

 crtl + alt + F5  

ctrl + alt  + Fn + F1 退出 

 显示

附录

  

  1 #include <stdio.h>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
  2 #include <sys/stat.h>
  3 #include <sys/types.h>
  4 #include <fcntl.h>
  5 #include <sys/ioctl.h>
  6 #include <linux/fb.h>
  7 #include <sys/mman.h>
  8 #include <unistd.h>
  9 #include <stdlib.h>
 10 #include <math.h>
 11 
 12 struct fb_var_screeninfo info;
 13 unsigned char * p_fd = NULL;
 14 
 15 typedef struct __color
 16 {
 17     unsigned char b;
 18     unsigned char g;
 19     unsigned char r;
 20     unsigned char null;
 21 }color;
 22 
 23 typedef union
 24 {
 25     color rgb;
 26     unsigned int l;
 27 }col;
 28 
 29 int draw_point(int x0, int y0, col c)
 30 {
 31     if((x0 < 0) || (x0 > info.xres_virtual))
 32         return -1;
 33     if((y0 < 0) || (y0 > info.yres_virtual))
 34         return -1;
 35 
 36     unsigned int * p = (unsigned int *)(p_fd + (y0 * info.xres_virtual + x0) * 4);
 37     *p = c.l;
 38 
 39     return 0;
 40 }
 41 int draw_h_line(int x0, int y0, int len, col c)
 42 {
 43     int i = 0;
 44     for(i = 0; i < len; i++)
 45     {
 46         draw_point(x0 + i, y0, c);
 47     }
 48 
 49     return 0;
 50 }
 51 
 52 int clr_bg()
 53 {
 54     int i = 0;
 55     col  c;
 56     c.l = 0;
 57     for(i = 0; i < 600; i++)
 58     {
 59         draw_h_line(0, i, info.yres, c);
 60     }
 61 }
 62 int show_bmp(const char * pathname, int x0, int y0)
 63 {
 64     int fd = open(pathname, O_RDWR);
 65     if(fd < 0)
 66     {
 67         perror("open bmp failed\n");
 68         return -1;
 69     }
 70 
 71     unsigned char buf[54] = {0};
 72     read(fd, buf, sizeof(buf));
 73 
 74     int size = 400 * 320 * 3;
 75     unsigned char * data = malloc(size);
 76     read(fd, data, size);
 77     unsigned char * p = data;
 78 
 79     int i = 0;
 80     int j = 0;
 81     for(j = 0; j < 320; j++)  // y
 82     {
 83         for(i = 0; i < 400; i++)  // x
 84         {
 85             col c;
 86             c.rgb.b = *p++;
 87             c.rgb.g = *p++;
 88             c.rgb.r = *p++;
 89 #if 0
 90             c.rgb.b = data[(j * 400 + i) * 3];
 91             c.rgb.g = data[(j * 400 + i) * 3 + 1];
 92             c.rgb.r = data[(j * 400 + i) * 3 + 2];
 93 #endif
 94             draw_point(x0 + i, y0 + 320 - j - 1, c);
 95         }
 96     }
 97 
 98     free(data);
 99     close(fd);
100 }
101 
102 int main(int argc, const char *argv[])
103 {
104     //open
105     int fd =  open("/dev/fb0", O_RDWR);
106     if(fd < 0)
107     {
108         perror("open fd failed:");
109         return fd;
110     }
111 
112     //get_screen_info
113     int ret = ioctl(fd, FBIOGET_VSCREENINFO, &info);
114     if(ret < 0)
115     {
116         perror("ioctl failed:");
117         return ret;
118     }
119     printf("xres = %d yres = %d\n",
120             info.xres, info.yres);
121     printf("xres_virtual = %d yres_virtual = %d\n",
122             info.xres_virtual, info.yres_virtual);
123     printf("bits_per_pixel = %d\n", info.bits_per_pixel);
124 
125     //mmap
126     unsigned long size = info.xres_virtual * info.yres_virtual * info.bits_per_pixel / 8;
127     p_fd = mmap(NULL, size, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0);
128     if(NULL == p_fd)
129     {
130         perror("mmap failed:");
131         return -3;
132     }
133     show_bmp("./2.bmp", 100, 200);
134     //munmap
135     munmap(p_fd, size);
136     //close
137     close(fd);
138     return 0;
139 }
140 
~       

  1 #include <stdio.h>
  2 #include <sys/stat.h>
  3 #include <sys/types.h>
  4 #include <fcntl.h>
  5 #include <sys/ioctl.h>
  6 #include <linux/fb.h>
  7 #include <sys/mman.h>
  8 #include <unistd.h>
  9 #include <stdlib.h>
 10 #include <math.h>
 11 #include <string.h>
 12 
 13 struct fb_var_screeninfo info;
 14 unsigned char * p_fd = NULL;
 15 
 16 typedef struct __color
 17 {
 18     unsigned char b;
 19     unsigned char g;
 20     unsigned char r;
 21     unsigned char null;
 22 }color;
 23 
 24 typedef union
 25 {
 26     color rgb;
 27     unsigned int l;
 28 }col;
 29 
 30 int draw_point(int x0, int y0, col c)
 31 {
 32     if((x0 < 0) || (x0 > info.xres_virtual))
 33         return -1;
 34     if((y0 < 0) || (y0 > info.yres_virtual))
 35         return -1;
 36 
 37     unsigned int * p = (unsigned int *)(p_fd + (y0 * info.xres_virtual + x0) * 4);
 38     *p = c.l;
 39 
 40     return 0;
 41 }
 42 
 43 int draw_h_line(int x0, int y0, int len, col c)
 44 {
 45     int i = 0;
 46     for(i = 0; i < len; i++)
 47     {
 48         draw_point(x0 + i, y0, c);
 49     }
 50 
 51     return 0;
 52 }
 53 
 54 int clr_bg()
 55 {
 56     int i = 0;
 57     col  c;
 58     c.l = 0xffffff;
 59     for(i = 0; i < 600; i++)
 60     {
 61         draw_h_line(0, i, info.xres, c);
 62     }
 63 }
 64 
 65 #define PI 3.1415926
 66 #pragma pack(2)
 67 typedef struct _tag_bmp_file_head{
 68     unsigned short  file_type;          // 位图文件的类型,必须为BMP (2个字节)
 69     unsigned int    file_size;          // 位图文件的大小,以字节为单位 (4个字节)
 70     unsigned short  file_reserved1;     // 位图文件保留字,必须为0 (2个字节)
 71     unsigned short  file_reserved2;     // 位图文件保留字,必须为0 (2个字节)
 72     unsigned int    file_offset_bits;   // 位图数据的起始位置,以相对于位图 (4个字节)
 73 }bmp_file_head;
 74 
 75 typedef struct _tag_bmp_info_head{
 76     unsigned int info_size;             // 本结构所占用字节数  (4个字节)
 77     unsigned int bit_width;             // 位图的宽度,以像素为单位(4个字节)
 78     unsigned int bit_height;            // 位图的高度,以像素为单位(4个字节)
 79     unsigned short bit_planes;          // 目标设备的级别,必须为1(2个字节)
 80     unsigned short bits_per_pixel;      // 每个像素所需的位数,必须是1(双色)、// 4(16色)、8(256色)、
 81                                         // 24(真彩色)或32(增强真彩色)之一 (2个字节)
 82     unsigned int bit_compression;       // 位图压缩类型,必须是 0(不压缩)、 1(BI_RLE8 
 83                                         // 压缩类型)或2(BI_RLE4压缩类型)之一 ) (4个字节)
 84     unsigned int bit_sizeImage;         // 位图的大小,以字节为单位(4个字节)
 85     unsigned int bit_xpels_per_meter;   // 位图水平分辨率,每米像素数(4个字节)
 86     unsigned int bit_ypels_per_meter;   // 位图垂直分辨率,每米像素数(4个字节)
 87     unsigned int bit_clr_used;          // 位图实际使用的颜色表中的颜色数(4个字节)
 88     unsigned int bit_clr_important;     // 位图显示过程中重要的颜色数(4个字节)
 89 }bmp_info_head;
 90 
 91 #pragma pack(4)
 92 int draw_a_ascii(char ch, int x0, int y0, col c)
 93 {
 94     unsigned char data[8] = {0x0,0x38,0x24,0x24,0x38,0x24,0x24,0x38};  //B
 95     int i = 2;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
 96     int j = 0;
 97     printf("x0 = %d y0 = %d\n", x0, y0) ;
 98     for(j = 0; j < 8; j++)
 99     {
100         unsigned char tmp = data[j];
101         for(i = 0; i < 8; i++)
102         {
103              if(0x80 & (tmp << i))
104              {
105                 draw_point(x0 + i, y0 + j, c);
106              }
107         }
108     }
109     return 0;
110 }
111 
112 int draw_str(const char * str, int x0, int y0, col c)
113 {
114     int len = strlen(str);
115     int i = 0;
116     int x = x0;
117     int y = y0;
118     for(i = 0; i < len; i++)
119     {
120         switch(str[i])
121         {
122             case '\n':
123                 y += 9;
124                 x = x0;
125                 break;
126             case ' ':
127                 x += 9;
128             default:
129                 draw_a_ascii(str[i], x, y, c);
130                 x += 9;
131                 break;
132         }
133     }
134     return 0;
135 }
136 
137 int main(int argc, const char *argv[])
138 {
139     //open
140     int fd =  open("/dev/fb0", O_RDWR);
141     if(fd < 0)
142     {
143         perror("open fd failed:");
144         return fd;
145     }
146 
147     //get_screen_info
148     int ret = ioctl(fd, FBIOGET_VSCREENINFO, &info);
149     if(ret < 0)
150     {
151         perror("ioctl failed:");
152         return ret;
153     }
154     printf("xres = %d yres = %d\n",
155             info.xres, info.yres);
156     printf("xres_virtual = %d yres_virtual = %d\n",
157             info.xres_virtual, info.yres_virtual);
158     printf("bits_per_pixel = %d\n", info.bits_per_pixel);
159 
160     //mmap
161     unsigned long size = info.xres_virtual * info.yres_virtual * info.bits_per_pixel / 8;
162     p_fd = mmap(NULL, size, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0);
163     if(NULL == p_fd)
164     {
165         perror("mmap failed:");
166         return -3;
167     }
168 
169     col c;
170     c.rgb.r = 0xff;
171     c.rgb.g = 0xff;
172     c.rgb.b = 0xff;
173 
174     clr_bg();
175 
176     col c1;
177     c1.l = 0;
178     c1.rgb.r = 0xff;
179 
180     draw_str("12345\n123 456\n1234567", 100, 100, c1);
181 
182     //munmap
183     munmap(p_fd, size);
184     //close
185     close(fd);
186     return 0;
187 }
188 
                
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <unistd.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

struct fb_var_screeninfo info;
unsigned char * p_fd = NULL;

typedef struct __color
{
	unsigned char b;
	unsigned char g;
	unsigned char r;
	unsigned char null;
}color;

typedef union 
{
	color rgb;
	unsigned int l;
}col;

int draw_point(int x0, int y0, col c)
{
	if((x0 < 0) || (x0 > info.xres_virtual))
		return -1;
	if((y0 < 0) || (y0 > info.yres_virtual))
		return -1;

	unsigned int * p = (unsigned int *)(p_fd + (y0 * info.xres_virtual + x0) * 4);
	*p = c.l;

	return 0;
}

int draw_h_line(int x0, int y0, int len, col c)
{
	int i = 0;
	for(i = 0; i < len; i++)
	{
		draw_point(x0 + i, y0, c);	
	}

	return 0;
}

int clr_bg()
{
	int i = 0;
	col  c;
	c.l = 0xffffff;
	for(i = 0; i < 600; i++)
	{
		draw_h_line(0, i, info.xres, c);	
	}
}
#pragma pack(2)
typedef struct _tag_bmp_file_head{
    unsigned short	file_type;			// 位图文件的类型,必须为BMP (2个字节)
    unsigned int	file_size;			// 位图文件的大小,以字节为单位 (4个字节)
    unsigned short	file_reserved1;		// 位图文件保留字,必须为0 (2个字节)
    unsigned short	file_reserved2;		// 位图文件保留字,必须为0 (2个字节)
    unsigned int	file_offset_bits;	// 位图数据的起始位置,以相对于位图 (4个字节)
}bmp_file_head;

typedef struct _tag_bmp_info_head{
	unsigned int info_size;     		// 本结构所占用字节数  (4个字节)
	unsigned int bit_width;      		// 位图的宽度,以像素为单位(4个字节)
	unsigned int bit_height;     		// 位图的高度,以像素为单位(4个字节)
	unsigned short bit_planes;    		// 目标设备的级别,必须为1(2个字节)
	unsigned short bits_per_pixel; 		// 每个像素所需的位数,必须是1(双色)、// 4(16色)、8(256色)、
										// 24(真彩色)或32(增强真彩色)之一 (2个字节)
	unsigned int bit_compression;		// 位图压缩类型,必须是 0(不压缩)、 1(BI_RLE8 
										// 压缩类型)或2(BI_RLE4压缩类型)之一 ) (4个字节)
	unsigned int bit_sizeImage;     	// 位图的大小,以字节为单位(4个字节)
	unsigned int bit_xpels_per_meter;  	// 位图水平分辨率,每米像素数(4个字节)
	unsigned int bit_ypels_per_meter;   // 位图垂直分辨率,每米像素数(4个字节)
	unsigned int bit_clr_used;			// 位图实际使用的颜色表中的颜色数(4个字节)
	unsigned int bit_clr_important;		// 位图显示过程中重要的颜色数(4个字节)
}bmp_info_head;

#pragma pack(4)

int show_bmp(const char * pathname, int x0, int y0)
{
	int fd = open(pathname, O_RDWR);
	if(fd < 0)
	{
		perror("open bmp failed\n");
		return -1;
	}

	bmp_file_head fhead;
	bmp_info_head ihead;
	read(fd, &fhead, sizeof(fhead));
	read(fd, &ihead, sizeof(ihead));

	int size = ihead.bit_height * ihead.bit_width * 3;
	unsigned char * data = malloc(size);
	read(fd, data, size);
	unsigned char * p = data;

	int i = 0;
	int j = 0;
	for(j = 0; j < ihead.bit_height; j++)  // y
	{
		for(i = 0; i < ihead.bit_width; i++)  // x
		{
			col c;
			c.rgb.b = *p++;
			c.rgb.g = *p++;
			c.rgb.r = *p++;

			draw_point(x0 + i, y0 + ihead.bit_height - j - 1, c);
		}
	}

	free(data);
	close(fd);
}
void draw_a_ascii_by_zimo (int x0, int y0, unsigned char *zimo, col f)
{
	int x, y;

	for (y = 0; y < 16; y++) {
		unsigned char tmp = *zimo++;
		for (x = 0; x < 8; x++) {
			if (tmp & 0x80) {
				draw_point (x0 + x, y0 + y, f);
			}
			tmp = tmp << 1;
		}
	}
}

extern unsigned char font_8x16[4096];
void draw_a_ascii (int x0, int y0, char ch, col f)
{
	unsigned char *pzimo = (void *)(font_8x16 + (int)ch * 16UL);
	draw_a_ascii_by_zimo(x0, y0, pzimo, f);
}

void draw_string ( char *str, int x0, int y0,col f)
{
	int len = strlen(str);
	int i;

	for (i = 0; i < len; i++) 
	{
		switch (*str) 
		{
		case '\r':x0 = 0;break;
		case '\n':x0 = 0;y0 += 16; break;
		case '\t':break;
		case '\b':break;
		default:draw_a_ascii(x0, y0, *str, f);
				x0 += 8;
				str++;
				break;
		}
	}
}

int main(int argc, const char *argv[])
{
	//open
	int fd =  open("/dev/fb0", O_RDWR);
	if(fd < 0)
	{
		perror("open fd failed:");
		return fd;
	}

	//get_screen_info
	int ret = ioctl(fd, FBIOGET_VSCREENINFO, &info);	
	if(ret < 0)
	{
		perror("ioctl failed:");
		return ret;
	}
	printf("xres = %d yres = %d\n",
			info.xres, info.yres);
	printf("xres_virtual = %d yres_virtual = %d\n",
			info.xres_virtual, info.yres_virtual);
	printf("bits_per_pixel = %d\n", info.bits_per_pixel);

	//mmap
	unsigned long size = info.xres_virtual * info.yres_virtual * info.bits_per_pixel / 8;
	p_fd = mmap(NULL, size, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0);
	if(NULL == p_fd)
	{
		perror("mmap failed:");
		return -3;
	}
	
	col c;
	c.rgb.r = 0xff;
	c.rgb.g = 0xff;
	c.rgb.b = 0xff;

	clr_bg();

	col c1;
	c1.l = 0;
	c1.rgb.r = 0xff;

	int fd1 = open("1.txt", O_RDWR);
	
	char buf[1024] = {0};
	read(fd1, buf, sizeof(buf));
	draw_string(buf, 100, 300, c1);
	close(fd1);
	//munmap
	munmap(p_fd, size);
	//close
	close(fd);
	return 0;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1974737.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

你会在Vision Pro里编程吗?

你会在Vision Pro里编程吗&#xff1f; Vision Pro作为一位开发者&#xff0c;你会考虑将Vision Pro应用到编程中吗&#xff1f;你认为Vision Pro有可能改变开发者的工作模式与效率吗&#xff1f; 初见Vision Pro有点陌生&#xff0c;不太了解Vision Pro是什么。那么这里先来了…

顶点着色器片段着色器

/* * FileName : OpenGL_Tutorial.cpp * Time : 2024-08-03 10:00:00 * Author : XuMing * Email : 920972751qq.com * description : 使用OpenGL进行顶点输入和着色器编译的详细解析 */#include <glad/glad.h> #include <GLFW/glfw3.…

【论文阅读visual grounding】QRNet论文解读与关键代码实现

Shifting More Attention to Visual Backbone: Query-modulated Refinement Networks for End-to-End Visual Grounding 论文链接&#xff1a;https://arxiv.org/abs/2203.15442 代码链接&#xff1a;https://github.com/z-w-wang/QRNet Motivation 视觉定位&#xff08;visua…

JavaScript基础——JavaScript变量声明

变量是存储数据的容器&#xff0c;可以变的量&#xff0c;值可以改变&#xff0c;在JavaScript中&#xff0c;变量声明的关键字有var、let&#xff0c;其中&#xff0c;var是ES5的语法&#xff0c;let是ES6的语法&#xff0c;变量需要先声明&#xff0c;在使用。 声明一个age变…

整除分块, CF538 F - A Heap of Heaps

一、题目 1、题目描述 2、输入输出 2.1输入 2.2输出 3、原题链接 F - A Heap of Heaps 二、解题报告 1、思路分析 给定v&#xff0c;k&#xff0c;v的父节点p (v - 2) / k 1 我们令P p - 1&#xff0c;V V - 2 P V / k&#xff0c;我们发现这就是一个整除分块问题…

Ubuntu22.04之有道词典mini窗口无法拖动问题(二百六十五)

简介&#xff1a; CSDN博客专家&#xff0c;专注Android/Linux系统&#xff0c;分享多mic语音方案、音视频、编解码等技术&#xff0c;与大家一起成长&#xff01; 新书发布&#xff1a;《Android系统多媒体进阶实战》&#x1f680; 优质专栏&#xff1a; Audio工程师进阶系列…

混合域注意力机制(空间+通道)

在计算机视觉任务中&#xff0c;空间域注意力通常关注图像中不同位置的重要性&#xff0c;例如突出图像中的关键对象或区域。而通道域注意力则侧重于不同通道&#xff08;特征图&#xff09;的重要性&#xff0c;决定哪些特征对于任务更具判别力。混合域注意力机制结合了空间域…

FIR低通滤波器

FIR低通滤波器 FIR(Finite Impulse Response)滤波器:有限长单位冲激响应滤波器,又称为非递归型滤波器,是数字信号处理系统中最基本的元件,它可以在保证任意幅频特性的同时具有严格的线性相频特性,同时其单位抽样响应是有限长的,因而滤波器是稳定的系统。 MATLAB实现…

详细了解架构师

架构师的核心职责是消除不确定性和降低复杂性&#xff01; 架构师画像 架构师的定位 架构设计环 澄清和技术相关的&#xff0c;比如支持百万级别的&#xff0c;架构师需要澄清&#xff0c;可能只有十万级。 架构师的三个核心能力 架构师的三个关键思维 架构设计流程和架构师…

初识MQ——学习MQ之前需要了解的知识点

目录 前言 1. 同步和异步通讯 1.1 同步通讯 1.2 异步通讯 2. MQ技术对比 前言 在现在的大数据时代&#xff0c;高并发的情况越来越普遍&#xff0c;系统一个不注意&#xff0c;就可能崩溃无法访问了。这是开发最不想看到的情况&#xff0c;如果是上班还好&#xff0c;可以…

【C++】—— 类与对象(二)

【C】—— 类与对象&#xff08;二&#xff09; 1、类的默认成员函数2、构造函数2.1、初见构造2.2、深入构造2.3、初始化列表2.3.1、什么是初始化列表2.3.2、初始化列表和函数体关系2.3.3、必须使用初始化列表的情况2.3.3.1、 c o n s t const const 成员变量2.3.3.2、引用成员…

AS400==tutorial for Beginners

系统AS400 语言RPGLE 参考视频&#xff1a; https://www.youtube.com/watch?vFqgwYsp7mjk&listPL3W4xRdnQJHVWWmYX1Klji7QUk_PQhq0t&index5 Lesson 1 | Introduction to As-400 and setting up As-400 Environment. 客户端软件TN5250 Terminal Emulation for Window…

MyBatis全方位指南:从注解到XML文件的数据库操作

目录 一.什么是MyBatis 入门程序初体验 二.MyBatis基本操作CRUD ▐ 增(Insert) 返回主键 ▐ 删(Delete) ▐ 改(Update) ▐ 查(Select) 起别名 结果映射 开启驼峰命名(推荐) 三.MyBatis XML配置文件 ▐ 增(Insert) ▐ 删(Delete) ▐ 改(Update) ▐ 查(Select) …

PostgreSQL(二十三)TOAST技术

目录 一、TOAST简介 二、TOAST的存储方式 1、存储方式概述 2、实验&#xff1a;创建TOAST表 三、TOAST的4种压缩策略 1、策略说明 2、TOAST表额外的三个字段 四、TOAST表的计算方式 1、说明 2、实验&#xff1a;计算表大小 五、TOAST表的特点 1、优点 2、缺点 3、…

【KAN】【API教程】get_fun

抽取某个激活函数的样子 from kan import * import matplotlib.pyplot as plt # create a KAN: 2D inputs, 1D output, and 5 hidden neurons. cubic spline (k3), 5 grid intervals (grid5). model KAN(width[2,5,1], grid5, k3, seed0) x torch.normal(0,1,size(100,2)) m…

给虚拟机Ubuntu扩展硬盘且不丢数据

1.Ubuntu关机状态下先扩展&#xff0c;如扩展20GB 2.进入ubuntu&#xff0c;切换root登录&#xff0c;必须是root全选&#xff0c;否则启动不了分区工具gparted 将新的20GB创建好后&#xff0c;选择ext4,primary&#xff1b; 3.永久挂载 我的主目录在/并挂载到/dev/sda1 从图…

C++解决:早餐组合

前言 应该都知道我之前沉默了很长一段时间&#xff0c;现在慢慢想明白了&#xff0c;会继续创作&#xff0c;真的非常感谢大家对我这个幼稚小孩的支持与鼓励。 有朋友私信问我退的原因&#xff0c;在这里和大家简要说一下【狗头】 我认识一位开学初三的学长&#xff0c;他和…

H81002S 1.7mm网络变压器:BMS汽车蓝牙接收器中的超薄共模电感科技

华强盛导读&#xff1a;在当今这个日新月异的汽车科技领域&#xff0c;每一处细节都蕴含着创新与突破。作为电动汽车心脏的电池管理系统&#xff08;BMS&#xff09;&#xff0c;其高效稳定的运行不仅关乎续航与安全&#xff0c;更是智能化驾驶体验的基石。而在这背后&#xff…

有那些AI数字人制作软件?

AI视频生成&#xff1a;小说文案智能分镜智能识别角色和场景批量Ai绘图自动配音添加音乐一键合成视频百万播放量https://aitools.jurilu.com/ 之前由于工作需要&#xff0c;要录制1 个真人讲PPT的视频&#xff0c;作为典型I人&#xff0c;本人露面是不可能的。 于是打起了数字人…

二维码门楼牌管理应用平台建设:打造高效运维新生态

文章目录 前言一、系统运维概述二、菜单管理&#xff1a;个性化服务的关键三、参数管理&#xff1a;优化系统性能的关键四、字典管理&#xff1a;数据标准化的基石五、邮件管理&#xff1a;沟通协作的桥梁六、任务调度&#xff1a;自动化工作的核心七、短信管理&#xff1a;及时…