Skip to content

Instantly share code, notes, and snippets.

View tonytan4ever's full-sized avatar

Tony Tan tonytan4ever

View GitHub Profile
$ keystone token-get
Traceback (most recent call last):
File "/usr/bin/keystone", line 6, in <module>
from keystoneclient.shell import main
ImportError: No module named shell
dockeradmin@docker-openstack-vm:~$ openstack token issuePassword:
+---------+----------------------------------+
| Field | Value |
+---------+----------------------------------+
| expires | 2016-07-13T17:42:39Z |
| id | a67dc096cf934c8b89b90322e877b7e0 |
| user_id | 98abd8976b8e44aa96cb8bffbbd9ddbc |
+---------+----------------------------------+
dockeradmin@docker-openstack-vm:/media/sf_Rackspace/devstack$ openstack token issue
+------------+----------------------------------+
| Field | Value |
+------------+----------------------------------+
| expires | 2016-07-13T17:46:35Z |
| id | ac5934a0bf064929905db4ced67894a9 |
| project_id | 099d0b098a3246edb09d2ccdb58baf18 |
| user_id | 98abd8976b8e44aa96cb8bffbbd9ddbc |
+------------+----------------------------------+
File "neutron/scheduler/l3_agent_scheduler.py", line 366, in schedule
plugin, context, router_id, candidates=candidates)
File "neutron/scheduler/l3_agent_scheduler.py", line 228, in _schedule_router
plugin, context, sync_router)
File "neutron/scheduler/l3_agent_scheduler.py", line 183, in _get_candidates
active_l3_agents)
File "neutron/db/l3_agentschedulers_db.py", line 465, in get_l3_agent_candidates
agent_mode = agent_conf.get(constants.L3_AGENT_MODE,
AttributeError: 'module' object has no attribute 'L3_AGENT_MODE'
[[local|localrc]]
LIBS_FROM_GIT+=python-neutronclient
GIT_BASE=${GIT_BASE:-https://git.openstack.org}
#USE_VENV=True
#OFFLINE=False
#RECLONE=Yes
#PIP_UPGRADE=True
KEYSTONE_TOKEN_FORMAT=UUID
MYSQL_PASSWORD=password
RABBIT_PASSWORD=password
https://codility.com/
In base −2, integers are represented by sequences of bits in the following way. Bits are ordered from the least to the most significant. Sequence B of N bits represents the number:
sum{ B[i]*(−2) for i = 0..N−1 }. The empty sequence represents 0.
Write a function:
def solution(A)
https://codility.com/trial/
An integer X and a non-empty zero-indexed array A consisting of N integers are given. We are interested in which elements of A are equal to X and which are different from X. The goal is to split array A into two parts, such that the number of elements equal to X in the first part is the same as the number of elements different from X in the other part. More formally, we are looking for a number K such that:
0 <= K <= N
the number of elements equal to X in A[0..K−1] is the same as the number of elements different from X in A[K..N−1]. (For K = 0, A[0..K−1] does not contain any elements. For K = N, A[K..N−1] does not contain any elements.)
A[0] = 5
A[1] = 5
A[2] = 1
A[3] = 7
A[4] = 2
{
"resources": [
{
"links": [
{
"href": "http://127.0.0.1:9696/v2.0/subnets",
"rel": "self"
}
],
"name": "subnet",
{
"AFFILIATE_COOKIE_NAME": "dev_affiliate_id",
"ANALYTICS_DASHBOARD_URL": "http://localhost:18110/courses",
"ANALYTICS_DATA_URL": "",
"ANALYTICS_SERVER_URL": "",
"AWS_SES_REGION_ENDPOINT": "email.us-east-1.amazonaws.com",
"AWS_SES_REGION_NAME": "us-east-1",
"BOOK_URL": "",
"BUGS_EMAIL": "[email protected]",
"BULK_EMAIL_DEFAULT_FROM_EMAIL": "[email protected]",