Java读写t5557卡源码

       T5557卡是美国Atmel公司生产的多功能非接触式射频卡芯片,属于125KHz的低频卡,在国内有广大的应用市场。该芯片共有330bit(比特)的EPROM(分布为10个区块, 每个区块33bit)。0页的块0是被保留用于设置T5557操作模式的参数配置块。第0页第7块可以作用户数据块使用,也可以作为保护全部数据的密码(假如在配置块中启用密码功能的话),防止非法改写数据。 第1页的1、2块保存了出厂商信息及唯一出厂ID,只能读取不可更改,T5567、T5577是T5557的升级版。

本示例使用的发卡器:T5557 T5567 T5577低频RFID读写器 EM4100 HID卡复制器 酒店门卡-淘宝网 (taobao.com) 

import com.sun.jna.Library ;
import com.sun.jna.Native;
import com.sun.jna.WString;interface CLibrary extends Library {//DLL绝对路径的地址获取,注意要去空格    String filePath = CLibrary.class.getResource("").getPath().replaceFirst("/","").replaceAll("%20"," ")+"OUR_IDR";CLibrary sdtapi = (CLibrary) Native.loadLibrary(filePath, CLibrary.class);//动态链接库中的方法byte idr_beep(int xms);                         //让设备发出声音byte pcdgetdevicenumber(byte[] devicenumber);   //读取设备编号String pcdgetdevicenumber_str();                //读取设备编号,输出字符串byte idr_read(byte[] mypiccserial );            //轻松读ID卡,只要卡在感应区,每次执行此方法都可以读到卡号byte hid_read(byte[] mypiccserial );            //轻松读ID卡,只要卡在感应区,每次执行此方法都可以读到卡号String idr_read_8h10d_str();                    //读ID卡,输出十位十进制卡号byte t5557_read(byte ctrlword, byte[] mypiccserial,byte[] oldkey,byte[] blockflag,byte[] blockdata);     //读t5557卡,byte t5557_write(byte ctrlword, byte[] mypiccserial,byte[] oldkey,byte[] blockflag,byte[] blockdata);     //写t5557卡,byte t5557_init(byte ctrlword, byte[] mypiccserial,byte[] oldkey,byte[] configdata,byte[] newkey);   //写t5557卡配置值byte t5557_changekey(byte ctrlword, byte[] mypiccserial,byte[] oldkey,byte[] newkey);  //修改t5557卡密钥
}
public class IDReader {public static final byte NEEDSERIAL=1;  //只对指定UID列号的卡操作public static final byte NEEDKEY=2;     //需要用密码认证卡public static final byte LOCKBIT=4;     //锁定配置块或数据块,仅对   t5557_init,t5557_write ,t5557_changekey函数有效public static final byte KEYENABLE=8;   //启用本卡的密码功能public static final byte RESETCARD=16;  //操作成功后重启卡片public static void main(String[] args) {System.setProperty("jna.encoding", "GBK");String filePath = CLibrary.class.getResource("").getPath().replaceFirst("/", "").replaceAll("%20", " ") + "OUR_IDR.DLL";System.out.println("本示例引用的DLL文件:" + filePath);if (args.length == 0) {System.out.println("\n请先输入运行参数!");System.out.println("\n参数 0:驱动读卡器嘀一声");System.out.println("\n参数 1:读取设备编号");System.out.println("\n参数 2:读取设备编号,输出字符串");System.out.println("\n参数 3:轻松读ID卡");System.out.println("\n参数 4:轻松读HID卡");System.out.println("\n参数 5:轻松读ID卡,输出十位十进制卡号");System.out.println("\n参数 6:读T5557卡");System.out.println("\n参数 7:写T5557卡");System.out.println("\n参数 8:写T5557卡配置值");System.out.println("\n参数 9:修改T5557卡密钥");return;}//Java中只能使用string1.equals(string2)的方式来比较字符串if (args[0].equals("0")) {             //驱动读卡器发嘀一声System.out.print("\n0-驱动读卡器嘀一声\n");CLibrary.sdtapi.idr_beep(50);System.out.print("结果:如果能听到读卡器嘀一声表示成功,否则请检查读卡器是否已连上线!\n\n");} else if (args[0].equals("1"))          //读取设备编号,可做为软件加密狗用,也可以根据此编号在公司网站上查询保修期限{int status;                          //存放返回值byte[] devicenumber = new byte[4];   //4字节设备编号System.out.print("\n1-读取设备编号\n");status = (int) (CLibrary.sdtapi.pcdgetdevicenumber(devicenumber) & 0xff);//& 0xff用于转为无符号行数据System.out.print("结果:");if (status == 0) {CLibrary.sdtapi.idr_beep(38);System.out.print("读取成功!设备编号为:" + (devicenumber[0] & 0xff) + "-" + (devicenumber[1] & 0xff) + "-" + (devicenumber[2] & 0xff) + "-" + (devicenumber[3] & 0xff));} else {PrintErrInf(status);   //错误代码提示}}else if (args[0].equals("2"))            //读取设备编号,直接输出字符串{System.out.print("\n2-读取设备编号\n");String statustr = CLibrary.sdtapi.pcdgetdevicenumber_str().trim();   //设备编号if(statustr.length()==10) {CLibrary.sdtapi.idr_beep(38);System.out.print("读取成功!设备编号为:" + statustr + "\n");}else{PrintErrStr(statustr);   //错误字符串代码提示}}else if (args[0].equals("3"))            //轻松读ID卡{int status;                           //存放返回值byte[] mypiccserial  = new byte[5];   //5字节卡序列号System.out.print("\n3-轻松读卡\n");status = (int) (CLibrary.sdtapi.idr_read(mypiccserial ) & 0xff);          //只要卡在感应区,每次执行此方法都可以读到卡号System.out.print("结果:");if (status == 0) {CLibrary.sdtapi.idr_beep(38);String serialnumber = "";for (int i = 0; i < 5; i++) {String bytestr = "00" + Integer.toHexString(mypiccserial[i] & 0xff);serialnumber = serialnumber + bytestr.substring(bytestr.length() - 2, bytestr.length());}System.out.print("读取成功!16进制卡序列号为:" + serialnumber+"\n");long cardnum;cardnum=mypiccserial[4] & 0xff;cardnum=cardnum+(mypiccserial[3] & 0xff) *256;cardnum=cardnum+(mypiccserial[2] & 0xff) *65536;cardnum=cardnum+(mypiccserial[1] & 0xff) *16777216;long cardno10 = 0;for (int j=28; j>=0; j-=4) {cardno10 = cardno10<<4 | (cardnum>>>j & 0xF);}System.out.print("换算成10进制卡号:"+String.format("%010d", cardno10)+"\n");} else {PrintErrInf(status);   //错误代码提示}}else if (args[0].equals("4"))            //轻松读HID卡{int status;                           //存放返回值byte[] mypiccserial  = new byte[7];   //7字节卡序列号System.out.print("\n4-轻松读HID卡\n");status = (int) (CLibrary.sdtapi.hid_read(mypiccserial ) & 0xff);System.out.print("结果:");if (status == 0) {CLibrary.sdtapi.idr_beep(38);String serialnumber = "";for (int i = 0; i < 7; i++) {String bytestr = "00" + Integer.toHexString(mypiccserial[i] & 0xff);serialnumber = serialnumber + bytestr.substring(bytestr.length() - 2, bytestr.length());}System.out.print("读取成功!16进制卡序列号为:" + serialnumber+"\n");long cardnum;cardnum=mypiccserial[6] & 0xff;cardnum=cardnum+(mypiccserial[5] & 0xff) *256;cardnum=cardnum+(mypiccserial[4] & 0xff) *65536;cardnum=cardnum+(mypiccserial[3] & 0xff) *16777216;long cardno10 = 0;for (int j=28; j>=0; j-=4) {cardno10 = cardno10<<4 | (cardnum>>>j & 0xF);}System.out.print("换算成8H10D卡号:"+String.format("%010d", cardno10)+"\n");} else {PrintErrInf(status);   //错误代码提示}}else if (args[0].equals("5"))            //读ID卡,输出十位十进制卡号{System.out.print("\n5-读10进制ID卡号\n");String statustr = CLibrary.sdtapi.idr_read_8h10d_str().trim();        //只要卡在感应区,每次执行此方法都可以读到卡号if(statustr.length()==10) {CLibrary.sdtapi.idr_beep(38);System.out.print("读卡成功!8H10D卡号为:" + statustr + "\n");}else{PrintErrStr(statustr);   //错误字符串代码提示}}else if (args[0].equals("6"))            //读T5557卡{System.out.print("\n6-读t5557卡\n");byte status;                         //存放返回值byte myctrlword=0;                   //控制字byte[] oldpicckey=new byte[4];       //认证密钥byte[] mypiccserial=new byte[6];     //卡UID序列号byte[] mypiccdata=new byte[100];      //读卡数据缓冲:卡无线转输分频比、卡内容长度(字节数),及最多返回12个块的数据byte[] mypiccblockflag=new  byte[2]; //指定本次操作的块boolean withkey=false;               //是否要认证卡密钥boolean thiscarduit =false;          //是否只操作指定UID序号的卡if (withkey){  //本次操作需要密码验证,将认证密钥加入oldpicckeymyctrlword=(byte)(myctrlword+NEEDKEY);String Keyhexstr="12345678";     //认证密钥for(int i=0;i<4;i++){oldpicckey[i]=(byte)Integer.parseInt(Keyhexstr.substring(i*2,(i+1)*2),16);}}if(thiscarduit){  //本次只操作指定UID号的卡,mypiccserialmyctrlword=(byte)(myctrlword+NEEDSERIAL);String Uidhexstr="000000000000";   //卡片uidfor(int i=0;i<6;i++){mypiccserial[i]=(byte)Integer.parseInt(Uidhexstr.substring(i*2,(i+1)*2),16);}}String Seleblockstr0="11111111";  //第0页每块选取状态,从左到右依次表示第7、6、5、4、3、2、1、0块是否要操作,取1表示该块要读,取0表示该块不读,如要读0、1、3 块取值为 00001011,读第0页全部块为 11111111String Seleblockstr1="11110";     //第1页每块选取状态,从左到右依次表示第3、2、1、0块是否要操作,取1表示该块要读,取0表示该块不读,该页总计4块,最右边表示页选取值0mypiccblockflag[0]=(byte)Integer.parseInt(Seleblockstr0,2);mypiccblockflag[1]=(byte)Integer.parseInt(Seleblockstr1,2);status = CLibrary.sdtapi.t5557_read(myctrlword,mypiccserial,oldpicckey,mypiccblockflag,mypiccdata);if(status == 0) {CLibrary.sdtapi.idr_beep(38);String cardnohex="";for (int i=0;i<6;i++){String bytestr = "00" + Integer.toHexString(mypiccserial[i] & 0xff);cardnohex = cardnohex + bytestr.substring(bytestr.length() - 2, bytestr.length()) ;}System.out.print("读卡成功,16进制卡序列号:"+cardnohex+"\n");System.out.print("卡无线转输分频比:"+Integer.toString(mypiccdata[0])+"\n");if(mypiccdata[1]>0) {String blockdata = "块内数据:";for (int i = 0; i < mypiccdata[1]; i++) {String bytestr = "00" + Integer.toHexString(mypiccdata[2 + i] & 0xff);blockdata = blockdata + bytestr.substring(bytestr.length() - 2, bytestr.length()) + " ";}System.out.print(blockdata+"\n");}}else {PrintErrInf(status);   //错误代码提示}}else if (args[0].equals("7"))            //写T5557卡{System.out.print("\n7-写t5557卡块\n");byte status;                         //存放返回值byte myctrlword=0;                   //控制字byte[] oldpicckey=new byte[4];       //认证密钥byte[] mypiccserial=new byte[6];     //卡UID序列号byte[] mypiccdata=new byte[50];      //读卡数据缓冲:卡无线转输分频比、卡内容长度(字节数),及最多返回12个块的数据byte[] mypiccblockflag=new  byte[2]; //指定本次操作的块boolean withkey=false;               //是否要认证卡密钥boolean thiscarduit =false;          //是否只操作指定UID序号的卡if (withkey){  //本次操作需要密码验证,将认证密钥加入oldpicckeymyctrlword=(byte)(myctrlword+NEEDKEY);String Keyhexstr="12345678";     //认证密钥for(int i=0;i<4;i++){oldpicckey[i]=(byte)Integer.parseInt(Keyhexstr.substring(i*2,(i+1)*2),16);}}if(thiscarduit){  //本次只操作指定UID号的卡,mypiccserialmyctrlword=(byte)(myctrlword+NEEDSERIAL);String Uidhexstr="000000000000";   //卡片uidfor(int i=0;i<6;i++){mypiccserial[i]=(byte)Integer.parseInt(Uidhexstr.substring(i*2,(i+1)*2),16);}}String Seleblockstr0="11111110";  //第0页每块选取状态,从左到右依次表示第7、6、5、4、3、2、1、0块是否要操作,取1表示该块要写,取0表示该块不写,如要写1、3 块取值为 00001010,第0块是配置块不能用此功能写入,如开启了密码功能,第7块为密码块也不能用此功能写String Seleblockstr1="00000";    //第1页每块选取状态,此页只读不可写,mypiccblockflag[0]=(byte)Integer.parseInt(Seleblockstr0,2);mypiccblockflag[1]=(byte)Integer.parseInt(Seleblockstr1,2);String writedatahex="11111111222222223333333344444444555555556666666677777777";   //写入的数据,实际写入数据的块 由mypiccblockflag值决定for (int i=0;i<28;i++){mypiccdata[i]=(byte)Integer.parseInt(writedatahex.substring(i*2,(i+1)*2),16);}status = CLibrary.sdtapi.t5557_write(myctrlword,mypiccserial,oldpicckey,mypiccblockflag,mypiccdata);if(status == 0) {CLibrary.sdtapi.idr_beep(38);String cardnohex = "";for (int i = 0; i < 6; i++) {String bytestr = "00" + Integer.toHexString(mypiccserial[i] & 0xff);cardnohex = cardnohex + bytestr.substring(bytestr.length() - 2, bytestr.length());}System.out.print("写卡成功,16进制卡序列号:" + cardnohex + "\n");}else {PrintErrInf(status);   //错误代码提示}}else if (args[0].equals("8"))            //写T5557卡配置块{System.out.print("\n8-写t5557卡配置块\n");byte status;                         //存放返回值byte myctrlword=0;                   //控制字byte[] oldpicckey=new byte[4];       //认证密钥byte[] newpicckey=new byte[4];       //卡片新密钥byte[] mypiccserial=new byte[6];     //卡UID序列号byte[] configdata=new byte[4];       //配置值boolean withkey=false;               //是否要认证卡密钥boolean newkeyEn=false;              //是否要开启卡片密钥功能if (withkey){  //本次操作需要密码验证,将认证密钥加入oldpicckeymyctrlword=(byte)(myctrlword+NEEDKEY);String oldKeyhexstr="12345678";     //认证密钥for(int i=0;i<4;i++){oldpicckey[i]=(byte)Integer.parseInt(oldKeyhexstr.substring(i*2,(i+1)*2),16);}}String configdatahex="00088028";  //卡片出厂默认配置值,不同功能配置值不一样,请查询相关资料if (newkeyEn){   //卡片启用密钥保护功能myctrlword=(byte)(myctrlword+KEYENABLE);configdatahex="00088038";     //开启密钥配置值,不同功能配置值不一样,请查询相关资料String newKeyhexstr="12345678";     //新密钥for(int i=0;i<4;i++){newpicckey[i]=(byte)Integer.parseInt(newKeyhexstr.substring(i*2,(i+1)*2),16);}}for (int i=0;i<4;i++){configdata[i]=(byte)Integer.parseInt(configdatahex.substring(i*2,(i+1)*2),16);}status = CLibrary.sdtapi.t5557_init(myctrlword,mypiccserial,oldpicckey,configdata,newpicckey);if(status == 0) {CLibrary.sdtapi.idr_beep(38);String cardnohex = "";for (int i = 0; i < 6; i++) {String bytestr = "00" + Integer.toHexString(mypiccserial[i] & 0xff);cardnohex = cardnohex + bytestr.substring(bytestr.length() - 2, bytestr.length());}System.out.print("写配置块成功,16进制卡序列号:" + cardnohex + "\n");}else {PrintErrInf(status);   //错误代码提示}}else if (args[0].equals("9"))            //修改T5557卡密钥{System.out.print("\n9-修改T5557卡密钥\n");byte status;                         //存放返回值byte myctrlword=0;                   //控制字byte[] oldpicckey=new byte[4];       //认证密钥byte[] newpicckey=new byte[4];       //卡片新密钥byte[] mypiccserial=new byte[6];     //卡UID序列号boolean withkey=true;                //是否要认证卡密钥boolean thiscarduit =false;          //是否只操作指定卡号的卡if (withkey){  //本次操作需要密码验证,将认证密钥加入oldpicckeymyctrlword=(byte)(myctrlword+NEEDKEY);String oldKeyhexstr="12345678";     //认证密钥for(int i=0;i<4;i++){oldpicckey[i]=(byte)Integer.parseInt(oldKeyhexstr.substring(i*2,(i+1)*2),16);}}if(thiscarduit){  //本次只操作指定UID号的卡,mypiccserialmyctrlword=(byte)(myctrlword+NEEDSERIAL);String Uidhexstr="000000000000";   //卡片uidfor(int i=0;i<6;i++){mypiccserial[i]=(byte)Integer.parseInt(Uidhexstr.substring(i*2,(i+1)*2),16);}}String newKeyhexstr="12345678";     //新密钥for(int i=0;i<4;i++){newpicckey[i]=(byte)Integer.parseInt(newKeyhexstr.substring(i*2,(i+1)*2),16);}status = CLibrary.sdtapi.t5557_changekey(myctrlword,mypiccserial,oldpicckey,newpicckey);if(status == 0) {CLibrary.sdtapi.idr_beep(38);String cardnohex = "";for (int i = 0; i < 6; i++) {String bytestr = "00" + Integer.toHexString(mypiccserial[i] & 0xff);cardnohex = cardnohex + bytestr.substring(bytestr.length() - 2, bytestr.length());}System.out.print("修改卡密钥成功,16进制卡序列号:" + cardnohex + "\n");}else {PrintErrInf(status);   //错误代码提示}}}//----------------------------------------------------------------------------------错误字符串代码提示static void PrintErrStr(String Errstr){if(Errstr.equals("ER08")){System.out.print("错误代码:ER08,未寻到卡,请重新拿开卡后再放到感应区!\n");} else if(Errstr.equals("ER22")){System.out.print("错误代码:ER22,动态库或驱动程序异常!\n");} else if(Errstr.equals("ER23")){System.out.print("错误代码:ER23,驱动程序错误或尚未安装!\n");} else if(Errstr.equals("ER24")){System.out.print("错误代码:ER24,操作超时,一般是动态库没有反映!\n");}else {System.out.print("错误代码:"+Errstr);}}//----------------------------------------------------------------------------------错误代码提示static void PrintErrInf(int errcode) {switch(errcode){case 1:System.out.print("错误代码:1,写入配置的值不正确,请重新写入!\n");break;case 2:System.out.print("错误代码:2,本卡尚未开启密码功能,函数myctrlword中无需加入NEEDKEY!\n");break;case 3:System.out.print("错误代码:3,需要密码才能读卡,函数myctrlword要加入NEEDKEY!\n");break;case 5:System.out.print("错误代码:5,密码错误!\n");break;case 8:System.out.print("错误代码:8,未寻到卡,请重新拿开卡后再放到感应区!\n");break;case 21:System.out.print("错误代码:21,没有动态库!\n");break;case 22:System.out.print("错误代码:22,动态库或驱动程序异常!\n");break;case 23:System.out.print("错误代码:23,驱动程序错误或尚未安装!\n");break;case 24:System.out.print("错误代码:24,操作超时,一般是动态库没有反映!\n");break;case 25:System.out.print("错误代码:25,发送字数不够!\n");break;case 26:System.out.print("错误代码:26,发送的CRC错!\n");break;case 27:System.out.print("错误代码:27,接收的字数不够!\n");break;case 28:System.out.print("错误代码:28,接收的CRC错!\n");break;default:System.out.print("未知错误,错误代码:"+Integer.toString(errcode)+"\n");break;}}
}

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

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

