摘要: python 使用字典写入CSV文件 import csv # 定义要写入CSV文件的数据(作为字典列表) data = [ {'Name': 'Alice', 'Age': '25', 'City': 'New York'}, {'Name': 'Bob', 'Age': '30', 'City' 阅读全文
posted @ 2024-07-26 23:04 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: python两个三阶矩阵相乘 import numpy as np matrix1 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) matrix2 = np.array([[9, 8, 7], [6, 5, 4], [3, 2, 1]]) result = 阅读全文
posted @ 2024-07-25 23:31 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: C++ opencv putText #include <opencv2/opencv.hpp> int main() { // 创建一个空白图像 cv::Mat img(400, 400, CV_8UC3, cv::Scalar(255, 255, 255)); // 设置文本内容 std::st 阅读全文
posted @ 2024-07-24 16:28 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: unity3d碰撞 Unity3D提供了多个碰撞事件函数,用于处理不同类型的碰撞情况。常用的碰撞事件函数包括: OnCollisionEnter:当两个物体开始碰撞时触发。这是碰撞的起始点,可以用于执行碰撞开始时的逻辑,如播放碰撞音效、改变游戏状态等。 OnCollisionStay:在两个物体持续 阅读全文
posted @ 2024-07-23 19:38 西北逍遥 阅读(9) 评论(0) 推荐(0) 编辑
摘要: unity3d Dictionary 根据key获取value using System; using System.Collections.Generic; using UnityEngine; public class DictionaryExample : MonoBehaviour { pr 阅读全文
posted @ 2024-07-21 22:26 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: unity3d缩放物体 using UnityEngine; public class ScaleObject : MonoBehaviour { // 缩放速度,可以根据需要调整 public float scaleSpeed = 0.1f; // 控制缩放的方向,这里以X轴为例 public b 阅读全文
posted @ 2024-07-20 23:05 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: InvalidOperationException: Insecure connection not allowed 在Edit -> Project Settings -> Player中找到平台设置(比如“PC, Mac & Linux Standalone”或者你的目标平台),然后滚动到底部找 阅读全文
posted @ 2024-07-19 23:01 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: unity3d get post请求 using UnityEngine; using UnityEngine.Networking; public class NetworkRequestExample : MonoBehaviour { IEnumerator Start() { string 阅读全文
posted @ 2024-07-18 18:12 西北逍遥 阅读(3) 评论(0) 推荐(0) 编辑
摘要: using System.Collections; using System.Collections.Generic; using UnityEngine; using Mono.Data.Sqlite; // 注意:这取决于你使用的SQLite库 public class SQLiteExampl 阅读全文
posted @ 2024-07-17 21:15 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5] y = [2, 3, 2, 4, 2] plt.scatter(x, y) plt.title('Scatter Plot Example') # 添加标题 plt.xlabel('X Axis' 阅读全文
posted @ 2024-07-16 11:32 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: python numpy 1x3的矩阵乘3x3的矩阵 import numpy as np # 创建1x3的矩阵A A = np.array([[1, 2, 3]]) # 创建3x3的矩阵B B = np.array([[4, 5, 6], [7, 8, 9], [10, 11, 12]]) # 矩 阅读全文
posted @ 2024-07-15 21:15 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: python根据三个点计算平面的法向量 import numpy as np # 定义三个点的坐标 point1 = np.array([1, 2, 1]) point2 = np.array([5, 1, 1]) point3 = np.array([4, 6, 2]) # 计算两个向量 vect 阅读全文
posted @ 2024-07-14 21:39 西北逍遥 阅读(6) 评论(0) 推荐(0) 编辑
摘要: import numpy as np # 定义三个点的坐标 point1 = np.array([1, 2, 1]) point2 = np.array([5, 1, 1]) point3 = np.array([4, 6, 2]) # 计算两个向量 vector1 = point2 - point 阅读全文
posted @ 2024-07-13 16:58 西北逍遥 阅读(5) 评论(0) 推荐(0) 编辑
摘要: unity3d 读取串口 using System.IO.Ports; using UnityEngine; public class SerialCommunication : MonoBehaviour { SerialPort mySerialPort = new SerialPort("CO 阅读全文
posted @ 2024-07-12 00:27 西北逍遥 阅读(4) 评论(0) 推荐(0) 编辑
摘要: python字典的四种遍历方式 使用for循环遍历字典的键: my_dict = {'a': 1, 'b': 2, 'c': 3} for key in my_dict: print(key, my_dict[key]) 使用items()方法遍历字典的键值对: my_dict = {'a': 1, 阅读全文
posted @ 2024-07-11 23:20 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: python 从list移除-1和非int类型的数据 # 原始列表 #my_list = [1, 2.5, -1, 3, 4.0, -1, 5, 6.6, 7] my_list =[ 0 2 3 4 5 6 7 8 9 10 11 12 13 14 -1 -1 -1 16 22.391 15] # 阅读全文
posted @ 2024-07-10 22:52 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: const int xPin = A0; // X轴连接的模拟引脚 const int yPin = A1; // Y轴连接的模拟引脚 void setup() { Serial.begin(9600); // 初始化串口通信 } void loop() { int xValue = analogR 阅读全文
posted @ 2024-07-09 00:07 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: Body Clipping Geometry 实体剪裁几何图形是通过使用仅涉及半空间实体的差分运算的构造实体几何模型来表示产品的三维形状。 应使用保持该几何表示的IfcShapeResentation的以下属性值: IfcShapeRepresentation.RepresentationIdent 阅读全文
posted @ 2024-07-07 16:54 西北逍遥 阅读(3) 评论(0) 推荐(0) 编辑
摘要: Body SectionedSolidHorizontal Body SectionedSolidHorizontal是通过使用两个或多个闭合轮廓(可能具有不同的尺寸)来表示产品的三维实体,这些轮廓沿准线在指定位置之间扫掠。应使用保持该几何表示的IfcShapeResentation的以下属性值: 阅读全文
posted @ 2024-07-06 23:12 西北逍遥 阅读(3) 评论(0) 推荐(0) 编辑
摘要: python批量修改文件后缀名 import os import glob def batch_rename_files(source_dir, old_extension, new_extension): # 确保新的文件名不会与现有文件冲突 def get_new_name(file_path, 阅读全文
posted @ 2024-07-05 23:03 西北逍遥 阅读(6) 评论(0) 推荐(0) 编辑
摘要: Body SurfaceModel Geometry 实体曲面模型几何图形是通过曲面模型表示产品的三维形状。应使用保持该几何表示的IfcShapeResentation的以下属性值: IfcShapeRepresentation.RepresentationIdentifier = 'Body' I 阅读全文
posted @ 2024-07-04 23:19 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h 27 Mar 2018' pip uninstall urllib3 阅读全文
posted @ 2024-07-03 23:03 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: from typing import Any, Callable, List, Optional, OrderedDict, Sequence, TupleImportError: cannot import name 'OrderedDict' from 'typing' (E:\Anaconda 阅读全文
posted @ 2024-07-02 23:58 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: A = [1 2 3; 4 5 6; 7 8 9]; for i = 1:size(A, 1) disp(A(i, :)) end # 阅读全文
posted @ 2024-07-01 22:16 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: import cv2 import numpy as np def euler_view_transformation(image, angle, scale, dx, dy): # 获取图像尺寸 (h, w) = image.shape[:2] # 设置旋转矩阵 center = (w // 2, 阅读全文
posted @ 2024-06-30 21:37 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: import sqlite3 # 连接到数据库 conn = sqlite3.connect('example.db') # 创建一个Cursor对象 cursor = conn.cursor() # 执行查询语句 cursor.execute('SELECT * FROM some_table') 阅读全文
posted @ 2024-06-27 23:50 西北逍遥 阅读(3) 评论(0) 推荐(0) 编辑
摘要: function timestampToDate(timestamp) { const date = new Date(timestamp); const year = date.getFullYear(); const month = String(date.getMonth() + 1).pad 阅读全文
posted @ 2024-06-26 13:44 西北逍遥 阅读(1) 评论(0) 推荐(0) 编辑
摘要: import cv2 # 读取图像 image = cv2.imread('input.jpg') # 获取原始图像的宽度和高度 height, width = image.shape[:2] # 定义新的大小 new_width = 640 # 新宽度 new_height = int(new_w 阅读全文
posted @ 2024-06-24 23:45 西北逍遥 阅读(5) 评论(0) 推荐(0) 编辑
摘要: self._conn = sqlite3.connect(dbName) ############################# 阅读全文
posted @ 2024-06-20 23:35 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑
摘要: python opencv创建空图片 import cv2 import numpy as np # 定义图片的宽度和高度 width = 640 height = 480 # 创建一个全黑的图片,numpy的zeros函数返回给定形状和类型的新数组,用零填充 # OpenCV使用BGR颜色空间,所 阅读全文
posted @ 2024-06-19 22:30 西北逍遥 阅读(2) 评论(0) 推荐(0) 编辑