三毛笔记,记录我的编程成长之路,同时分享各种网络资源、羊毛福利,收集各种有趣实用的软件和APP,发现一些稀奇古怪的的网站,折腾一些有趣实用的教程,关注互联网最新资讯动态,探索新领域,发现新美好,分享小快乐。
三范式第一范式:任何一张表都应该有主键,每个字段是原子性的不能再分。第二范式:建立在第一范式基础上,另外要求所有非主键字段完全依赖主键,不能产生部分依赖。学生编号(PK)教师编号(PK)学生姓名教师姓名10011张三王老师10022李四赵老师10031王五王老师10012张三赵老师上表虽然符合第一范式,但违背第二范式,学生姓名、老师姓名都产生了部分依赖,导致数据冗余。第三范式:建立在第二范式基础上,非主键字段不能传递依赖于主键字段。学生编号(PK)学生姓名班级编号班级姓名1001张三1一年一班1002李四2一年二班1003王五3一年三班1004赵六3一年三班上表因为产生了传递依赖,导致班级名称冗余。表设计一对多(学校 - 学生):一对多两张表,多的表加外键。多对多(学生 - 课程):多对多三张表,关系表加外键。一对一第一种方案:主键共享。hid(主键)hname1张三2李四3王五wid(主键+外键)wname1小花2小兰3小红一对一第二种方案:外键唯一。hid(主键)hname1张三2李四3王五wid(主键)wnamehid(外键+unique)1小花12小兰23小红3最终设计以满足客
字符串相关在MySQL中,字符串既可以使用双引号也可以使用单引号,但建议使用单引号,因为单引号属于标准SQL。upper():转大写,转小写是lower()SELECT UPPER('abc');ABClength():获取字节长度SELECT LENGTH('张三123');9char_length():获取字符个数SELECT CHAR_LENGTH('张三123');5concat():字符串拼接,MySQL8之后,||只作为逻辑运算符使用,也不可以使用+进行字符串拼接select concat('123', 'abc');123abclpad():左填充,右填充为rpad()select lpad('abc', 5, '-');--abctrim():去除首尾空白,也可去除指定的前缀后缀select trim(' abc 123 ');abc 123select trim(leading '0' from '000111000'); -- 111000select trim(trailing '0' from '000111000'); -- 000111select trim
GitHub Chinese Top Charts是GitHub中文排行榜,帮助你发现优秀中文项目,可以无语言障碍地、更高效地吸收优秀经验成果。GitHub中文排行榜,各语言分设「软件 | 资料」榜单,精准定位中文好项目。各取所需,高效学习。项目特色亮点【首创】中文排行榜【首创】中文增速榜【首创】中文新秀榜【首创】软件与资料项目分榜网站地址GitHub:https://github.com/GrowingGit/GitHub-Chinese-Top-Charts
中括号中括号有两种使用方法:用于比较操作符:比较两个值大小或者判断两个值是否相等。例如:-eq:判断两个值是否相等(equal to),例如[ $a -eq $b ]-ne:判断两个值是否不相等(not equal to),例如[ $a -ne $b ]-lt:判断左边的值是否小于右边的值(less than),例如[ $a -lt $b ]-gt:判断左边的值是否大于右边的值(greater than),例如[ $a -gt $b ]-le:判断左边的值是否小于等于右边的值(less than or equal to),例如[ $a -le $b ]-ge:判断左边的值是否大于等于右边的值(greater than or equal to),例如[ $a -ge $b ]用于测试表达式:测试某个表达式是否成立。例如:-f:判断某个文件是否存在并且是一个常规文件(regular file),例如[ -f file.txt ]-d:判断某个文件是否存在并且是一个目录(directory),例如[ -d dir ]-z:判断某个字符串是否为空(zero length),例如[ -z &qu
在Linux中,有三种类型的Shell变量,包括:环境变量本地变量特殊变量变量名命名规范:环境变量一般全部大写,单词和单词之间采用下划线分割:JAVA_HOME本地变量一般小写环境变量环境变量是在Shell会话外设置的,可由多个脚本和进程共享。在Linux中,环境变量没有固定值,而是在需要时通过脚本或命令进行设置或更新,系统环境变量一般在/etc/profile文件中设置。查看当前所有环境变量:printenv或env。设置一个新环境变量,使用export命令,例如:export MY_VAR="Hello World"。要使用环境变量,必须在变量名称前加上$符号,例如:echo $MY_VAR。本地变量本地变量是一种临时变量,在Shell会话中设置和使用。与环境变量不同,本地变量仅限于当前Shell会话,不会被其他脚本或命令使用。设置本地变量可以使用“=”号操作符,例如:MY_VAR="Hello World"。类似于环境变量,在使用本地变量时,变量名称前必须加上$符号。例如:echo $MY_VAR。特殊变量特殊变量是在Shell中预定义的变
开源数字集市是一个提供各种免费和开源软件信息的平台,包括音频编辑、视频编辑、数据库管理、编程工具等,还突出显示了各个项目的推荐指数,帮助用户快速判断某个工具的受欢迎程度和实用性。开源数字集市致力于提供一个由广大爱好者共同维护的开源项目分享网站,在这里,你可以进行分享你创作的或者发现的项目,也可以查看或者收藏别人分享的。网站地址开源数字集市:https://osdmp.com/
输出重定向凡是在控制台上能够打印出来的,都可以重定向,将其打印到控制台的行为重定向到文件或其它设备。ls -l > ls.txt执行结果是将输出重定向到ls.txt文件(覆盖写),追加到文件为:ls -l >> ls.txt。输入重定向<:将文件内容输入给某个命令,这是一种默认行为,通常<可省略。例如,a.txt文件内容如下:10 5 2 44 68 51将a.txt文件中的内容输入给sort命令:sort -n < ls.txt。通常<可省略,也就是:sort -n ls.txt。<<:可以接收键盘输入,例如,EOF是一个结束符,随意的,当键盘输入EOF之后,键盘输入则自动结束,然后sort命令将键盘输入的内容进行排序。# sort -n << EOF > 10 > 3 > 6 > 99 > 54 > 657 > 1 > EOF 1 3 6 10 54 99 657
软链接软链接,也称为符号链接,类似于Windows操作系统中的快捷方式,作用是方便操作。有些经常被操作的文件,藏的很深,每一次找很麻烦,怎么办?可以给这些经常操作的文件创建软链接,通过软链接快捷的操作目标文件。ln命令用来创建软链接:ln -s a.txt a,表示给a.txt文件创建一个a的快捷方式(软链接)。软链接和目标文件实际上是两个文件,在软链接中存储的是目标文件的路径。软链接关联的目标文件如果被删除,软链接这个快捷方式也就失效了。可以通过查看inode号,来证明软链接和目标文件是两个不同的文件。硬链接创建硬链接:ln a.txt a,不加-s是创建硬链接。硬链接和原文件inode号一致,说明是同一个文件。硬链接特点:主要是用来做:重要文件备份目标文件删除之后,硬链接只要在,文件其实就没有被删除。总结一句话:目标文件或者硬链接只要有一个存在,文件就没有被真正的删除硬链接机制和复制粘贴还不一样,复制粘贴之后的文件,修改其中之一,另一个不会变,但是硬链接就不一样了。通过操作硬链接,目标文件会改变;操作目标文件,硬链接也会改变
Templatemaker是一个在线免费纸盒模型下载和纸盒制作方法的网站,教你做各种各样的纸盒,种类非常丰富,原材料只需要剪刀、硬纸板和胶水,用户可以免费创建和下载自定义尺寸的纸艺和包装模板,模版类型众多,包括用于纸工艺、包装、包装设计、学习材料、装饰等,免注册即可使用下载。在这个个纸制品手工制作大全网站,如果你想自己制作一些纸盒、信封、礼品盒等纸制品,那么这个网站一定非常适合你。这个网站可以让你根据自己的需要,生成各种形状和尺寸的纸制品模板,然后只需要打印出来,按照指示折叠和粘贴,就可以得到你想要的纸制品了,让你能够充分发挥你的创造力,制作出各种各样的纸制品。无论是节日、生日、聚会还是日常生活,都可以用它来增添一些乐趣和温馨。它是一个国外网站,支持中文。网站地址Templatemaker:https://www.templatemaker.nl/
uTools是新一代效率工具平台,自由组合插件应用,打造专属你的趁手工具集。呼之即来,即用即走,打造你的个人效率助理。即用即走:不中断、无干扰,uTools致力于成为你的趁手工具插件化:一切皆插件设计,自由挑选组合轻量、优雅、简洁的插件应用超轻量:简约而不简单,插件仅一张图片大小,但功能强大。受腾讯小薇助手的影响,uTools官方插件均已免费使用。下载地址官网:https://u.tools/
Blip是一个完全免费的文件传输工具,只需一步即可转移,不限制文件大小。支持发送文件夹、全质量发送、设备快速切换、发送给附近设备等,简单轻量级。将无大小限制、高质量的大文件直接发送给其他人和设备。Blip允许您跨平台将任何大小的文件发送到其他设备或任何人(无论他们在哪里)。文件直接发送给另一个人,因此他们可以以极快的速度立即开始接收,即使是远距离。今天免费开始使用Blip。下载地址官网:https://blip.net/
GCopy是一款跨设备免费剪切板同步工具,能够帮助我们在不同设备之间无缝地共享剪切板数据,使用Go和Nextjs开发,完全开源免费。无论是文本、图片还是其他格式的文件内容,都能通过这个工具在所有已连接的设备上实现同步传输。这种便捷的剪切板同步功能,能够极大提高我们的工作效率和协作体验。该工具的优势在于能够最大限度地保护用户隐私,通过采用先进的内存临时存储方式,所以不会将我们的数据永久保存在服务器上,这就意味着我们的敏感信息不会被泄露或滥用。该工具支持多种主流浏览器和操作系统,如Windows、macOS、Android、iOS和HarmonyOS等,直接能够打开网页浏览器即可使用该工具。使用起来也非常简单,只需在不同设备上打开官网,然后使用同一电子邮箱进行登录,即可开始进行跨设备剪切板同步。复制内容后,点击右键。切换到其他设备,再次点击按钮,剪切板数据就会被同步过来,接下来就可以直接粘贴了。该工具主要面向需要在多台设备之间频繁切换工作的用户群体,能够极大地提高工作效率。除了支持文本同步外,还支持截图和文件的跨设备传输,覆盖了日常工作中的多种场景需求。网站地址官网:https://gco
996忍者身处996,则需要学会摸鱼技巧。网站初衷是:如果你为了生存无法逃离996,也要多学会摸鱼。于是乎提供了各种各样的摸鱼方式,摸鱼才是科技的第一生产力!上班就是为了下班。你摸鱼,我摸鱼,老板宝马变青桔。钱要多拿,事要少做。做最少的工作,同时保证自己全身而退,这才是摸鱼党的工作作风。坚持摸鱼20年。我的工资让我在摸鱼的时候毫无愧疚感,这叫问薪无愧。网站地址996忍者:https://996.ninja/
Supertone Shift是一款免费AI实时变声器软件,由韩国Supertone公司推出,适用于Windows和macOS系统。这款桌面客户端软件具备个性化定制、低延迟、高质量声音转换等特点,可用于VTuber、内容创作者、游戏玩家等(例如Discord、VRChat和Twitch)流行应用集成。用户可以即时切换到任意选择的声音,包括各种角色和性别,调整音高、音高动态和混响、声音并调整混合比例等参数,实现个性化声音创作,创建属于你的独特声音。功能:实时语音变换:Supertone Shift支持用户即刻切换到选择的声音,进行实时语音变换,非常适合需要即时变声的场景高质量声音库:提供由专业团队策划的高质量声音库,并且库中的声音会定期更新,以满足用户的不同需求声音自定义:用户可以调整音调、音调动态和混响等多个参数,定制和雕塑出个性化的声音语音融合:用户可以选择一个基础声音并调整融合比例,创造出独特的、属于自己的声音易于集成:Supertone Shift可以轻松集成到Discord、VRChat和Twitch等流行应用程序中,实现无缝连接和使用下载地址官网:https://produc
升级R在Windows环境下,使用installr包自动将R升级到最新版本,并将旧版本安装的R包复制到新版本R中,注意根据需求进行选择。建议在RGui中更新R,前往RGui,使用以下命令,安装并加载一个名为installr的包。install.packages("installr") library("installr")接着,运行installr::updateR()命令,并等待对话框出现。升级RStudio检查RStudio更新:Help -> Check for Updates
pyttsx3是Python文本转语音第三方库,与其他库不同,它可以脱机工作。它基于底层的TTS(Text-to-Speech)引擎,并提供了简单易用的接口,可以将文本转换为声音输出。安装安装pyttsx3:pip install pyttsx3,pip下载速度慢的话,可通过修改pip镜像源加快模块下载速度。使用import cowsay import pyttsx3 this = input("What's this? ") cowsay.cow(this) engine = pyttsx3.init() # 初始化语音引擎 engine.setProperty("rate", 150) # 设置语速 engine.setProperty("volume", 0.8) # 设置音量 voices = engine.getProperty("voices") engine.setProperty("voice", voices[0].id) # 设置语音合成器 engin
之前介绍过利用Python实现图片翻转图片裁剪图片拼接,使用的第三方库是matplotlib,今天来学习另一个用于图像处理的第三方库Pillow。PillowPIL( Python Imaging Library)是一个Python第三方图像处理库,由于其功能丰富,API简洁易用,因此深受好评,是Python中最常用且最受欢迎的图像处理库之一。但是,PIL库更新缓慢。于是一群Python社区志愿者在PIL库的基础上开发了一个支持Python3版本的图像处理库,它就是Pillow。安装安装Pillow:pip install Pillow,pip下载速度慢的话,可通过修改pip镜像源加快模块下载速度。使用文件hello.py:import sys from PIL import Image images = [] for arg in sys.argv[1:]: images.append(Image.open(arg)) images[0].save( "merged.gif", save_all=True, append_images=imag
之前有用到Python自带的测试框架unittest,听说,Python中最火的第三方开源测试框架是pytest,我们也稍微来学习一下吧!介绍pytest是一个非常成熟的全功能Python测试框架,简单灵活,容易上手。文档:http://docs.pytest.org/en/latest/contents.htmlGithub地址:https://github.com/pytest-dev/pytest/安装安装pytest:pip install pytest,pip下载速度慢的话,可通过修改pip镜像源加快模块下载速度。查看pytest版本:pytest --version。使用文件hello.py:def hello(to="world"): return f"hello, {to}" print(hello()) print(hello("python"))文件test_hello.py:from hello import hello def test_hello(): assert hello()
TinyTask是一款简约的模拟键盘和鼠标自动点击的工具,可用于记录和重复操作,为用户解决重复枯燥的鼠标或键盘的点击工作。它小得令人难以置信(只有 36KB!)、超紧凑且100%便携。界面简洁,无广告,可重复执行,很好用。使用这款免费的Windows自动化工具,可以轻松记录和重复操作。该程序可让您记录流程,只需单击按钮即可将其用作宏。顾名思义,该应用程序是轻量级的,安装时间不会超过几秒钟。事实上,它甚至不需要编码或脚本来实现流程自动化。使用TinyTask,可以节省大量时间,直接影响到效率和生产力。优点:界面简洁干净轻量级应用记录创建宏操作良好响应时间下载地址官网:https://tinytask.net/
行列设置import pandas as pd print(pd.get_option("display.max_columns")) # 显示列数 print(pd.get_option("display.max_rows")) # 显示行数 pd.set_option("display.max_columns", 1000) # 如果设置成 None 则显示所有 pd.set_option("display.max_rows", 1000) pd.reset_option("display.max_columns") # 重置为默认值 pd.reset_option("display.max_rows") print(pd.get_option("display.max_colwidth")) # 默认列宽50字符 pd.set_option("colheader_justify", "left&q
Everypixel是一个基于人工智能的图片搜索引擎,节省在海量库存内容中搜索图片的时间,从包括27个付费库存图片网站和21个免费库存图片网站聚合授权内容,减少搜索时间,并且区分过时和劣质图片,挑选出好的库存图片,每周更新,保持内容新鲜。可以搜索试一下:Naked Girls,看上去不错,艺术家可以写生了。Everypixel是一家成立于2015年的人工智能技术公司,总部位于美国华盛顿州的西雅图市。该公司利用深度学习和计算机视觉技术,为客户提供先进的图像和视频搜索工具。其主要产品包括图像搜索引擎和视频库搜索引擎,这些工具可以帮助用户快速地找到高质量、具有版权的图片和视频素材。此外,Everypixel还提供一些AI驱动的工具,如图像标记工具和颜色调整工具,帮助用户更好地处理和管理其图像库。网站地址Everypixel:https://www.everypixel.com/
三毛
头发渐少,仅剩三根