相关文章

完善kset_uevent_ops结构体

1、struct kset_uevent_ops 2、实验 #include<linux/module.h> #include<linux/init.h>

win10删除鼠标右键选项-360工具

鼠标右键菜单时&#xff0c;发现里面的选项特别多&#xff0c;找一下属性&#xff0c;半天找不到。删除一些不常用的选项&#xff0c;让右键菜单变得干净整洁。 1、打开360安全卫士&#xff0c;点击功能大全&#xff0c;搜索"右键管理" 2、点击右键管理 3、找到对应的…

SpringCache介绍

SpringCache是Spring提供的缓存框架。提供了基于注解的缓存功能。 SpringCache提供了一层抽象&#xff0c;底层可以切换不同的缓存实现&#xff08;只需要导入不同的Jar包即可&#xff09;&#xff0c;如EHCache&#xff0c;Caffeine&#xff0c;Redis。 2个重要依赖已经导入&a…

C++ 高精度时钟获取当前时间 std::chrono::high_resolution_clock::now

C 高精度时钟获取当前时间 std::chrono::high_resolution_clock::now 1. std::chrono::high_resolution_clock::now1.1. Parameters1.2. Return value1.3. Example 2. std::chrono::milliseconds3. std::chrono::microseconds3.1. Example References 1. std::chrono::high_res…

