用Cursor生成一个代办事项列表的功能

news2024/11/17 17:35:19

一、本地新建html文件

二、输入代码

2.1 Cursor描述

其实这一段代码使用Cursor生成,可以输入如下内容,即可自动生成代码:

创建一个代办事项列表应用的基本结构,呈现在可交互界面上,1,提供可交互界面,html,生成本地可使用的界面,需要生成前端页面代码,前端可展示页面,把他写在一个网页上。

我废话有点儿多,因为我叠加了好几次,我觉得重点是:

1. 功能:创建一个代办事项列表应用的基本结构

2.方式:需要生成前端页面代码,前端可展示页面

大家可以多调试一下,反正也可以追加指示

2.2 代码结果

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>待办事项列表</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f0f0f0;
        }
        h1 {
            text-align: center;
            color: #333;
        }
        #task-form {
            display: flex;
            margin-bottom: 20px;
        }
        #task-input {
            flex-grow: 1;
            padding: 10px;
            font-size: 16px;
            border: 1px solid #ddd;
            border-radius: 4px 0 0 4px;
        }
        button {
            padding: 10px 15px;
            font-size: 16px;
            cursor: pointer;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 0 4px 4px 0;
        }
        button:hover {
            background-color: #45a049;
        }
        #task-list {
            list-style-type: none;
            padding: 0;
        }
        .task-item {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            background-color: white;
            padding: 10px;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .task-text {
            flex-grow: 1;
            margin-left: 10px;
        }
        .completed {
            text-decoration: line-through;
            color: #888;
        }
        .delete-btn {
            background-color: #f44336;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 4px;
            cursor: pointer;
        }
        .delete-btn:hover {
            background-color: #d32f2f;
        }
    </style>
</head>
<body>
    <h1>待办事项列表</h1>
    <form id="task-form">
        <input type="text" id="task-input" placeholder="输入新任务" required>
        <button type="submit">添加任务</button>
    </form>
    <ul id="task-list"></ul>

    <script>
        const taskForm = document.getElementById('task-form');
        const taskInput = document.getElementById('task-input');
        const taskList = document.getElementById('task-list');

        let tasks = JSON.parse(localStorage.getItem('tasks')) || [];

        function renderTasks() {
            taskList.innerHTML = '';
            tasks.forEach((task, index) => {
                const li = document.createElement('li');
                li.className = 'task-item';
                li.innerHTML = `
                    <input type="checkbox" ${task.completed ? 'checked' : ''}>
                    <span class="task-text ${task.completed ? 'completed' : ''}">${task.text}</span>
                    <button class="delete-btn">删除</button>
                `;
                
                const checkbox = li.querySelector('input[type="checkbox"]');
                checkbox.addEventListener('change', () => toggleTask(index));

                const deleteBtn = li.querySelector('.delete-btn');
                deleteBtn.addEventListener('click', () => deleteTask(index));

                taskList.appendChild(li);
            });
        }

        function addTask(text) {
            tasks.push({ text, completed: false });
            saveTasks();
            renderTasks();
        }

        function toggleTask(index) {
            tasks[index].completed = !tasks[index].completed;
            saveTasks();
            renderTasks();
        }

        function deleteTask(index) {
            tasks.splice(index, 1);
            saveTasks();
            renderTasks();
        }

        function saveTasks() {
            localStorage.setItem('tasks', JSON.stringify(tasks));
        }

        taskForm.addEventListener('submit', (e) => {
            e.preventDefault();
            const text = taskInput.value.trim();
            if (text) {
                addTask(text);
                taskInput.value = '';
            }
        });

        renderTasks();
    </script>
</body>
</html>








三、开启调试

3.1 显示预览

3.2 打开本地页面

选终端,然后启动调试。

四、后续优化

4.1 我又调试了一番,增加了一些花里胡哨的功能

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>待办事项列表</title>
    <style>
        body {
            font-family: 'Helvetica Neue', Arial, sans-serif;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f7f7f7;
            color: #333;
        }
        h1 {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 30px;
        }
        #task-form {
            display: flex;
            margin-bottom: 30px;
        }
        #task-input {
            flex-grow: 1;
            padding: 12px;
            font-size: 16px;
            border: 2px solid #ddd;
            border-radius: 4px 0 0 4px;
            transition: border-color 0.3s;
        }
        #task-input:focus {
            outline: none;
            border-color: #3498db;
        }
        button {
            padding: 12px 20px;
            font-size: 16px;
            cursor: pointer;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 0 4px 4px 0;
            transition: background-color 0.3s;
        }
        button:hover {
            background-color: #2980b9;
        }
        #task-list {
            list-style-type: none;
            padding: 0;
        }
        .task-item {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            background-color: white;
            padding: 15px 15px 15px 10px;
            border-radius: 8px;
            box-shadow: 0 3px 6px rgba(0,0,0,0.1);
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .task-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 10px rgba(0,0,0,0.15);
        }
        .task-text {
            flex-grow: 1;
            margin-left: 15px;
            font-size: 18px;
        }
        .completed {
            text-decoration: line-through;
            color: #95a5a6;
        }
        .delete-btn {
            background-color: #e74c3c;
            color: white;
            border: none;
            padding: 8px 12px;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        .delete-btn:hover {
            background-color: #c0392b;
        }
        input[type="checkbox"] {
            width: 20px;
            height: 20px;
            margin-right: 10px;
        }
        .task-number {
            min-width: 24px;
            height: 24px;
            background-color: #3498db;
            color: white;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 14px;
            margin-right: 10px;
        }
        .task-content {
            display: flex;
            align-items: center;
            flex-grow: 1;
        }

        .timeline {
            display: flex;
            margin-top: 30px;
            background-color: #f9f9f9;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .timeline-day {
            flex: 1;
            padding: 15px;
            border-right: 1px solid #e0e0e0;
            transition: background-color 0.3s;
        }

        .timeline-day:last-child {
            border-right: none;
        }

        .timeline-day:hover {
            background-color: #f0f0f0;
        }

        .timeline-date {
            font-weight: bold;
            margin-bottom: 15px;
            text-align: center;
            color: #3498db;
            font-size: 14px;
        }

        .timeline-tasks {
            list-style-type: none;
            padding: 0;
        }

        .timeline-task {
            background-color: #ffffff;
            border-radius: 6px;
            padding: 10px;
            margin-bottom: 10px;
            font-size: 14px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            transition: transform 0.2s, box-shadow 0.2s;
            cursor: pointer;
        }

        .timeline-task:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .timeline-task.completed {
            text-decoration: line-through;
            color: #95a5a6;
            background-color: #f8f8f8;
        }

        .timeline-task-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            margin-right: 8px;
            background-color: #3498db;
        }

        .timeline-task.completed .timeline-task-dot {
            background-color: #95a5a6;
        }

        .timeline-day.today {
            background-color: #e8f4fd;
        }

        .timeline-day.today .timeline-date {
            color: #2980b9;
        }

        @media (max-width: 768px) {
            .timeline {
                flex-direction: column;
            }

            .timeline-day {
                border-right: none;
                border-bottom: 1px solid #e0e0e0;
            }

            .timeline-day:last-child {
                border-bottom: none;
            }
        }

        .calendar {
            display: flex;
            justify-content: space-between;
            margin-bottom: 20px;
        }

        .day {
            flex: 1;
            text-align: center;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .day:hover {
            background-color: #f0f0f0;
        }

        .day.selected {
            background-color: #3498db;
            color: white;
        }

        .day-name {
            font-weight: bold;
            margin-bottom: 5px;
        }

        .day-date {
            font-size: 12px;
        }

        #task-form {
            display: flex;
            flex-direction: column;
            margin-bottom: 30px;
        }

        #task-input {
            margin-bottom: 10px;
        }

        #add-task-btn {
            align-self: flex-end;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>待办事项列表</h1>
        <div class="calendar" id="calendar"></div>
        <form id="task-form">
            <input type="text" id="task-input" placeholder="输入新任务" required>
            <button type="submit" id="add-task-btn">添加任务</button>
        </form>
        <ul id="task-list"></ul>
        <div class="timeline" id="timeline"></div>
    </div>

    <script>
        const taskForm = document.getElementById('task-form');
        const taskInput = document.getElementById('task-input');
        const taskList = document.getElementById('task-list');
        const calendar = document.getElementById('calendar');

        let tasks = JSON.parse(localStorage.getItem('tasks')) || [];
        let selectedDate = new Date();

        function renderCalendar() {
            calendar.innerHTML = '';
            const today = new Date();
            const weekStart = new Date(today);
            weekStart.setDate(today.getDate() - today.getDay());

            for (let i = 0; i < 7; i++) {
                const date = new Date(weekStart);
                date.setDate(weekStart.getDate() + i);
                const dayElement = document.createElement('div');
                dayElement.className = 'day';
                if (date.toDateString() === selectedDate.toDateString()) {
                    dayElement.classList.add('selected');
                }
                dayElement.innerHTML = `
                    <div class="day-name">${['日', '一', '二', '三', '四', '五', '六'][date.getDay()]}</div>
                    <div class="day-date">${date.getDate()}</div>
                `;
                dayElement.addEventListener('click', () => {
                    selectedDate = date;
                    renderCalendar();
                    renderTasks();
                });
                calendar.appendChild(dayElement);
            }
        }

        function renderTimeline() {
            const timeline = document.getElementById('timeline');
            timeline.innerHTML = '';

            const weekStart = new Date(selectedDate);
            weekStart.setDate(selectedDate.getDate() - selectedDate.getDay());

            for (let i = 0; i < 7; i++) {
                const date = new Date(weekStart);
                date.setDate(weekStart.getDate() + i);
                
                const dayElement = document.createElement('div');
                dayElement.className = 'timeline-day';
                if (date.toDateString() === new Date().toDateString()) {
                    dayElement.classList.add('today');
                }
                
                const dateElement = document.createElement('div');
                dateElement.className = 'timeline-date';
                dateElement.textContent = `${date.getMonth() + 1}月${date.getDate()}日 ${['周日', '周一', '周二', '周三', '周四', '周五', '周六'][date.getDay()]}`;
                dayElement.appendChild(dateElement);

                const taskList = document.createElement('ul');
                taskList.className = 'timeline-tasks';

                const dayTasks = tasks.filter(task => 
                    new Date(task.date).toDateString() === date.toDateString()
                );

                dayTasks.forEach(task => {
                    const taskElement = document.createElement('li');
                    taskElement.className = `timeline-task ${task.completed ? 'completed' : ''}`;
                    taskElement.innerHTML = `
                        <span class="timeline-task-dot"></span>
                        ${task.text}
                    `;
                    taskElement.addEventListener('click', () => toggleTask(task.id));
                    taskList.appendChild(taskElement);
                });

                dayElement.appendChild(taskList);
                timeline.appendChild(dayElement);
            }
        }

        function renderTasks() {
            taskList.innerHTML = '';
            const filteredTasks = tasks.filter(task => 
                new Date(task.date).toDateString() === selectedDate.toDateString()
            );
            filteredTasks.forEach((task, index) => {
                const li = document.createElement('li');
                li.className = 'task-item';
                li.innerHTML = `
                    <div class="task-content">
                        <span class="task-number">${index + 1}</span>
                        <input type="checkbox" ${task.completed ? 'checked' : ''}>
                        <span class="task-text ${task.completed ? 'completed' : ''}">${task.text}</span>
                    </div>
                    <button class="delete-btn">删除</button>
                `;
                
                const checkbox = li.querySelector('input[type="checkbox"]');
                checkbox.addEventListener('change', () => toggleTask(task.id));

                const deleteBtn = li.querySelector('.delete-btn');
                deleteBtn.addEventListener('click', () => deleteTask(task.id));

                taskList.appendChild(li);
            });
            renderTimeline();
        }

        function addTask(text) {
            const newTask = { 
                id: Date.now(), 
                text, 
                completed: false, 
                date: selectedDate.toISOString() 
            };
            tasks.push(newTask);
            saveTasks();
            renderTasks();
        }

        function toggleTask(id) {
            const task = tasks.find(t => t.id === id);
            if (task) {
                task.completed = !task.completed;
                saveTasks();
                renderTasks();
            }
        }

        function deleteTask(id) {
            tasks = tasks.filter(t => t.id !== id);
            saveTasks();
            renderTasks();
        }

        function saveTasks() {
            localStorage.setItem('tasks', JSON.stringify(tasks));
        }

        taskForm.addEventListener('submit', (e) => {
            e.preventDefault();
            const text = taskInput.value.trim();
            if (text) {
                addTask(text);
                taskInput.value = '';
            }
        });

        renderCalendar();
        renderTasks();
    </script>
