编译原理实验 之 TINY 解释测试目标代码

文章目录

  • 实验
    • 任务1
    • 任务2

  • 本次的实验是在前三次TINYC的基础上的一个测试,所以完成前三次的实验是基础

编译原理 之 实验一
编译原理实验 之 Tiny C语言编译程序实验 语法分析
编译原理实验 之 TINY 之 语义分析(第二次作业

  • 首先将新的文件复制到先前的目录下面

需要复制的文件

在这里插入图片描述

整体的实验目录

在这里插入图片描述

实验要求

本次实验任务:
1、联调,给出sample.tny程序运行结果截图
2、自行编写Tiny C语言源程序,上交源代码,有运行结果的截图。

实验

任务1

直接对原本的那个sample.tny进行测试

其实那个TM.c我还修改了一下,应该是不用修改的,如果修改的话,可以直接复制我下面的代码

/****************************************************/
/* File: tm.c                                       */
/* The TM ("Tiny Machine") computer                 */
/****************************************************/#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif/******* const *******/
#define   IADDR_SIZE  1024 /* increase for large programs */
#define   DADDR_SIZE  1024 /* increase for large programs */
#define   NO_REGS 8
#define   PC_REG  7#define   LINESIZE  121
#define   WORDSIZE  20/******* type  *******/typedef enum {opclRR,     /* reg operands r,s,t */opclRM,     /* reg r, mem d+s */opclRA      /* reg r, int d+s */} OPCLASS;typedef enum {/* RR instructions */opHALT,    /* RR     halt, operands are ignored */opIN,      /* RR     read into reg(r); s and t are ignored */opOUT,     /* RR     write from reg(r), s and t are ignored */opADD,    /* RR     reg(r) = reg(s)+reg(t) */opSUB,    /* RR     reg(r) = reg(s)-reg(t) */opMUL,    /* RR     reg(r) = reg(s)*reg(t) */opDIV,    /* RR     reg(r) = reg(s)/reg(t) */opRRLim,   /* limit of RR opcodes *//* RM instructions */opLD,      /* RM     reg(r) = mem(d+reg(s)) */opST,      /* RM     mem(d+reg(s)) = reg(r) */opRMLim,   /* Limit of RM opcodes *//* RA instructions */opLDA,     /* RA     reg(r) = d+reg(s) */opLDC,     /* RA     reg(r) = d ; reg(s) is ignored */opJLT,     /* RA     if reg(r)<0 then reg(7) = d+reg(s) */opJLE,     /* RA     if reg(r)<=0 then reg(7) = d+reg(s) */opJGT,     /* RA     if reg(r)>0 then reg(7) = d+reg(s) */opJGE,     /* RA     if reg(r)>=0 then reg(7) = d+reg(s) */opJEQ,     /* RA     if reg(r)==0 then reg(7) = d+reg(s) */opJNE,     /* RA     if reg(r)!=0 then reg(7) = d+reg(s) */opRALim    /* Limit of RA opcodes */} OPCODE;typedef enum {srOKAY,srHALT,srIMEM_ERR,srDMEM_ERR,srZERODIVIDE} STEPRESULT;typedef struct {int iop  ;int iarg1  ;int iarg2  ;int iarg3  ;} INSTRUCTION;/******** vars ********/
int iloc = 0 ;
int dloc = 0 ;
int traceflag = FALSE;
int icountflag = FALSE;INSTRUCTION iMem [IADDR_SIZE];
int dMem [DADDR_SIZE];
int reg [NO_REGS];char * opCodeTab[]= {"HALT","IN","OUT","ADD","SUB","MUL","DIV","????",/* RR opcodes */"LD","ST","????", /* RM opcodes */"LDA","LDC","JLT","JLE","JGT","JGE","JEQ","JNE","????"/* RA opcodes */};char * stepResultTab[]= {"OK","Halted","Instruction Memory Fault","Data Memory Fault","Division by 0"};char pgmName[20];
FILE *pgm  ;char in_Line[LINESIZE] ;
int lineLen ;
int inCol  ;
int num  ;
char word[WORDSIZE] ;
char ch  ;
int done  ;/********************************************/
int opClass( int c )
{ if      ( c <= opRRLim) return ( opclRR );else if ( c <= opRMLim) return ( opclRM );else                    return ( opclRA );
} /* opClass *//********************************************/
void writeInstruction ( int loc )
{ printf( "%5d: ", loc) ;if ( (loc >= 0) && (loc < IADDR_SIZE) ){ printf("%6s%3d,", opCodeTab[iMem[loc].iop], iMem[loc].iarg1);switch ( opClass(iMem[loc].iop) ){ case opclRR: printf("%1d,%1d", iMem[loc].iarg2, iMem[loc].iarg3);break;case opclRM:case opclRA: printf("%3d(%1d)", iMem[loc].iarg2, iMem[loc].iarg3);break;}printf ("\n") ;}
} /* writeInstruction *//********************************************/
void getCh (void)
{ if (++inCol < lineLen)ch = in_Line[inCol] ;else ch = ' ' ;
} /* getCh *//********************************************/
int nonBlank (void)
{ while ((inCol < lineLen)&& (in_Line[inCol] == ' ') )inCol++ ;if (inCol < lineLen){ ch = in_Line[inCol] ;return TRUE ; }else{ ch = ' ' ;return FALSE ; }
} /* nonBlank *//********************************************/
int getNum (void)
{ int sign;int term;int temp = FALSE;num = 0 ;do{ sign = 1;while ( nonBlank() && ((ch == '+') || (ch == '-')) ){ temp = FALSE ;if (ch == '-')  sign = - sign ;getCh();}term = 0 ;nonBlank();while (isdigit(ch)){ temp = TRUE ;term = term * 10 + ( ch - '0' ) ;getCh();}num = num + (term * sign) ;} while ( (nonBlank()) && ((ch == '+') || (ch == '-')) ) ;return temp;
} /* getNum *//********************************************/
int getWord (void)
{ int temp = FALSE;int length = 0;if (nonBlank ()){ while (isalnum(ch)){ if (length < WORDSIZE-1) word [length++] =  ch ;getCh() ;}word[length] = '\0';temp = (length != 0);}return temp;
} /* getWord *//********************************************/
int skipCh ( char c  )
{ int temp = FALSE;if ( nonBlank() && (ch == c) ){ getCh();temp = TRUE;}return temp;
} /* skipCh *//********************************************/
int atEOL(void)
{ return ( ! nonBlank ());
} /* atEOL *//********************************************/
int error( char * msg, int lineNo, int instNo)
{ printf("Line %d",lineNo);if (instNo >= 0) printf(" (Instruction %d)",instNo);printf("   %s\n",msg);return FALSE;
} /* error *//********************************************/
int readInstructions (void)
{ OPCODE op;int arg1, arg2, arg3;int loc, regNo, lineNo;for (regNo = 0 ; regNo < NO_REGS ; regNo++)reg[regNo] = 0 ;dMem[0] = DADDR_SIZE - 1 ;for (loc = 1 ; loc < DADDR_SIZE ; loc++)dMem[loc] = 0 ;for (loc = 0 ; loc < IADDR_SIZE ; loc++){ iMem[loc].iop = opHALT ;iMem[loc].iarg1 = 0 ;iMem[loc].iarg2 = 0 ;iMem[loc].iarg3 = 0 ;}lineNo = 0 ;while (! feof(pgm)){ fgets( in_Line, LINESIZE-2, pgm  ) ;inCol = 0 ; lineNo++;lineLen = strlen(in_Line)-1 ;if (in_Line[lineLen]=='\n') in_Line[lineLen] = '\0' ;else in_Line[++lineLen] = '\0';if ( (nonBlank()) && (in_Line[inCol] != '*') ){ if (! getNum())return error("Bad location", lineNo,-1);loc = num;if (loc > IADDR_SIZE)return error("Location too large",lineNo,loc);if (! skipCh(':'))return error("Missing colon", lineNo,loc);if (! getWord ())return error("Missing opcode", lineNo,loc);int opInt = static_cast<int>(opHALT);while ((opInt < opRALim) && (strncmp(opCodeTab[opInt], word, 4) != 0))opInt++;op = static_cast<OPCODE>(opInt);switch ( opClass(op) ){ case opclRR :/***********************************/if ( (! getNum ()) || (num < 0) || (num >= NO_REGS) )return error("Bad first register", lineNo,loc);arg1 = num;if ( ! skipCh(','))return error("Missing comma", lineNo, loc);if ( (! getNum ()) || (num < 0) || (num >= NO_REGS) )return error("Bad second register", lineNo, loc);arg2 = num;if ( ! skipCh(',')) return error("Missing comma", lineNo,loc);if ( (! getNum ()) || (num < 0) || (num >= NO_REGS) )return error("Bad third register", lineNo,loc);arg3 = num;break;case opclRM :case opclRA :/***********************************/if ( (! getNum ()) || (num < 0) || (num >= NO_REGS) )return error("Bad first register", lineNo,loc);arg1 = num;if ( ! skipCh(','))return error("Missing comma", lineNo,loc);if (! getNum ())return error("Bad displacement", lineNo,loc);arg2 = num;if ( ! skipCh('(') && ! skipCh(',') )return error("Missing LParen", lineNo,loc);if ( (! getNum ()) || (num < 0) || (num >= NO_REGS))return error("Bad second register", lineNo,loc);arg3 = num;break;}iMem[loc].iop = op;iMem[loc].iarg1 = arg1;iMem[loc].iarg2 = arg2;iMem[loc].iarg3 = arg3;}}return TRUE;
} /* readInstructions *//********************************************/
STEPRESULT stepTM (void)
{ INSTRUCTION currentinstruction  ;int pc  ;int r,s,t,m  ;int ok ;pc = reg[PC_REG] ;if ( (pc < 0) || (pc > IADDR_SIZE)  )return srIMEM_ERR ;reg[PC_REG] = pc + 1 ;currentinstruction = iMem[ pc ] ;switch (opClass(currentinstruction.iop) ){ case opclRR :/***********************************/r = currentinstruction.iarg1 ;s = currentinstruction.iarg2 ;t = currentinstruction.iarg3 ;break;case opclRM :/***********************************/r = currentinstruction.iarg1 ;s = currentinstruction.iarg3 ;m = currentinstruction.iarg2 + reg[s] ;if ( (m < 0) || (m > DADDR_SIZE))return srDMEM_ERR ;break;case opclRA :/***********************************/r = currentinstruction.iarg1 ;s = currentinstruction.iarg3 ;m = currentinstruction.iarg2 + reg[s] ;break;} /* case */switch ( currentinstruction.iop){ /* RR instructions */case opHALT :/***********************************/printf("HALT: %1d,%1d,%1d\n",r,s,t);return srHALT ;/* break; */case opIN :/***********************************/do{ printf("Enter value for IN instruction: ") ;fflush (stdin);fflush (stdout);gets(in_Line);lineLen = strlen(in_Line) ;inCol = 0;ok = getNum();if ( ! ok ) printf ("Illegal value\n");else reg[r] = num;}while (! ok);break;case opOUT :  printf ("OUT instruction prints: %d\n", reg[r] ) ;break;case opADD :  reg[r] = reg[s] + reg[t] ;  break;case opSUB :  reg[r] = reg[s] - reg[t] ;  break;case opMUL :  reg[r] = reg[s] * reg[t] ;  break;case opDIV :/***********************************/if ( reg[t] != 0 ) reg[r] = reg[s] / reg[t];else return srZERODIVIDE ;break;/*************** RM instructions ********************/case opLD :    reg[r] = dMem[m] ;  break;case opST :    dMem[m] = reg[r] ;  break;/*************** RA instructions ********************/case opLDA :    reg[r] = m ; break;case opLDC :    reg[r] = currentinstruction.iarg2 ;   break;case opJLT :    if ( reg[r] <  0 ) reg[PC_REG] = m ; break;case opJLE :    if ( reg[r] <=  0 ) reg[PC_REG] = m ; break;case opJGT :    if ( reg[r] >  0 ) reg[PC_REG] = m ; break;case opJGE :    if ( reg[r] >=  0 ) reg[PC_REG] = m ; break;case opJEQ :    if ( reg[r] == 0 ) reg[PC_REG] = m ; break;case opJNE :    if ( reg[r] != 0 ) reg[PC_REG] = m ; break;/* end of legal instructions */} /* case */return srOKAY ;
} /* stepTM *//********************************************/
int doCommand (void)
{ char cmd;int stepcnt=0, i;int printcnt;int stepResult;int regNo, loc;do{ printf ("Enter command: ");fflush (stdin);fflush (stdout);gets(in_Line);lineLen = strlen(in_Line);inCol = 0;}while (! getWord ());cmd = word[0] ;switch ( cmd ){ case 't' :/***********************************/traceflag = ! traceflag ;printf("Tracing now ");if ( traceflag ) printf("on.\n"); else printf("off.\n");break;case 'h' :/***********************************/printf("Commands are:\n");printf("   s(tep <n>      "\"Execute n (default 1) TM instructions\n");printf("   g(o            "\"Execute TM instructions until HALT\n");printf("   r(egs          "\"Print the contents of the registers\n");printf("   i(Mem <b <n>>  "\"Print n iMem locations starting at b\n");printf("   d(Mem <b <n>>  "\"Print n dMem locations starting at b\n");printf("   t(race         "\"Toggle instruction trace\n");printf("   p(rint         "\"Toggle print of total instructions executed"\" ('go' only)\n");printf("   c(lear         "\"Reset simulator for new execution of program\n");printf("   h(elp          "\"Cause this list of commands to be printed\n");printf("   q(uit          "\"Terminate the simulation\n");break;case 'p' :/***********************************/icountflag = ! icountflag ;printf("Printing instruction count now ");if ( icountflag ) printf("on.\n"); else printf("off.\n");break;case 's' :/***********************************/if ( atEOL ())  stepcnt = 1;else if ( getNum ())  stepcnt = abs(num);else   printf("Step count?\n");break;case 'g' :   stepcnt = 1 ;     break;case 'r' :/***********************************/for (i = 0; i < NO_REGS; i++){ printf("%1d: %4d    ", i,reg[i]);if ( (i % 4) == 3 ) printf ("\n");}break;case 'i' :/***********************************/printcnt = 1 ;if ( getNum ()){ iloc = num ;if ( getNum ()) printcnt = num ;}if ( ! atEOL ())printf ("Instruction locations?\n");else{ while ((iloc >= 0) && (iloc < IADDR_SIZE)&& (printcnt > 0) ){ writeInstruction(iloc);iloc++ ;printcnt-- ;}}break;case 'd' :/***********************************/printcnt = 1 ;if ( getNum  ()){ dloc = num ;if ( getNum ()) printcnt = num ;}if ( ! atEOL ())printf("Data locations?\n");else{ while ((dloc >= 0) && (dloc < DADDR_SIZE)&& (printcnt > 0)){ printf("%5d: %5d\n",dloc,dMem[dloc]);dloc++;printcnt--;}}break;case 'c' :/***********************************/iloc = 0;dloc = 0;stepcnt = 0;for (regNo = 0;  regNo < NO_REGS ; regNo++)reg[regNo] = 0 ;dMem[0] = DADDR_SIZE - 1 ;for (loc = 1 ; loc < DADDR_SIZE ; loc++)dMem[loc] = 0 ;break;case 'q' : return FALSE;  /* break; */default : printf("Command %c unknown.\n", cmd); break;}  /* case */stepResult = srOKAY;if ( stepcnt > 0 ){ if ( cmd == 'g' ){ stepcnt = 0;while (stepResult == srOKAY){ iloc = reg[PC_REG] ;if ( traceflag ) writeInstruction( iloc ) ;stepResult = stepTM ();stepcnt++;}if ( icountflag )printf("Number of instructions executed = %d\n",stepcnt);}else{ while ((stepcnt > 0) && (stepResult == srOKAY)){ iloc = reg[PC_REG] ;if ( traceflag ) writeInstruction( iloc ) ;stepResult = stepTM ();stepcnt-- ;}}printf( "%s\n",stepResultTab[stepResult] );}return TRUE;
} /* doCommand *//********************************************/
/* E X E C U T I O N   B E G I N S   H E R E */
/********************************************/main( int argc, char * argv[] )
{ if (argc != 2){ printf("usage: %s <filename>\n",argv[0]);exit(1);}strcpy(pgmName,argv[1]) ;if (strchr (pgmName, '.') == NULL)strcat(pgmName,".tm");pgm = fopen(pgmName,"r");if (pgm == NULL){ printf("file '%s' not found\n",pgmName);exit(1);}/* read the program */if ( ! readInstructions ())exit(1) ;/* switch input file to terminal *//* reset( input ); *//* read-eval-print */printf("TM  simulation (enter h for help)...\n");dodone = ! doCommand ();while (! done );printf("Simulation done.\n");return 0;
}
  • 如果修改了这个TM.c,那就需要编译一下
gcc TM.C -o TM
  • OK,接下来就是正式的测试

  • 首先需要修改这个main.c程序,下面的main.c已经是修改好了的,可以直接复制来用

/****************************************************/
/* File: main.c                                     */
/* Main program for TINY compiler                   */
/****************************************************/#include "globals.h"/* set NO_PARSE to FALSE to enable the parser */
#define NO_PARSE FALSE
/* set NO_ANALYZE to FALSE to enable semantic analysis */
#define NO_ANALYZE FALSE
/* set NO_CODE to TRUE to disable code generation */
#define NO_CODE FALSE#include "util.h"
#if NO_PARSE
#include "scan.h"
#else
#include "parse.h"
#if !NO_ANALYZE
#include "analyze.h"
#if !NO_CODE
#include "cgen.h"
#endif
#endif
#endif/* allocate global variables */
int lineno = 0;
FILE * source;
FILE * listing;
FILE * code;/* allocate and set tracing flags */
int EchoSource = TRUE;
int TraceScan = FALSE;     // 禁用词法分析输出
int TraceParse = TRUE;     // 启用语法分析输出
int TraceAnalyze = TRUE;   // 启用语义分析输出
int TraceCode = FALSE;
int Error = FALSE;int main(int argc, char * argv[])
{ TreeNode * syntaxTree;char pgm[120]; /* source code file name */if (argc != 2){ fprintf(stderr,"usage: %s <filename>\n",argv[0]);exit(1);}strcpy(pgm,argv[1]) ;if (strchr (pgm, '.') == NULL)strcat(pgm,".tny");source = fopen(pgm,"r");if (source==NULL){ fprintf(stderr,"File %s not found\n",pgm);exit(1);}listing = stdout; /* send listing to screen */fprintf(listing,"\nTINY COMPILATION: %s\n",pgm);
#if NO_PARSEwhile (getToken()!=ENDFILE);           /* ʷʷ */
#elsesyntaxTree = parse();                  /* ﷨ */if (TraceParse) {fprintf(listing,"\nSyntax tree:\n");printTree(syntaxTree);}#if !NO_ANALYZE                          /* ֣ע͵ */if (! Error){ if (TraceAnalyze) fprintf(listing,"\nBuilding Symbol Table...\n");buildSymtab(syntaxTree);if (TraceAnalyze) fprintf(listing,"\nChecking Types...\n");typeCheck(syntaxTree);if (TraceAnalyze) fprintf(listing,"\nType Checking Finished\n");}
#if !NO_CODEif (! Error){ char * codefile;int fnlen = strcspn(pgm,".");codefile = (char *) calloc(fnlen+4, sizeof(char));strncpy(codefile,pgm,fnlen);strcat(codefile,".tm");code = fopen(codefile,"w");if (code == NULL){ printf("Unable to open %s\n",codefile);exit(1);}codeGen(syntaxTree, codefile);fclose(code);}
#endif
#endif
#endiffclose(source);return 0;
}
  • 编译程序,其余的程序和上次一样
   gcc main.c util.c scan.c parse.c analyze.c symtab.c cgen.c code.c -o tiny
  • 使用TINY编译器编译sample.tny,会生成这个sample.tm文件
./tiny sample.tny
  • 运行TM虚拟机,并加载sample.tm文件
./TM sample.tm

在这里插入图片描述

  • 然后就输入g

在这里插入图片描述

  • 注意这是一个测试阶乘的程序,所以,你输入一个数字,就可以输出结果

在这里插入图片描述

  • 如果想要退出这个虚拟机,按CTRL+C即可

任务2

2、自行编写Tiny C语言源程序,上交源代码,有运行结果的截图。

Attention!

  • 发现ai写的会报错,会一直报错!
  • 所以十分建议在原本的SAMPLE.TNY的基础上,自己修改!

之前的SAMPLE.TNY是计算阶乘的,你只需要让ai修改一下,换一个功能,然后按照任务1的流程进行测试即可

在这里插入图片描述

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

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

相关文章

CanFestival移植到STM32G4

文章目录 一、准备工作二、软件配置三、移植CanFestival参考 一、准备工作 1、获取Canfestival源码 2、Python下载 3、wxPython下载 4、CanFestival字典生成 5、安装参考 Python2.7.15及wxPython2.8百度云盘下载地址&#xff1a;https://pan.baidu.com/s/1bRS403m4B31m4ovSJ-_…

iOS性能调优实战:借助克魔(KeyMob)与常用工具深度洞察App瓶颈

在日常iOS开发过程中&#xff0c;性能问题往往是最令人头疼的一类Bug。尤其是在App上线前的压测阶段或是处理用户反馈的高发期&#xff0c;开发者往往需要面对卡顿、崩溃、能耗异常、日志混乱等一系列问题。这些问题表面上看似偶发&#xff0c;但背后往往隐藏着系统资源调度不当…

第十三章 RTC 实时时钟

第十三章 RTC 实时时钟 目录 第十三章 RTC 实时时钟 1 RTC简介 1.1 主要特性 2 功能描述 2.1 概述 2.2 复位过程 2.3 读RTC寄存器 2.4 配置RTC寄存器 2.5 RTC标志的设置 3 RTC寄存器描述 3.1 RTC控制寄存器高位(RTC_CRH) 3.2 RTC控制寄存器低位(RTC_CRL) 3.3 RTC预…

618来了,推荐京东云服务器

2核2G3M,49元/1年,348元/3年 2核4G5M,149元/1年,518元/3年 4核8G5M,368元/1年,1468元/3年 8核16G5M,1258元/1年,3498元/3年 8核32G10M,1498元/1年,4268元/3年 活动地址&#xff1a;https://3.cn/2hT-F6AX

数据库逻辑删除,唯一性约束究极解决方案

文章目录 一、写在前面二、解决方案1、业务逻辑层面控制2、物理删除数据归档3、is_delete !0的都认为是删除&#xff08;推荐&#xff09;4、MySQL 函数索引&#xff08;表达式索引&#xff09;&#xff08;需 MySQL 8.0&#xff09;&#xff08;推荐&#xff09;5、部分索引&a…

3-存储系统

一-基本概念 二-主存储器 三-主存储器与CPU的连接 四-外部存储器 五-高速缓冲存储器 六-虚拟存储器

华为0528笔试

第三题 题目 给定一个二维数组 mountainMap 表示一座山的地图&#xff0c;数组中的每个元素 mountainMap[x][y] 代表坐标 (x, y) 处山的高度。登山员从山底出发&#xff0c;爬到山峰。 山底的含义&#xff1a;mountainMap中高度为0的坐标点。 山峰的含义&#xff1a;mountain…

Redis的过期策略和淘汰策略

Redis的过期策略和淘汰策略 想象一下周末的大型超市&#xff1a;生鲜区的酸奶贴着"今日特价"标签&#xff0c;促销员定时检查这些商品的保质期&#xff1b;而仓库管理员正根据"先进先出"原则整理货架&#xff0c;确保商品不会过期积压。这种高效的商品管理…

laravel8+vue3.0+element-plus搭建方法

创建 laravel8 项目 composer create-project --prefer-dist laravel/laravel laravel8 8.* 安装 laravel/ui composer require laravel/ui 修改 package.json 文件 "devDependencies": {"vue/compiler-sfc": "^3.0.7","axios": …

【HarmonyOS 5】 影视与直播详以及 开发案例

&#x1f3a5; ‌一、超高清低延迟直播‌ ‌4K/8K硬解能力‌&#xff1a;通过鸿蒙媒体引擎实现15Mbps码率视频流稳定解码&#xff0c;华为Pura X实测端到端延迟<80ms‌分布式渲染‌&#xff1a;支持手机拍摄→智慧屏导播→平板监看的工作流协同&#xff0c;设备间传输延迟&…

Tunna工具实战:基于HTTP隧道的RDP端口转发技术

工具概述 Tunna是一款利用HTTP/HTTPS隧道进行TCP通信的渗透测试工具&#xff0c;由SECFORCE团队开发并开源。该工具主要应用于需要绕过防火墙限制的场景&#xff0c;通过Webshell实现内网服务的端口转发&#xff0c;特别适合在仅开放80/443端口的环境中建立TCP连接。 项目地址…

c# Autorest解析

AutoRest 工具生成用于访问 RESTful Web 服务的客户端库。AutoRest 的输入是使用 OpenAPI 规范格式描述 REST API 的规范。OpenAPI(f.k.a Swagger)规范代码生成器。支持 C#、PowerShell、Go、Java、Node.js、TypeScript、Python。 安装 AutoRest 在 Windows、MacOS 或 Linux …

高中数学联赛模拟试题精选学数学系列第24套几何题

⊙ O 1 \odot O_1 ⊙O1​ 和 ⊙ O 2 \odot O_2 ⊙O2​ 交于 A A A, B B B. Y Y Y 是 ⊙ O 1 \odot O_1 ⊙O1​ 上一点, Z Z Z 是 ⊙ O 2 \odot O_2 ⊙O2​ 上一点&#xff0c; Y Z YZ YZ 通过 A A A. 过 Y Y Y 的 ⊙ O 1 \odot O_1 ⊙O1​ 的切线和过 Z Z Z 的 ⊙…

【QT】INI格式文件读写类IniApi封装

【QT】INI文件读写类IniApi封装 前言实现INI文件写入方法INI文件读取方法 测试 前言 INI格式文件是一种纯文本格式&#xff0c;使用方括[]定义节&#xff08;Section&#xff09;&#xff0c;每个节下包含键值对&#xff0c;如下图所示。该格式文件简单易读易编辑。而且在所有…

ABAP设计模式之---“童子军法则(The Boy Scout Rule)”

法则介绍 The Boy Scout Rule&#xff0c;中文一般翻译为“童子军法则”&#xff0c;是一个简单却非常有意义的软件开发原则&#xff0c;它最早由软件开发大师 Robert C. Martin (Uncle Bob) 在他的《Clean Code》一书中提出。 这条法则的核心思想非常简单&#xff1a; “确保…

BaikalDB 架构演进实录:打造融合向量化与 MPP 的 HTAP 查询引擎

导读 BaikalDB作为服务百度商业产品的分布式存储系统&#xff0c;支撑了整个广告库海量物料的存储和OLTP事务处理。随着数据不断增长&#xff0c;离线计算时效性和资源需求压力突显&#xff0c;基于同一份数据进行OLAP处理也更为经济便捷&#xff0c;BaikalDB如何在OLTP系统内…

【抖音小程序】通用交易系统-下单问题整理

在通用交易系统中&#xff0c;支付流程如下 1、服务端-预下单&#xff1a;生成参数与签名信息&#xff08;此过程不需要与抖音平台对接&#xff09; 参考 生成下单参数与签名_抖音开放平台 2、小程序用户端&#xff1a;根据返回的参数与签名&#xff0c;拉起抖音支付&#x…

模型参数、模型存储精度、参数与显存

模型参数量衡量单位 M&#xff1a;百万&#xff08;Million&#xff09; B&#xff1a;十亿&#xff08;Billion&#xff09; 1 B 1000 M 1B 1000M 1B1000M 参数存储精度 模型参数是固定的&#xff0c;但是一个参数所表示多少字节不一定&#xff0c;需要看这个参数以什么…

EurekaServer 工作原理

一、核心工作流程 二、核心组件解析 1. 自动配置引擎 入口&#xff1a;EnableEurekaServer 引入 EurekaServerMarkerConfiguration&#xff0c;创建标记Bean Marker触发条件&#xff1a;EurekaServerAutoConfiguration 检测到 Marker 存在时激活关键Bean初始化&#xff1a; …

Playwright 与 Selenium:自动化测试的两大主流工具对比

《Playwright 与 Selenium&#xff1a;自动化测试的两大主流工具对比》 *Playwright 和 Selenium 是自动化测试领域的两大主流工具&#xff0c;二者在架构设计、功能特性和适用场景上存在显著差异&#xff0c;以下是核心对比&#xff1a; 一、架构与设计理念 维度Playwright…