ICode9

精准搜索请尝试: 精确搜索
  • Jupyter Notebook 琐碎知识点2022-05-03 18:33:21

    在markdown模式下输入 a[0][0] = 0 往往不会显示正确的结果。这时可以使用 转义 (反斜杠)来解决这个问题: a\[0\]\[0\] = 0   jupyter notebook里面的 in [ ]中括号里面的数字含义,这个数字就是运行这段代码的次数。   查看Jupyter Notebook 当前运行的虚拟环境 import os, sys pr

  • PyQT5开发STM32调试助手基于PyCharm集成开发环境2022-05-03 15:35:27

    创建工程    安装PyQt5和PyQt5-Tools    新建一个主函数文件    打开QtDesigner    创建一个窗体    保存文件到工程目录下    将UI文件转化成py文件    修改窗口标题  创建main.py文件,添加 如下内容 1 """ 2 # 公司名称:XXX 3 # 开发人员:宁静致远 4 #

  • Python内置库 sys2022-04-30 11:33:48

    sys 概述 是 Python 自带的内置模块 是与 Python 解释器交互的桥梁 sys 使用 常用属性 常用方法 导入 sys 模块 # 导入sys模块 import sys # 查看sys模块帮助文档 help(sys) # 查看sys模块的属性和方法 print(dir(sys))   sys 常用属性 sys.version:返回 Python

  • KingbaseES R6 集群归档备份故障分析解决案例2022-04-28 17:32:35

    案例说明: 在使用ps工具查看主库进程,发现主库‘archiver’进程失败,检查sys_log日志可以发现归档失败的信息。通过sys_log日志提取归档语句手工执行归档操作,提示“当前数据库启动的data目录和sys_rman.conf配置的‘kb1-path'参数指定的路径不一致”。后查看备份配置文件sys_rman.con

  • 通过/proc/sys/kernel/printk设置打印级别2022-04-27 10:33:23

    cat /proc/sys/kernel/printk 4 4 1 7 共有4个参数 4 4 1 7 (1)第一个参数 4表示小于4优先级消息才会被输出到控制台,通过设置参数可以控制打印到控制台的日志级别,也就是,数字越大,会有越多的日志输出到控制台。 (2)第二个参数4 表示默认的printk消息优先级别,即printk(“hell world”);

  • mac m1上使用rust编译openssl-sys失败的一次记录2022-04-25 21:03:19

    mac m1 编译openssl-sys的时候报错: 遇到错误,报错信息如下 admin@admindeMacBook-Air b3 % cargo run Compiling openssl-sys v0.9.72 error: failed to run custom build command for `openssl-sys v0.9.72` Caused by: process didn't exit successfully: `/Users/admin/pr

  • linux 清理buf/cache2022-04-24 19:01:01

    https://rumenz.com/rumenbiji/linux-buff-cache.html   > sync > echo 1 > /proc/sys/vm/drop_caches > echo 2 > /proc/sys/vm/drop_caches > echo 3 > /proc/sys/vm/drop_caches 定期清理脚本: > vim clean.sh #!/bin/bash#每两小时清除一次缓存 echo "开始

  • mysql 精确查询 CHAR、VARCHAR、TEXT 类型字段忽略右侧空格的问题2022-04-24 15:00:56

    mysql 精确查询(=)时,如果字段是varchar类型的,如果查询字段最右侧有空格,mysql会自动忽略右侧的空格。比如以下三条SQL,对于数据库来说是等价的。 // 1 SELECT * FROM sys_user WHERE user_name = 'admin '; // 2 SELECT * FROM sys_user WHERE user_name = 'admin '; //

  • 牛客华为机试HJ1002022-04-23 09:05:34

    原题传送门 1. 题目描述 2. Solution import sys def solve(n): a1 = 2 d = 3 print(a1 * n + n * (n - 1) * d // 2) for line in sys.stdin: n = int(line.strip()) solve(n)

  • 牛客华为机试HJ1022022-04-23 09:04:51

    原题传送门 1. 题目描述 2. Solution import sys if sys.platform != "linux": sys.stdin = open("input/HJ102.txt") def solve(s): from collections import Counter, defaultdict res = Counter(s).most_common() cnt_group = defaultdict(

  • 牛客华为机试HJ1032022-04-23 09:04:24

    原题传送门 1. 问题描述 2. Solution 1、思路 2、代码实现 import sys if sys.platform != "linux": file_in = open("input/HJ103.txt") sys.stdin = file_in def solve(nums, n): dp = [1] * n for i in reversed(range(n)): # 4, 3, 2, 1, 0

  • 牛客华为机试HJ1062022-04-23 09:03:19

    原题传送门 1. 题目描述 2. Solution import sys for line in sys.stdin: s = line.strip() print(s[::-1])

  • 牛客华为机试HJ1072022-04-23 09:03:01

    原题传送门 1. 题目描述 2. Solution 1、思路分析 二分法 2、代码实现 import sys if sys.platform != "linux": sys.stdin = open("input/HJ107.txt") def solve(n): if n >= 0: if n < 1: lo, hi = 0, 1 else: lo,

  • 牛客华为机试HJ1082022-04-23 09:02:46

    原题传送门 1. 题目描述 2. Solution import sys if sys.platform != "linux": sys.stdin = open("input/HJ108.txt") def gcd(a, b): return a if b == 0 else gcd(b, a % b) def lcm(a, b): return a // gcd(a, b) * b for line in sys.stdi

  • 牛客华为机试HJ962022-04-23 08:31:27

    原题传送门 1. 问题描述 2. Solution import re import sys if sys.platform != "linux": sys.stdin = open("input/HJ96.txt") def solve1(s): print(re.sub(r'(\d+)', r'*\1*', s)) # 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

  • 牛客华为机试HJ972022-04-23 08:31:06

    原题传送门 1. 题目描述 2. Solution import sys if sys.platform != "linux": file_in = open("input/HJ97.txt") sys.stdin = file_in while True: try: n = int(input().strip()) nums = list(map(int, input().strip().split()

  • SQL Server 日志文件缩减2022-04-22 19:01:53

    --切换数据库 USE [数据库名] GO -- 查找指定数据库(mcms)的日志文件名,第三步需用到 SELECT name as '文件名' FROM sys.database_files where type_desc='LOG' GO -- 备份事务日志,必须确认E:\DB\DBBackup路径存在 backup log DBTest to disk='E:\DB\DBBackup\Log_Backup_of

  • 牛客华为机试HJ822022-04-22 07:35:58

    原题传送门 1. 题目描述 2. Solution 1、思路 设要拆解的真分数为\(\frac{A}{B}\),设 B除以A的商为C,余数为D。即: \(B=A \cdot C+D\)。等式两边同时除以A,可得 \(\frac{B}{A} = C + \frac{D}{A} < C + 1(\because D < A)\) , 易知C + 1是大于\(\frac{B}{A}\)的最小分数。将分式倒置

  • 牛客华为机试HJ832022-04-22 07:35:36

    原题传送门 1. 题目描述 2. Solution 1 1、思路分析 2、代码实现 import sys if sys.platform != "linux": file_in = open("input/HJ83.txt") sys.stdin = file_in """ 7 4 2 2 1 0 5 4 7 4 0 0 0 -1 -1 """ while True: tr

  • 牛客华为机试HJ842022-04-22 07:35:19

    原题传送门 1. 题目描述 2. Solution import sys def solve(s): cnt = 0 for c in s: if c.isupper(): cnt += 1 print(cnt) for line in sys.stdin: s = line.strip() solve(s)

  • 牛客华为机试HJ862022-04-22 07:34:45

    原题传送门 1. 题目描述 2. Solution1 1、思路分析 把输入n转成bit字符串,然后用0切开,对剩余每一个只包含1的部分求长度并取长度最大值为最终结果。 2、代码实现 import sys if sys.platform != "linux": file_in = open("input/HJ86.txt") sys.stdin = file_in def so

  • 牛客华为机试HJ892022-04-22 07:33:25

    原题传送门 1. 问题描述 2. Solution import sys from itertools import permutations, product if sys.platform != "linux": file_in = open("input/HJ89.txt") sys.stdin = file_in num_map = dict(zip( "3 4 5 6 7 8 9 10 J Q K A 2"

  • 牛客华为机试HJ902022-04-22 07:32:46

    原题传送门 1. 题目描述 2. Solution import sys if sys.platform != "linux": file_in = open("input/HJ90.txt") sys.stdin = file_in def solve(s): if ".." in s or s.count(".") != 3: print("NO")

  • 牛客华为机试HJ912022-04-22 07:32:06

    原题传送门 1. 题目描述 2. Solution 1、思路分析 DFS 2、代码实现 import sys if sys.platform != "linux": file_in = open("input/HJ91.txt") sys.stdin = file_in def ways(x, y, m, n): if x == (m - 1) and y == (n - 1): global res

  • 牛客华为机试HJ922022-04-22 07:31:47

    原题传送门 1. 问题描述 2. Solution import sys from collections import defaultdict if sys.platform != "linux": sys.stdin = open("input/HJ92.txt") def solve(s): import re parts = re.split(r'\D+', s) res = defaultdic

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有