</body>
</html>








4.1 自动适配屏幕大小

我的补充:界面根据屏幕大小适配

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>待办事项列表</title>
    <style>
        body {
            font-family: 'Helvetica Neue', Arial, sans-serif;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f7f7f7;
            color: #333;
        }
        .container {
            background-color: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }
        h1 {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 30px;
        }
        #task-form {
            display: flex;
            margin-bottom: 30px;
        }
        #task-input {
            flex-grow: 1;
            padding: 12px;
            font-size: 16px;
            border: 2px solid #ddd;
            border-radius: 4px 0 0 4px;
            transition: border-color 0.3s;
        }
        #task-input:focus {
            outline: none;
            border-color: #3498db;
        }
        button {
            padding: 12px 20px;
            font-size: 16px;
            cursor: pointer;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 0 4px 4px 0;
            transition: background-color 0.3s;
        }
        button:hover {
            background-color: #2980b9;
        }
        #task-list {
            list-style-type: none;
            padding: 0;
        }
        .task-item {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            background-color: white;
            padding: 15px 15px 15px 10px;
            border-radius: 8px;
            box-shadow: 0 3px 6px rgba(0,0,0,0.1);
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .task-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 10px rgba(0,0,0,0.15);
        }
        .task-text {
            flex-grow: 1;
            margin-left: 15px;
            font-size: 18px;
        }
        .completed {
            text-decoration: line-through;
            color: #95a5a6;
        }
        .delete-btn {
            background-color: #e74c3c;
            color: white;
            border: none;
            padding: 8px 12px;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        .delete-btn:hover {
            background-color: #c0392b;
        }
        input[type="checkbox"] {
            width: 20px;
            height: 20px;
            margin-right: 10px;
        }
        .task-number {
            min-width: 24px;
            height: 24px;
            background-color: #3498db;
            color: white;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 14px;
            margin-right: 10px;
        }
        .task-content {
            display: flex;
            align-items: center;
            flex-grow: 1;
        }

        .timeline {
            display: flex;
            margin-top: 30px;
            background-color: #f9f9f9;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .timeline-day {
            flex: 1;
            padding: 15px;
            border-right: 1px solid #e0e0e0;
            transition: background-color 0.3s;
        }

        .timeline-day:last-child {
            border-right: none;
        }

        .timeline-day:hover {
            background-color: #f0f0f0;
        }

        .timeline-date {
            font-weight: bold;
            margin-bottom: 15px;
            text-align: center;
            color: #3498db;
            font-size: 14px;
        }

        .timeline-tasks {
            list-style-type: none;
            padding: 0;
        }

        .timeline-task {
            background-color: #ffffff;
            border-radius: 6px;
            padding: 10px;
            margin-bottom: 10px;
            font-size: 14px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            transition: transform 0.2s, box-shadow 0.2s;
            cursor: pointer;
        }

        .timeline-task:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .timeline-task.completed {
            text-decoration: line-through;
            color: #95a5a6;
            background-color: #f8f8f8;
        }

        .timeline-task-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            margin-right: 8px;
            background-color: #3498db;
        }

        .timeline-task.completed .timeline-task-dot {
            background-color: #95a5a6;
        }

        .timeline-day.today {
            background-color: #e8f4fd;
        }

        .timeline-day.today .timeline-date {
            color: #2980b9;
        }

        .calendar {
            display: flex;
            justify-content: space-between;
            margin-bottom: 20px;
        }

        .day {
            flex: 1;
            text-align: center;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .day:hover {
            background-color: #f0f0f0;
        }

        .day.selected {
            background-color: #3498db;
            color: white;
        }

        .day-name {
            font-weight: bold;
            margin-bottom: 5px;
        }

        .day-date {
            font-size: 12px;
        }

        #task-form {
            display: flex;
            flex-direction: column;
            margin-bottom: 30px;
        }

        #task-input {
            margin-bottom: 10px;
        }

        #add-task-btn {
            align-self: flex-end;
        }

        @media (max-width: 768px) {
            body {
                padding: 10px;
            }
            .container {
                padding: 15px;
            }
            h1 {
                font-size: 24px;
            }
            #task-form {
                flex-direction: column;
            }
            #task-input, #add-task-btn {
                width: 100%;
                margin-bottom: 10px;
                border-radius: 4px;
            }
            .task-item {
                flex-direction: column;
                align-items: flex-start;
            }
            .task-content {
                width: 100%;
                margin-bottom: 10px;
            }
            .delete-btn {
                align-self: flex-end;
            }
            .timeline {
                flex-direction: column;
            }
            .timeline-day {
                border-right: none;
                border-bottom: 1px solid #e0e0e0;
            }
            .timeline-day:last-child {
                border-bottom: none;
            }
            .calendar {
                flex-wrap: wrap;
            }
            .day {
                flex-basis: calc(33.33% - 10px);
                margin-bottom: 10px;
            }
        }

        @media (max-width: 480px) {
            .day {
                flex-basis: calc(50% - 10px);
            }
        }
    </style>
</head>
<body>
    <!-- HTML 结构保持不变 -->
    
    <script>
        // JavaScript 代码保持不变
    </script>
</body>
</html>

4.3 将内容存储下来

我们没有服务器的时候,只能用localStorage存在本地,浏览器有5MB的限制。

  • 我的补充:我想问一下,怎么把输入的结果存下来
  • 他的回答:要将输入的结果存储下来,我们可以使用浏览器的本地存储(localStorage)来实现。这样,即使用户关闭了浏览器,下次打开时也能看到之前添加的任务。以下是如何修改JavaScript代码来实现这个功能:
<script>
    const taskForm = document.getElementById('task-form');
    const taskInput = document.getElementById('task-input');
    const taskList = document.getElementById('task-list');
    const calendar = document.getElementById('calendar');

    let tasks = JSON.parse(localStorage.getItem('tasks')) || [];
    let selectedDate = new Date();

    function renderCalendar() {
        // ... 日历渲染代码保持不变 ...
    }

    function renderTimeline() {
        // ... 时间轴渲染代码保持不变 ...
    }

    function renderTasks() {
        taskList.innerHTML = '';
        const filteredTasks = tasks.filter(task => 
            new Date(task.date).toDateString() === selectedDate.toDateString()
        );
        filteredTasks.forEach((task, index) => {
            const li = document.createElement('li');
            li.className = 'task-item';
            li.innerHTML = `
                <div class="task-content">
                    <span class="task-number">${index + 1}</span>
                    <input type="checkbox" ${task.completed ? 'checked' : ''}>
                    <span class="task-text ${task.completed ? 'completed' : ''}">${task.text}</span>
                </div>
                <button class="delete-btn">删除</button>
            `;
            
            const checkbox = li.querySelector('input[type="checkbox"]');
            checkbox.addEventListener('change', () => toggleTask(task.id));

            const deleteBtn = li.querySelector('.delete-btn');
            deleteBtn.addEventListener('click', () => deleteTask(task.id));

            taskList.appendChild(li);
        });
        renderTimeline();
    }

    function addTask(text) {
        const newTask = { 
            id: Date.now(), 
            text, 
            completed: false, 
            date: selectedDate.toISOString() 
        };
        tasks.push(newTask);
        saveTasks();
        renderTasks();
    }

    function toggleTask(id) {
        const task = tasks.find(t => t.id === id);
        if (task) {
            task.completed = !task.completed;
            saveTasks();
            renderTasks();
        }
    }

    function deleteTask(id) {
        tasks = tasks.filter(t => t.id !== id);
        saveTasks();
        renderTasks();
    }

    function saveTasks() {
        localStorage.setItem('tasks', JSON.stringify(tasks));
    }

    taskForm.addEventListener('submit', (e) => {
        e.preventDefault();
        const text = taskInput.value.trim();
        if (text) {
            addTask(text);
            taskInput.value = '';
        }
    });

    renderCalendar();
    renderTasks();