OpenCV 棋盘格相机标定(保姆版)

目录 一、概述 1.1标定原理 1.2实现步骤 1.3应用场景 二、代码 2.1 cv2.calibrateCamera函数 2.1.1输入参数 2.1.2输出参数 2.2完整代码 三、实现效果 3.1处理图像 3.2内参与畸变系数 一、概述 使用 OpenCV 进行相机标定&#xff0c;通常需要拍摄多张包含棋盘格标定…

第一次参加数学建模竞赛新手小白备赛经验贴

2024年暑假已经来临&#xff0c;下半年的数学建模竞赛非常多&#xff0c;许多同学可能是第一次参赛&#xff0c;对于如何准备感到迷茫和无从下手。在这种情况下&#xff0c;我们将分享一些备赛的小技巧&#xff0c;帮助大家在这个暑假更好的入门&#xff0c;即便是零基础的小白…

Python面试宝典第14题:背包问题

题目 现有编号从 0 到 n - 1 的 n 个背包&#xff0c;给你两个下标从 0 开始的整数数组 capacity 和 rocks 。第 i 个背包最大可以装 capacity[i] 块石头&#xff0c;当前已经装了 rocks[i] 块石头&#xff08;0 < rocks[i] < capacity[i]&#xff09;。另给你一个整数 a…

