computer science and tech
记录计算机专业学习期间的基础知识
迷麟Milin
There isn't time, so brief is life, for bickerings, apologies, heartburnings, callings to account. There is only time for loving, and but an instant, so to speak, for that. The good life is built with good relationships.
——Mark Twain
展开
-
计算Python的代码块或程序的运行时间
计算Python的代码块或程序的运行时间 1.运用场景在很多的时候我们需要计算我们程序的性能,这个时候我们常常需要统计程序运行的时间。下面我们就来说说怎么统计程转载 2020-08-04 20:14:18 · 667 阅读 · 0 评论 -
Ubuntu 界面设置
Ubuntu界面设置先上界面:界面设置方案桌面壁纸双击打开图片,右键选择设置为桌面壁纸,并设置为填充/平铺模式。图标安装Unity teek tools,在外观-主题选项中,设置扁平模式。终端透明度打开终端,右键,调节透明度。Docker任务栏下载Docker,选择Air模式。...原创 2020-03-01 00:25:54 · 1363 阅读 · 0 评论 -
github代码搜索技巧
github代码搜索技巧 代码搜索网站:代码:GitHubCodaseOhlohkrugleMerobase Component FinderGoogle Code ArchiveSymbolHound可以搜索特殊符号的搜索引擎,程序员的福音,遇...转载 2020-02-18 21:12:02 · 310 阅读 · 0 评论 -
汇编语言考试整理
一、input+xmov cl,[input1+1] ;获得输入的字符串的长度lea SI,input1+2 ;获得第一个字符的位置;用int 21h接收字符串的缓冲区的格式是第一个字节是缓冲区大小,;第二个字节是实际接收的大小的地址,;第三个字节起才是实际内容的地址。;所以INPUT+2才是实际接收内容的第一个字符的地址。二、显示字符与字符串(1)字符显示方...原创 2019-12-28 22:06:12 · 456 阅读 · 0 评论 -
Ford-Fulkerson算法 示例推导 算法导论 图算法
本文为算法导论图算法第26章最大流Ford-Fulkerson算法示例的过程推导以及方法总结。方法简述:(1)增广路更新&再选取:给多少,返多少;剩多少,送所少;最后按规则选取新的增广路(2)剩余网络计算&照抄:在选取的增广路上加min权重,其余照抄上一个剩余网络(3)算法终止:无法选取增广路时,算法终止Ford算法的实例推导过程如下:...原创 2019-12-21 19:47:23 · 951 阅读 · 1 评论 -
linux shell 多个命令一起执行的几种方法
...转载 2019-12-11 20:18:43 · 968 阅读 · 0 评论 -
linux 远程服务器 上传和下载文件
下载文件至本地:scp username@remote_ip: remote_path local_path示例:scp lixi@10.102.32.69:/home/lixi/baseline/context_attentive_ir-master/my_code/results/random_dev_candidates.txt /Users/milin/PycharmP...原创 2019-11-21 19:58:35 · 416 阅读 · 0 评论 -
用信号量解决进程的同步与互斥探讨
<p>本篇也是一篇老文,发布于2015年5月,文章比较长,算老博客看的比较多的了,贴到这儿与大家分享,以求多多交流探讨。</p>前言现代操作系统采用多道程序设计机制,多个进程可以并发执行,CPU在进程之间来回切换,共享某些资源,提高了资源的利用率,但这也使得处理并发执行的多个进程之间的冲突和相互制约关系成为了一道难题。如果对并发进程的调度不当,则可能会出现运行结果与...转载 2019-11-06 15:38:11 · 1872 阅读 · 1 评论 -
树的直径 证明 算法导论
树的直径的定义:树中任意两点距离的最大值树的直径的求法:从树的任意一点y,通过BFS到达终点x;则x必为直径的一个端点。再从x通过BFS到达终点z。z必为直径的另一个端点。则从x经过BFS到z的路径为树的其中一条直径。证明:思路:首先利用反证法证明x为直径的一个端点,则同理z也是直径的一个端点,从而xz为树的直径。证:反证法。假设x不为...原创 2019-10-20 17:42:28 · 1010 阅读 · 0 评论 -
常用汇编指令对标志位的影响
加法指令 ADD (addition)指令对标志位的影响: CF=1 最高有效位向高位有进位 CF=0 最高有效位向高位无进位 OF=1 两个同符号数相加(正数+正数 或 负数+负数),结果符号与其相反。 OF=0 ...转载 2019-10-05 20:43:36 · 7154 阅读 · 1 评论 -
Linux 后台运行程序 Screen 服务器
Linux后台运行python程序,断网||关机后仍能在继续在服务器上运行常用screen参数: screen -S sess_name -> 新建一个叫sess_name的session screen -ls -> 列出当前所有的session screen -r sess_name-> 回到sess_name这个session ...原创 2019-08-22 14:12:12 · 609 阅读 · 0 评论 -
ACM图论之存图方式
ACM图论之存图方式 By 剑紫青天 发表于 2015-07-21 文章目录 ACM图论之存图方式 邻接矩阵存图思想代码实现优点缺点邻接表存图思想代码实现优点缺点链式前...转载 2018-08-21 11:04:33 · 1122 阅读 · 0 评论 -
汉诺塔问题——递归(时隔9个月,终于懂了)
记得我第一次做汉诺塔这道题时,是2017年11月。当时,我坐在山大青岛校区图书馆3楼,不知怎么地,看到了这个题。然后,就思考了一整天,233当然,悲剧就是,我当时花了一天的时间还是没有真正理解这道题递归的思路。如今,我终于懂了,嘿嘿嘿。关于递归: 一定不要试图跟踪大型递归的过程! 要写出递归,关键就是找出递归的递归方程式: 也就是说,要完成最后一步,那么最后一步的前一步要做什...原创 2018-08-24 21:18:03 · 60524 阅读 · 41 评论 -
【UML 建模】在线UML建模工具 ProcessOn 使用详解
&转载 2018-10-28 15:09:11 · 780 阅读 · 0 评论 -
Visual Studio 2017 代码自动对齐
点【编辑】-【高级】-【设置选定内容的格式】或者按Ctrl + K 然后再按Ctrl + F 就好了你可以在常用快捷键自定义 窗口中进行查看1.进入工具-选项 对话框2.选择【环境】-【键盘】3.在 【显示命令包含】 下面的对话框中输入“对齐”关键字,然后就会在这个编辑框下面一个文本窗口中显示关于“对齐”一系列的“某某对齐”操作命令,选中你想查看的,就会在【选定命令的快捷键】一...转载 2018-10-23 19:58:51 · 33146 阅读 · 0 评论 -
c++ 判断两个文件是否相同
作者:MyLinChi 来源:CSDN 原文:https://blog.csdn.net/MyLinChi/article/details/53264342 程序很简单,主要使用了一个freopen()函数。具体的用法是:函数名:freopen 声明:FILE *freopen( const char *path, const char *mode, FILE *stream...转载 2018-11-01 20:00:51 · 5639 阅读 · 0 评论 -
矩阵快速幂模板(重载矩阵乘法)
矩阵快速幂模板转载自https://blog.csdn.net/Acerkoo/article/details/805878541. 将矩阵乘法的'+'号变为max,乘号变为'+'号C++代码如下:const int maxn = 105;typedef long long ll;ll n, m;struct node{ // m*m, m^n 矩...转载 2019-06-18 20:54:58 · 413 阅读 · 0 评论 -
U盘文件夹变成.exe文件的解决方法
U盘文件夹变成.exe文件的解决方法1.新建一个记事本文件夹, 内容为Windows Registry Editor Version 5.00[HKEY_LOCAL_ MA...转载 2019-06-09 11:30:40 · 11374 阅读 · 1 评论 -
nohup命令输出到指定的文件, 而不是默认的nohup.out
nohup命令输出到指定的文件, 而不是默认的nohup.outnohup 默认输出到当前目录的nohup.out, 可以通过下面的命令来制定nohup输出位置nohup some_command &> NEW_name.out&例如:nohup python main.py --cuda &> DRMM.out&转自下...转载 2019-08-20 18:50:43 · 10168 阅读 · 0 评论 -
C++控制数据的输出格式及位数
std::cout.setf(std::ios_base::fixed, std::ios_base::floatfield);这设置了一个cout对象的标记,命令cout使用定点表示法。同样,下面的语句导致cout在使用定点表示法时,显示3位小数:std::cout.precision(3);(此后,若输出data,则std::cout.precision(data),data便会显示3位小数)...原创 2018-03-19 19:17:39 · 5778 阅读 · 0 评论