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
| # Capture Image | |
| time.sleep(3) | |
| image_file = 'screenshots/screenshot.png' | |
| chrome_driver.save_screenshot(image_file) | |
| # Get location of element to crop screenshot | |
| element = chrome_driver.find_element_by_id("AthleteTheme_wtLayoutNormal_block_wtMainContent") | |
| location = element.location | |
| size = element.size |
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 selenium import webdriver | |
| import credentials | |
| import time | |
| from PIL import Image | |
| # Navigate to Wodify | |
| chrome_driver = webdriver.Chrome() | |
| chrome_driver.implicitly_wait(10) | |
| chrome_driver.get("https://app.wodify.com") |
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 selenium import webdriver | |
| import credentials | |
| # Navigate to Wodify | |
| chrome_driver = webdriver.Chrome() | |
| chrome_driver.implicitly_wait(10) | |
| chrome_driver.get("https://app.wodify.com") | |
| # Sign in to Wodify | |
| chrome_driver.find_element_by_id("Input_UserName").send_keys(credentials.user_name) |
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
| import lombok.Data; | |
| import javax.persistence.Entity; | |
| import javax.persistence.GeneratedValue; | |
| import javax.persistence.Id; | |
| import java.util.Date; | |
| @Data | |
| @Entity | |
| public class Patient { |
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
| interface MyGeneric<T> { | |
| T compute(T t); | |
| } | |
| public static void main(String args[]){ | |
| // String version of MyGenericInteface | |
| MyGeneric<String> reverse = (str) -> { | |
| String result = ""; | |
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
| interface MyString { | |
| String myStringFunction(String str); | |
| } | |
| public static void main (String args[]) { | |
| // Block lambda to reverse string | |
| MyString reverseStr = (str) -> { | |
| String result = ""; | |
| for(int i = str.length()-1; i >= 0; i--) |
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
| MyGreeting morningGreeting = (String str) -> "Good Morning " + str + "!"; | |
| MyGreeting eveningGreeting = (String str) -> "Good Evening " + str + "!"; |
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
| interface NumericTest { | |
| boolean computeTest(int n); | |
| } | |
| public static void main(String args[]) { | |
| NumericTest isEven = (n) -> (n % 2) == 0; | |
| NumericTest isNegative = (n) -> (n < 0); | |
| // Output: false | |
| System.out.println(isEven.computeTest(5)); |
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
| interface MyGreeting { | |
| String processName(String str); | |
| } | |
| public static void main(String args[]) { | |
| MyGreeting morningGreeting = (str) -> "Good Morning " + str + "!"; | |
| MyGreeting eveningGreeting = (str) -> "Good Evening " + str + "!"; | |
| // Output: Good Morning Luis! | |
| System.out.println(morningGreeting.processName("Luis")); |
NewerOlder