我无法连接到postgres(使用hombrew版本9.4.4安装).我以前能够成功连接.我认为唯一可以改变的是我安装了PHP 5.5.
我尝试启动服务器:
postgres -D /usr/local/var/postgres
LOG: unrecognized configuration parameter "dynamic_shared_memory_type"
in file "/usr/local/var/postgres/postgresql.conf" line 130
FATAL: configuration file "/usr/local/var/postgres/postgresql.conf"
contains errors
Run Code Online (Sandbox Code Playgroud)
我的服务器日志返回相同的错误.以下是抛出错误的postgresql.conf文件的内容:
dynamic_shared_memory_type = posix # the default is the first option
# supported by the operating system:
# posix
# sysv
# windows
# mmap
# use none to disable dynamic shared memory
Run Code Online (Sandbox Code Playgroud)
在尝试进行故障排除时,我注释掉了dynamic_shared_memory_type并得到了以下错误:
FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 9.4,
which is not compatible with this version …Run Code Online (Sandbox Code Playgroud) 我的表单中有一个输入,它需要一个信用卡号。
<input type="text" class="form-control" name="CCnumber" ng-model="CCnumber" ng-blur="balanceParent.maskCreditCard(this)">
Run Code Online (Sandbox Code Playgroud)
在模糊时,我想像这样屏蔽信用卡输入:
4444************
然后在焦点上,我想返回原始信用卡号:
4444333322221111
使用 ng-blur,我可以执行简单的 javascript 来返回屏蔽输入。
vm.maskCreditCard = function(modalScope) {
if(modalScope.CCnumber){
var CCnumber = modalScope.CCnumber.replace(/\s+/g, '');
var parts = CCnumber.match(/[\s\S]{1,4}/g) || [];
for(var i = 0; i < parts.length; i++) {
if(i !== 0) {
parts[i] = '****';
}
}
modalScope.CCnumber = parts.join("");
}
};
Run Code Online (Sandbox Code Playgroud)
我的问题是一旦用户再次关注输入,就可以恢复该数字。有没有办法在保留输入的初始值的同时屏蔽它?