javaSwing酒店管理系統

一、 使用方法:

在使用前,需要到druid.properties 配置文件中,修改自己對應于自己數據庫的屬性;如用戶名,密碼等

driverClassName=com.mysql.cj.jdbc.Driver
url=jdbc:mysql:///hotel?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC
username=root
password=123456
# 初始化連接數量
initialSize=5
# 最大連接數
maxActive=10
# 最大等待時間
maxWait=3000

注意:如果是保持數據庫連接異常,則說明數據庫和jar包版本匹配了,注意升級數據庫jar包版本;

二、項目介紹

  1. 本項目主要是基于Swing框架搭建的java桌面應用程序 在項目中主要實現的功能有:

1.開始界面

  • 開始界面為動態代碼雨的歡迎效果
    在這里插入圖片描述

2.注冊界面

  • 注冊界面。實現了驗證碼的生成和驗證,以及出生日期的日歷控件化的選擇,當用戶注冊成功后,用戶名密碼就會通過方法傳到登錄界面從而避免了用戶第二次填賬號密碼的麻煩

    在這里插入圖片描述

3.分角色登錄

  • 登錄主要分為管理員登錄和用戶登錄,管理員登錄后有

    • 客房管理功能:這個功能主要實現了對房間的增刪改查,以及查看對應房間的評論等;涉及到了多對多的查詢

在這里插入圖片描述

4.用戶管理

  • 用戶管理功能:主要的增刪改查操作,點擊對應的用戶右邊小框框展示用戶的頭像

在這里插入圖片描述

5.訂單管理

  • 訂單管理功能:在這里會展示用戶的全部訂單,通過多對多的查詢展示用戶的訂房信息等;已經對用戶的一些信息進行統計;主要用到了ifreechart 框架進行繪制表格

在這里插入圖片描述

6.客房服務

  • 客房服務功能:就是給房間添加一些新的設備以及多張配圖,方便用戶瀏覽

在這里插入圖片描述

7.歷史記錄

  • 歷史記錄:主要記錄用戶的訂房退房記錄,實現這個功能主要用到mysql的觸發器,通過觸發器,沒刪除一個訂單,就將對于的訂單保存到歷史記錄表里邊;最后導出表格,而我導出的表格用csv文件逗號陣列,比較方便生成

在這里插入圖片描述