</script>

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

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

相关文章

乐器检测系统源码分享

乐器检测检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Computer Vision …

【Vue】- Vue表达式

文章目录 知识回顾前言Vue项目介绍 源码分析1. 项目结构介绍&#xff08;单页面应用程序&#xff09;2. 项目运行流程图(单页面应用程序)3. 选项式和组合式api4. 插值表达式 {{}} 胡子语法5. reactive函数6. ref表达式 拓展知识reactive和ref的选择 总结 知识回顾 前言 Vue项…

利用python处理线性规划问题

利用python处理线性规划问题 linprog函数基本例题例题1例题2 典型例题例一&#xff1a;生产决策问题例一&#xff1a;生产决策问题 &#xff08;例题和部分解答思路来自清风老师&#xff09; linprog函数 导入模块 from scipy.optimize import linprog函数功能 Linear progra…

计算机毕业设计 毕业季一站式旅游服务定制平台的设计与实现 Java实战项目 附源码+文档+视频讲解

博主介绍&#xff1a;✌从事软件开发10年之余&#xff0c;专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌ &#x1f345;文末获取源码联系&#x1f345; &#x1f447;&#x1f3fb; 精…

视频笔记1

玩转apollo课程内讲解靠边启动场景_哔哩哔哩_bilibili 用open_space_roi_decider 改后 善用坐标点 如何不影响其它场景&#xff1a;if判断

