- 博客(60)
- 资源 (32)
- 收藏
- 关注
原创 刷剑指 offer 算法题
刷剑指 offer 算法题《剑指Offer》是非常好的算法书,很有启发性。《剑指Offer:名企面试官精讲典型编程题(第2版)》剖析了80个典型的编程面试题,系统整理基础知识、代码质量、解题思路、优化效率和综合能力这5个面试要点。《剑指Offer:名企面试官精讲典型编程题(第2版)》共分7章,主要包括面试的流程,讨论面试每一环节需要注意的问题;面试需要的基础知识,从编程语言、数据结构及算法三方面总结程序员面试知识点;高质量的代码,讨论影响代码质量的3个要素(规范性、完整性和鲁棒性),强调高质量代码除完成
2022-01-27 21:33:30
370
原创 写一个登录小程序,Servlet 和 HttpServlet 比较
详见https://wjftu.com/zh/tuts/javaweb/servlet/在 web.xml 里配置全局变量 <context-param> <param-name>username</param-name> <param-value>wjf</param-value> </context-param&...
2020-01-12 18:20:03
312
原创 javascript练习1 入门
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>test html</title> <script type="text/javascript"> /* *弹出一个警告框 *a.alert("...");...
2019-08-18 23:21:41
285
原创 python统计词频
wordlist = [] #一个列表,存放所有的词counter = {} #一个字典,key为词,value为计数fread = open('1.txt','r')while True: oneline = fread.readline() if not oneline: break oneline = oneline.rstrip() #去掉这一行的换行符 one...
2019-06-25 22:14:25
3438
原创 用来处理gwdac网站爬取的实验数据的python代码
写了几个用来整理gwdac爬取的散射实验数据的python代码,在这里保存一下,免得以后找不到代码一把按组分类的实验数据转成一行一个数据点#This program transfer gwdac datas to one data point per lineimport osobslist = (["DSG","P","D","DT","AYY","AXX","AZZ","AZX"...
2019-04-12 20:38:00
235
原创 MINUIT 在 local minimum 面前束手无策
设计一个0-1之间的有很多局域最小值的快速震荡函数FVAL = cos(100*3.1415926535*xval(1))/(1+scale*(xval(1)-0.55)**2)scale是一个放大参数,scale越大,最小值与其它极值点差异越大代码:program main implicit none integer,parameter :: NER=kind(0.0d0) i...
2019-04-09 22:39:28
628
原创 scp命令复制文件到服务器
在终端使用scp命令scp -P 端口 本地路径 username@ip:服务器路径例如:scp -P 22 /home/1.txt username@192.168.211.100:/home/如果是复制文件夹:scp -P 22 -r /home/mydir username@192.168.211.100:/home/如果是从服务器复制文件到本地:scp -P 22 us...
2019-03-28 10:50:02
674
原创 求4位数中所有的吸血鬼数字 c++
什么是吸血鬼数字?就像这样的 1260=2160 1827=2187#include<iostream>using namespace std;int main(){ int i; int a,b,c,d; int aa,bb; for(i=1000;i<10000;i++){ a=i%10; b=(i/10)%10; c=(i/100)%10; ...
2019-03-18 08:49:32
2341
原创 C++ Standard Template Library (STL)
模板 Template#include<iostream>using namespace std;template <typename T>T func(T a,T b){ return a+b;}int main(){ int a=1; int b=2; float c=3.0; float d=4.5; ...
2019-03-12 15:16:57
438
原创 name.com域名优惠5.89刀11年xyz域名
使用下面的链接注册可以获得5刀:https://www.name.com/referral/35bc135刀的优惠超过10刀的订单可用,6位数以上纯数字域名(必须是纯数字,而且不能是靓号)0.99刀一年,renew也是0.99刀,最长可以注册10年,两个域名凑够11年10.89-5=5.89刀。价格非常优惠了,虽然纯数字域名不那么好看,但还是可以买来玩玩。另外还有免费隐私保护1年优惠码: P...
2019-02-27 21:43:04
1287
2
原创 C++析构数组的顺序
使用析构函数析构数组的时候,析构的顺序是正向还是反向?写一段代码来看看:#include<stdio.h>class A{ public: A(){printf("A::A()\naddress=%p\n",this);} ~A(){printf("~A::A() i=%d\naddress=%p\n",i,this);} void setA(int ii){i=...
2019-02-26 13:52:01
788
原创 C++ 标准库中的复数类
参考:http://www.cplusplus.com/reference/complex/complex/#include&lt;complex&gt;#include&lt;iostream&gt;using namespace :: std; int main(){ std::complex&lt;double&gt; cnum1; std::complex&
2019-02-13 11:06:11
2486
原创 CentOS安装VNC和FireFox
之前试过很多次都失败了,这一次安装成功系统:Linux Centos 6.3 X86 64 Desktop Gnome Gen2 V1安装用的脚本:wget -N --no-check-certificate https://raw.githubusercontent.com/mmmwhy/ss-panel-and-ss-py-mu/master/Vagex-Firefox.sh &...
2019-02-10 14:14:55
662
原创 centos系统使用GNOME Shell自带的屏幕录制功能
centos系统缺少录屏软件,如果是ubuntu可以用kazam。但GNOME Shell自带录屏功能,可以通过快捷键开启和停止。开启/停止:Ctrl + Alt + Shift + R开始后右上角会显示要给小红点,说明正在录制。默认设置会30秒后自动停止,需要手动设置最长录屏时间。例如,设置最长时间为600秒gsettings set org.gnome.settings-daem...
2019-01-25 12:55:04
2100
1
原创 Hexo搭建博客及部署在 github pages 上
本地安装首先安装node.js然后按照 hexo.io 网站上的命令安装hexonpm install hexo-cli -ghexo init blog cd blog npm install # 安装依赖hexo server # 启动本地服务新建文章和页面:hexo new 文章名 # 新建文章hexo new page 页面名 # 新建页面 会在source文件夹...
2019-01-21 21:49:23
1088
原创 Linux系统下用systemd设置开机自动启动
不知道为什么有时后用rc.local设置启动项会失败,所以用systemd来设置开机自动启动首先在/etc/systemd/system/目录下建一个文件例如:vi /etc/systemd/system/aaa.service写入一下内容:[Unit]Description = This will run at startup[Service]ExecStart = /...
2019-01-20 15:59:28
5903
原创 npm install hexo-cli -g 报错
报错如下:npm ERR! Linux 4.15.0-29-genericnpm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "hexo-cli" "-g"npm ERR! node v8.10.0npm ERR! npm v3.5.2npm ERR! path /usr/local/libnpm ERR! code EACC...
2019-01-16 23:00:20
3384
4
原创 ubunu 18.04 无法安装 npm 解决办法
ubunu 18.04 无法安装npm提示:Reading package lists... DoneBuilding dependency tree Reading state information... DoneSome packages could not be installed. This may mean that you haverequested an i...
2019-01-16 22:15:21
5588
4
原创 Fortran三种计时方法
方法1:call date_and_time(charecter_date(len=8),charecter_time(len=10))方法2:call cpu_time(real_time)注意,如果是多线程运行,得到的结果是所以线程时间的和方法3:call system_clock(int_time)单位是毫秒代码:program main implicit non...
2019-01-11 11:27:11
16192
5
原创 Fortran openmp section并行计算
使用 !$OMP SECTIONS 来分配不同到线程执行不同的任务代码如下:program main use omp_lib implicit none integer :: ii,jj,kk !$OMP PARALLEL !$OMP SECTIONS !$OMP SECTION do ii=1,10 wr...
2019-01-10 01:08:13
1412
原创 Fortran DO循环使用openmp并行
使用do循环输出整数1-10,use omp_lib 可以使用函数OMP_get_thread_num()查看线程号,从0开始使用 !$OMP DO 可以将do循环拆分到不同线程program main use omp_lib implicit none integer :: ii write(*,*) "parallel" !$OMP ...
2019-01-10 00:57:26
7511
原创 Fortran openmp并行 Hello World
代码如下:program main implicit none write(*,*) 'sequential:' write(*,*) 'hello!' write(*,*) 'parallel:' !$omp parallel write(*,*) 'hello, world!' !$omp end parallel write(*,*) 'sequ...
2019-01-10 00:08:42
2732
原创 Linux下 df 命令查看磁盘空间
Linux下可以用 df 命令查看磁盘空间dfFilesystem 1K-blocks Used Available Use% Mounted onudev 8123336 0 8123336 0% /devtmpfs 1630560 1896 1628664 1% /run/dev/sd...
2019-01-09 20:09:54
1618
原创 gnuplot 使用脚本画图
每次画图如果输入一大堆命令,然后要修改其中一项,可能又要重复输入一大堆命令,可以把所有命令写在一个文本文件里,例如:#File name: plot.pltset title 'DSG at 14.1 MeV'set xlabel '{/*1.5 CM Angle (degree)}'set ylabel '{/*1.5 DSG (mb)}'set title font ",17"se...
2018-12-28 16:09:47
7909
原创 sublime 编写的 makefile 运行遇到 makefile missing separator 错误
sublime有时候会自动把Tab转换为空格,sublime打开makefile文件后,先设置Tab size = 4,再取消 indent using space,再把空格的地方改为Tab,即可如图所示,命令前面要是Tab,不能是空格1 : 1.o gfortran -o 1 obj/*.o...
2018-12-27 15:04:23
495
原创 Python open语句读写文件
print('file1\n')a='lalala'file1=open('file1.txt','w')file1.write('this is line1\nthis is line2\n')file1.write(a)file1.write('\n')file1.close()print('\nfile2\n')file2=open('file1.txt','a')fil...
2018-12-20 21:48:56
416
原创 Python函数
def sayhello(): print('hello')def plus(a,b): print(a+b)def minus(a=4,b=2): print(a-b) a=5sayhello()plus(1,3)plus(a,3)minus(a)minus(6,1)minus()def locala(): a = 9 ...
2018-12-20 21:21:25
138
原创 Python if语句
x=1y=2z=3if x<y: print('x is less than y')if x<y<z: print('x is less than y and y is less than z')if x!=y: print('x is not equal to y') if y>z: print( 'y>...
2018-12-20 20:56:41
196
原创 Python循环while和for
print('while loop 1')a=1while True: print(a) a=a+1 if a>5: breakprint('while loop 2')a=0while a<5: print(a) a=a+1print('for loop1')listb=[1,7,3,5,88,4,663]f...
2018-12-20 01:06:41
190
原创 Python 简单的运算
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwinType "copyright", "credits" or "license()" for more information.>>> 1+34>>> 4-6-2..
2018-12-20 00:47:47
252
原创 Python 打印字符串
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwinType "copyright", "credits" or "license()" for more information.>>> print('hello world')hello...
2018-12-20 00:38:55
5700
原创 python在文件中写 '\b' 与 ' ' 的区别
python在文件中写 ‘\b’ ,在gedit里面显示正常,在sublime里面显示&lt;0x08&gt;,如果用fortran读文件,会出错,改为 ’ ’ 后sublime和fortran都正常了
2018-12-18 15:48:44
1847
原创 sublime3 配置 Fortran语法高亮
下载解压后复制文件夹,打开sublime =&gt; Preference =&gt; Browse packages 粘贴进去。重启sublime,在 View =&gt; syntax =&gt; Fortran 选择 Fortran - modern
2018-12-16 15:16:22
3858
1
原创 python爬虫爬取nn-online的数据
写一个爬虫爬取nn-online.org的np散射的pwa93的各分波的理论值需要先安装Python3,Python-pip3,selenium,geckodriverpython crawler代码如下# Wang Jianfeng Dec 14 2018# python3# Install selenium first: pip3 install seleniumfrom se...
2018-12-14 15:34:13
277
原创 Python爬虫准备工作,ubuntu安装selenium和geckodriver
安装seleniumsudo apt-get install python3-pippip3 install selenium安装geckodriver (用于Firefox)在这里下载:https://github.com/mozilla/geckodriver/releasestar -zxvf geck [Tab]mv geck [Tab] /usr/local/bin...
2018-12-13 11:04:44
678
原创 Fortran面向对象练习,timer类
module mod_timerinteger,parameter :: DBL = 4 !selected_real_kind(p=14)type,public :: timer private real(DBL) :: saved_timecontains procedure,public :: start_timer =&gt; start_timer_sub pr...
2018-12-11 11:11:12
844
原创 linux 开机自动启动
编辑 etc/rc.local如果文件存在直接在 exit 0 前面加启动命令,如果文件不存在,新建一个,粘贴以下内容,在 exit 0 前面加启动命令#!/bin/sh -e## rc.local## This script is executed at the end of each multiuser runlevel.# Make sure that the script w...
2018-12-10 10:27:26
439
原创 c++ 类class
声明一个book类:#include<iostream>using namespace std;class Book{ public: string name; string author; int pages;};int main(){ Book book1; book1.name = "Lord of Ring...
2018-12-08 15:48:06
223
原创 c++指针
#include <iostream>using namespace std;int main (){ int age = 27; int *page = &age; string name = "WJF"; string *pname = &name; int numbers[5] = {1,2,3,4,5}; c...
2018-12-08 11:46:54
112
Hexo静态网站搭建,中文文档
2019-05-21
《编写高质量代码:改善C++程序的150个建议》李健(作者) epub
2019-03-28
《CentOS 7系统管理与运维实战》王亚飞&王刚
2019-01-13
PPT演示之道:写给非设计人员的幻灯片指南(典藏版) 孙小小 azw3
2018-12-19
《PPT演示之道:写给非设计人员的幻灯片指南(典藏版)全彩》 孙小小 mobi
2018-12-19
PPT演示之道:写给非设计人员的幻灯片指南(典藏版) 孙小小 epub
2018-12-18
《Linux Shell编程与编辑器使用详解》刘丽霞 azw3
2018-12-17
minuit 操作手册
2018-12-17
大数据时代:生活、工作与思维的大变革(精制多看/Kindle版)》维克托·迈尔·舍恩伯格 mobi
2018-12-17
计算进化史:改变数学的命运》[法]吉尔·多维克 azw3
2018-12-17
《Excel函数与公式速查手册》赛贝尔资讯 mobi
2018-12-16
《HTML CSS JavaScript 网页制作从入门到精通(第3版)》刘西杰 azw3
2018-12-16
《“笨办法”学Python(第3版)》[美]Zed A. Shaw azw3
2018-12-16
《Git团队协作》艾玛·简·霍格宾·韦斯特比 azw3
2018-12-16
Sublime3 Fortran语言高亮配置文件
2018-12-16
《Nginx模块开发指南:使用C++11和Boost程序库》罗剑锋 azw3
2018-12-16
《C及C++程序设计(第4版)》张富&王晓军 azw3
2018-12-16
《学习正则表达式》[美]Michael Fitzgerald epub
2018-12-14
《Python爬虫开发与项目实战》范传辉 azw3
2018-12-14
《Python 3.5从零开始学》刘宇宙 mobi
2018-12-14
《机器学习从认知到实践(第2辑)(套装共3册,Python+TensorFlow)》Alexander·T·Combs
2018-12-14
《简单的逻辑学》D.Q.麦克伦尼 azw3
2018-12-14
《简单的逻辑学》D.Q.麦克伦尼
2018-12-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人