This file contains 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
Tool | Perspective | Value | Complexity | |
---|---|---|---|---|
Spring | Dev | 10 | 6 | |
Maven | Dev-Test | 9 | 1 | |
Parameterization | Dev-Test | 8 | 4 | |
Relative paths | Dev-Test | 9 | 3 | |
Unit Testing | Dev | 8 | 4 |
This file contains 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
Tool | Perspective | Value | Complexity | |
---|---|---|---|---|
Unit Testing (100% Coverage) | Dev | 2 | 8 | |
Docker | Test | 2 | 6 | |
Jenkins | Test | 1 | 7 |
This file contains 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
import requests | |
import json | |
keycloak_url = 'http://localhost:8080/' | |
admin_token_endpoint = 'auth/realms/master/protocol/openid-connect/token' | |
realms_endpoint = 'auth/admin/realms' | |
bearer_token = '' | |
url='' | |
print("get the admin bearer token") |
This file contains 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
Place | Function | Input Size | Cycles | Time (usec) | Slowness | |
---|---|---|---|---|---|---|
1 | Slicing | 10000 | 1000 | 11.7 | x1 | |
2 | 'List' 'reverse' and 'join' | 10000 | 1000 | 118 | x10.1 | |
3 | 'Reversed' and 'join' | 10000 | 1000 | 143 | x12.2 | |
4 | Swap in 'list' and 'join' | 10000 | 1000 | 745 | x63.7 | |
5 | Traverse backwards | 10000 | 1000 | 993 | x84.9 | |
6 | Traverse forwards and append to front | 10000 | 1000 | 1470 | x125.6 |
This file contains 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
python3 -m timeit --number 1000 --unit usec 'import src.nicks_py_algs.reverse' 'src.nicks_py_algs.reverse.reverse_0("abcdefghijklmnopqrstuvwxyz")' |
This file contains 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
def reverse_0(s: str) -> str: | |
reversed_output = "" | |
s_length = len(s) | |
for i in range(s_length-1, 0-1, -1): | |
reversed_output = reversed_output + s[i] | |
return reversed_output |
This file contains 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
def reverse_1(s: str) -> str: | |
reversed_output = "" | |
for c in s: | |
reversed_output = c + reversed_output | |
return reversed_output |
This file contains 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
def reverse_2(s: str) -> str: | |
s_length = len(s) | |
s_list = list(s) | |
j = s_length-1 | |
for i in range(s_length-1): | |
swap_var = s_list[j] | |
s_list[j] = s_list[i] | |
s_list[i] = swap_var | |
j=j-1 | |
if (j<i): |
This file contains 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
def reverse_3(s: str) -> str: | |
s_list = list(s) | |
s_list.reverse() | |
return ''.join(s_list) |
This file contains 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
def reverse_4(s: str) -> str: | |
return ''.join(reversed(s)) |
OlderNewer