Gradio快速部署构建AIGC的web应用 ,python

Gradio快速部署构建AIGC的web应用 &#xff0c;python Gradio开源项目链接&#xff1a; https://github.com/gradio-app/gradiohttps://github.com/gradio-app/gradio &#xff08;1&#xff09;python的pip安装&#xff1a; pip install gradio &#xff08;2&#xff09;写…

webpack打包原理

目录 1、搭建结构&#xff0c;读取配置参数2、配置参数对象初始化 Compiler&#xff08;new Compiler(webpackOptions)&#xff09;3、挂载配置文件中的插件&#xff0c;4、执行Compiler 中的 run 方法进行编译5、根据配置文件中的entry 配置项找到所有的入口6、从入口文件出发…

HAL库学习梳理——UART

笔者跟着B站铁头山羊视频学习 STM32-HAL库 开发教程。下面对HAL库有关UART课程知识和应用做一个梳理。 省流&#xff1a; uint8_t byteNumber 0x5a;uint8_t byteArray[] {0,1,2,3,4,5};char ch a;char *str "Hello word";HAL_UART_Transmit(&huart1,&by…

Windows环境下 VS2022 编译 Xvid 源码

Xvid Xvid 是一个开源的视频编解码器&#xff0c;遵循 MPEG-4 视频编码标准&#xff0c;特别是 MPEG-4 Part 2 Advanced Simple Profile。它被广泛用于视频的压缩和解压&#xff0c;尤其是在互联网上分享视频文件时&#xff0c;因为它能够有效地减小文件大小而不会过多损失视频…

