- // use ansi c,
// HEC = Human Engineered Computer Company
//做这个程序的目的是实现java.exe的功能
//也就是对ClassFile文件(字节码文件进行处理)
//首先需要
#include "stdio.h"
#include "iostream.h"
#include "stdlib.h"
#include "jni_md.h"
#include "jni.h"
#include "vm.h"
#include "string.h"
#include "SemanticCheck.h"
#include "ByteCodeCheck.h"
#include "SingleReferenceCheck.h"
#include "Method_info.h"
void main(int argc, char *argv[]){
// char bufClassFile[1024];
printf("hello,java virtual machine/n");- FILE *fp=fopen("c://Test.class","rb");
if(fp==NULL) //C中是NULL, java中是null(null,true,false是literal)
{
printf("can't open file/n");
exit(0);
} - int fileSize=-1;
while(!feof(fp)){
fgetc(fp);
++fileSize;
}
rewind(fp);
printf("The ClassFile is %d Bytes/n",fileSize);
if(fileSize==0){
printf("Error,ByteCode File has zero size/n");
exit(0);
}
Byte buf[2048]={0};
int k=sizeof(fp);
printf("k=%d/n",k); //指针占4个字节
printf("sizeof(buf)=%d/n",sizeof(buf));- //第一次检验
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
flagJavaMagic=getJavaMagic(fp); //0xCAFE BABE (4B)
if(flagJavaMagic==false){
printf("ClassFile format is wrong!/n");
exit(0);
}
flagMinorVersion=getMinorVersion(fp); // 00 03 (2B)
if(flagMinorVersion==false){
printf("ClassFile format is wrong!");
exit(0);
} - flagMajorVersion= getMajorVersion(fp); // 00 2D (2B)
if(flagMajorVersion==false){
printf("ClassFile format is wrong!");
exit(0);
}
//***************************************************************************
//常量池
printf("Below is about ConstantPool Information/n");
constantPoolCount=getConstantPoolCount(fp); //constant_pool_count (2B)
int i=0;
for( i=0; i<constantPoolCount-1; i++){
printf("/nconstant_pool_index=%d,",i+1);
constantPoolAnalyze(fp);
}
printf("/nEnd ConstantPool Information/n");
getAccessFlags(fp); // access_flags是class/interface的访问权限
getThisClass(fp); //指乡向constant_pool的有效索引值
getSuperClass(fp); // 0或者指向constant_pool的有效索引值
/*1*************************************************************/
int interfaceCount=getInterfaceCount(fp);
if(interfaceCount>0){
// 处理
}
else
printf("/n the file has no interface. /n");
// printf("/ninterface_count=%d/n",interfaceCount);
/*1*************************************************************/- /*2************************************************************/
int fields_count=getFieldsCount(fp); - if(fields_count>0){
//????处理
} - else
// printf("/nfields_count=%d/n",fields_count);
int methods_count=getMethodsCount(fp); - /*2**************************************************************/
/*3***************************************************************/
if(methods_count>0){
Method_info mInfo;
mInfo.getMethodAccessFlags(fp);
mInfo.getMethodNameIndex(fp);
mInfo.getDescriptorIndex(fp);
mInfo.getAttributesCount(fp);
}
else
attributes_count=getAttributesCount(fp);
/*****************************************************************/
if(attributes_count>0){
}
else{
}- //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// 第二次检验
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
SemanticCheck sCheck;
// 第三次检验
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ByteCodeCheck bCheck;
//第四次检验
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
SingleReferenceCheck rCheck;
printf("sizeof(short)=%d/n",sizeof(short));
printf("sizeof(Byte)=%d/n",sizeof(Byte));- return;
- } // end main()
bool getJavaMagic(FILE *fp1){ //0x CA FE BA BE (4B)
char *temp="CAFEBABE";
char *str[4];
int offset=0;
Byte bufJavaMagic[4];
fread(bufJavaMagic,sizeof(char),4,fp1);
for(int i=0; i<4; i++){
str[i]=ByteToHexidecimal(bufJavaMagic[i]);
}
strJavaMagic=str[0];
for(i=1; i<4;i++)
strcat(strJavaMagic,str[i]);- printf("/n");
printf("Java Magic=%s/n/n",str[0]);
int k=strcmp(str[0],temp);
if(k==0)
return true;
else
return false;
}
bool getMinorVersion(FILE *fp1){ //0x 00 03
char *temp="0003";
char *strMinor[2];
int offset=4;
Byte bufMinorVersion[2]={0}; // initialization
fread(bufMinorVersion,sizeof(char),2,fp1);
for(int i=0; i<2; i++){
strMinor[i]=ByteToHexidecimal(bufMinorVersion[i]);
}- strMinorVersion=strMinor[0];
strcat(strMinorVersion,strMinor[1]);
printf("Minor_Version=%s/n/n",strMinor[0]);
int k=strcmp(strMinor[0],temp);
if(k==0)
return true;
else
return false; - }
- bool getMajorVersion(FILE *fp1){ // 0x 00 2D
char *temp="002D";
char *strMajor[2];
Byte bufMajorVersion[2]={0}; // initialization
int offset=6;
fread(bufMajorVersion,sizeof(char),2,fp1);
for(int i=0; i<2;i++){
strMajor[i]=ByteToHexidecimal(bufMajorVersion[i]);
}
strMajorVersion=strMajor[0];
strcat(strMajorVersion,strMajor[1]);
printf("MajorVersion=%s/n/n",strMajor[0]);
int k=strcmp(strMajor[0],temp);
return true;
return false;
}
char* ByteToHexidecimal(Byte num){
char a[2];
Byte number[2];
Byte low=num%16;
number[1]=low;- num/=16;
Byte high=num%16;
number[0]=high; - for(int i=0; i<2; i++){
switch(number[i]){
case 0: a[i]= '0'; break;
case 1: a[i]= '1'; break;
case 2: a[i]= '2'; break;
case 3: a[i]= '3'; break;
case 4: a[i]= '4'; break;
case 5: a[i]= '5'; break;
case 6: a[i]= '6'; break;
case 7: a[i]= '7'; break;
case 8: a[i]= '8'; break;
case 9: a[i]= '9'; break;
case 10: a[i]= 'A'; break;
case 11: a[i]= 'B'; break;
case 12: a[i]= 'C'; break;
case 13: a[i]= 'D'; break;
case 14: a[i]= 'E'; break;
case 15: a[i]= 'F'; break;
default:
break;
}
}
char *str=(char*)malloc(2*sizeof(char));
strcpy(str,a); //not str=a; as a is a local variable
*(str+2)='/0';
return str;
} - int getConstantPoolCount(FILE *fp1){
// 0x XXXX
char *strConstantpool[2];
Byte bufConstantPoolCount[2];
fread(bufConstantPoolCount,sizeof(char),2,fp1);
// printf("%d,%d/n",bufConstantPoolCount[0],bufConstantPoolCount[1]);
for(int i=0;i<2;i++){
strConstantpool[i]=ByteToHexidecimal(bufConstantPoolCount[i]);
}
strConstantPoolCount=strConstantpool[0];
strcat(strConstantPoolCount,strConstantpool[1]);
int k=HexidecimalToDecimal(strConstantPoolCount);
printf("/nconstantPoolCount=%d/n",k);
return k;
} - int HexidecimalToDecimal(char *str){
int constantPoolCount=0; // initialization
char num[4];
int a[4]; //sizeof(a)=sizeof(int)*4=16
int k=strlen(str);
for(int i=0; i<k; i++){
num[i]=*(str+i);
}
for(i=0; i<4; i++){
switch(num[i]){
case '0': a[i]=0; break;
case '1': a[i]=1; break;
case '2': a[i]=2; break;
case '3': a[i]=3; break;
case '4': a[i]=4; break;
case '5': a[i]=5; break;
case '6': a[i]=6; break;
case '7': a[i]=7; break;
case '8': a[i]=8; break;
case '9': a[i]=9; break;
case 'A': a[i]=10; break;
case 'B': a[i]=11; break;
case 'C': a[i]=12; break;
case 'D': a[i]=13; break;
case 'E': a[i]=14; break;
case 'F': a[i]=15; break;
default:
break;
}
}
constantPoolCount=((a[0]*16+a[1])*16+a[2])*16+a[3];
return constantPoolCount;
}
void constantPoolAnalyze(FILE *fp1){ //tag占1B
int j=0;
int length=0;
Byte bufTag[1];
fread(bufTag,sizeof(char),1,fp1);
printf(" tag=%d/n",bufTag[0]);
switch(bufTag[0]){
case 1:
char *strConstantUtf8Info;
char *str1[3];
Byte constantUtf8Info[2];
fread(constantUtf8Info,sizeof(char),2,fp1);
for(j=0; j<2; j++){
str1[j]=ByteToHexidecimal(constantUtf8Info[j]);
}
strConstantUtf8Info=str1[0];
for(j=1; j<2; j++)
strcat(strConstantUtf8Info,str1[j]);
printf("ConstantUtf8Info=%s/n",strConstantUtf8Info);
length=HexidecimalToDecimal(strConstantUtf8Info);
char *strx[100]; //bug 1
char bytesBuf[100]; //bug 2
fread(bytesBuf,sizeof(char),length,fp1);
printf("ConstantUtf8Info's Length=%d/n",length);
for(j=0;j<length;j++)
strx[j]=ByteToHexidecimal(bytesBuf[j]);
strConstantUtf8Info=strx[0];
for(j=1; j<length; j++)
strcat(strConstantUtf8Info,strx[j]);
printf("ConstantUtf8Info=%s/n",strConstantUtf8Info);
break;- case 3:
char *strConstantIntegerInfo;
char *str3[4];
Byte constantIntegerInfo[4];
fread(constantIntegerInfo,sizeof(char),4,fp1);
for(j=0; j<4; j++){
str3[j]=ByteToHexidecimal(constantIntegerInfo[j]);
}
strConstantIntegerInfo=str3[0];
for(j=1; j<4; j++)
strcat(strConstantIntegerInfo,str3[j]);
printf("ConstantIntegerInfo=%s/n",strConstantIntegerInfo);
break; - case 4:
char *strConstantFloatInfo;
char *str4[4];
Byte constantFloatInfo[4];
fread(constantFloatInfo,sizeof(char),4,fp1);
for(j=0; j<4; j++){
str4[j]=ByteToHexidecimal(constantFloatInfo[j]);
}
strConstantFloatInfo=str4[0];
for(j=1; j<4; j++)
strcat(strConstantFloatInfo,str4[j]);
printf("ConstantFloatInfo=%s/n",strConstantFloatInfo);
break; - case 5:
Byte constLongInfo[8];
fread(constantFloatInfo,sizeof(char),8,fp1);
break; - case 6:
Byte constantDoubleInfo[8];
fread(constantDoubleInfo,sizeof(char),8,fp1);
break; - case 7:
char *strConstantClassInfo;
char *str7[2];
Byte constantClassInfo[2];
fread(constantClassInfo,sizeof(char),2,fp1);
for(j=0; j<2; j++){
str7[j]=ByteToHexidecimal(constantClassInfo[j]);
}
strConstantClassInfo=str7[0];
strcat(strConstantClassInfo,str7[1]);
printf("ConstantClassInfo=%s/n",strConstantClassInfo);
break; - case 8:
char *strConstantStringInfo;
char *str8[2];
Byte constantStringInfo[2];
fread(constantStringInfo,sizeof(char),2,fp1);
for(j=0; j<2; j++){
str8[j]=ByteToHexidecimal(constantStringInfo[j]);
}
strConstantStringInfo=str8[0];
strcat(strConstantStringInfo,str8[1]);
printf("ConstantStringInfo=%s/n",strConstantStringInfo);
break; - case 9:
char *strConstantFieldrefInfo;
char *str9[4];
Byte constantFieldrefInfo[4];
fread(constantFieldrefInfo,sizeof(char),4,fp1);
for(j=0; j<4; j++){
str9[j]=ByteToHexidecimal(constantFieldrefInfo[j]);
}
strConstantFieldrefInfo=str9[0];
for(j=1; j<4; j++){
strcat(strConstantFieldrefInfo,str9[j]);
}
printf("ConstantFieldrefInfo=%s",strConstantFieldrefInfo);
break; - case 10:
char *strConstantMethodrefInfo;
char *str10[4];
Byte constantMethodrefInfo[4];
fread(constantMethodrefInfo,sizeof(char),4,fp1);
for(j=0; j<4; j++){
str10[j]=ByteToHexidecimal(constantMethodrefInfo[j]);
}
strConstantMethodrefInfo=str10[0];
for(j=1; j<4; j++)
strcat(strConstantMethodrefInfo,str10[j]);
printf("ConstantMethodrefInfo=%s/n",strConstantMethodrefInfo);
break; - case 11:
Byte constantInterfaceMethodrefInfo[4];
fread(constantInterfaceMethodrefInfo,sizeof(char),4,fp1);
break; - case 12:
char *strConstantNameandTypeInfo;
char *str12[4];
Byte constantNameandTypeInfo[4];
fread(constantNameandTypeInfo,sizeof(char),4,fp1);
for(j=0; j<4; j++){
str12[j]=ByteToHexidecimal(constantNameandTypeInfo[j]);
}
strConstantNameandTypeInfo=str12[0];
for(j=1; j<4; j++)
strcat(strConstantNameandTypeInfo,str12[j]);
printf("ConstantNameandTypeInfo=%s/n",strConstantNameandTypeInfo);
break; - default:
printf("ClassFile format is wrong!/n");
break;
} - return;
} - int getAccessFlags(FILE *fp1){
char *strAccessFlags[2];
char bufAccessFlags[2];
fread(bufAccessFlags,sizeof(char),2,fp1);
for(int j=0; j<2; j++){
strAccessFlags[j]=ByteToHexidecimal(bufAccessFlags[j]);
}
access_flags=strAccessFlags[0];
strcat(access_flags,strAccessFlags[1]);
printf("/naccess_flags=%s/n",access_flags); - return 1;
} - int getThisClass(FILE *fp1){
char *strThisClass[2];
char bufThisClass[2];
fread(bufThisClass,sizeof(char),2,fp1);
for(int j=0; j<2; j++){
strThisClass[j]=ByteToHexidecimal(bufThisClass[j]);
}
this_class=strThisClass[0];
strcat(this_class,strThisClass[1]);
printf("/nthis_class=%s/n",this_class); - return 1;
} - int getSuperClass(FILE *fp1){
char *strSuperClass[2];
char bufSuperClass[2];
fread(bufSuperClass,sizeof(char),2,fp1);
for(int j=0; j<2; j++){
strSuperClass[j]=ByteToHexidecimal(bufSuperClass[j]);
}
super_class=strSuperClass[0];
strcat(super_class,strSuperClass[1]);
printf("/nsuper_class=%s/n",super_class); - return 1;
} - int getInterfaceCount(FILE *fp1){
char *strInterfaceCount[2];
char bufInterfaceCount[2];
fread(bufInterfaceCount,sizeof(char),2,fp1);
for(int j=0; j<2; j++){
strInterfaceCount[j]=ByteToHexidecimal(bufInterfaceCount[j]);
}
interface_count=strInterfaceCount[0];
strcat(interface_count,strInterfaceCount[1]);
printf("/ninterface_count=%s/n",interface_count);
//把16进制数转化成10进制数
int k=HexidecimalToDecimal(interface_count);
return k;
}
int getFieldsCount(FILE *fp1){
char *strFieldsCount[2];
char bufFieldsCount[2];
fread(bufFieldsCount,sizeof(char),2,fp1);
for(int j=0; j<2; j++){
strFieldsCount[j]=ByteToHexidecimal(bufFieldsCount[j]);
}
fields_count=strFieldsCount[0];
strcat(fields_count,strFieldsCount[1]);
printf("/nfields_count=%s/n",fields_count);
int k=HexidecimalToDecimal(fields_count);
printf("k=%d/n",k);
return k;
}- int getMethodsCount(FILE *fp1){
char *strMethodsCount[2];
char bufMethodsCount[2];
fread(bufMethodsCount,sizeof(char),2,fp1);
for(int j=0; j<2; j++){
strMethodsCount[j]=ByteToHexidecimal(bufMethodsCount[j]);
}
methods_count=strMethodsCount[0];
strcat(methods_count,strMethodsCount[1]);
printf("/nmethods_count=%s/n",methods_count);
int k=HexidecimalToDecimal(methods_count);
return k;
} - int getAttributesCount(FILE *fp1){
int j=0;
char *strAttributesCount[2];
char bufAttributesCount[2];
fread(bufAttributesCount,sizeof(char),2,fp1);
for(j=0; j<2;j++){
strAttributesCount[j]=ByteToHexidecimal(bufAttributesCount[j]);
}
attributes_counts=strAttributesCount[0];
strcat(attributes_counts,strAttributesCount[1]);
int k=HexidecimalToDecimal(attributes_counts);
return 1;
}
相关推荐
Ubuntu系统下编译c语言主程序及用Makefile方式编程主程序
编写一个主程序文件 main1.c 和一个子程序文件 sub1.c 在linux ubuntu终端创建main1.c和sub1.c 下面展示一些 命令行。 // 使用touch命令创建main1.c和sub1.c touch main1.c touch sub1.c 下面展示一些 内联代码片。 //使用gedit命令打开main1.c gedit main1.c 在main1.c文件中输入代码 ...
2025系统架构师---主程序/子程序架构风格
主程序/子程序架构风格以其简洁性、高效性与确定性,持续在实时控制、科学计算等领域展现不可替代的价值。尽管现代架构思想不断演进,但其核心设计原则——功能分解、接口显式化、高内聚低耦合——仍是软件工程的基础法则。架构师应在深入理解业务需求的基础上,灵活选择架构风格:在需要极致性能与确定性的场景坚守主程序/子程序范式,在需要弹性扩展的领域拥抱微服务与事件驱动。未来,随着异构计算(如FPGA、量子计算)的普及,主程序/子程序架构或将与硬件特性深度结合,焕发新的生命力。
Python定义函数,模块导入以及Python主程序文件结构
dir(__builtins__) #dir(__builtins__)显示__builtins__模块内部函数,Python启动时,__builtins__模块自 动被加载,其内部有函数可以被直接调用,为内置函数 help(dir)显示函数dir的帮助 id(variable)显示对象地址 模块__builtins__内部函数如dir,id()等 for i
【Unity】 HTFramework框架(二十三)Main主程序
更新日期:2019年11月7日。 Github源码:[点我获取源码] 索引Main主程序简介使用Main主循环调用其他模块ScriptingDefine 脚本定义Main Data 全局数据License 授权许可Parameter 全局参数 Main主程序简介 Main为框架的主模块,提供访问其他模块的快捷接口,还支持快捷宏定义、指定全局主要数据类、设置项目授权、以及配置全局参数等。 使用M.........
SoftMgr_Setup_v3.1.1442.301
SoftMgr_Setup_v3.1.1442.301
mugen主程序
mugen主程序
main主程序
1:程序执行的入口 2:单线程,会出现中间出错后面不执行
主程序主程序
学习常用软件,努力学习,提高自己,为社会做出自己的贡献,加油!
华为 eNSP 安装教程(附下载地址,完美适配主流 Windows)
本文指导大家在 Windows 操作系统上完成华为 eNSP 模拟器的安装,以及如何解决安装后报 40/41 代码的错误。
常见消息队列:ActiveMQ、RabbitMQ、RocketMQ、Kafka的区别总结
常见消息队列:ActiveMQ、RabbitMQ、RocketMQ、Kafka的区别。
PID控制器(位置式和增量式)
PID控制算法
matlab中主程序如何调用其它子程序,主程序怎样调用子程序
快速导读:Q1:vbs怎么调用子程序?你可以这样操作比如你要调用C:\m.exe Set ws = CreateObject("Wscript.Shell") Set fs = CreateObject("Scripting.FileSystemObject") ws.Run "c:\m.exe" 希望能帮助你!!!!!Q2:matlab中如何用主程序调用子程序形式必须有函数文件存在时,才能调用其...
《算法第四版》学习心得一——怎么学算法
一、算法的两个核心 算法的核心内容实际上有两个: 算法的概念和思路。 算法的编程实现。 两者相互关联影响,缺一不可。 不理解基本概念和思路,就算把实现代码背下来,也无济于事,因为脑袋里依然是一片模糊。理解了概念和思路,不去用代码实现,脑袋里有的只是概念,无法根据真实需求实现解决方案。 二、学算法需要什么基础 首先,必须要有一定的编程语言基础,要理解语言中最基本的概念:数据类型,类,成...
如何区别python的主程序和子程序_主程序和子程序的区别
Q1:子程序和主程序有什么区别在计算机科学中,子程序(英语:Subroutine, procedure, function, routine, method, subprogram, callable unit),是一个大型程序中的某部份代码,由一个或多个语句块组成。它负责完成某项特定任务,而且相较于其他代码,具备相对的独立性。一般会有输入参数并有返回值,提供对过程的封装和细节的隐藏。这些代码通常...
极智AI | 谈谈为什么卷积加速更喜欢 NHWC Layout
本文主要讨论一下为什么卷积加速更加喜欢 NHWC 的数据排布。
uni-app - 将 base64 图片编码转为 Blob 本地文件路径(把base64类型的图片,转换成blob二进制文件流)适用于 uni-app / vue.js / JavaScript
uni-app/vue.js/JavaScript将base64转Blob,uniappapp端如何将图片的base64编码转换成File对象或Blob,uni-app/vue.js/JavaScript中拿到base64转blob对象,uniapp图片base64格式转blob格式方法,uniapp上传图片压缩转base64码与base64转图片路径,Base64/Blob/File图片文件转换,url、base64、blob相互转换方法,读取本地文件为Base64并转成B
mugen linux主程序,Mugen主程序报错汇总
原文来自11区民间整合的Mugen主程序报错汇总,同时加入了千寻网站平时收集的常见报错,源地址:http://mugenbinran.web.fc2.com/error.html以下皆为机翻,有空会慢慢修正翻译加载初始场景报错报错关键字:dojo.def 或 stage0.def原因:程序以debug模式运行且调用了debug场景解决方法:1、在mugen.cfg文件内找到[Debug]下的Sta...
扣子(Coze)搭建智能体完整实战指南 —— 从零基础入门到写小说及其他需求扩展开发
随着大语言模型进入应用爆发期,我们正在经历从“寻找提示词”向“构建智能体”的范式转移。扣子(Coze)作为字节跳动推出的一站式AI智能体开发与运营平台,极大地降低了AI应用开发的门槛,让非技术人员也能快速搭建具备感知、决策、行动能力的智能体。 本文将手把手带你从零开始,在扣子平台上搭建一个功能完备的**小说创作智能体**,并基于此展示如何将同一套架构扩展到其他需求场景。无论你是写作爱好者、内容创作者,还是希望用AI赋能日常工作的职场人士,这套完整的技术方案都将帮助你快速上手。
如何运行matlab代码?怎样找到matlab主程序?
下载的代码包里的文件都是干什么的? 当我们从网络上下载matlab的源代码时,得到的通常是代码的压缩包,里面包括很多各种后缀的文件。他们都是什么文件呢,都是干什么用的? m后缀的文件:这是matlab代码的最常用后缀,就像C++的常用后缀是cpp一样。只要看到.m文件,你就知道这个是matlab的代码。和C++不同的是,很多matlab的自定义函数,也是单独定义在m文件中的。 fig后缀的文件:这个是matlab输出的绘图结果保存的文件,保存着各种仿真结果的曲线。此外,GUI的图形用户界面也是以fig文件的
学Simulink——基于软开关与高频变换的整流器系统场景实例:移相全桥ZVS整流器在轻载条件下的效率优化
本文以Simulink为平台,详细介绍了移相全桥ZVS整流器在轻载条件下的建模与优化方法。通过六个步骤系统讲解了从项目创建到仿真运行的全过程,重点分析了移相全桥拓扑结构、ZVS检测逻辑设计及轻载特性。结果显示,传统移相全桥在轻载时ZVS失效导致效率下降(<88%)。针对此问题,提出了动态频率调整、不对称半桥模式等优化策略。该案例为理解软开关技术、提升电源效率提供了实用建模方法和优化思路。
openGauss学习笔记-280 openGauss性能调优-实际调优案例09-修改启动参数解决TPCC大幅度波动
openGauss学习笔记-280 openGauss性能调优-实际调优案例09-修改启动参数解决TPCC大幅度波动280.1 现象描述280.2 优化分析 openGauss学习笔记-280 ope
mugen linux主程序,MUGEN主程序
M.U.G.E.N是一款由美国的Elecbyte小组使用C语言与Allegro程序库开发的免费的2D格斗游戏引擎(只作为个人爱好者使用,非专业引擎),目前M.U.G.E.N有分别在DOS、Windows和Linux等操作系统上运行的版本。MUGEN在日文中有“无限”的意思,本身即是一个开放的平台,目前以格斗类游戏角色对战为主要和常用功能,既适合AI观战,也适合手操对战。MUGEN给予了不同系统的人...
VC中sqlite的使用
在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示
主程序与python的双向交互
如果需要用脚本来扩展一个程序的功能,或是定制差异化的客制功能,或是用脚本自动运行一系列需要手动执行的操作,可以考虑用python脚本来实现。当然也可以用lua脚本来实现,不过python库更丰富,可扩展空间更大。 要达成上述功能,就需要主程序与python能够实现双向交互,即主程序可以调用python脚本并取得结果,python脚本也可以调用主程序的功能。 已知主程序是可以单向调用python解释器来执行脚本的,也已知python可以通过ctypes库来...
华为的C语言编程规范.pdf
华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。
怀旧版电脑GBC模拟器
再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。
单片机c语言中主程序怎么写,单片机的主程序和中断程序是怎么样运行的
描述中断用于执行优先级更高的任务中断顾名思义是“中途打断”的意思。举一个简单的例子:您正在和部门的同事在开会,突然老板进来找你,你就得暂停会议,离开会议室,跟老板谈完重要的事情,再重新回来会议室继续会议。单片机的中断就是类似的一个过程,发生中断时,就会打断正在执行的主程序,先处理完中断任务,返回主程序继续运行,当然在执行中断函数之前,单片机需要把关键的数据保存下来,中断函数执行完成后才可以正确的恢...
迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)
迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)
Python笔记-以主程序运行
当python脚本被运行时,解释器会从脚本的第一行开始逐行执行代码,直到到达脚本的末尾。3、使用'if __name__="__main__"来判断当前脚本是否被直接运行,这个条件语句的目的是,当脚本被直接运行(而不是被导入为模块时),执行'main'函数。2、定义了一个名为'main'的函数,包含了主程序的执行流程,包括调用'greet'函数和一个简单的循环。当脚本作为模块被导入时,主程序不会自动执行。假设有两个python脚本,一个是'module.py'另一个是'main_script.py'。
Python模块—以主程序的形式执行
案例-1 #1、创建一个模块,名称为fun。代码块如下: pinetree = "我是一棵松树^-^" #定义全局变量(松树) def fun_christmastree():#定义函数 pinetree = '挂上彩灯...我变成一棵圣诞树^-^' #定义局部变量 print(pinetree) #输出局部变量值 #******************************函数体外****************************** print('下雪了...') print('
936



被折叠的 条评论
为什么被折叠?



