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 numpy as np | |
import pandas as pd | |
import pydicom | |
import cv2 | |
from sklearn.model_selection import train_test_split | |
from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
from keras_preprocessing.image.dataframe_iterator import DataFrameIterator | |
# tested on tf 2.1 |
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
def create_dir(dirname): | |
try: | |
os.makedirs(dirname) | |
print(f"Directory '{dirname}' created.") | |
except FileExistsError: | |
print(f"Directory '{dirname}' already exists.") |
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
// usage: node index.js getUserRepos --username userName | |
const fetch = require("node-fetch"); | |
const yargs = require("yargs"); | |
const path = require("path"); | |
yargs.command({ | |
command: "getUserRepos", | |
builder: { | |
username: { |
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
CREATE FUNCTION Main() RETURNS BOOLEAN | |
BEGIN | |
DECLARE message CHARACTER; | |
-- \n in hex is 0x0a, we need to represent it as '\n' | |
-- and encode it as UTF-8 whose CodingCharSetId is 1208 | |
DECLARE newlineChar CHAR CAST(CAST('X''0A''' AS BLOB) AS CHAR CCSID 1208); | |
SET message = InputRoot.XMLNSC.text; |
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
CREATE FUNCTION isMadeOfOneChar(IN text CHAR, IN dividerChar CHAR) RETURNS BOOLEAN | |
BEGIN | |
DECLARE index INT 1; | |
DECLARE textLength INT LENGTH(text); | |
DECLARE currentChar CHAR; | |
-- If empty string, return false | |
IF textLength = 0 THEN | |
RETURN FALSE; | |
END IF; |
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
/* | |
JAR files to be added to shared-classes folder under server or integration node dir: | |
dom4j-1.6.1.jar | |
names.txt | |
poi-3.9-20121203.jar | |
poi-ooxml-3.9-20121203.jar | |
poi-ooxml-schemas-3.9-20121203.jar | |
xmlbeans-2.3.0.jar | |
*/ |
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
# pip install PyPDF2 | |
from PyPDF2 import PdfFileMerger | |
pdfs = ['file1.pdf', 'file2.pdf'] | |
merger = PdfFileMerger() | |
for pdf in pdfs: | |
merger.append(pdf) |