切线空间:unity中shader切线空间,切线矩阵,TBN矩阵 ,法线贴图深度剖析

unity中shader切线空间 看了网上各种解释&#xff0c;各种推理。直接脑袋大。感觉复杂的高大上。当深入了解后&#xff0c;才发是各种扯淡。 一切从模型法向量开始 在shader中&#xff0c;大部分的光照计算都是与法向量有关。通过法向量和其他向量能计算出模型在光线照射下的…

How to see if openAI (node js) createModeration response “flagged“ is true

题意&#xff1a;如何查看 OpenAI (Node.js) createModeration 响应中的 "flagged" 是否为 true 问题背景&#xff1a; Using the OpenAI createModeration feature, I am trying to see if the string gets flagged or not. 使用 OpenAI 的 createModeration 功能…

医学数据分析实训 项目一 医学数据采集

项目一 医学数据采集 一、实践目的 了解医学数据的特点&#xff1b;熟悉常见的医学公共数据库的使用方法&#xff1b;掌握获取医学数据的方法&#xff1b; 二、实践平台 操作系统&#xff1a;Windows10 及以上Python 版本&#xff1a;3.8.x 及以上PyCharm 或 Anoconda 集成…

Ubuntu 安装最新 Google Chrome 浏览器

谷歌浏览器使用简单并且用户友好&#xff0c;使用它浏览互联网愉悦至极。许多用户喜欢 Chrome&#xff0c;因为它加载网页又快又流畅。Chrome 提供强大的安全功能&#xff0c;帮助用户保持在线安全。Google Chrome 官方提供了一个 Debian 软件包存储库&#xff0c;基于 Debian …