牛客周赛 Round 51 (C++)

目录 A-小红的同余_牛客周赛 Round 51 (nowcoder.com) 思路&#xff1a; 代码&#xff1a; B-小红的三倍数_牛客周赛 Round 51 (nowcoder.com) 思路&#xff1a; 代码&#xff1a; C-小红充电_牛客周赛 Round 51 (nowcoder.com) 思路&#xff1a; 代码&#xff1a; …

SHOT(方向直方图)

Salti等人在2014年提出一种表面匹配的局部三维描述子SHOT。Salti等人将现有三维局部特征描述方法分为两类&#xff0c;即基于特征的描述方法与基于直方图的描述方法&#xff0c;并分析了两种方法的优势&#xff0c;提出基于特征的局部特征描述方法要比后者在特征的描述能力上更…

基于视觉工具箱和背景差法的行人检测,行走轨迹跟踪,人员行走习惯统计matlab仿真

目录 1.算法运行效果图预览 2.算法运行软件版本 3.部分核心程序 4.算法理论概述 5.算法完整程序工程 1.算法运行效果图预览 (完整程序运行后无水印) 在三维图中&#xff0c;幅度越大&#xff0c;则表示人员更习惯的行走路线。 2.算法运行软件版本 matlab2022a 3.部分核…

【北京迅为】《i.MX8MM嵌入式Linux开发指南》-第一篇 嵌入式Linux入门篇-第二十九章 NFS服务器的搭建和使用

