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
# ref https://stackoverflow.com/questions/53876007/how-to-vertically-merge-two-images/53882483 | |
# usage | |
# $ python vertical_stack.py </path/to/top/figure> </path/to/bottom/figure> </directory/to/output/figure> <output_file_name_with_extension> | |
# <output_file_name_with_extension> is optional, default to vertical_stack.png | |
# example | |
# $ python stack_vertical_images.py /Users/foo/bar/top_figure.png /Users/foo/bar/button_figure.png /Users/output vertical_stack.png | |
# NOTE |
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
# references | |
# https://www.programmersought.com/article/8966116355/ | |
# https://stackoverflow.com/questions/59758904/check-if-image-is-all-white-pixels-with-opencv | |
# figures in this paper were all cropped using this code snippet - https://arxiv.org/pdf/2101.03300.pdf | |
# usage - save this code snippet as a python file and use two arguments | |
# $ python this_program.py </path/to/original/figure> </path/to/output/directory> | |
# example |
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
# assume expression is one line of code | |
# must have "# write your expression below" as a starting code | |
# thanks to Prof. Wassil and Dr. Bart's suggestion https://gist.github.com/acbart/32ecc194870eb98a452448b35c11378e | |
# Write an expression which will be True if and only if a previously-defined variable result is not equal to 100. Please wrap your expression in the provided print() function. | |
from sources import get_student_source, set_student_source | |
student_code = get_student_source() | |
class TestCase(EdfinityTestCase): |
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
# bubble sort | |
def bubble_sort(arr): | |
arr_len = len(arr) | |
for i in range(arr_len - 1, 0, -1): | |
for j in range(i): | |
if arr[j] > arr[j + 1]: | |
arr[j], arr[j + 1] = arr[j + 1], arr[j] | |
a = [2,5,1,8,-2,0,9,2] | |
bubble_sort(a) # inplace sorting |
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
/** | |
* An empty Dabblet | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |