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
set foreign_key_checks = 0; | |
drop table sla_matrix_config cascade; | |
set foreign_key_checks = 1; | |
--OR-- | |
drop table gender_tab cascade constraints; |
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
<td *ngIf="(question.responseType === 'F'); | |
else pickListResponse">Free Text</td> | |
<ng-template #pickListResponse> | |
<td>Pick List</td> | |
</ng-template> |
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 is_int(x): | |
if( (abs(x) - (abs(int(x)))) > 0 ): | |
return False | |
else: | |
return True |
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
"""A simple function that sums the digit of a number""" | |
# x could be any number such as 1234, the function will result in (1 + 2 + 3 + 4) = 10 | |
def digit_sum(x): | |
string_val = str(x) | |
sum = 0 | |
for i in string_val: | |
sum += int(i) | |
return sum |
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 factorial(x): | |
fact = 1 | |
for i in range(x): | |
fact *= i + 1 | |
return fact |
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 is_prime(x): | |
if(x < 2 ): | |
return False | |
if(x == 2): | |
return True | |
for n in range(2, x): | |
if(x % n == 0): | |
return False | |
return True |
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(text): | |
string_len = len(text) | |
new_word = '' | |
for i in text: | |
new_word += text[string_len -1] | |
string_len -=1 | |
return new_word | |
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
delete and truncate : | |
delete from mytable | |
This will delete all the content of the table, not reseting the autoincremental id, this process is very slow. If you want to delete specific records append a where clause at the end. | |
truncate myTable | |
This will reset the table i.e. all the auto incremental fields will be reset. Its a DDL and its very fast. You cannot delete any specific record through truncate. |
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
delete and truncate : | |
delete from mytable | |
This will delete all the content of the table, not reseting the autoincremental id, this process is very slow. If you want to delete specific records append a where clause at the end. | |
truncate myTable | |
This will reset the table i.e. all the auto incremental fields will be reset. Its a DDL and its very fast. You cannot delete any specific record through truncate. |
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 anti_vowel(text): | |
result = "" | |
vowels = "ieaouIEAOU" | |
for char in text: | |
if char not in vowels: | |
result += char | |
return result | |
print anti_vowel("hello book") | |