基于Snap的Nextcloud安装与配置
Git适合基于纯文本类文件的多人协作,但是对于一般的文件同步需求来说显得过于复杂,所以最近尝试在自己的CentOS云主机上安装了一个类似于私有云盘的Nextcloud,这里记录一下安装过程。
由于中途参考了大量博客和论坛的解决方案,这里就不一一声明和记录了。
安装Snap
据说新版的Ubuntu自带了Snap,但是我当前使用的CentOS显然没有,这里使用yum安装:
1sudo yum install snapd
安装完Snap之后就遇到了第一个坑,无法继续进行,这里要先做一些处理:
123sudo systemctl unmask snapd.servicesystemctl enable snapd.servicesystemctl start snapd.service
安装Nextcloud
使用Snap安装Nextcloud也比较简单:
12sudo snap install nextcloudsudo snap start nextcloud
完成后,首先要进入初始化页面完成初始化安装,默认地址是http://<IP/域名>,但是因为我的80和443端口都无 ...
阅读障碍与ADHD共患问题的VBM元分析
文献笔记的记录和收集。
Title
DOI
Are there shared neural correlates between dyslexia and ADHD? A meta-analysis of voxel-based morphometry studies
https://doi.org/10.1186/s11689-019-9287-8
Focus: Gray matter correlates
Introduction
The multiple deficit model stipulates that there are multiple, probabilistic predictors of developmental disorders across levels of analysis and that comorbidity arises because of risk factors that are shared by disorders.
What is missing are the potential overla ...
How To Think Straight About Psychology - 摘录 6
第四章,关注的是个案研究和安慰剂效应。
顺便一提,这个作者貌似比较喜欢在章节开头说得很绝对,然后再慢慢改回来。
Sentence 1
The reason is that case studies and testimonials are isolated events that lack the comparative information necessary to rule out alternative explanations. (Chap. 4, p. 55)
简评:不太明白这里对个案研究的划定。如果是非常罕见而几乎只能找到个案的现象,不知道作者会不会把这一类归进去。
Sentence 2
One of the leading writers about Freud’s work, Frank Sulloway, has said that “science is a two-step process. The first step is the development of hypotheses. Freud had developed a set of ext ...
How To Think Straight About Psychology - 摘录 5
进入第三章。标题是“操作主义和本质主义”。
Sentence 1
Operationism is simply the idea that concepts in scientific theories must in some way be grounded in, or linked to, observable eventes that can be measured. Linking the concept to an observable events makes the concept public. (Chap. 3, p. 39)
简评:对操作主义的简单、明确的定义。还是很容易让人接受。
Sentence 2
For example, defining the concept hunger as “that gnawing feeling I get in my stomach” is not an operational definition because it is related to the personal experience of a “gnaw ...
How To Think Straight About Psychology - 摘录 4
继续是第二章的摘录。
Sentence 1
I remind the audience that replication of a finding is critical to its acceptance as an established scientific fact and that this is particularly true in the case of results that contradict either previous data or established theory. (Chap. 2, p. 27)
简评:这里应该是把可证伪性和可重复性联系在一起了,不知道是否符合逻辑。
Sentence 2
Thus, we must look not only at the quantity of the confirming evidence, but also at the quality of the confirming instances. (Chap. 2, p. 28)
简评:这是在可证伪上的延伸,从证伪推向证实,虽然关系并不是那么密切 ...
How To Think Straight About Psychology - 摘录 3
进入绪论之后的第二章,可证伪性。作者把这一部分安排在这个位置,不难推知他对可证伪性的重视。
Sentence 1
Scientific theories must always be stated in such a way that the predictions derived from them could potentially be shown to be false. Thus, the methods of evaluating new evidence relevant to a particular theory must always include the possibility that the data will falsify the theory. (Chap. 2, p. 22)
简评:非常简单直接的阐释,简单得让人想起行为主义的主张。当然,也可以作一些延伸。从这个解释出发,可以推导出科学应当具有的预测力。一些不具有可证伪性的体系,确实不具有预测力,或者具有虚假的预测力。
Sentence 2
The more specific and prec ...
Python中ctypes调用dll的简单测试
Python便于开发但是效率一般,C/C++效率较高但是开发难度相对更大,这可以说是老生常谈了。对于我这样的业余人士而言,效率并不是那么重要,但是如果能够做相对少的工作,而使得性能可以有较大的改善,我当然还是乐意的。这里介绍一下我对ctypes调用dll的简单测试。
首先,编写一个C的程序。这里使用最简单的累加来测试速度。
123456/* test.c */void sumup();void sumup() { for(unsigned long long i = 1; i <= 1000000; i++) {}}
然后,使用gcc将test.c编译为Python可以调用的dll(注意是否添加了环境变量)。
1gcc test.c -shared -fPIC -o test.dll
在Python中分别通过ctypes调用sumup累加和使用Python实现累加,并通过装饰器(鸣谢:@Toyomu)计时。由于单次运行时间较短,为方便起见,这里选择了在Python中循环调用来延长时间。
12345678910111213141516 ...
How To Think Straight About Psychology - 摘录 2
这次看的还是绪论部分,大致讲述了心理学和“常识”的冲突,有价值的地方有不少。
Sentence 1
We all have implicit models of behavior that govern our interactions and out thoughts about ourselves and other people. Indeed, some social, personality, and cognitive psychologists study the nature of these implicit psychological theories. Rarely do we state our theories clearly and logically. (Chap. 1, p. 13)
简评:这说的应该就是“心理理论”,确实是我们会视为理所当然,常常忽视但是意义非凡的心理现象。
Sentence 2
That folk wisdom is “after the fact” wisdom, and that it actually is useles ...
How To Think Straight About Psychology - 摘录 1
来自Keith E. Stanovich所著的How To Think Straight About Psychology,人民邮电出版社,英文版,第十版。简单地摘录一些句子,以备期末作业使用。会附一些简评。
Sentence 1
The term “sciences” also signals where to look for the unity in the discipline of psychology—not to its content, but instead to its methods. (Chap. 1, p. 6)
简评:应该是作者的重要核心论点。部分同意。但是学科毕竟不能只是靠方法来定性。
Sentence 2
Another source of resistance to scientific psychology stems from the tendency to oppose the expansion of science into areas where unquestioned authorities and “common sense” ...
PyQt5基本用法&注意事项小结
前言
PyQt5可以说是Python中比较重要,也比较热门的GUI模块,依托Qt的实力而具有丰富的积累。就我目前的了解来看,和Python自带的GUI模块Tkinter相比,PyQt的重要优势是附带的图形界面工具Designer可以帮助开发者高效建立图形界面,以及更丰富的部件和信号发送-处理机制。综合起来,使用体验和Tkinter相比是要好很多的。
当然,网上关于PyQt的教程已经很多了,我暂时还是在短暂地接触上手的阶段,没有原创的经验。这里摘录一些比较基础、常用的使用示例,我个人遇到的一些问题,以及对应的解决方案。因为来源太多,很难一一记录,这里声明,除有特别说明的以外,本文的示例代码和解决方案都并非原创。
基础使用和代码示例
这里简单介绍PyQt及其GUI工具的安装和使用。
基础使用
首先是安装,使用pip install PyQt5安装即可。(PyQt模块体积略大)
安装完成后,在Python安装目录/Scripts/目录下的designer.exe即为自带的pyqt-tools图形界面工具。开启时似乎会伴有Shell界面,但是在之后关闭也没有影响。界面如图。
选择Mainw ...