This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create a new number C from A and B (both non -ve’s) | |
- 1st digit of C = 1st digit of A | |
- 2nd digit of C = 1st digit of B | |
- 3rd digit of C = 2nd digit of A | |
- 4th digit of C = 2nd digit of B | |
- so on | |
Rules | |
- A & B are non -ve’s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements: | |
# - upper case characters >= 1 | |
# - no digits | |
# I/p | |
# S -> len(S) = N | |
# O/P -> len(longest_substring) which passes requirements | |
import re | |
from string import ascii_uppercase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acl = AccessControlList() | |
acl.resource_read_rule(everyone_role, 'GET', '/api/v1/employee/1/info') | |
acl.resource_delete_rule(admin_role, 'DELETE', '/api/v1/employee/1/') | |
# checking READ operation on resource for user `everyone_user` | |
for user_role in [role.get_name() for role in everyone_user.get_roles()]: | |
assert acl.is_read_allowed(user_role, 'GET', '/api/v1/employee/1/info') == True | |
# checking WRITE operation on resource for user `everyone_user` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls -la roles | |
total 0 | |
drwxr-xr-x 13 tasdik tasdik 442 May 23 14:28 . | |
drwxr-xr-x 20 tasdik tasdik 680 May 24 11:05 .. | |
-rw-r--r-- 1 tasdik tasdik 0 May 23 14:28 ansible.cfg | |
drwxr-xr-x 6 tasdik tasdik 204 May 23 14:28 ovirt-collect-logs | |
drwxr-xr-x 6 tasdik tasdik 204 May 23 14:28 ovirt-common | |
drwxr-xr-x 6 tasdik tasdik 204 May 23 14:28 ovirt-engine-backup | |
drwxr-xr-x 7 tasdik tasdik 238 May 23 14:28 ovirt-engine-cleanup | |
drwxr-xr-x 6 tasdik tasdik 204 May 23 14:28 ovirt-engine-config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@centos-4gb-blr1-ovirt-engine ~]# yum update | |
[root@centos-4gb-blr1-ovirt-engine ~]# yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release41.rpm | |
[root@centos-4gb-blr1-ovirt-engine ~]# yum -y install ovirt-engine | |
[root@centos-4gb-blr1-ovirt-engine ~]# engine-setup | |
[ INFO ] Stage: Initializing | |
[ INFO ] Stage: Environment setup | |
Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf'] | |
Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20170520124451-wvuuny.log | |
Version: otopi-1.6.1 (otopi-1.6.1-1.el7.centos) | |
[ INFO ] Stage: Environment packages setup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from markovipy.markovipy import MarkoviPy | |
>>> | |
>>> obj = MarkoviPy("/Users/tasrahma/development/projects/markovipy/corpus/shakespeare/hamlet_utf8.txt", 3) | |
>>> obj.generate_sentence() | |
'If his occulted guilt, Do not it selfe vnkennell in one speech, It is most retrograde to our desire And we beseech you, bend you to remaine Heere in the cheere and comfort of our eye, Our cheefest Courtier Cosin, and our whole Kingdome To be contracted in one brow of woe Yet so farre hath Discretion fought with Nature, That we with wisest sorrow thinke on him, Together with remembrance of our selues.' | |
>>> obj.generate_sentence() | |
'Fare you well my Lord Ham.' | |
>>> obj.generate_sentence() | |
'To thinke, my Lord? Ham.' |
reference: [https://www.sitepoint.com/beginners-guide-node-package-manager/] (https://www.sitepoint.com/beginners-guide-node-package-manager/)
Changing the Location of Global Packages Let’s see what output npm config gives us.
$ npm config list
; cli configs
user-agent = "npm/3.6.0 node/v5.7.0 linux x64"
- no upfront installation/agents on remote/slave machines - ssh should be enough
- application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
- configuration templating
- environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
- deployment process run from Jenkins
- no upfront installation/agents on remote/slave machines - ssh should be enough
- application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
- configuration templating
- environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
- deployment process run from Jenkins