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
| # Node class | |
| class Node: | |
| def __init__(self, initial_data): | |
| self.data = initial_data | |
| self.next = None | |
| # Singly-linked List class | |
| class LinkedList: | |
| def __init__(self): | |
| self.head = None |
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
| # Append a list | |
| ListAppend(list, newNode) { | |
| if (list->head == null) { | |
| list->head = newNode | |
| list->tail = newNode | |
| } | |
| else { | |
| list->tail->next = newNode | |
| list->tail = newNode | |
| } |
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
| $( document ).ready(function() { | |
| pageSize = 1; | |
| pagesCount = $(".content").length; | |
| console.log(pagesCount); | |
| var currentPage = 1; | |
| /////////// PREPARE NAV /////////////// | |
| var nav = ''; | |
| var totalPages = Math.ceil(pagesCount / pageSize); |
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
| // Use of Builder Pattern | |
| WindowsDisplay windowDisplay = new WindowsBuilder() | |
| .setRb(rb) | |
| .setFXMLPath("UserLogin.fxml") | |
| .build(); | |
| windowDisplay.displayScene(); |
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
| /** | |
| * The WindowsDisplay class is used to load FXML, set BundleResource (as needed), | |
| * and pass an instance of mainApp and active Stage to the controller for use | |
| * in other method calls defined in controller. | |
| * | |
| * Object for WindowsDisplay is instantiated using a WindowsBuilder, which is | |
| * an instance of a builder pattern. Due to several optional parameters being | |
| * used for constructing a WindowsDisplay, the builder design pattern was used. | |
| * | |
| * @param rb (optional) ResourceBundle for the language_files |
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
| /** | |
| * This is a builder pattern for WindowsDisplay. | |
| * The use of builder pattern makes it easier to add parameters to WindowsDisplay | |
| * in the future to customize different types of FXML Loader. | |
| * @author thanhtruong | |
| */ | |
| public class WindowsBuilder { | |
| ResourceBundle rb; | |
| String FXMLPath; | |
| String title; |
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
| // Set items into the TableView | |
| customerTable.setItems(custDB.getCustomerList()); | |
| FilteredList<Customer> filteredCustomerByName = new FilteredList<>( | |
| custDB.getCustomerList(), p -> true); | |
| customerSearchText.textProperty().addListener((observable, oldValue, newValue) -> { | |
| filteredCustomerByName.setPredicate(customer -> { | |
| if((newValue.toString().isEmpty()) || (newValue.toString().equals(null))) { | |
| return true; |
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
| public class AppointmentDB { | |
| private static ObservableList<Appointment> apptListByCust; | |
| private static ObservableList<Appointment> apptListByUser; | |
| private static ObservableList<Appointment> allApptList; | |
| private static ObservableList<Appointment> sortedList = FXCollections.observableArrayList(); | |
| private static Map<Integer, Map<Integer, ObservableList<String>>> apptMapByMonth; | |
| private static Map<Integer, Map<Integer, ObservableList<Appointment>>> apptMapByWeek; | |
| private static final AppointmentDB instance; | |
| private String sqlStatement; |
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
| // Variable getter placed in the Details section of the report | |
| // Each time a row is printed, the value is added to the variable and concatenated after filtering out duplicate values | |
| whileprintingrecords; | |
| stringvar Device; | |
| if Device = "" then Device := {SPC_DEVICE.EQNO} + " " + {SPC_DEVICE_TYPE.NAME} + ", " | |
| else if not ({SPC_DEVICE.EQNO} in Device) then Device := Device + {SPC_DEVICE.EQNO} + " " + {SPC_DEVICE_TYPE.NAME} + ", " | |
| // Reset the variable to an emtpty String after each group is printed | |
| // Place this variable in the Group Header section of the report to ensure the variable is reset for each group/table | |
| whileprintingrecords; |
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
| double topAnchor, botAnchor; | |
| int rSpan; | |
| // Calculate the number of rows to span across based on | |
| // the number of hours for the appointment | |
| if (endHr > startHr && endMin != 0) { | |
| rSpan = endHr - startHr + 1; | |
| } else if (endHr > startHr && endMin == 0) { | |
| rSpan = endHr - startHr; | |
| } else { | |
| rSpan = 1; |
NewerOlder