bad

Nginx报错 13: Permission denied

心不动则不痛 提交于 2021-01-12 07:53:02
今天使用Nginx代理私服nexus,出现了一个错误,前台页面直接报错显示“Bad GetWay”,后台日志输出为“13: Permission denied”。   先贴后台日志输出详细信息: 2016/05/05 14:15:21 [crit] 5014#5014: *1 connect() to 127.0.0.1:8081 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.105, server: www.dev.com, request: "GET /nexus HTTP/1.1", upstream: "http://127.0.0.1:8081/nexus", host: "www.dev.com"   解决方法:关闭SELinux这个玩意。它是干什么的?请自行百度。   查看SELinux状态:   1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态   SELinux status: enabled   2、getenforce ##也可以用这个命令检查   关闭SELinux:   1、临时关闭(不用重启机器):   setenforce 0 ##设置SELinux

C++之IO流的状态

荒凉一梦 提交于 2020-03-30 09:00:33
1 #include <iostream> 2 #include <fstream> 3 4 using namespace std; 5 6 void check_cin (istream &is) 7 { 8 if(is.bad())//系统级的错误才会bad 9 { 10 cout<<"cin bad()"<<endl; 11 }else{ 12 cout<<"cin not bad()"<<endl; 13 } 14 15 if(is.fail())// 16 { 17 cout<<"cin fail()"<<endl; 18 }else{ 19 cout<<"cin not fail()"<<endl; 20 } 21 22 if(is.eof())//输入结束的时候是eof 23 { 24 cout<<"cin eof()"<<endl; 25 }else{ 26 cout<<"cin not eof()"<<endl; 27 } 28 29 30 if(is.good())// 31 { 32 cout<<"cin good()"<<endl; 33 }else{ 34 cout<<"cin not good()"<<endl; 35 } 36 37 } 38 39 int main() 40 { 41 cout<<"检查cin的状态,一下四个状态"<<endl;

LeetCode 278 First Bad Version

|▌冷眼眸甩不掉的悲伤 提交于 2020-03-27 23:39:24
题目: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad. You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API

前端JavaScript规范

断了今生、忘了曾经 提交于 2020-03-20 23:17:39
JavaScript规范 目录 类型 对象 数组 字符串 函数 属性 变量 条件表达式和等号 块 注释 空白 逗号 分号 类型转换 命名约定 存取器 构造器 事件 模块 jQuery ES5 兼容性 HTML、CSS、JavaScript分离 使用jsHint 前端工具 类型 原始值 : 相当于传值(JavaScript对象都提供了字面量),使用字面量创建对象。 string number boolean null undefined var foo = 1, bar = foo; bar = 9; console.log(foo, bar); // => 1, 9 复杂类型 : 相当于传引用 object array function var foo = [1, 2], bar = foo; bar[0] = 9; console.log(foo[0], bar[0]); // => 9, 9 对象 使用字面值创建对象 // bad var item = new Object(); // good var item = {}; 不要使用保留字 reserved words 作为键 // bad var superman = { class: 'superhero', default: { clark: 'kent' }, private: true }; // good var

【Leetcode】278. First Bad Version

孤人 提交于 2020-03-20 22:15:41
原题 You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad. You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.

letecode [278] - First Bad Version

假装没事ソ 提交于 2020-03-17 01:03:55
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad. You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.

LeetCode(278)First Bad Version

笑着哭i 提交于 2020-03-07 07:11:20
题目 You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, …, n] and you want to find out the first bad one, which causes all the following ones to be bad. You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.

nfs挂载报错误wrong fs type, bad option, bad superblock

回眸只為那壹抹淺笑 提交于 2020-03-05 15:15:56
今天在kubernetes集群上搭建wordpress时,利用pv nfs存储方式持久化,但是pod一直不能Running, kubectl describe pod {wordpress pod name} 报错如下: mount: wrong fs type, bad option, bad superblock on 125.64.41.244:/data/img, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program) In some cases useful info is found in syslog - try dmesg | tail or so 我的wordpress服务部署到kubernetes集群,主机是腾讯云,nfs部署到阿里云,在网上搜索了一下说是没有安装 mount.nfs 导致,也是说需要在我的腾讯云主机上安装 mount.nfs 就不会有wrong fs type, bad option, bad superblock错误提示了。 根据错误提示,查看 /sbin/mount.<type> 文件,果然发现没有 /sbin

编程风格——编程中的命名设计那点事

心不动则不痛 提交于 2020-03-03 23:23:41
编程中的命名设计那点事 在我开始设计系统的时候,我会花去很多时间去设计命名,因为好的命名和好的设计是分不开的。 In the beginning was the Word, and the Word was with God, and the Word was God 太初有道。道与神同在,道就是神。 (约翰福音第一章,第一节) 在设计过程中给类,方法和函数好的命名会带来好的设计,虽然这不是一定成立,但是如果坏的命名那一定不会给你带来好的设计。在设计过程,如果你发现你很难命名某一个模块,某个方法时,可能你真正遇到的问题不是难命名的问题,而是这个设计是否真的合理,你或许应该花更多的时间来重新设计一下你的模块。 好的命名不仅会带来好的设计,好的命名还提高了程序的可读性,降低代码维护的成本。另一方面,如果糟糕的命名会给代码带来一堵无形的墙,让你必须深入代码去研究代码具有的行为,增加你理解代码的时间。 为此我总结了几条关于命名的指导原则,希望这几条原则能为你的命名设计带来帮助,我使用的是C++的语法,当然这些原则也很容易扩展到其他语言中去。 类型命名(类,接口,和结构): 名字应该尽量采用名词 Bad: Happy Good: Happiness 不要使用类似名字空间的前缀 Bad: SystemOnlineMessage Good: System::Online:Message

编程中的命名设计那点事

做~自己de王妃 提交于 2020-02-27 09:04:09
在我开始设计系统的时候,我会花去很多时间去设计命名,因为好的命名和好的设计是分不开的。 In the beginning was the Word , and the Word was with God, and the Word was God 太初有道。道与神同在,道就是神。 (约翰福音第一章,第一节) 在设计过程中给类,方法和函数好的命名会带来好的设计,虽然这不是一定成立,但是如果坏的命名那一定不会给你带来好的设计。在设计过程,如果你发现你很难命名某一个模块,某个方法时,可能你真正遇到的问题不是难命名的问题,而是这个设计是否真的合理,你或许应该花更多的时间来重新设计一下你的模块。 好的命名不仅会带来好的设计,好的命名还提高了程序的可读性,降低代码维护的成本。另一方面,如果糟糕的命名会给代码带来一堵无形的墙,让你必须深入代码去研究代码具有的行为,增加你理解代码的时间。 为此我总结了几条关于命名的指导原则,希望这几条原则能为你的命名设计带来帮助,我使用的是C++的语法,当然这些原则也很容易扩展到其他语言中去。 类型命名(类,接口,和结构) 名字应该尽量采用名词 Bad: Happy Good: Happiness 不要使用类似名字空间的前缀 Bad: SystemOnlineMessage Good: System::Online:Message 形容词不要用太多,能描述清楚就行