关于#include<ext/hash_map>问题

In file included from /usr/include/c++/4.8/ext/hash_map:60:0,
from AlgorithmNBM.h:9,
from AlgorithmNBM.cpp:10:
/usr/include/c++/4.8/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^
求大神相助,急,谢谢!!!

2个回答

增加编译选项:To disable this warning use -Wno-deprecated. [-Wcpp]

u014731570
Parcomputing 在哪里加?
大约 4 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
hash_map 自定义hash函数出错
最近在使用hash_map 的时候发现不能自定义hash 函数,只要这样的话,就会出问题,hash_map<const char*, int, hash<const char*>, eqstr> day ;但是如果这样的话就不会有问题了,还望大神求解呀 hash_map<const char*, int> days; #include<iostream> #include<hash_map> #include<string> using namespace std; struct eqstr //定义比较函数,字符串的比较函数需要单独定义 { bool operator()(const char* a1, const char* a2) const { return strcmp(a1,a2)==0; } }; int main() { hash_map<const char*, int, hash<const char*>, eqstr> days; days["january1"] = 31; days["january2"] = 41; days["january3"] = 61; days["january4"] = 51; hash_map<const char*, int, hash<const char*>, eqstr>::iterator ite1=days.begin(); hash_map<const char*, int, hash<const char*>, eqstr>::iterator ite2 = days.end(); for (; ite1 != ite2; ++ite1) { cout << ite1->first << endl; } system("pause"); return 0; } ``` ``` ![图片说明](https://img-ask.csdn.net/upload/201803/18/1521363288_472206.jpg) 。
在linux生存mysql.so的时候 编译不通过
我想生成mysql。so文件让他被PHP调用 过程是这样的 1进入php源代码目录:# cd /usr/ChenShao/php-5.3.1/ 2、再进入要添加的mysql扩展源码目录:# cd ext/mysql/ 2、调用已经编译好的php里面的phpize:# /usr/local/php5/bin/phpize 3、然后configure:# ./configure --with-php-config=/usr/local/php5/bin/php-config --with-mysql=/usr/local/mysql (/usr/local/mysql 为mysql的安装目录) 然后我进行make(谢谢大家!) [root@ovz435 msql]# make /bin/sh /usr/local/php/php-5.2.17/ext/msql/libtool --mode=compile cc -I. -I/usr/local/php/php-5.2.17/ext/msql -DPHP_ATOM_INC -I/usr/local/php/php-5.2.17/ext/msql/include -I/usr/local/php/php-5.2.17/ext/msql/main -I/usr/local/php/php-5.2.17/ext/msql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/Hughes/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/php/php-5.2.17/ext/msql/php_msql.c -o php_msql.lo mkdir .libs cc -I. -I/usr/local/php/php-5.2.17/ext/msql -DPHP_ATOM_INC -I/usr/local/php/php-5.2.17/ext/msql/include -I/usr/local/php/php-5.2.17/ext/msql/main -I/usr/local/php/php-5.2.17/ext/msql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/Hughes/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/php/php-5.2.17/ext/msql/php_msql.c -fPIC -DPIC -o .libs/php_msql.o /usr/local/php/php-5.2.17/ext/msql/php_msql.c:38:18: 错误:msql.h:没有那个文件或目录 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:117: 错误:expected specifier-qualifier-list before ‘m_result’ /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘_delete_query’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:129: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:129: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: 在顶层: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:133: 错误:expected ‘)’ before ‘*’ token /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zm_activate_msql’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:195: 错误:‘msqlErrMsg’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:195: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:195: 错误:所在的函数内只报告一次。) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_query’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:583: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_db_query’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:625: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_list_dbs’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:636: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:636: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:659: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_list_tables’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:670: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:670: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:700: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_list_fields’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:711: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:711: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:742: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_error’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:753: 错误:‘msqlErrMsg’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_result’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:762: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:762: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:764: 错误:‘m_row’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:764: 错误:expected ‘;’ before ‘sql_row’ /usr/local/php/php-5.2.17/ext/msql/php_msql.c:783: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:791: 错误:‘sql_row’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:799: 错误:‘m_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:799: 错误:‘tmp_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_num_rows’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:863: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:863: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:870: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_num_fields’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:880: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:880: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:887: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘php_msql_fetch_hash’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:897: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:897: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:898: 错误:‘m_row’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:898: 错误:expected ‘;’ before ‘msql_row’ /usr/local/php/php-5.2.17/ext/msql/php_msql.c:899: 错误:‘m_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:899: 错误:‘msql_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:925: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:926: 错误:‘msql_row’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_data_seek’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1004: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1004: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1011: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘php_msql_get_field_name’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1030: 错误:‘INT_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1033: 错误:‘CHAR_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1036: 错误:‘REAL_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1039: 错误:‘IDENT_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1042: 错误:‘NULL_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_fetch_field’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1070: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1070: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1071: 错误:‘m_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1071: 错误:‘msql_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1089: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1107: 错误:‘PRI_KEY_FLAG’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_field_seek’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1121: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1121: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1128: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘php_msql_field_info’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1154: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1154: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1155: 错误:‘m_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1155: 错误:‘msql_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1162: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1198: 错误:‘NOT_NULL_FLAG’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1198: 错误:‘PRI_KEY_FLAG’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_free_result’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1282: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1282: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1289: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_affected_rows’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1300: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1300: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1306: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1307: 错误:‘m_query’ 没有名为 ‘af_rows’ 的成员
hash_map,unordered_map以string作为键,插入一千多万条数据后崩溃
代码: #include "stdafx.h" #include"iostream" #include<string> #include<map> #include<sstream> #include<time.h> #include<hash_map> using namespace std; typedef hash_map<string, double> myMap; void CharsAllSequen(myMap &resultMap, string &str, unsigned int n, double defaultVal); void Clear0ForStrQuen(myMap &resultMap); int main() { myMap totalMap; myMap resultMap; string str; CharsAllSequen(resultMap, str, 6, 0.00323223); stringstream ss; for (int i = 0; i < 3000; i++) { myMap::iterator iter; for (iter = resultMap.begin(); iter != resultMap.end(); ++iter) { string strTemp = iter->first; ss.str(""); ss.clear(); ss << "_"; ss << i; strTemp += ss.str(); totalMap.insert(myMap::value_type(strTemp, iter->second + i / 3001.0)); } } return 0; } void Clear0ForStrQuen(myMap &resultMap) { myMap::iterator iter = resultMap.begin(); while (iter!=resultMap.end()) { iter->second = 0; ++iter; } } //获取特定长度,由0,1,2,3四个字符组成的字符串,比如010203,作为key,值设置为defaultVal void CharsAllSequen(myMap &resultMap, string &str, unsigned int n, double defaultVal) { if (n==0) { if (str.size()>0) { resultMap.insert(myMap::value_type(str, defaultVal)); } else { return; } } else { for (int i = 0; i < 4; i++) { stringstream ss; ss << i; string temp = ss.str(); str.append(temp); CharsAllSequen(resultMap, str, n - 1, defaultVal); str = str.substr(0, str.size() - 1); } } } ![图片说明](https://img-ask.csdn.net/upload/201603/30/1459321907_516343.png)
ruby rails调试byebug在未设置断点处停留
在使用byebug调试rails代码时,经常碰到在没有设置断点的地方停住了。请求大神是怎么回事,能否去掉这个现象。 没有断点,没有多线程,没有异常。 命令行为:bundle exec unicorn_rails -c config/unicorn.rb -E development ``` (byebug) list= [85, 94] in /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/axiom-types-0.1.1/lib/axiom/types.rb 85: require 'axiom/types/decimal' 86: require 'axiom/types/float' 87: require 'axiom/types/hash' 88: require 'axiom/types/integer' 89: require 'axiom/types/set' 90: require 'axiom/types/string' 91: require 'axiom/types/symbol' => 92: require 'axiom/types/time' 93: 94: require 'axiom/types/version' (byebug) info breakpoints No breakpoints. (byebug) thread list + 1 #<Thread:0x0000000000d7cbe8 run> /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/axiom-types-0.1.1/lib/axiom/types.rb:92 (byebug) where --> #0 <main> at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/axiom-types-0.1.1/lib/axiom/types.rb:92 ͱ-- #1 Kernel.require at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #2 block in Kernel.block in require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #3 Bootsnap::LoadPathCache::LoadedFeaturesIndex.register(short#String, long#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65 #4 Kernel.require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20 #5 Kernel.require(path#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29 #6 block in ActiveSupport::Dependencies::Loadable.block in require(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293 #7 ActiveSupport::Dependencies::Loadable.load_dependency(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:259 #8 ActiveSupport::Dependencies::Loadable.require(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293 #9 <main> at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/axiom-types-0.1.1/lib/axiom-types.rb:3 ͱ-- #10 Kernel.require at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #11 block in Kernel.block in require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #12 Bootsnap::LoadPathCache::LoadedFeaturesIndex.register(short#String, long#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65 #13 Kernel.require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20 #14 Kernel.require(path#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29 #15 block in ActiveSupport::Dependencies::Loadable.block in require(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293 #16 ActiveSupport::Dependencies::Loadable.load_dependency(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:259 #17 ActiveSupport::Dependencies::Loadable.require(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293 #18 <main> at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/virtus-1.0.5/lib/virtus.rb:245 ͱ-- #19 Kernel.require at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #20 block in Kernel.block in require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #21 Bootsnap::LoadPathCache::LoadedFeaturesIndex.register(short#String, long#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65 #22 Kernel.require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20 #23 Kernel.require(path#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29 #24 block in ActiveSupport::Dependencies::Loadable.block in require(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293 #25 ActiveSupport::Dependencies::Loadable.load_dependency(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:259 #26 ActiveSupport::Dependencies::Loadable.require(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293 #27 <main> at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/grape-1.1.0/lib/grape.rb:23 ͱ-- #28 Kernel.require at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #29 block in Kernel.block in require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #30 Bootsnap::LoadPathCache::LoadedFeaturesIndex.register(short#String, long#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65 #31 Kernel.require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20 #32 Kernel.require(path#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29 #33 block in ActiveSupport::Dependencies::Loadable.block in require(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293 #34 ActiveSupport::Dependencies::Loadable.load_dependency(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:259 #35 ActiveSupport::Dependencies::Loadable.require(file#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293 #36 <main> at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/grape-path-helpers-1.0.6/lib/grape-path-helpers.rb:1 ͱ-- #37 Kernel.require(path) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #38 block in #<Class:Kernel>.block in require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 #39 Bootsnap::LoadPathCache::LoadedFeaturesIndex.register(short#String, long#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65 #40 #<Class:Kernel>.require_with_bootsnap_lfi(path#String, resolved#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20 #41 #<Class:Kernel>.require(path#String) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29 #42 block (2 levels) in Bundler::Runtime.block (2 levels) in require(*groups#Array) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:81 ͱ-- #43 Array.each at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:76 #44 block in Bundler::Runtime.block in require(*groups#Array) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:76 ͱ-- #45 Array.each at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:65 #46 Bundler::Runtime.require(*groups#Array) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:65 #47 #<Class:Bundler>.require(*groups#Array) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/bundler-1.17.3/lib/bundler.rb:114 #48 <top (required)> at /opt/gitlab/gitlab/gdk-ce/gitlab/config/application.rb:5 ͱ-- #49 Kernel.require_relative at /opt/gitlab/gitlab/gdk-ce/gitlab/config/environment.rb:3 #50 <top (required)> at /opt/gitlab/gitlab/gdk-ce/gitlab/config/environment.rb:3 ͱ-- #51 Kernel.require(path) at /opt/gitlab/gitlab/gdk-ce/gitlab/config.ru:23 #52 block in block in <main> at /opt/gitlab/gitlab/gdk-ce/gitlab/config.ru:23 ͱ-- #53 BasicObject.instance_eval(*args) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/builder.rb:55 #54 Rack::Builder.initialize(default_app#NilClass, &block#Proc) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/builder.rb:55 ͱ-- #55 Class.new(*args) at /opt/gitlab/gitlab/gdk-ce/gitlab/config.ru:1 #56 <main> at /opt/gitlab/gitlab/gdk-ce/gitlab/config.ru:1 ͱ-- #57 Kernel.eval(*args) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/unicorn-5.1.0/lib/unicorn.rb:56 #58 block in #<Class:Unicorn>.block in builder(ru#String, op#Hash) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/unicorn-5.1.0/lib/unicorn.rb:56 #59 block in Object.block in rails_builder(ru#NilClass, op#OptionParser, daemonize#FalseClass) at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/unicorn-5.1.0/bin/unicorn_rails:141 #60 Unicorn::HttpServer.build_app! at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:752 #61 Unicorn::HttpServer.start at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:129 #62 <top (required)> at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/unicorn-5.1.0/bin/unicorn_rails:213 ͱ-- #63 Kernel.load at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/bin/unicorn_rails:23 #64 <main> at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/bin/unicorn_rails:23 ͱ-- #65 Kernel.eval at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24 #66 <main> at /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24 ```
为何django admin 静态文件一直加载不上去
user root; worker_processes auto; #pid /run/nginx.pid; events { worker_connections 768; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; #access_log/var/log/nginx/access.log; #error_log/var/log/nginx/error.log; gzip on; gzip_disable "msie6"; server { listen 80; server_name 47.103.45.202; charset utf-8; location / { uwsgi_pass 127.0.0.1:8000; include /usr/local/nginx/conf/uwsgi_params; uwsgi_param UWSGI_CHDIR /data/mywork/mywork; uwsgi_param UWSGI_SCRIPT mywork.wsgi; } location /static/ { alias /data/mywork/static/; } } } ``` [uwsgi] chdir = /data/mywork #ip =0.0.0.0 #port=8000 module= mywork.wsgi:application #home= /data/env/pyweb #workers=%k processes = 4 threads=2 #http=%(d):%(port) wsgi-file = mywork/wsgi.py socket=127.0.0.1:8000 master = true pidfile=uwsgi.pid enabled-threads=true vacuum = true daemonize = /data/mywork/mywork/run.log disable-logging = true #virtualenv = /data/evn/pyweb/lib/python3.6/ static-map=/static=/data/mywork/static ``` ``` ```按照网上的方法修改setting.by, 然后先收集静态文件 修改nginx静态文件配置路径,重启nginx 重启uwsgi 还是不行,不知道原因出在哪里 求高人指点
关于intel TBB里的concurrent_hash_map里的find方法
最近用到了intel TBB里的concurrent_hash_map里的bool find( accessor& result, const Key& key ),我在if语句里判断了之后,可是发现好像进去了find函数之后就出不来了,有人直到是为什么吗,跪求大神们赐教。 代码如下: bool ThreadSafeLRUCache<TKey, TValue, THash>:: setTValue(const TKey& key,TValue& value) { HashMapAccessor hashAccessor; printf("enter setvalue\n"); if(!m_map.find(hashAccessor, key)){ printf("return false\n"); return false; } printf("left setvalue"); void *ptemp; // Acquire the lock, but don't block if it is already held std::unique_lock<ListMutex> lock(m_listMutex, std::try_to_lock); if (lock) { printf("enter lock\n"); ptemp = hashAccessor->second.m_value.value; hashAccessor->second.m_value = value; lock.unlock(); printf("left lock\n"); } scalable_free(ptemp); return true; }
wpa_supplicant编译时出现 undefined reference to `sha256_vector'
CC ../src/drivers/drivers.c CC ../src/l2_packet/l2_packet_linux.c ../src/wps/wps_common.o: In function `wps_derive_keys': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/wps/wps_common.c:101: undefined reference to `sha256_vector' ../src/wps/wps_enrollee.o: In function `wps_process_pubkey': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/wps/wps_enrollee.c:519: undefined reference to `sha256_vector' ../src/crypto/tls_openssl.o: In function `openssl_tls_cert_event': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/crypto/tls_openssl.c:1346: undefined reference to `sha256_vector' ../src/crypto/tls_openssl.o: In function `tls_verify_cb': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/crypto/tls_openssl.c:1421: undefined reference to `sha256_vector' ../src/crypto/crypto_openssl.o: In function `crypto_hash_init': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/crypto/crypto_openssl.c:620: undefined reference to `EVP_sha256' ../src/crypto/crypto_openssl.o: In function `hmac_sha256_vector': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/crypto/crypto_openssl.c:754: undefined reference to `EVP_sha256' collect2: error: ld returned 1 exit status make: *** [wpa_supplicant] Error 1 root@atheros:/home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant#
linux下整合Apache+subversion加载mod_dav_svn.so报错
报错信息: ``` httpd: Syntax error on line 219 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_dav_svn.so into server: /usr/local/subversion/lib/libsvn_subr-1.so.0: undefined symbol: apr_hash_this_key_len ``` 在modules目录下是可以找到这个mod_dav_svn.so的 一下是查看mod_dav_svn.so的信息: ``` [root@localhost bin]# ldd -r /etc/httpd/modules/mod_dav_svn.so linux-vdso.so.1 => (0x00007fff2e7ff000) libsvn_repos-1.so.0 => /usr/local/subversion/lib/libsvn_repos-1.so.0 (0x00007fe22f9c7000) libsvn_fs-1.so.0 => /usr/local/subversion/lib/libsvn_fs-1.so.0 (0x00007fe22f7bb000) libsvn_fs_fs-1.so.0 => /usr/local/subversion/lib/libsvn_fs_fs-1.so.0 (0x00007fe22f56c000) libsvn_fs_x-1.so.0 => /usr/local/subversion/lib/libsvn_fs_x-1.so.0 (0x00007fe22f31a000) libsvn_fs_util-1.so.0 => /usr/local/subversion/lib/libsvn_fs_util-1.so.0 (0x00007fe22f117000) libsvn_delta-1.so.0 => /usr/local/subversion/lib/libsvn_delta-1.so.0 (0x00007fe22ef05000) libsvn_subr-1.so.0 => /usr/local/subversion/lib/libsvn_subr-1.so.0 (0x00007fe22eb48000) libaprutil-1.so.0 => /usr/local/apr-util/lib/libaprutil-1.so.0 (0x00007fe22e922000) libexpat.so.0 => /usr/local/apr-util/lib/libexpat.so.0 (0x00007fe22e6fb000) libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0 (0x00007fe22e4c8000) librt.so.1 => /lib64/librt.so.1 (0x00007fe22e2b2000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fe22e07b000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fe22de77000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe22dc59000) libc.so.6 => /lib64/libc.so.6 (0x00007fe22d8c5000) /lib64/ld-linux-x86-64.so.2 (0x000000361da00000) libfreebl3.so => /lib64/libfreebl3.so (0x00007fe22d64b000) undefined symbol: ap_filter_flush (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_get_server_name (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_register_provider (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_fputstrs (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_os_escape_path (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_escape_html2 (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_register_output_filter (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_sub_req_method_uri (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_hook_insert_filter (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_fprintf (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_get_server_description (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_pass_brigade (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_construct_url (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_get_locktoken_list (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_hook_insert_all_liveprops (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_new_error_tag (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_find_linked_module (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_psignature (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_add_input_filter (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_xmlns_add (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_hook_find_liveprop (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_hook_gather_propsets (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_destroy_sub_req (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_lookup_provider (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_set_last_modified (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_register_liveprop_group (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_get_limit_req_body (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_push_error (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_str_tolower (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_set_content_length (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_hook_post_config (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_hook_fixups (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_show_mpm (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_hook_translate_name (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_hook_handler (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_rwrite (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_add_output_filter (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_stripprefix (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_remove_input_filter (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_get_status_line (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_get_brigade (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_getparents (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_fflush (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_do_find_liveprop (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_new_error (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_rvputs (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_add_version_component (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_hook_pre_config (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_log_perror_ (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_get_token (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_rprintf (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_xml_get_cdata (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_set_content_type (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_remove_output_filter (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_ht_time (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_no2slash (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_update_mtime (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_hook_map_to_storage (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_register_input_filter (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_log_error_ (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: ap_log_rerror_ (/etc/httpd/modules/mod_dav_svn.so) undefined symbol: dav_get_liveprop_info (/etc/httpd/modules/mod_dav_svn.so) ``` 但是我不是很懂 ,请大家帮帮忙看看是什么原因呀!
关于C++中 unordered_map 中类成员的初始化
``` #include <iostream> #include <vector> #include <unordered_map> using namespace std; class Testclass{ public: explicit Testclass(); private: std::unordered_map<std::vector<int>, int> world; }; Testclass::Testclass() { std::vector<int> temp(5); world = {{temp,0}}; } int main() { Testclass testclass(); return 0; } ``` 运行这段代码之后会报错,提示说implicit instantiation of undefined template 'std::__1::hash<std::__1::vector<int, std::__1::allocator<int> > >' : public integral_constant<bool, __is_empty(_Tp)> {}; 我觉得可能是构造函数中类成员变量member初始化的过程中出现了一些问题。求各位大神解答一下
std::map和stdext::hash_map效率问题
近期,接到一个项目,由于需要在程序运行中解析一部分数据,且该部分数据需要向后提供。 所以前同事在设计时使用了stdext::hash~map。 近期在优化该程序,需要将处理能力提高100%,我从IO,队列锁等方面改了一大通,现在效率才提高50%。 所以想问下经验较多的人,map和hash~map效率到底差距有多少(结合我的使用场景)。 1、每个map(hash~map)最多只有100个数据,键值为string std::map<string, MyDataStruct> 键值长度4~30个字符不等,且会存在汉语(会影响效率吗) 2、每个处理逻辑map均会重新构建, 两者插入效率是否差异较大。 3、查询效率,该部分自己已经写代码测试过。两者效率(vs2008+STLport)差异不大,查询10万次hash~map约少个1毫秒。(GetTicketCount()); 由于现在想知道,但是手头没有电脑,没法测试,想问下大家具体的经验。最好是自己做过实验的。
nginx ip_hash 负载均衡问题
nginx配置如下: #user nobody; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; # 定义负载均衡服务器列表 upstream svr_balance{ ip_hash; #均衡规则为 根据客户端ip地址的哈希值来分配 server 192.168.78.177; server 202.202.202.167; } server { # 虚拟服务器 http://192.168.78.177:8081 listen 8081; server_name localhost; location / { root /usr/local/nginx/html/; #网站根目录 index index.php index.html index.htm; #定义首页索引文件的名称 } # 定义 http://192.168.78.177:8081/AlienWi/ 访问规则 location /AlienWi/{ proxy_pass http://svr_balance/AlienWi/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } } 不同的客户端(ip地址同一网段,不同网段都有测试)访问http://192.168.78.178:8081/AlienWi/ 为什么总是访问到202.202.202.167, 而没有访问到192.168.78.177呢
Overlapping Squares 重叠问题
Problem Description In most puzzles we are given some pieces and we have to make a target pattern which can be built in only one possible way. But some puzzles are a bit different, we are given a target pattern and from that target pattern we have to find in how many ways the pieces can be placed. Such a puzzle is the puzzle of overlapping squares. To understand this puzzle, look at the pictures below: [tu pian] In first figure we have placed a (2x2) filled square in a (4x4) grid. In the second figure we have placed another (2x2) filled square in the grid, which have of course deleted some part of the black lines of the previous square, in third picture we have placed a third square and in the fourth picture we have placed a fourth square. The picture can become even more complex if we place more (2x2) squares. Write a program to determine if it's possible to form a target image using at most six pieces of 2x2 squares. Input The input consists of several test cases. Each test case is contained in five lines and each line contains nine characters. If the horizontal border of a filled square is visible it is denoted with ‘_’ (ASCII value 95) sign and if vertical border of a filled square is visible then it is denoted with ‘|’ (ASCII value 124) character. The board contains no other character than ‘_’, ‘|’ and of course ‘ ’ (ASCII Value 32). The border lines of the squares can only be along the grid lines. Each board lines end with a ‘#’ (Hash character) which denotes the end of line. This character is not a part of the grid or square. The last test case is followed by a single zero, which should not be processed. Output For each test case, print the case number and 'Yes' or 'No', depending on whether it's possible to form the target. Sample Input # _ _ _ # | |_ _| # |_| | # |_ _| # # _ _ # | | # |_ _| # # _ _ _ _ # |_|_|_|_|# |_|_|_|_|# |_|_|_|_|# |_|_|_|_|# _ _ # _| |_ # | |_ _| |# |_| |_|# |_ _|_|# 0 Sample Output Case 1: Yes Case 2: Yes Case 3: No Case 4: Yes
g_hash_table_insert函数无法正确插入
如题:g_hash_table_insert函数在循环中时,把循环变量作为键的时候无法正确插入,例子是插入10值结果只得到八个。 #include <glib.h> #include <string.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char** argv) { int a,b,c,d; b=2; char outbuf[100]="Columbus"; int i=0; GHashTable* hash = g_hash_table_new(g_int_hash, g_int_equal); for(i=0;i<10;i++){ g_hash_table_insert(hash, &i,outbuf); } g_printf("There are %d keys in the hash\n", g_hash_table_size(hash)); for(i=0;i<10;i++){ g_printf("The %d is %s\n",i, g_hash_table_lookup(hash, &i)); } g_printf("The 2 is %s\n", g_hash_table_lookup(hash, &b)); g_hash_table_destroy(hash); return 0; } 输出的结果是: There are 8 keys in the hash The 0 is Columbus The 1 is Columbus The 2 is Columbus The 3 is Columbus The 4 is Columbus The 5 is Columbus The 6 is Columbus The 7 is Columbus The 8 is Columbus The 9 is Columbus The 2 is (null) 为什么输出的数量是8呢,还有就是第二次查找键为2的值的时候为什么是null而在第一次却有值?
连接远端数据库失败
development: adapter: mysql encoding: utf8 database: name username: user password: 123456 host: 10.20.128.152 这样配置数据库来访问内网其他机器的数据库! 报错! Mysql::Error (Client does not support authentication protocol requested by server; consider upgrading MySQL client): c:/ruby/lib/ruby/1.8/mysql.rb:453:in `read' c:/ruby/lib/ruby/1.8/mysql.rb:130:in `real_connect' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:471:in `connect' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:165:in `initialize' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:88:in `new' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:88:in `mysql_connection' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in `send' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in `connection=' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:259:in `retrieve_connection' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1080:in `columns' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1088:in `columns_hash' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:63:in `define_attribute_methods' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:290:in `respond_to?' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:133:in `dump' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:133:in `marshal' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:111:in `close' c:/ruby/lib/ruby/1.8/cgi/session.rb:324:in `close' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1247:in `close_session' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1292:in `process_cleanup_without_flash' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/flash.rb:173:in `process_cleanup_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:133:in `process_cleanup_without_components' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/components.rb:161:in `process_cleanup' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:532:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 /!\ FAILSAFE /!\ 2010年08月20日 15时29分 Status: 500 Internal Server Error Client does not support authentication protocol requested by server; consider upgrading MySQL client c:/ruby/lib/ruby/1.8/mysql.rb:453:in `read' c:/ruby/lib/ruby/1.8/mysql.rb:130:in `real_connect' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:471:in `connect' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:165:in `initialize' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:88:in `new' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:88:in `mysql_connection' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in `send' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in `connection=' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:259:in `retrieve_connection' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1080:in `columns' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1088:in `columns_hash' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:63:in `define_attribute_methods' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:290:in `respond_to?' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:133:in `dump' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:133:in `marshal' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:111:in `close' c:/ruby/lib/ruby/1.8/cgi/session.rb:324:in `close' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1247:in `close_session' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1292:in `process_cleanup_without_flash' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/flash.rb:173:in `process_cleanup_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:133:in `process_cleanup_without_components' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/components.rb:161:in `process_cleanup' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:532:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3
nginx 跨域 swagger 访问api 请求 options 405
![图片说明](https://img-ask.csdn.net/upload/201812/21/1545383287_910353.png) 相关配置文件如下 ``` user www www; worker_processes auto; error_log /data/wwwlogs/error_nginx.log crit; pid /var/run/nginx.pid; worker_rlimit_nofile 51200; events { use epoll; worker_connections 51200; multi_accept on; } http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 1024m; client_body_buffer_size 10m; sendfile on; tcp_nopush on; keepalive_timeout 120; server_tokens off; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; fastcgi_intercept_errors on; #Gzip Compression gzip on; gzip_buffers 16 8k; gzip_comp_level 6; gzip_http_version 1.1; gzip_min_length 256; gzip_proxied any; gzip_vary on; gzip_types text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml text/javascript application/javascript application/x-javascript text/x-json application/json application/x-web-app-manifest+json text/css text/plain text/x-component font/opentype application/x-font-ttf application/vnd.ms-fontobject image/x-icon; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; ##If you have a lot of static files to serve through Nginx then caching of the files' metadata (not the actual files' contents) can save some latency. #open_file_cache max=1000 inactive=20s; #open_file_cache_valid 30s; #open_file_cache_min_uses 2; #open_file_cache_errors on; #######################appapi######################### upstream api{ server 119.3.201.144:8080; server 119.3.206.88:8080; } server { listen 7070; access_log /data/wwwlogs/access_nginx.log combined; error_log /data/wwwlogs/error_nginx.log; server_name localhost; location / { proxy_pass http://api/appapi/; include proxy.conf; } } #######################coap######################### server { listen 9090; access_log /data/wwwlogs/access_nginx.log combined; error_log /data/wwwlogs/error_nginx.log; server_name localhost; location / { proxy_pass http://api/coap/; include proxy.conf; } } ########################## vhost ############################# #include vhost/*.conf; } proxy.conf proxy_connect_timeout 300s; proxy_send_timeout 900; proxy_read_timeout 900; proxy_buffer_size 32k; proxy_buffers 4 64k; proxy_busy_buffers_size 128k; proxy_redirect off; proxy_hide_header Vary; proxy_set_header Accept-Encoding ''; proxy_set_header Referer $http_referer; proxy_set_header Cookie $http_cookie; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; ~ ```
C语言身份证校验项目,哈希表+链表
用C语言实现身份的校验,要用身份证前6位找出对应的省区,这个省区内容放在![图片说明](https://img-ask.csdn.net/upload/201706/18/1497798023_835270.png) 一个txt文件里面了,要用哈希表+链表将这些内容加入进去,该怎么实现? typedef struct _hash_map_t { size_t size; listnode_t** key; listnode_t** value; } hash_map_t; 这是哈希的结构体 struct _listnode_t { struct _listnode_t *next; union { void* data; struct _list_t *list; const char *str; long key; }nodeData; }; typedef struct _listnode_t listnode_t; 这是结点的 struct _list_t { size_t size; /* 节点数量 */ listnode_t *head; /*链表头结点指针*/ listnode_t *tail; /*链表尾结点指针*/ }; typedef struct _list_t list_t; 这是链表的 ``` ```
postfix+dovecot+extmail+nginx,在使用outlook时出现问题
给公司内部配置个邮件服务器,不对外。 以文章http://linuxu.blog.51cto.com/9471357/1641436/作为参考。 其间出现种种问题,一一解决。目前状态是以网页的形式可以正常使用,但是使用 outlook客户端时就不能工作,显示无法登录接收的邮件服务器。 我的postfix的main.cf文件是 compatibility_level = 2 queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix unknown_local_recipient_reject_code = 550 debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail newaliases_path = /usr/bin/newaliases mailq_path = /usr/bin/mailq setgid_group = postdrop html_directory = no manpage_directory = /usr/local/man sample_directory = /etc/postfix readme_directory = no inet_protocols = ipv4 meta_directory = /etc/postfix shlib_directory = no myhostname = XTIC mydomain = mail.xtic.com myorigin = $mydomain inet_interfaces = all #mydestination = $myhostname, localhost, $mydomain, localhost.$mydomain mynetworks = 192.168.2.0/24, 127.0.0.0/8 #mynetworks = 0.0.0.0/0 alias_maps = hash:/etc/aliases smtputf8_enable = no ## postfix support smtp ## smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = '' smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination #smtpd_recipient_restrictions = permit_mynetworks broken_sasl_auth_clients = yes smtpd_client_restrictions = permit_mynetworks,permit_sasl_authenticated #smtpd_client_restrictions = permit_mynetworks smtpd_sasl_security_options = noanonymous ## postfix support virtual ## virtual_mailbox_base = /var/mailbox virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf virtual_alias_domains = virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf virtual_uid_maps = static:2525 virtual_gid_maps = static:2525 virtual_transport = virtual maillog文件内容是 Sep 14 11:10:17 XTIC postfix/smtpd[5635]: connect from unknown[192.168.1.200] Sep 14 11:10:17 XTIC postfix/smtpd[5635]: DC4901C0852: client=unknown[192.168.1.200], sasl_method=LOGIN, sasl_username=zxdong@mail.xtic.com Sep 14 11:10:17 XTIC postfix/cleanup[5644]: DC4901C0852: message-id=<> Sep 14 11:10:17 XTIC postfix/smtpd[5635]: disconnect from unknown[192.168.1.200] ehlo=1 auth=1 mail=1 rcpt=1 data=1 commands=5 Sep 14 11:10:18 XTIC postfix/qmgr[28146]: DC4901C0852: from=<zxdong@mail.xtic.com>, size=546, nrcpt=1 (queue active) Sep 14 11:10:18 XTIC postfix/virtual[5646]: DC4901C0852: to=<zxdong@mail.xtic.com>, relay=virtual, delay=0.25, delays=0.17/0.03/0/0.05, dsn=2.0.0, status=sent (delivered to maildir) Sep 14 11:10:18 XTIC postfix/qmgr[28146]: DC4901C0852: removed 望哪位高人给点指点,谢谢
几何重叠,Overlapping Squares怎么实现
Problem Description In most puzzles we are given some pieces and we have to make a target pattern which can be built in only one possible way. But some puzzles are a bit different, we are given a target pattern and from that target pattern we have to find in how many ways the pieces can be placed. Such a puzzle is the puzzle of overlapping squares. To understand this puzzle, look at the pictures below: [tu pian] In first figure we have placed a (2x2) filled square in a (4x4) grid. In the second figure we have placed another (2x2) filled square in the grid, which have of course deleted some part of the black lines of the previous square, in third picture we have placed a third square and in the fourth picture we have placed a fourth square. The picture can become even more complex if we place more (2x2) squares. Write a program to determine if it's possible to form a target image using at most six pieces of 2x2 squares. Input The input consists of several test cases. Each test case is contained in five lines and each line contains nine characters. If the horizontal border of a filled square is visible it is denoted with ‘_’ (ASCII value 95) sign and if vertical border of a filled square is visible then it is denoted with ‘|’ (ASCII value 124) character. The board contains no other character than ‘_’, ‘|’ and of course ‘ ’ (ASCII Value 32). The border lines of the squares can only be along the grid lines. Each board lines end with a ‘#’ (Hash character) which denotes the end of line. This character is not a part of the grid or square. The last test case is followed by a single zero, which should not be processed. Output For each test case, print the case number and 'Yes' or 'No', depending on whether it's possible to form the target. Sample Input # _ _ _ # | |_ _| # |_| | # |_ _| # # _ _ # | | # |_ _| # # _ _ _ _ # |_|_|_|_|# |_|_|_|_|# |_|_|_|_|# |_|_|_|_|# _ _ # _| |_ # | |_ _| |# |_| |_|# |_ _|_|# 0 Sample Output Case 1: Yes Case 2: Yes Case 3: No Case 4: Yes
怎么让web3.js调用合约方法执行多笔交易在一个交易hash中?
怎么让web3.js调用合约方法执行多笔交易在一个交易hash中?之前通过智能合约调用已部署合约实现的,后来发现需要payable方法,而已经部署的合约没有该方法,然后就很尴尬了![图片说明](https://img-ask.csdn.net/upload/201806/06/1528264605_15213.png)![图片说明](https://img-ask.csdn.net/upload/201806/06/1528264662_807538.png)这两个是之前用合约调用已部署合约 下面就是用web3.js调用的效果![图片说明](https://img-ask.csdn.net/upload/201806/06/1528264643_843943.png)![图片说明](https://img-ask.csdn.net/upload/201806/06/1528264655_910078.png)
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了无数
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
大学四年自学走来,这些珍藏的「实用工具/学习网站」我全贡献出来了
知乎高赞:文中列举了互联网一线大厂程序员都在用的工具集合,涉及面非常广,小白和老手都可以进来看看,或许有新收获。
《阿里巴巴开发手册》读书笔记-编程规约
Java编程规约命名风格 命名风格 类名使用UpperCamelCase风格 方法名,参数名,成员变量,局部变量都统一使用lowerCamelcase风格 常量命名全部大写,单词间用下划线隔开, 力求语义表达完整清楚,不要嫌名字长 ...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
Python绘图,圣诞树,花,爱心 | Turtle篇
1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle() circle.shape('circle') circle.color('red') circle.speed('fastest') circle.up() square = turtle.Turtle()
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
为什么听过很多道理,依然过不好这一生?
记录学习笔记是一个重要的习惯,不希望学习过的东西成为过眼云烟。做总结的同时也是一次复盘思考的过程。 本文是根据阅读得到 App上《万维钢·精英日课》部分文章后所做的一点笔记和思考。学习是一个系统的过程,思维模型的建立需要相对完整的学习和思考过程。以下观点是在碎片化阅读后总结的一点心得总结。
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
如何优雅地打印一个Java对象?
你好呀,我是沉默王二,一个和黄家驹一样身高,和刘德华一样颜值的程序员。虽然已经写了十多年的 Java 代码,但仍然觉得自己是个菜鸟(请允许我惭愧一下)。 在一个月黑风高的夜晚,我思前想后,觉得再也不能这么蹉跎下去了。于是痛下决心,准备通过输出的方式倒逼输入,以此来修炼自己的内功,从而进阶成为一名真正意义上的大神。与此同时,希望这些文章能够帮助到更多的读者,让大家在学习的路上不再寂寞、空虚和冷。 ...
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
Linux 命令(122)—— watch 命令
1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 [1] watch(1) manual
Linux 命令(121)—— cal 命令
1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 [1] cal(1) manual
记jsp+servlet+jdbc实现的新闻管理系统
1.工具:eclipse+SQLyog 2.介绍:实现的内容就是显示新闻的基本信息,然后一个增删改查的操作。 3.数据库表设计 列名 中文名称 数据类型 长度 非空 newsId 文章ID int 11 √ newsTitle 文章标题 varchar 20 √ newsContent 文章内容 text newsStatus 是否审核 varchar 10 news...
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告(本文) 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允
相关热词 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数 c#日期精确到分钟 c#自定义异常必须继承 c#查表并返回值 c# 动态 表达式树 c# 监控方法耗时 c# listbox c#chart显示滚动条
立即提问