8.管理員登錄

  • 管理員管理,主要是設置權限的1位超級管理員0 為普通管理員

     ![在這里插入圖片描述](https://img-blog.csdnimg.cn/direct/d88c15305f3149caba1e5e256299300d.png)
    
    • 在退出前會有監聽事件,會詢問用戶是否最小化托盤,如果最小化托盤則項目已經在運行中

    • 在登錄前,由于想模仿QQ登錄功能輸入對應的賬號顯示不同的頭像,最后添加了鍵盤監聽功能和數據庫查詢,所以剛開始會有點卡

9.查看房間

  • 用戶登錄功能

    • 用戶登錄后,可以查看房間和其各種資料;

      在這里插入圖片描述

10.點評房間

  • 用戶也可以點評房間

    在這里插入圖片描述

11.充值界面

  • 用戶可以對客房進行預訂,如果金額不足之前則需要用戶進行充值

    • 而充值界面需要用戶點擊我的頭像那里進入個人信息頁面

    在這里插入圖片描述

  • 用戶個人信息還有評論記錄都可以在個人信息這里修改刪除等

三、文件夾目錄說明

image    主要用于保存項目中用到的圖片文件的
lib      主要用于保存用項目中用到jar包
sql      整個項目運行的數據和數據庫表
src      全部源碼com.ludashen.control  主要保存各種自定義的控件的com.ludashen.dao      數據庫交互代碼com.ludashen.frame    用戶交互界面代碼com.ludashen.hothl    模型對象類com.ludashen.panel    面板容器
resource  資源文件,圖片等
druid.properties 數據庫配置文件

四、 代碼

1.runFrame

package com.ludashen.frame;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;public class RunFrame extends JDialog implements ActionListener {private int gi=0;private Random random = new Random();private Dimension screenSize;private JPanel graphicsPanel;private final static int gap = 20;//存放雨點頂部的位置信息(marginTop)private int[] posArr;//行數private int lines;//列數private int columns;public RunFrame() {initComponents();}private void initComponents() {setLayout(new BorderLayout());graphicsPanel = new GraphicsPanel();add(graphicsPanel, BorderLayout.CENTER);this.setUndecorated(true);setSize(500,400);setLocationRelativeTo(null);this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);setVisible(true);screenSize = Toolkit.getDefaultToolkit().getScreenSize();lines = screenSize.height / gap;columns = screenSize.width / gap;posArr = new int[columns + 1];random = new Random();for (int i = 0; i < posArr.length; i++) {posArr[i] = random.nextInt(lines);}new Timer(120, this).start();}private int getChr() {return random.nextInt(10);}//定時器的@Overridepublic void actionPerformed(ActionEvent e) {graphicsPanel.repaint();}private class GraphicsPanel extends JPanel {@Overridepublic void paint(Graphics g) {Graphics2D g2d = (Graphics2D) g;g2d.setFont(getFont().deriveFont(Font.BOLD));g2d.setColor(Color.BLACK);g2d.fillRect(0, 0, screenSize.width, screenSize.height);//當前列int currentColumn = 0;for (int x = 0; x < screenSize.width; x += gap) {int endPos = posArr[currentColumn];g2d.setColor(Color.CYAN);g2d.drawString(String.valueOf(getChr()), x, endPos * gap);int cg = 0;for (int j = endPos - 15; j < endPos; j++) {//顏色漸變cg += 20;if (cg > 255) {cg = 255;}g2d.setColor(new Color(0, cg, 0));g2d.drawString(String.valueOf(getChr()), x, j * gap);}//每放完一幀,當前列上雨點的位置隨機下移1~5行posArr[currentColumn] += random.nextInt(5);//當雨點位置超過屏幕高度時,重新產生一個隨機位置if (posArr[currentColumn] * gap > getHeight()) {posArr[currentColumn] = random.nextInt(lines);}currentColumn++;}if(gi>6){g2d.setFont(new Font("italicc",3,25));g2d.setColor(Color.WHITE);g2d.drawString("歡迎使用酒店管理系統", getWidth()/2-100, getHeight()/2);}if(gi++>25){dispose();new LoginFrame().setVisible(true);}}}public static void main(String[] args) {new RunFrame();}
}

2.UserFrame

package com.ludashen.frame;import com.ludashen.control.*;import com.ludashen.dao.CommentDao;
import com.ludashen.dao.HouseDao;
import com.ludashen.dao.RoomInfoDao;
import com.ludashen.dao.UserDao;
import com.ludashen.hothl.Comment;
import com.ludashen.hothl.House;
import com.ludashen.hothl.RoomInfo;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.util.ArrayList;
import java.util.List;
import java.util.Map;public class UserFrame extends JFrame {private Map<String, Object> userInfo;//保存用戶信息的private JMenuBar menuBar;private JLabel title,img;   //選中列表顯示房子標題和圖片private JTextPane tDetails;     //客房詳情private JTextPane tComment;     //顧客點評private List<House> house;private int hid;    //用于記錄房子id的private String detail;  //記錄房子詳情的private JList buddyList;    //列表信息private int choose; //獲取當前選擇的列private List<String> image=new ArrayList<>();//用于放當前房間的片private int index;//記錄當前放到那張照片了public UserFrame(String uid){//構造函數根據登錄id查找用戶信息super("酒店管理系統");try {userInfo= UserDao.users(uid);}catch (Exception e){JOptionPane.showMessageDialog(null,"沒有這個用戶請重新登錄");System.exit(0);}setTitle("酒店系統----"+userInfo.get("uName")+"在線");init();}private void init() {setResizable(false);//設置標題圖標setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/resource/log.png")));title= new JLabel();img=new JLabel();tDetails=new JTextPane();tComment=new JTextPane();tComment.setEnabled(false);tDetails.setEnabled(false);tDetails.setBackground(new Color(0x134FAE));addWindowListener(new WindowAdapter() {@Overridepublic void windowClosing(WindowEvent e) {super.windowClosing(e);if (JOptionPane.showConfirmDialog(null, "是否最小化托盤") != 0) {System.exit(0);}}});tDetails.setContentType("text/html");tComment.setContentType("text/html");title.setFont(new Font("",1,30));topBar();Tool.SystemTrayInitial(this);this.add(mainPanel());this.setSize(900,750);this.setLocationRelativeTo(null);}private JPanel mainPanel(){JPanel p=new JPanel(null);JPanel panel = new JPanel();tDetails.setOpaque(false);RScrollPane details=new RScrollPane(tDetails,"/resource/bg1.jpg");panel.setLayout(new BorderLayout());JPanel p2=new JPanel(new BorderLayout());JTextField field=new JTextField(50);field.setSize(500,30);RButton send=new RButton("發送");p2.add(field,BorderLayout.WEST);p2.add(send,BorderLayout.EAST);panel.add(p2, BorderLayout.SOUTH);tComment.setOpaque(false);RScrollPane comment=new RScrollPane(tComment,"/resource/bg1.jpg");panel.add(comment, BorderLayout.CENTER);JTabbedPane jTabbedPane =Tool.jTabbedPane(235,450,p,640,215);jTabbedPane.setTabPlacement(1);Tool.Tabp(jTabbedPane,"酒店詳情", "/resource/tabp/applicatio.png",details, "詳情");Tool.Tabp(jTabbedPane,"點評列表", "/resource/tabp/Comment.png", panel, "列表");RButton ding=Tool.rButton(800,5,"預定",p,80);title.setBounds(240,5,260,45);img.setBounds(240,50,630,400);p.add(Tool.getFunButton(500, 10, "/resource/button/back1.png", "/resource/button/back2.png", e->{setBackImage();}));p.add(Tool.getFunButton(600, 10, "/resource/button/next1.png", "/resource/button/next2.png", e -> {setNetImage();}));RButton refresh=Tool.rButton(0,633,"刷新",p,235);send.addActionListener(e->{Comment comment1=new Comment((String) userInfo.get("uid"),String.valueOf(hid),field.getText());if(CommentDao.setCommentDao(comment1)) {tComment.setText(commentDao());JOptionPane.showMessageDialog(null,"評論成功!");field.setText("");}});ding.addActionListener(e ->{new YudingDialog(house.get(choose).getHid(),(String) userInfo.get("uid"),(Float) userInfo.get("money")).setVisible(true);});refresh.addActionListener(e -> {reRoom();});p.add(img);p.add(title);p.add(listRoom());p.add(refresh);return p;}private JScrollPane listRoom(){buddyList = new JList();buddyList.setOpaque(false);reRoom();if(house.size()!=0){img.setIcon(new ImageIcon((Image) new ImageIcon("image\\room\\"+house.get(0).gethImg()).getImage().getScaledInstance(630, 400,Image.SCALE_DEFAULT )));title.setText(house.get(0).gethName());image.add(house.get(0).gethImg());hid=house.get(0).getHid();detail= "<html><h2>詳情:"+house.get(0).gethDetails()+"</h2>"+roomInfo()+"</html>";tDetails.setText(detail);choose=0;}else {tDetails.setText("<h1>沒有空房間</h1>");}buddyList.addListSelectionListener(e -> {if(buddyList.getValueIsAdjusting())try {img.setIcon(new ImageIcon((Image) new ImageIcon("image\\room\\"+house.get(buddyList.getSelectedIndex()).gethImg()).getImage().getScaledInstance(630, 400,Image.SCALE_DEFAULT )));    //設置JLable的圖片image.clear();index=0;image.add(house.get(buddyList.getSelectedIndex()).gethImg());hid=house.get(buddyList.getSelectedIndex()).getHid();detail= "<html><h2>詳情:"+house.get(buddyList.getSelectedIndex()).gethDetails()+"</h2>"+roomInfo()+"</html>";title.setText(house.get(buddyList.getSelectedIndex()).gethName());tDetails.setText(detail);tComment.setText(commentDao());choose=buddyList.getSelectedIndex();for (RoomInfo imgs:RoomInfoDao.getRoomInfo(hid,3)){image.add(imgs.getFuntion());}}catch (Exception e1){buddyList.clearSelection();}});buddyList.setCellRenderer(new FriListCellRenderer());buddyList.setFont(new Font(Font.SERIF, Font.PLAIN, 18));buddyList.setPreferredSize(new Dimension(230, 72*house.size()));RScrollPane jp = new RScrollPane(buddyList,"");jp.setBounds(0,0,233,630);return jp;}private void setNetImage() {if(index==image.size()-1) {JOptionPane.showMessageDialog(null,"已經是最后一張了");return;}elseindex++;img.setIcon(new ImageIcon((Image) new ImageIcon("image\\room\\"+image.get(index)).getImage().getScaledInstance(630, 400,Image.SCALE_DEFAULT )));}private void setBackImage(){if(index==0) {JOptionPane.showMessageDialog(null,"已經是第一張了");return;}index--;img.setIcon(new ImageIcon((Image) new ImageIcon("image\\room\\"+image.get(index)).getImage().getScaledInstance(630, 400,Image.SCALE_DEFAULT )));}public void reRoom(){house= HouseDao.getHouser(2);HouseModel buddy = new HouseModel(house);buddyList.setModel(buddy);}private String roomInfo(){List<RoomInfo> roomInfo =RoomInfoDao.getRoomInfo(hid,1);StringBuffer str=new StringBuffer();for(RoomInfo info:roomInfo){str.append("<p>"+info.getName()+":");str.append(info.getFuntion()+"</p>");}return str.toString();}private String commentDao(){int a=0;List<Comment> comments= CommentDao.getRoomComment(String.valueOf(hid),1);StringBuffer str=new StringBuffer();str.append("<html>");for (Comment comment:comments){if(a%2==0) {str.append("<div style='background-color:#3333CC;'><span style='font-size: 20px'>");str.append(comment.getUid() + "</span><br>");str.append(comment.getComment() + "<br>" + comment.getDate());str.append("<br></div>");}else {str.append("<div  style='background-color:#3300FF;'><span style='font-size: 20px'>");str.append(comment.getUid() + "</span><br>");str.append(comment.getComment() + "<br>" + comment.getDate());str.append("<br></div>");}a++;}if (comments.size()==0)str.append("占時沒有評論");str.append("</table></html>");return str.toString();}private void topBar() {menuBar = new JMenuBar();menuBar.setLayout(null);JButton head=new CircleButton(40,(String)userInfo.get("head"));head.setBounds(840, 0, 40, 40);head.addMouseListener(new MouseAdapter() {@Overridepublic void mouseClicked(MouseEvent e) {super.mouseClicked(e);new UserInfoDialog(userInfo).setVisible(true);}});JMenu menu = new JMenu("酒店");menu.setBounds(0,0,80,30);JMenuItem zmenu = new JMenuItem("酒店簡介");zmenu.addActionListener(e->{IntroduceDialog introduceDialog = new IntroduceDialog();introduceDialog.setVisible(true);new Thread(introduceDialog).start();});menu.add(zmenu);menuBar.add(head);menuBar.add(menu);menuBar.setPreferredSize(new Dimension(300, 40));setJMenuBar(menuBar);}
}

3.loginFrame

package com.ludashen.frame;import com.ludashen.control.*;
import com.ludashen.dao.AdminDao;
import com.ludashen.dao.ContFile;
import com.ludashen.dao.UserDao;
import jdk.nashorn.internal.scripts.JO;import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
import java.sql.SQLException;public class LoginFrame extends JFrame {private RPanel RP1;private RPanel RP2;private JPanel p;private JTextField userName;private JPasswordField password;private static Boolean isAdmin=false;private JLabel head;ContFile file=new ContFile();public LoginFrame(){super();init();}public static void setAdmin(Boolean b){isAdmin=b;}private void init(){setResizable(false);//設置圖片URL re = getClass().getResource("/resource/log.png");ImageIcon ico =new ImageIcon(re);setIconImage(Toolkit.getDefaultToolkit().getImage(re));//設置標題圖標this.setLayout(null);RP1=new RPanel("/resource/Lmain.png");RP2=new RPanel("/resource/login.png");RP1.setBounds(0,0,600,400);RP2.setBounds(0,400,600,100);RP2.setLayout(null);RP1.setLayout(null);Tool.jLabel(50,40,"賬號:",RP2);Tool.jLabel(280,40,"密碼:",RP2);userName= Tool.jTextField(100, 40, RP2,162);password=Tool.passwordField(330, 40, '*',RP2,159);head=Tool.jLabel(250,150,"",RP1,100,100);userName.addKeyListener(new KeyAdapter() {@Overridepublic void keyReleased(KeyEvent e) {super.keyReleased(e);head.setIcon(new ImageIcon((Image) new ImageIcon("image\\head\\" +UserDao.head(userName.getText())).getImage().getScaledInstance(100, 100,Image.SCALE_DEFAULT )));}});RButton LoginButton=Tool.rButton(500, 39,"登錄",RP2,80);JLabel register=Tool.jLabel(530, 69,"快速注冊",RP2);JLabel set=Tool.jLabel(480, 69, "設置",RP2);setChangColor(register, new MouseAdapter() {@Overridepublic void mouseClicked(MouseEvent e) {super.mouseClicked(e);new Register().setVisible(true);dispose();}});setChangColor(set, new MouseAdapter() {@Overridepublic void mouseClicked(MouseEvent e) {super.mouseClicked(e);new LoginSetDialog().setVisible(true);}});RP1.add(Tool.getFunButton(560, 5, "/resource/close2.png", "/resource/close1.png", e->{System.exit(0);}));RP1.add(Tool.getFunButton(520, 5, "/resource/min1.png", "/resource/min2.png", e -> {setExtendedState(JFrame.ICONIFIED);}));LoginButton.addActionListener(e -> {try {String pass = file.readFile("pass");String[] sp = pass.split("@");String name = userName.getText();String spass = new String(password.getPassword());if (!isAdmin) {if (UserDao.getUser(name, spass)) {if (sp[0].trim().equals("0")) {file.writeFile("pass", "0@" + name + "@" + spass);} else {file.writeFile("pass", "1");}new UserFrame(name).setVisible(true);dispose();} else {JOptionPane.showMessageDialog(null, "您現在正在登陸用戶系統,而用戶密碼或名字錯誤");}} else {if (AdminDao.getAdminLogin(name, spass)) {if (sp[0].trim().equals("0")) {file.writeFile("pass", "0@" + name + "@" + spass);} else {file.writeFile("pass", "1");}new AdminFrame(name).setVisible(true);dispose();} else {JOptionPane.showMessageDialog(null, "您現在正在登陸管理系統,用戶密碼或名字錯誤");}}}catch (Exception e1){
//                new ContFile().writeFile("e.txt",e1.printStackTrace());JOptionPane.showMessageDialog(null,e1.getLocalizedMessage());}});pass();this.add(RP1);this.add(RP2);this.setUndecorated(true);//去掉標題欄this.setSize(600,500);this.setLocationRelativeTo(null);this.setDefaultCloseOperation(3);}private void pass(){String pass=file.readFile("pass");String[] sp=pass.split("@");if(sp[0].trim().equals("0")&&sp.length>1){userName.setText(sp[1]);password.setText(sp[2]);head.setIcon(new ImageIcon((Image) new ImageIcon("image\\head\\" +sp[1]).getImage().getScaledInstance(100, 100,Image.SCALE_DEFAULT )));}}private void setChangColor(JLabel jLabel,MouseListener l){jLabel.addMouseListener(l);jLabel.addMouseListener(new MouseAdapter() {@Overridepublic void mouseEntered(MouseEvent e) {super.mouseEntered(e);jLabel.setForeground(Color.WHITE);}@Overridepublic void mouseExited(MouseEvent e) {super.mouseExited(e);jLabel.setForeground(Color.ORANGE);}});}public void setUser(String name,String pass){userName.setText(name);password.setText(pass);}}

五、聯系與交流

扣:969060742 運行視頻 完整程序資源 sql 程序資源

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/212223.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/212223.shtml
英文地址,請注明出處:http://en.pswp.cn/news/212223.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

midwayjs從零開始創建項目,連接mikro-orm框架(必須有java的springboot基礎)

前言&#xff1a; 我一直都是用java的springboot開發項目&#xff0c;然后進來新公司之后&#xff0c;公司的后端是用node.js&#xff0c;然后框架用的是 midwayjs &#xff0c;然后網上的資料比較少&#xff0c;在此特地記錄一波 文檔&#xff1a; 1.官方文檔&#xff1a;介紹…

vue 前端crypto-js 如何實現加密解密

npm 安裝 crypto-js 引用 import CryptoJS from "crypto-js"; 或者 import CryptoJS from "crypto-js"; //秘鑰 var aesKey "s10dfc3321ba59abbe123057f20f883e"; //將秘鑰轉換成Utf8字節數組 var key CryptoJS.enc.Utf8.parse(aesKey); /…

Spring Boot 3.0 : 集成flyway數據庫版本控制工具

目錄 Spring Boot 3.0 : 集成flyway數據庫版本控制工具flyway是什么為什么使用flyway主要特性支持的數據庫&#xff1a; flyway如何使用spring boot 集成實現引入依賴配置sql版本控制約定3種版本類型 運行SpringFlyway 8.2.1及以后版本不再支持MySQL&#xff1f; 個人主頁: 【?…

常見web漏洞的流量分析

常見web漏洞的流量分析 文章目錄 常見web漏洞的流量分析工具sql注入的流量分析XSS注入的流量分析文件上傳漏洞流量分析文件包含漏洞流量分析文件讀取漏洞流量分析ssrf流量分析shiro反序列化流量分析jwt流量分析暴力破解流量分析命令執行流量分析反彈shell 工具 攻擊機受害機wi…

Unity DOTS中的baking(一) Baker簡介

Unity DOTS中的baking&#xff08;一&#xff09; Baker簡介 baking是DOTS ECS工作流的一環&#xff0c;大概的意思就是將原先Editor下的GameObject數據&#xff0c;全部轉換為Entity數據的過程。baking是一個不可逆的過程&#xff0c;原先的GameObject在運行時不復存在&#x…

leetcode 股票DP系列 總結篇

121. 買賣股票的最佳時機 你只能選擇 某一天 買入這只股票&#xff0c;并選擇在 未來的某一個不同的日子 賣出該股票。 只能進行一次交易 很簡單&#xff0c;只需邊遍歷邊記錄最小值即可。 class Solution { public:int maxProfit(vector<int>& prices) {int res …

Vue-安裝及安裝vscode相應插件

安裝Vue 安裝nodejs&#xff0c; 地址&#xff1a;https://nodejs.org/en 下載后直接安裝。 安裝后重新打開命令行工具&#xff0c;輸入 node -v PS C:\Users\zcl36> node -v v20.10.0 2. 安裝vue包npm install -g vue/cli安裝之后&#xff0c;你就可以在命令行中訪問 vue…

【git】關于git二三事

文章目錄 前言一、創建版本庫1.通過命令 git init 把這個目錄變成git可以管理的倉庫2.將修改的內容添加到版本庫2.1 git add .2.2 git commit -m "Xxxx"2.3 git status 2.4 git diff readme.txt3.版本回退3.1 git log3.2 git reset --hard HEAD^ 二、理解工作區與暫存…

操作系統內部機制學習

切換線程時需要保存什么 函數需要保存嗎&#xff1f;函數在Flash上&#xff0c;不會被破壞&#xff0c;無需保存。函數執行到了哪里&#xff1f;需要保存嗎&#xff1f;需要保存。全局變量需要保存嗎&#xff1f;全局變量在內存上&#xff0c;無需保存。局部變量需要保存嗎&am…

Leetcode—337.打家劫舍III【中等】

2023每日刷題&#xff08;五十二&#xff09; Leetcode—337.打家劫舍III 算法思想 實現代碼 /*** Definition for a binary tree node.* struct TreeNode {* int val;* TreeNode *left;* TreeNode *right;* TreeNode() : val(0), left(nullptr), right(null…

I.MX6ULL_Linux_驅動篇(46)linux LCD驅動

LCD 是很常用的一個外設&#xff0c;在Linux 下LCD 的使用更加廣泛&#xff0c;在搭配 QT 這樣的 GUI 庫下可以制作出非常精美的 UI 界面。本章我們就來學習一下如何在 Linux 下驅動 LCD 屏幕。 Linux 下 LCD 驅動簡析 Framebuffer 設備 先來回顧一下裸機的時候 LCD 驅動是怎…

前端入門:HTML初級指南,網頁的簡單實現!

代碼部分&#xff1a; <!DOCTYPE html> <!-- 上方為DOCTYPE聲明&#xff0c;指定文檔類型為HTML --> <html lang"en"> <!-- html標簽為整個頁面的根元素 --> <head> <!-- title標簽用于定義文檔標題 --> <title>初始HT…

單點登錄方案調研與實現

作用 在一個系統登錄后&#xff0c;其他系統也能共享該登錄狀態&#xff0c;無需重新登錄。 演進 cookie → session → token →單點登錄 Cookie 可以實現瀏覽器和服務器狀態的記錄&#xff0c;但Cookie會出現存儲體積過大和可以在前后端修改的問題 Session 為了解決Co…

【其他數學】結式 resultant

結式 resultant 2023年11月30日 #analysis 文章目錄 結式 resultant介紹Sylvester矩陣應用在消元中的應用傳遞函數的化簡 下鏈 介紹 結式用來計算曲線的交點、消元、找參數化曲線的隱含方程。 為了引出定義&#xff0c;思考如下問題&#xff1a; f ( x ) x 2 ? 5 x 6 g (…

UVM建造測試用例

&#xff08;1&#xff09;加入base_test 在一個實際應用的UVM驗證平臺中&#xff0c;my_env并不是樹根&#xff0c;通常來說&#xff0c;樹根是一個基于uvm_test派生的類。真正的測試用例都是基于base_test派生的一個類。 class base_test extends uvm_test;my_env e…

14-2(C++11)類型推導、類型計算

14-2&#xff08;C11&#xff09;類型推導、類型計算 類型推導auto關鍵字auto類型推斷本質auto與引用 聯用auto關鍵字的使用限制 類型計算類型計算分類與類型推導相比四種類型計算的規則返回值后置 類型推導 auto關鍵字 C98中&#xff0c;auto表示棧變量&#xff0c;通常省略…

Leetcode刷題筆記題解(C++):25. K 個一組翻轉鏈表

思路&#xff1a;利用棧的特性&#xff0c;K個節點壓入棧中依次彈出組成新的鏈表&#xff0c;不夠K個節點則保持不變 /*** struct ListNode {* int val;* struct ListNode *next;* ListNode(int x) : val(x), next(nullptr) {}* };*/ #include <stack> class Solution { …

在國內,現在月薪1萬是什么水平?

看到網友發帖問&#xff1a;現在月薪1W是什么水平&#xff1f; 在現如今的情況下&#xff0c;似乎月薪過萬這個標準已經成為衡量個人能力的一個標準了&#xff0c;尤其是現在互聯網橫行的時代&#xff0c;好像年入百萬&#xff0c;年入千萬就應該是屬于大眾的平均水平。 我不是…

kafka入門(四):消費者

消費者 (Consumer ) 消費者 訂閱 Kafka 中的主題 (Topic) &#xff0c;并 拉取消息。 消費者群組&#xff08; Consumer Group&#xff09; 每一個消費者都有一個對應的 消費者群組。 一個群組里的消費者訂閱的是同一個主題&#xff0c;每個消費者接收主題的一部分分區的消息…

大師學SwiftUI第18章Part2 - 存儲圖片和自定義相機

存儲圖片 在前面的示例中&#xff0c;我們在屏幕上展示了圖片&#xff0c;但也可以將其存儲到文件或數據庫中。另外有時使用相機將照片存儲到設備的相冊薄里會很有用&#xff0c;這樣可供其它應用訪問。UIKit框架提供了如下兩個保存圖片和視頻的函數。 UIImageWriteToSavedPh…