在检查服务时,nova-compute出错,nova-compute root nova enabled XXX None

root@root:~# nova-manage service list
nova-compute root nova enabled XXX None
nova-consoleauth root nova enabled :-) 2015-08-06 01:43:01
nova-network root nova enabled :-) 2015-08-06 01:43:03
查看日志,里面是这样显示的:
2015-08-06 09:20:53 CRITICAL nova [-] Cannot recv data: Connection reset by peer
2015-08-06 09:20:54 AUDIT nova.service [-] Starting compute node (version 2012.1.4-LOCALBRANCH:LOCALREVISION)

请问各路大神,这个应该怎么解决!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
检查Nova服务时,nova-compute出现xxx怎么解决?求大神指点!菇凉在线等
root@ubuntu:~# nova-manage service list Binary Host Zone Status State Updated At nova-consoleauth ubuntu nova enabled :-) 2015-08-06 12:42:18 nova-scheduler ubuntu nova enabled :-) 2015-08-06 12:42:18 nova-compute ubuntu nova enabled XXX None nova-network ubuntu nova enabled :-) 2015-08-06 12:42:19
kolla安装单节点openstack ocata版本过程中报错
kolla-ansible deploy /home/all-in-one一安装一大半成功了,到nova-compute就卡住了。对ansible不太熟悉,这种错误怎么解决呢,求教 相关配置文件./ansible/roles/nova/tasks/simple_cell_setup.yml TASK [nova : Waiting for nova-compute service up] ****************************** FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (20 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (19 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (18 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (17 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (16 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (15 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (14 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (13 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (12 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (11 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (10 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (9 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (8 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (7 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (6 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (5 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (4 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (3 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (2 retries left). FAILED – RETRYING: TASK: nova : Waiting for nova-compute service up (1 retries left). fatal: [localhost -> localhost]: FAILED! => {“attempts”: 20, “changed”: false, “cmd”: [“docker”, “exec”, “kolla_toolbox”, “openstack”, “–os-interface”, “internal”, “–os-auth-url”, “http://10.0.0.100:35357/v3”, “–os-identity-api-version”, “3”, “–os-project-domain-name”, “default”, “–os-tenant-name”, “admin”, “–os-username”, “admin”, “–os-password”, “zyops”, “–os-user-domain-name”, “default”, “compute”, “service”, “list”, “-f”, “json”, “–service”, “nova-compute”], “delta”: “0:00:01.242621”, “end”: “2017-03-24 20:31:43.880186”, “failed”: true, “rc”: 0, “start”: “2017-03-24 20:31:42.637565”, “stderr”: “”, “stdout”: “[]”, “stdout_lines”: [“[]”], “warnings”: []} NO MORE HOSTS LEFT ************************************************************* to retry, use: –limit @/usr/share/kolla-ansible/ansible/site.retry PLAY RECAP ********************************************************************* localhost : ok=145 changed=0 unreachable=0 failed=1 Command failed ansible-playbook -i /usr/share/kolla-ansible/ansible/inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e action=deploy /usr/share/kolla-ansible/ansible/site.yml
执行指令OpenStack compute service list 出现HTTP(500)
2017-11-08 19:18:52.833 ERROR nova.compute.manager [req-e4abe3b9-f679-41cb-bed6-064ca37a3f7f - - - - -]更新节点controller时发生错误 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager Traceback (most recent call last): 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 6571, in update_available_resource_for_node 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager rt.update_available_resource(context, nodename) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 551, in update_available_resource 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager self._update_available_resource(context, resources) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 271, in inner 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return f(*args, **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 575, in _update_available_resource 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager self._init_compute_node(context, resources) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 438, in _init_compute_node 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager self.scheduler_client.update_resource_stats(cn) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/__init__.py", line 60, in update_resource_stats 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager self.reportclient.update_resource_stats(compute_node) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/__init__.py", line 37, in __run_method 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return getattr(self.instance, __name)(*args, **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 631, in update_resource_stats 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager compute_node.hypervisor_hostname) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 407, in _ensure_resource_provider 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager rp = self._get_resource_provider(uuid) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 55, in wrapper 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return f(self, *a, **k) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 309, in _get_resource_provider 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager resp = self.get("/resource_providers/%s" % uuid) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 209, in get 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager endpoint_filter=self.ks_filter, raise_exc=False, **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 758, in get 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return self.request(url, 'GET', **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/positional/__init__.py", line 101, in inner 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return wrapped(*args, **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 491, in request 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager auth_headers = self.get_auth_headers(auth) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 818, in get_auth_headers 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return auth.get_headers(self, **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/plugin.py", line 90, in get_headers 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager token = self.get_token(session) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 90, in get_token 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return self.get_access(session).auth_token 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 136, in get_access 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager self.auth_ref = self.get_auth_ref(session) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 198, in get_auth_ref 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return self._plugin.get_auth_ref(session, **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/v3/base.py", line 167, in get_auth_ref 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager authenticated=False, log=False, **rkwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 766, in post 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return self.request(url, 'POST', **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/positional/__init__.py", line 101, in inner 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager return wrapped(*args, **kwargs) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 655, in request 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager raise exceptions.from_response(resp, method, url) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager InternalServerError: Internal Server Error (HTTP 500) 2017-11-08 19:18:52.833 1503 ERROR nova.compute.manager
安装netcdf-fortran出错 cannot compute sizeof (off_t)
![图片说明](https://img-ask.csdn.net/upload/201902/01/1548951130_689021.png)安装netcdf-fortran出错,求助各位大佬
openstack 登陆不上dashboard 500
systemctl restart httpd memcached重启正常无报错,但是在网页访问 http://192.168.10.11/dashboard就报错了!! 网页显示内容: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. **error_log:** [Tue Apr 16 12:12:21.668699 2019] [suexec:notice] [pid 17748] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Tue Apr 16 12:12:21.683331 2019] [auth_digest:notice] [pid 17748] AH01757: generating secret for digest authentication ... [Tue Apr 16 12:12:21.684405 2019] [lbmethod_heartbeat:notice] [pid 17748] AH02282: No slotmem from mod_heartmonitor [Tue Apr 16 12:12:21.692264 2019] [mpm_prefork:notice] [pid 17748] AH00163: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations [Tue Apr 16 12:12:21.692312 2019] [core:notice] [pid 17748] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Tue Apr 16 12:12:44.497412 2019] [:error] [pid 17753] WARNING:root:Use of this 'djano.wsgi' file has been deprecated since the Rocky release in favor of 'wsgi.py' in the 'openstack_dashboard' module. This file is a legacy naming from before Django 1.4 and an importable 'wsgi.py' is now the default. This file will be removed in the T release cycle. [Tue Apr 16 12:12:45.992718 2019] [:error] [pid 17753] [remote 192.168.10.1:68] mod_wsgi (pid=17753): Target WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi' cannot be loaded as Python module. [Tue Apr 16 12:12:45.992801 2019] [:error] [pid 17753] [remote 192.168.10.1:68] mod_wsgi (pid=17753): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'. [Tue Apr 16 12:12:45.992834 2019] [:error] [pid 17753] [remote 192.168.10.1:68] Traceback (most recent call last): [Tue Apr 16 12:12:45.992852 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi", line 40, in <module> [Tue Apr 16 12:12:45.992936 2019] [:error] [pid 17753] [remote 192.168.10.1:68] application = get_wsgi_application() [Tue Apr 16 12:12:45.992949 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application [Tue Apr 16 12:12:45.992985 2019] [:error] [pid 17753] [remote 192.168.10.1:68] django.setup(set_prefix=False) [Tue Apr 16 12:12:45.992994 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/lib/python2.7/site-packages/django/__init__.py", line 22, in setup [Tue Apr 16 12:12:45.993032 2019] [:error] [pid 17753] [remote 192.168.10.1:68] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) [Tue Apr 16 12:12:45.993042 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__ [Tue Apr 16 12:12:45.993109 2019] [:error] [pid 17753] [remote 192.168.10.1:68] self._setup(name) [Tue Apr 16 12:12:45.993118 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup [Tue Apr 16 12:12:45.993131 2019] [:error] [pid 17753] [remote 192.168.10.1:68] self._wrapped = Settings(settings_module) [Tue Apr 16 12:12:45.993137 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 110, in __init__ [Tue Apr 16 12:12:45.993146 2019] [:error] [pid 17753] [remote 192.168.10.1:68] mod = importlib.import_module(self.SETTINGS_MODULE) [Tue Apr 16 12:12:45.993154 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module [Tue Apr 16 12:12:45.993191 2019] [:error] [pid 17753] [remote 192.168.10.1:68] __import__(name) [Tue Apr 16 12:12:45.993199 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/share/openstack-dashboard/openstack_dashboard/settings.py", line 460, in <module> [Tue Apr 16 12:12:45.993304 2019] [:error] [pid 17753] [remote 192.168.10.1:68] '.secret_key_store')) [Tue Apr 16 12:12:45.993313 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/lib/python2.7/site-packages/horizon/utils/secret_key.py", line 70, in generate_or_read_from_file [Tue Apr 16 12:12:45.993380 2019] [:error] [pid 17753] [remote 192.168.10.1:68] key = read_from_file(key_file) [Tue Apr 16 12:12:45.993398 2019] [:error] [pid 17753] [remote 192.168.10.1:68] File "/usr/lib/python2.7/site-packages/horizon/utils/secret_key.py", line 52, in read_from_file [Tue Apr 16 12:12:45.993413 2019] [:error] [pid 17753] [remote 192.168.10.1:68] with open(key_file, 'r') as f: [Tue Apr 16 12:12:45.993428 2019] [:error] [pid 17753] [remote 192.168.10.1:68] IOError: [Errno 13] Permission denied: '/usr/share/openstack-dashboard/openstack_dashboard/local/.secret_key_store' **acces_log:** 192.168.10.128 - - [16/Apr/2019:12:12:30 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/allocations HTTP/1.1" 200 54 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:12:38 +0800] "GET /resource_providers?in_tree=96408690-7cca-44ad-b187-13ee8fadbca6 HTTP/1.1" 200 807 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.1 - - [16/Apr/2019:12:12:43 +0800] "GET /dashboard HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" 192.168.10.128 - - [16/Apr/2019:12:12:45 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/inventories HTTP/1.1" 200 395 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:12:48 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/aggregates HTTP/1.1" 200 53 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:12:48 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/traits HTTP/1.1" 200 368 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:12:49 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/inventories HTTP/1.1" 200 395 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:13:31 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/allocations HTTP/1.1" 200 54 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:13:31 +0800] "GET /resource_providers?in_tree=96408690-7cca-44ad-b187-13ee8fadbca6 HTTP/1.1" 200 807 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:13:31 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/inventories HTTP/1.1" 200 395 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:13:32 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/aggregates HTTP/1.1" 200 53 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:13:32 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/traits HTTP/1.1" 200 368 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" 192.168.10.128 - - [16/Apr/2019:12:13:32 +0800] "GET /resource_providers/96408690-7cca-44ad-b187-13ee8fadbca6/inventories HTTP/1.1" 200 395 "-" "nova-compute keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5"
tensorflow-gpu跑训练时GPU的compute0使用率90%多,compute1使用率却为0%
如题,tensorflow-gpu跑训练时,Windows的任务管理器显示GPU的compute0使用率90%多,compute1使用率却为0%,截图如下,请问是什么原因? ![图片说明](https://img-ask.csdn.net/upload/201909/22/1569145936_781691.png)
openstack-在centos7上源码安装ocata版,创建实例时,报401的错,求助!
环境:centos7 + ocata版本 + OpenPower 服务器 tail -f /var/log/nova/compute.log 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager [req-48ad4de2-cfb6-4166-94bb-cb5525ce6f76 8a19a07251864ea79ec9e21c5ded1737 40a3463da5d744dd90868e2436d2da94 - - -] Instance failed network setup after 1 attempt(s): Unauthorized: The request you have made requires authentication. (HTTP 401) (Request-ID: req-f162b5bb-209d-4fa7-8c21-1f24c439ee11) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager Traceback (most recent call last): 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1403, in _allocate_network_async 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager bind_host_id=bind_host_id) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 873, in allocate_for_instance 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager bind_host_id, dhcp_options, available_macs) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 992, in _update_ports_for_instance 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager vif.destroy() 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__ 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager self.force_reraise() 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager six.reraise(self.type_, self.value, self.tb) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 962, in _update_ports_for_instance 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager port_client, instance, port_id, port_req_body) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 427, in _update_port 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager port_response = port_client.update_port(port_id, port_req_body) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 99, in wrapper 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager ret = obj(*args, **kwargs) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 780, in update_port 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager return self.put(self.port_path % (port), body=body) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 99, in wrapper 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager ret = obj(*args, **kwargs) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 370, in put 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager headers=headers, params=params) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 99, in wrapper 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager ret = obj(*args, **kwargs) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 338, in retry_request 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager headers=headers, params=params) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 99, in wrapper 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager ret = obj(*args, **kwargs) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 289, in do_request 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager resp, replybody = self.httpclient.do_request(action, method, body=body) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/neutronclient/client.py", line 314, in do_request 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager return self.request(url, method, **kwargs) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/neutronclient/client.py", line 302, in request 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager resp = super(SessionClient, self).request(*args, **kwargs) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 189, in request 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager return self.session.request(url, method, **kwargs) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 573, in request 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager auth_headers = self.get_auth_headers(auth) 2017-11-02 09:47:06.248 5999 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 900, in get_auth_headers
pycharm远程调试openstack
搭建了一套OpenStack单机环境,自己本机安装了pycharm专业版。想进行远程调试,pycharm进行了remote_debug 配置,并且自己用一个demo脚本进行了测试,远程可以单步调试。但是当对nova-compute组件调试的时候,一点击单步调试按钮就停止调试,控制台报如下错: Could not find thread pid_22072_id_140464812642256 Available: ['pid_22072_id_140464797811344', 'pid_22072_id_140464586618256', 'pid_22072_id_140464586743952', 'pid_22072_id_140464586618768', 'pid_22072_id_140464586620048']
openstack云主机起不来,具体看下边问题和日志
``` 456 ID 77553db8-8258-4e53-b63c-1e79271ab089 状态 错误 可用域 nova 已创建 2019年4月11日 21:57 从创建以来 0 分钟 主机 - 故障 消息 No valid host was found. There are not enough hosts available. 编码 500 详情 File "/usr/lib/python2.7/site-packages/nova/conductor/manager.py", line 392, in build_instances context, request_spec, filter_properties) File "/usr/lib/python2.7/site-packages/nova/conductor/manager.py", line 436, in _schedule_instances hosts = self.scheduler_client.select_destinations(context, spec_obj) File "/usr/lib/python2.7/site-packages/nova/scheduler/utils.py", line 372, in wrapped return func(*args, **kwargs) File "/usr/lib/python2.7/site-packages/nova/scheduler/client/__init__.py", line 51, in select_destinations return self.queryclient.select_destinations(context, spec_obj) File "/usr/lib/python2.7/site-packages/nova/scheduler/client/__init__.py", line 37, in __run_method return getattr(self.instance, __name)(*args, **kwargs) File "/usr/lib/python2.7/site-packages/nova/scheduler/client/query.py", line 32, in select_destinations return self.scheduler_rpcapi.select_destinations(context, spec_obj) File "/usr/lib/python2.7/site-packages/nova/scheduler/rpcapi.py", line 121, in select_destinations return cctxt.call(ctxt, 'select_destinations', **msg_args) File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 158, in call retry=self.retry) File "/usr/lib/python2.7/site-packages/oslo_messaging/transport.py", line 90, in _send timeout=timeout, retry=retry) File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 470, in send retry=retry) File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 461, in _send raise result 已创建 2019年4月11日 21:57 规格 云主机类型名称 云主机1型 云主机类型ID 8eda3b60-4832-4ab0-8f9a-3ef9604b9b8e 内存 2GB VCPU数量 3 VCPU 磁盘 20GB 临时磁盘 2GB IP地址 外网 10.0.0.109 Sharednet1 192.168.200.111 安全组 default 允许 IPv4 from default 允许 IPv4 icmp from default 允许 IPv4 icmp to 0.0.0.0/0 允许 IPv6 to ::/0 允许 IPv4 to 0.0.0.0/0 允许 IPv6 from default 元数据 密钥对名称 无 镜像名称 CentOS6.5 镜像ID 873a7d1e-16d2-49e3-85c1-60e880253dcc ``` ``` 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [req-4b1cd3d0-1b63-4f3d-a101-482dc9b7cdc2 73392af71b774eae8ec398adf423d560 b9670c01673c47fa8c24e854fdf9f737 - - -] [instance: 77553db8-8258-4e53-b63c-1e79271ab089] Instance failed to spawn 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] Traceback (most recent call last): 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2218, in _build_resources 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] yield resources 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2064, in _build_and_run_instance 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] block_device_info=block_device_info) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 2780, in spawn 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] block_device_info=block_device_info) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4924, in _create_domain_and_network 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] xml, pause=pause, power_on=power_on) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4855, in _create_domain 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] guest.launch(pause=pause) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/guest.py", line 142, in launch 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] self._encoded_xml, errors='ignore') 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__ 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] self.force_reraise() 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] six.reraise(self.type_, self.value, self.tb) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/guest.py", line 137, in launch 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] return self._domain.createWithFlags(flags) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 183, in doit 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] result = proxy_call(self._autowrap, f, *args, **kwargs) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 141, in proxy_call 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] rv = execute(f, *args, **kwargs) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 122, in execute 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] six.reraise(c, e, tb) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 80, in tworker 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] rv = meth(*args, **kwargs) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1110, in createWithFlags 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] libvirtError: internal error: qemu unexpectedly closed the monitor: 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] (process:51935): GLib-WARNING **: 06:57:57.413: gmem.c:489: custom memory allocation vtable not supported 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] 2019-04-11T21:57:57.529392Z qemu-kvm: CPU feature arat not found 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] ```
openstack 用deshboard创建实例失败
环境是ubuntu12.04 server 3个节点,compute node,controller node,block storage node,网络服务用到是nova-network 每台服务器一个网卡,eth0 192.168.1.xxx, 然后又虚拟了一个ip eth0:0 10.0.0.xxx 接下来完全安装openstack官网的安装部署步骤来的,在安装完以后用deshboard登录,创建实例的时候出现错误,错误信息如下: 云主机概况 信息 名称 a ID 0eb442be-8ad3-4184-b8c4-a8d1027b4ccb 状态 Error 可用域 nova 已创建 七月 3, 2014, 6:19 a.m. 正常运行时间 16 分钟 故障 消息 Remote error: ProcessExecutionError Unexpected error while running command. Command: sudo nova-rootwrap /etc/nova/rootwrap.conf env CONFIG_FILE=["/etc/nova/nova.conf"] NETWORK_ID=1 dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/var/lib/ 编码 500 详情 File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 296, in decorated_function return function(self, context, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2075, in run_instance do_run_instance() File "/usr/lib/python2.7/dist-packages/nova/openstack/common/lockutils.py", line 249, in inner return f(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2074, in do_run_instance legacy_bdm_in_spec) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1207, in _run_instance notify("error", fault=e) # notify that build failed File "/usr/lib/python2.7/dist-packages/nova/openstack/common/excutils.py", line 68, in __exit__ six.reraise(self.type_, self.value, self.tb) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1191, in _run_instance instance, image_meta, legacy_bdm_in_spec) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1355, in _build_instance filter_properties, bdms, legacy_bdm_in_spec) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1401, in _reschedule_or_error self._log_original_error(exc_info, instance_uuid) File "/usr/lib/python2.7/dist-packages/nova/openstack/common/excutils.py", line 68, in __exit__ six.reraise(self.type_, self.value, self.tb) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1396, in _reschedule_or_error bdms, requested_networks) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2127, in _shutdown_instance self._try_deallocate_network(context, instance, requested_networks) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2086, in _try_deallocate_network self._set_instance_error_state(context, instance['uuid']) File "/usr/lib/python2.7/dist-packages/nova/openstack/common/excutils.py", line 68, in __exit__ six.reraise(self.type_, self.value, self.tb) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2081, in _try_deallocate_network self._deallocate_network(context, instance, requested_networks) File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1775, in _deallocate_network context, instance, requested_networks=requested_networks) File "/usr/lib/python2.7/dist-packages/nova/network/api.py", line 94, in wrapped return func(self, context, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/nova/network/api.py", line 318, in deallocate_for_instance requested_networks=requested_networks) File "/usr/lib/python2.7/dist-packages/nova/network/rpcapi.py", line 190, in deallocate_for_instance return cctxt.call(ctxt, 'deallocate_for_instance', **kwargs) File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/client.py", line 150, in call wait_for_reply=True, timeout=timeout) File "/usr/lib/python2.7/dist-packages/oslo/messaging/transport.py", line 90, in _send timeout=timeout) File "/usr/lib/python2.7/dist-packages/oslo/messaging/_drivers/amqpdriver.py", line 412, in send return self._send(target, ctxt, message, wait_for_reply, timeout) File "/usr/lib/python2.7/dist-packages/oslo/messaging/_drivers/amqpdriver.py", line 405, in _send raise result 已创建 七月 3, 2014, 6:19 a.m. 规格 云主机类型 m1.tiny 内存 512MB 虚拟内核 1 虚拟内核 磁盘 1GB IP地址 Demo-Net 安全组 default 未定义规则。 元数据 键名称 demo-key 镜像名称 (not found) 云硬盘已连接 连接到 myVolume on vda 我个人感觉可能是network出现了问题,希望遇到过这个问题,或者能提供一些排错方法的朋友致电
matplotlib中add_subplot出错
以下代码是天文包astroML中的例子,运行时出错,调试发现是 一起 fig = plt.figure(figsize=(5, 1.66)) 与 ax = fig.add_subplot(131) 一起运行时出错。但不知道为什么? 还有很奇怪的时以前可以运行的代码,在运行完下面代码出错后,在运行也会出同样的错误 代码: ``` """ EM example: Gaussian Mixture Models ----------------------------------- Figure 6.6 A two-dimensional mixture of Gaussians for the stellar metallicity data. The left panel shows the number density of stars as a function of two measures of their chemical composition: metallicity ([Fe/H]) and alpha-element abundance ([alpha/Fe]). The right panel shows the density estimated using mixtures of Gaussians together with the positions and covariances (2-sigma levels) of those Gaussians. The center panel compares the information criteria AIC and BIC (see Sections 4.3.2 and 5.4.3). """ # Author: Jake VanderPlas # License: BSD # The figure produced by this code is published in the textbook # "Statistics, Data Mining, and Machine Learning in Astronomy" (2013) # For more information, see http://astroML.github.com # To report a bug or issue, use the following forum: # https://groups.google.com/forum/#!forum/astroml-general from __future__ import print_function import numpy as np from matplotlib import pyplot as plt from sklearn.mixture import GaussianMixture from astroML.datasets import fetch_sdss_sspp from astroML.utils.decorators import pickle_results from astroML.plotting.tools import draw_ellipse #---------------------------------------------------------------------- # This function adjusts matplotlib settings for a uniform feel in the textbook. # Note that with usetex=True, fonts are rendered with LaTeX. This may # result in an error if LaTeX is not installed on your system. In that case, # you can set usetex to False. if "setup_text_plots" not in globals(): from astroML.plotting import setup_text_plots setup_text_plots(fontsize=8, usetex=True) #------------------------------------------------------------ # Get the Segue Stellar Parameters Pipeline data data = fetch_sdss_sspp(cleaned=True) X = np.vstack([data['FeH'], data['alphFe']]).T # truncate dataset for speed X = X[::5] #------------------------------------------------------------ # Compute GaussianMixture models & AIC/BIC N = np.arange(1, 14) @pickle_results("GMM_metallicity.pkl") def compute_GaussianMixture(N, covariance_type='full', max_iter=1000): models = [None for n in N] for i in range(len(N)): print(N[i]) models[i] = GaussianMixture(n_components=N[i], max_iter=max_iter, covariance_type=covariance_type) models[i].fit(X) return models models = compute_GaussianMixture(N) AIC = [m.aic(X) for m in models] BIC = [m.bic(X) for m in models] i_best = np.argmin(BIC) gmm_best = models[i_best] print("best fit converged:", gmm_best.converged_) print("BIC: n_components = %i" % N[i_best]) #------------------------------------------------------------ # compute 2D density FeH_bins = 51 alphFe_bins = 51 H, FeH_bins, alphFe_bins = np.histogram2d(data['FeH'], data['alphFe'], (FeH_bins, alphFe_bins)) Xgrid = np.array(list(map(np.ravel, np.meshgrid(0.5 * (FeH_bins[:-1] + FeH_bins[1:]), 0.5 * (alphFe_bins[:-1] + alphFe_bins[1:]))))).T log_dens = gmm_best.score_samples(Xgrid).reshape((51, 51)) #------------------------------------------------------------ # Plot the results fig = plt.figure(figsize=(5, 1.66)) fig.subplots_adjust(wspace=0.45, bottom=0.25, top=0.9, left=0.1, right=0.97) # plot density ax = fig.add_subplot(131) ax.imshow(H.T, origin='lower', interpolation='nearest', aspect='auto', extent=[FeH_bins[0], FeH_bins[-1], alphFe_bins[0], alphFe_bins[-1]], cmap=plt.cm.binary) ax.set_xlabel(r'$\rm [Fe/H]$') ax.set_ylabel(r'$\rm [\alpha/Fe]$') ax.xaxis.set_major_locator(plt.MultipleLocator(0.3)) ax.set_xlim(-1.101, 0.101) ax.text(0.93, 0.93, "Input", va='top', ha='right', transform=ax.transAxes) # plot AIC/BIC ax = fig.add_subplot(132) ax.plot(N, AIC, '-k', label='AIC') ax.plot(N, BIC, ':k', label='BIC') ax.legend(loc=1) ax.set_xlabel('N components') plt.setp(ax.get_yticklabels(), fontsize=7) # plot best configurations for AIC and BIC ax = fig.add_subplot(133) ax.imshow(np.exp(log_dens), origin='lower', interpolation='nearest', aspect='auto', extent=[FeH_bins[0], FeH_bins[-1], alphFe_bins[0], alphFe_bins[-1]], cmap=plt.cm.binary) ax.scatter(gmm_best.means_[:, 0], gmm_best.means_[:, 1], c='w') for mu, C, w in zip(gmm_best.means_, gmm_best.covariances_, gmm_best.weights_): draw_ellipse(mu, C, scales=[1.5], ax=ax, fc='none', ec='k') ax.text(0.93, 0.93, "Converged", va='top', ha='right', transform=ax.transAxes) ax.set_xlim(-1.101, 0.101) ax.set_ylim(alphFe_bins[0], alphFe_bins[-1]) ax.xaxis.set_major_locator(plt.MultipleLocator(0.3)) ax.set_xlabel(r'$\rm [Fe/H]$') ax.set_ylabel(r'$\rm [\alpha/Fe]$') plt.show() ```
/usr/bin/ld: cannot find -lOPTIONS 无法找到OPTIONS库。
我在UBUNTU 18.04 下用CUDA 10.2 和 C++11标准编译一个较大的工程。 Makefile 是用CMAKE文件生成的。当我在terminal完成编译时显示了如下错误: ``` /usr/bin/ld: cannot find -lOPTIONS collect2: error: ld returned 1 exit status CMakeFiles/cuda_othermain.dir/build.make:132: recipe for target 'bin/cuda_othermain' failed make[2]: *** [bin/cuda_othermain] Error 1 CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/cuda_othermain.dir/all' failed make[1]: *** [CMakeFiles/cuda_othermain.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 ``` 提示是找不到一个叫OPTIONS的库。我的camke和源码里都没有链接这个库,而且我在网上搜索也根本没有一个库叫做OPTIONS。我很疑惑,编译工程时没有显示任何其他错误,顶多就是有几个warning,我查了一下都是没有太大关系的。所以现在没有什么思路去解决这个问题。 所以想请教一下各位有没有什么解决思路。 CMAKE文件如下: ``` cmake_minimum_required (VERSION 3.8 FATAL_ERROR) #project (cusam_cuda) project(cusam_cuda LANGUAGES C CXX CUDA) find_package(CUDA 10.2 REQUIRED) set(CUDA_NVCC_FLAGS -std=c++11 -L/usr/local/cuda-10.2/lib64 -lcudart -lcuda) set(CMAKE_CXX_STANDARD 11) if (CUDA_VERBOSE_PTXAS) set(VERBOSE_PTXAS --ptxas-options=-v) endif (CUDA_VERBOSE_PTXAS) #set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Debug") SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CUDA_NVCC_FLAGS} -O0 -Wall -g -ggdb") SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CUDA_NVCC_FLAGS} -O3 -Wall") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(GENCODE_SM30 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_30,code=compute_30) set(GENCODE_SM35 -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_35,code=compute_35) set(GENCODE_SM37 -gencode=arch=compute_37,code=sm_37 -gencode=arch=compute_37,code=compute_37) set(GENCODE_SM50 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_50,code=compute_50) set(GENCODE_SM60 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_60,code=compute_60) set(GENCODE_SM61 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_61,code=compute_61) set(GENCODE_SM70 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_70,code=compute_70) set(GENCODE_SM71 -gencode=arch=compute_71,code=sm_71 -gencode=arch=compute_71,code=compute_71) set(GENCODE_SM75 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_75,code=compute_75) option(CUDAMATRIX_GENCODE_SM30 "GENCODE_SM30" OFF) option(CUDAMATRIX_GENCODE_SM35 "GENCODE_SM35" ON) option(CUDAMATRIX_GENCODE_SM37 "GENCODE_SM37" OFF) option(CUDAMATRIX_GENCODE_SM50 "GENCODE_SM50" OFF) option(CUDAMATRIX_GENCODE_SM60 "GENCODE_SM60" OFF) option(CUDAMATRIX_GENCODE_SM61 "GENCODE_SM61" OFF) option(CUDAMATRIX_GENCODE_SM70 "GENCODE_SM70" OFF) option(CUDAMATRIX_GENCODE_SM71 "GENCODE_SM71" OFF) option(CUDAMATRIX_GENCODE_SM75 "GENCODE_SM75" OFF) if (CUDAMATRIX_GENCODE_SM37) set(GENCODE ${GENCODE} ${GENCODE_SM37}) endif(CUDAMATRIX_GENCODE_SM37) if (CUDAMATRIX_GENCODE_SM50) set(GENCODE ${GENCODE} ${GENCODE_SM50}) endif(CUDAMATRIX_GENCODE_SM50) if (CUDAMATRIX_GENCODE_SM60) set(GENCODE ${GENCODE} ${GENCODE_SM60}) endif(CUDAMATRIX_GENCODE_SM60) if (CUDAMATRIX_GENCODE_SM61) set(GENCODE ${GENCODE} ${GENCODE_SM61}) endif(CUDAMATRIX_GENCODE_SM61) if (CUDAMATRIX_GENCODE_SM70) set(GENCODE ${GENCODE} ${GENCODE_SM70}) endif(CUDAMATRIX_GENCODE_SM70) if(CUDAMATRIX_GENCODE_SM71) set(GENCODE ${GENCODE} ${GENCODE_SM71}) endif(CUDAMATRIX_GENCODE_SM71) if(CUDAMATRIX_GENCODE_SM75) set(GENCODE ${GENCODE} ${GENCODE_SM75}) endif(CUDAMATRIX_GENCODE_SM75) include_directories(/usr/local/cuda/include) include_directories(utils) #include_directories(3rdparty/googletest/googletest) #include_directories(3rdparty/googletest/googletest/include) #add_subdirectory(3rdparty/googletest/googletest googletest.out) add_subdirectory(geometry) add_subdirectory(navigation) add_subdirectory(3rdparty) add_subdirectory(nonlinear) add_subdirectory(inference) add_subdirectory(mat) add_subdirectory(miniblas) add_subdirectory(miniblas/cblas) add_subdirectory(miniblas/blas) add_subdirectory(miniblas/permutation) add_subdirectory(miniblas/sys) add_subdirectory(miniblas/linalg) add_subdirectory(linear) #add_subdirectory(test) #cuda_add_executable(imukittiexamplegps_gaussiannewton imukittiexamplegps_gaussiannewton.cpp # OPTIONS ${GENCODE} ${CUDA_VERBOSE_PTXAS}) #target_link_libraries(imukittiexamplegps_gaussiannewton geometry miniblas blas cblas linalg permutation sys navigation 3rdparty linear nonlinear inference mat) #cuda_add_executable(othermain othermain.cpp # OPTIONS ${GENCODE} ${CUDA_VERBOSE_PTXAS}) #target_link_libraries(othermain geometry miniblas blas cblas linalg permutation sys navigation 3rdparty linear nonlinear inference mat) target_compile_features(nonlinear PUBLIC cxx_std_11) cuda_add_executable(cuda_othermain cuda_othermain.cu OPTIONS ${GENCODE} ${CUDA_VERBOSE_PTXAS}) target_compile_features(cuda_othermain PUBLIC cxx_std_11) set_target_properties(cuda_othermain PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_link_libraries(cuda_othermain geometry miniblas blas cblas linalg permutation sys navigation 3rdparty linear nonlinear inference mat) ``` 源代码就没发帖了,因为工程还算比较大。有劳各位了。
用Mac版Matlab的fraclab工具箱计算分形维数时出错。
用Mac版Matlab的fraclab工具箱计算分形维数时出错 可以到达这个界面 ![图片说明](https://img-ask.csdn.net/upload/201911/28/1574905590_824947.png) 但是点击计算之后无论是自动还是手动都无法计算分形维数。 手动计算报错代码如下: MEX 文件 '/Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64' 无效: dlopen(/Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64, 6): Library not loaded: @loader_path/libmex.dylib Referenced from: /Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64 Reason: image not found。 出错 fl_monolr (line 36) [a_hat,b_hat] = monolr(x,y,RegType,u{:}); 出错 choixbornes (line 64) [a_hat,b_hat]=fl_monolr(x(Indexes),y(Indexes),RegParam_bis{:}); 计算 Line ButtonDownFcn 时出错。 自动计算报错代码如下: MEX 文件 '/Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64' 无效: dlopen(/Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64, 6): Library not loaded: @loader_path/libmex.dylib Referenced from: /Applications/MATLAB_R2018a.app/toolbox/FracLab-2-2.2-Universal_20170325/FracLab-2.2-Universal/FracLab/Binaries/osx64intel/monolr.mexmaci64 Reason: image not found。 出错 fl_monolr (line 36) [a_hat,b_hat] = monolr(x,y,RegType,u{:}); 出错 fl_regression (line 89) [a_hat,b_hat]=fl_monolr(x,y,RegParam{:}); 出错 boxdim_listepoints (line 135) [boxdim,handlefig,bounds]=fl_regression(log2(tailles_carres),log2(Nboites),'-a_hat','BoxDimension',reg,RegParam{:}); 出错 boxdim_binaire (line 136) [boxdim,Nboites,handlefig,bounds]=boxdim_listepoints(listepoints,tailles_carres,pave_elementaire,Waitbar,reg,u{:}); 出错 fl_boxdim_compute (line 251) [dim,nb,handlefig]=boxdim_binaire(SignIn,box_size,AspectRatio,[],1,reg,RegParam{:}); 计算 UIControl Callback 时出错。 请求大佬帮忙看一下
Robot Navigation 罗伯特的导航问题
Problem Description A robot has been sent to explore a remote planet. To specify a path the robot should take, a program is sent each day. The program consists of a sequence of the following commands: FORWARD X: move forward by X units. TURN LEFT: turn left (in place) by 90 degrees. TURN RIGHT: turn right (in place) by 90 degrees. The robot also has sensor units which allow it to obtain a map of its surrounding area. The map is represented as a grid. Some grid points contain hazards (e.g. craters) and the program must avoid these points or risk losing the robot. Naturally, if the initial location of the robot, the direction it is facing, and its destination position are known, it is best to send the shortest program (one consisting of the fewest commands) to move the robot to its destination (we do not care which direction it faces at the destination). You are more interested in knowing the number of different shortest programs that can move the robot to its destination. However, the number of shortest programs can be very large, so you are satisfied to compute the number as a remainder modulo 1,000,000. Input There will be several test cases in the input. Each test case will begin with a line with two integers N M Where N is the number of rows in the grid, and M is the number of columns in the grid (2 ≤ N, M ≤ 100). The next N lines of input will have M characters each. The characters will be one of the following: ‘.’ Indicating a navigable grid point. ‘*’ Indicating a crater (i.e. a non-navigable grid point). ‘X’ Indicating the target grid point. There will be exactly one ‘X’. ‘N’, ‘E’, ‘S’, or ‘W’ Indicating the starting point and initial heading of the robot. There will be exactly one of these. Note that the directions mirror compass directions on a map: N is North (toward the top of the grid), E is East (toward the right of the grid), S is South (toward the bottom of the grid) and W is West (toward the left of the grid). There will be no spaces and no other characters in the description of the map. The input will end with a line with two 0s. Output For each test case, output two integers on a single line, with a single space between them. The first is the length of a shortest possible program to navigate the robot from its starting point to the target, and the second is the number of different programs of that length which will get the robot to the target (modulo 1,000,000). If there is no path from the robot to the target, output two zeros separated by a single space. Output no extra spaces, and do not separate answers with blank lines. Sample Input 5 6 *....X .....* .....* .....* N....* 6 5 ....X .**** .**** .**** .**** N**** 3 3 .E. *** .X. 0 0 Sample Output 6 4 3 1 0 0
openstack验证nova时执行openstack host list命令报错
``` ``` 这是执行命令后报的错误 The server is currently unavailable. Please try again at a later time.<br /><br /> (HTTP 503) (Request-ID: req-cc86ee4c-b854-4577-ba9a-57190d2cf39c) 这是日志中报的错误 2019-04-09 20:37:56.792 1778 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}} 2019-04-09 20:37:56.793 1778 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data 这是我改的配置文件(基于n版) [root@bogon ~]# egrep "^[a-z]" /etc/nova/nova.conf use_neutron=True firewall_driver = nova.virt.firewall.NoopFirewallDriver enabled_apis=osapi_compute,metadata auth_strategy=keystone connection=mysql+pymysql://nova:nova@192.168.131.129/nova_api connection=mysql+pymysql://nova:nova@192.168.131.129/nova api_servers=http://192.168.131.129:9292 auth_uri = http://192.168.131.129:5000 auth_url = http://192.168.131.129:35357 memcached_servers = 192.168.131.129:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = nova lock_path=/var/lib/nova/tmp transport_url=rabbit://openstack:openstack@192.168.131.129 vncserver_listen=0.0.0.0 vncserver_proxyclient_address=192.168.131.129 我确定nova的用户和密码是正确的,以及服务也创建成功了的 ```
caffe编译:compute_image_mean.cpp:(.text.startup+0x2f):对‘boost::system::generic_category()’未定义的引用
caffe编译: compute_image_mean.cpp:(.text.startup+0x2f):对‘boost::system::generic_category()’未定义的引用 ![图片说明](https://img-ask.csdn.net/upload/201911/28/1574900443_165848.png) 求大神解决
Sunday Drive 用什么代码思路
Problem Description After wracking your brains at a programing contest on Saturday, you’d like to relax by taking a leisurely Sunday drive. But, gasoline is so expensive nowadays! Maybe, by creatively changing lanes, you can minimize the distance you travel and save some money! You will be given a description of several sections of a highway. All sections will have the same number of lanes. Think of your car as a point mass, moving down the center of the lane. Each lane will be 10 feet wide. There are two kinds of highway sections: curved and straight. You can only change lanes on straight sections, and it takes a minimum of 100 feet of the straight section to move over one lane. You can take longer than that, of course, if you choose. All curve sections will make 90 degree turns. You cannot change lanes on a curve section. In addition, you must be driving along the exact middle of a lane during a turn. So during a turn your position will be 5 feet, or 15 feet, or 25 feet from the edge, etc. Given a description of a highway, compute the minimum total distance required travel the entire highway, including curves and lane changes. You can start, and end, in any lane you choose. Assume that your car is a point mass in the center of the lane. The highway may cross over/under itself, but the changes in elevation are miniscule, so you shouldn’t worry about their impact on your distance traveled. In order to be used to cross 2 lanes, this straight section must be at least 200 feet long. Input There will be several test cases in the input. Each test case will begin with two integers N M Where N (1 ≤ N ≤ 1,000) is the number of segments, and M (2 ≤ M ≤ 10) is the number of lanes. On each of the next N lines will be a description of a segment, consisting of a letter and a number, with a single space between them: T K The letter T is one of S, L, or R (always capital). This indicates the type of the section: a straight section (S), a left curve (L) or a right curve (R). If the section is a straight section, then the number K (10 ≤ K ≤ 10,000) is simply its length, in feet. If the section is a right or left curve, then the number K (10 ≤ K ≤ 10,000) is the radius of the inside edge of the highway, again in feet. There will never be consecutive straight sections in the input, but multiple consecutive turns are possible. The input will end with a line with two 0s. Output For each test case, print a single number on its own line, indicating the minimum distance (in feet) required to drive the entire highway. The number should be printed with exactly two decimal places, rounded. Output no extra spaces, and do not separate answers with blank lines. Sample Input 3 3 R 100 S 1000 L 100 9 5 S 2500 L 500 S 2000 L 500 S 5000 L 500 S 2000 L 500 S 2500 5 4 L 100 L 100 L 100 L 100 L 100 0 0 Sample Output 1330.07 17173.01 824.67
Electronic Document Security 安全问题
Problem Description The Tyrell corporation uses a state-of-the-art electronic document system that controls all aspects of document creation, viewing, editing, and distribution. Document security is handled via access control lists (ACLs). An ACL defines a set of entities that have access to the document, and for each entity defines the set of rights that it has. Entities are denoted by uppercase letters; an entity might be a single individual or an entire division. Rights are denoted by lowercase letters; examples of rights are a for append, d for delete, e for edit, and r for read. The ACL for a document is stored along with that document, but there is also a separate ACL log stored on a separate log server. All documents start with an empty ACL, which grants no rights to anyone. Every time the ACL for a document is changed, a new entry is written to the log. An entry is of the form ExR, where E is a nonempty set of entities, R is a nonempty set of rights, and x is either "+", "–", or "=". Entry E+R says to grant all the rights in R to all the entities in E, entry E–R says to remove all the rights in R from all the entities in E, and entry E=R says that all the entities in E have exactly the rights in R and no others. An entry might be redundant in the sense that it grants an entity a right it already has and/or denies an entity a right that it doesn't have. A log is simply a list of entries separated by commas, ordered chronologically from oldest to most recent. Entries are cumulative, with newer entries taking precedence over older entries if there is a conflict. Periodically the Tyrell corporation will run a security check by using the logs to compute the current ACL for each document and then comparing it with the ACL actually stored with the document. A mismatch indicates a security breach. Your job is to write a program that, given an ACL log, computes the current ACL. Input The input consists of one or more ACL logs, each 3–79 characters long and on a line by itself, followed by a line containing only "#" that signals the end of the input. Logs will be in the format defined above and will not contain any whitespace. Output For each log, output a single line containing the log number (logs are numbered sequentially starting with one), then a colon, then the current ACL in the format shown below. Note that (1) spaces do not appear in the output; (2) entities are listed in alphabetical order; (3) the rights for an entity are listed in alphabetical order; (4) entities with no current rights are not listed (even if they appeared in a log entry), so it's possible that an ACL will be empty; and (5) if two or more consecutive entities have exactly the same rights, those rights are only output once, after the list of entities. Sample Input MC-p,SC+c YB=rde,B-dq,AYM+e GQ+tju,GH-ju,AQ-z,Q=t,QG-t JBL=fwa,H+wf,LD-fz,BJ-a,P=aw # Sample Output 1:CSc 2:AeBerMeYder 3: 4:BHJfwLPaw
Zero's Number 怎么来写
Problem Description Xnozero is very interested in k-divide number. A way of k-divide on a number is defined as if number N can be divide into two parts m, n, and the sum of m and n can be divided by k, then this is a way of k-divide number based k. For example, 3 + 33 = 36 is a way of 3-divide on number 333, as you can only divide 333 into 3 and 33, and the sum of 3 and 33 is 36, which can be divided by 3. Zero's number is defined as f(n,k), and f(n,k) is the number of ways of n divided into k-divide numbers. As defined above, 333 can be divided into two parts in two ways 3|33 and 33|3, so f(333,3)=2. Now give you A, B, K, can you help Xnozero compute the sum of f(i,K) (A≤i≤B)? (1 ≤ K ≤ 20, 10 ≤ A ≤ B ≤ 1017) Input Multiple cases, process to the end of file. Each line contains 3 integers A,B,K as descripted above. Output Output the sum of f(i,k), one per line. Sample Input 333 333 3 10 100 2 Sample Output 2 46
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
GitHub标星近1万:只需5秒音源,这个网络就能实时“克隆”你的声音
作者 | Google团队 译者 | 凯隐 编辑 | Jane 出品 | AI科技大本营(ID:rgznai100) 本文中,Google 团队提出了一种文本语音合成(text to speech)神经系统,能通过少量样本学习到多个不同说话者(speaker)的语音特征,并合成他们的讲话音频。此外,对于训练时网络没有接触过的说话者,也能在不重新训练的情况下,仅通过未知...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
【管理系统课程设计】美少女手把手教你后台管理
【文章后台管理系统】URL设计与建模分析+项目源码+运行界面 栏目管理、文章列表、用户管理、角色管理、权限管理模块(文章最后附有源码) 1. 这是一个什么系统? 1.1 学习后台管理系统的原因 随着时代的变迁,现如今各大云服务平台横空出世,市面上有许多如学生信息系统、图书阅读系统、停车场管理系统等的管理系统,而本人家里就有人在用烟草销售系统,直接在网上完成挑选、购买与提交收货点,方便又快捷。 试想,若没有烟草销售系统,本人家人想要购买烟草,还要独自前往药...
4G EPS 第四代移动通信系统
目录 文章目录目录4G 与 LTE/EPCLTE/EPC 的架构E-UTRANE-UTRAN 协议栈eNodeBEPCMMES-GWP-GWHSSLTE/EPC 协议栈概览 4G 与 LTE/EPC 4G,即第四代移动通信系统,提供了 3G 不能满足的无线网络宽带化,主要提供数据(上网)业务。而 LTE(Long Term Evolution,长期演进技术)是电信领域用于手机及数据终端的高速无线通...
相关热词 c# 图片上传 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd
立即提问