i.MX8MM处理器采用了先进的14LPCFinFET工艺&#xff0c;提供更快的速度和更高的电源效率;四核Cortex-A53&#xff0c;单核Cortex-M4&#xff0c;多达五个内核 &#xff0c;主频高达1.8GHz&#xff0c;2G DDR4内存、8G EMMC存储。千兆工业级以太网、MIPI-DSI、USB HOST、WIFI/BT…

VS2022配置Qt环境

文章目录 前言VS2022写Qt的好处下载插件前提条件离线下载在线安装配置VS For Qt 创建项目总结 前言 在许多开发环境中&#xff0c;Visual Studio 2022&#xff08;VS2022&#xff09;和Qt都是非常重要的工具。VS2022是微软开发的一款强大的集成开发环境&#xff08;IDE&#x…

前缀和算法——部分OJ题详解

&#xff08;文章的题目解释可能存在一些问题&#xff0c;欢迎各位小伙伴私信或评论指点&#xff08;双手合十&#xff09;&#xff09; 关于前缀和算法 前缀和算法解决的是“快速得出一个连续区间的和”&#xff0c;以前求区间和的时间复杂度是O(N)&#xff0c;使用前缀和可…

STM32智能农业灌溉系统教程

目录 引言环境准备智能农业灌溉系统基础代码实现&#xff1a;实现智能农业灌溉系统 4.1 数据采集模块 4.2 数据处理与决策模块 4.3 通信与网络系统实现 4.4 用户界面与数据可视化应用场景&#xff1a;农业灌溉管理与优化问题解决方案与优化收尾与总结 1. 引言 智能农业灌溉系…