Llama Factory :百种以上语言模型的统一高效微调框架

人工智能咨询培训老师叶梓 转载标明出处 大模型适应到特定下游任务时&#xff0c;传统的全参数微调方法成本高昂&#xff0c;因此&#xff0c;研究者们一直在探索更高效的微调技术。由北京航空航天大学和北京大学的研究团队提出了一个名为Llama Factory的统一框架&#xff0c;…

【免费刷题】实验室安全第一知识题库分享

道路千万条&#xff0c;实验安全第一条。 嘿&#xff0c;实验室的小伙伴们&#xff01;是不是还在为实验室安全考试而烦恼&#xff1f;别担心&#xff0c;今天就让我来分享一些实用的题库&#xff0c;帮助你轻松应对考试&#xff0c;同时也更好地保护自己和实验室的安全。 一、…

前端开发第三节课

20-目录文件夹和根目录 4.8图像标签和路径&#xff08;重点&#xff09; 2.路径&#xff08;前期铺垫知识&#xff09; &#xff08;1&#xff09;目录文件夹和目录 实际工作中&#xff0c;我们的文件不能随便乱放&#xff0c;否则用起来很难快速地找到他们&#xff0c;因此…

LeetCode 热题 100 回顾13

干货分享&#xff0c;感谢您的阅读&#xff01;原文见&#xff1a;LeetCode 热题 100 回顾_力code热题100-CSDN博客 一、哈希部分 1.两数之和 &#xff08;简单&#xff09; 题目描述 给定一个整数数组 nums 和一个整数目标值 target&#xff0c;请你在该数组中找出 和为目标…

基于SpringBoot+Vue的个性化旅游推荐系统

作者&#xff1a;计算机学姐 开发技术&#xff1a;SpringBoot、SSM、Vue、MySQL、JSP、ElementUI、Python、小程序等&#xff0c;“文末源码”。 专栏推荐&#xff1a;前后端分离项目源码、SpringBoot项目源码、SSM项目源码 系统展示 【2025最新】基于JavaSpringBootVueMySQL的…

free -h 查看内存free空间不足

free空间不足 大部分被buff/cache占用 解决办法一: 手动释放缓存 释放页缓存 sudo sync; sudo sysctl -w vm.drop_caches1 释放目录项和inode缓存 sudo sync; sudo sysctl -w vm.drop_caches2 释放所有缓存&#xff08;页缓存、目录项和inode缓存&#xff09; sudo sync…

【隐私计算】安全多方计算MPC中的高效三角函数计算

隐私计算中的非线性函数很难算&#xff0c;或者开销很大。三角函数更是如此&#xff0c;Squirrel文章中提出了一种高效的计算方式&#xff0c;感觉可以作为一种通用优化方案。 参考文献&#xff1a;Squirrel: A Scalable Secure Two-Party Computation Framework for Training…