react基础样式控制

行内样式 <div style{{width:500px, height:300px,background:#ccc,margin:200px auto}}>文本</div> class类名 注意&#xff1a;在react中使用class类名必须使用className 在外部src下新建index.css文件写入你的样式 .fontcolor{color:red } 在用到的页面引入…

基于springboot和mybatis的RealWorld后端项目实战二之实现tag接口

修改pom.xml 新增tag数据表 SET FOREIGN_KEY_CHECKS0;-- ---------------------------- -- Table structure for tags -- ---------------------------- DROP TABLE IF EXISTS tags; CREATE TABLE tags (id bigint(20) NOT NULL AUTO_INCREMENT,name varchar(255) NOT NULL,PR…

IP地址定位与智慧城市和智能交通

智慧城市和智能交通是现代城市发展的关键领域&#xff0c;通过先进技术提升城市管理和居民生活质量。IP地址定位在交通监控、智能路灯管理等方面发挥了重要作用&#xff0c;本文将深入探讨其技术实现及应用。 交通监控与优化 通过IP地址连接交通传感器和摄像头&#xff0c;可…

Hive 函数

分类 Hive 的函数分为两大类&#xff1a;内置函数&#xff08;Built-in-Functions&#xff09;、用户自定义函数&#xff08;User-Defined-Functions&#xff09;&#xff1b;内置函数可分为&#xff1a;数值类型函数、日期类型函数、字符串类型函数、集合函数等&#xff1b;用…

使用llama.cpp量化模型

文章目录 概要整体实验流程技术细节小结 概要 大模型量化是指在保持模型性能尽可能不变的情况下&#xff0c;通过减少模型参数的位数来降低模型的计算和存储成本。本次实验环境为魔搭社区提供的免费GPU环境&#xff08;24G&#xff09;&#xff0c;使用Llama.cpp进行4bit量化可…

行业模板|DataEase物业管理大屏模板推荐

DataEase开源数据可视化分析工具于2022年6月发布模板市场&#xff08;https://templates-de.fit2cloud.com&#xff09;&#xff0c;并于2024年1月新增适用于DataEase v2版本的模板分类。模板市场旨在为DataEase用户提供专业、美观、拿来即用的大屏模板&#xff0c;方便用户根据…