icb_code.rstrip("0")
CharMatcher trailingZeroMatcher = CharMatcher.is('0'); String trimmedInput = trailingZeroMatcher.trimTrailingFrom(input);
Most sophisticated informations and issues related with widely known IT sector and many more ;-)
icb_code.rstrip("0")
CharMatcher trailingZeroMatcher = CharMatcher.is('0'); String trimmedInput = trailingZeroMatcher.trimTrailingFrom(input);
Map<String, String> record = getRecord(); TreeMap<String, String> caseInsensitiveMap = new TreeMap<>getCaseInsensitiveComparator()); caseInsensitiveMap.putAll(record); protected Comparator<String> getCaseInsensitiveComparator() { return Comparator.nullsFirst(String.CASE_INSENSITIVE_ORDER); }
public Map<FileType, List<File>> splitFilesByFileType(List<File> listOfFiles) { return listOfFiles.stream() .reduce(new HashMap<>(), (filesByFileType, file) -> { FileType fileType = file.getFileType(); if (filesByFileType.containsKey(fileType)) { filesByFileType.get(fileType).add(file); } else { filesByFileType.putIfAbsent(fileType, Lists.newArrayList(file)); } return filesByFileType; }, (acc1, acc2) -> { acc1.putAll(acc2); return acc1; }); }
import org.apache.commons.lang3.EnumUtils; public enum Operation { COUNTA, SUM,
NA; public static Operation parse(String input) { Operation operation = EnumUtils.getEnum(Operation.class, input); if (operation == null) { return NA; } return operation; } public boolean isCount() { return this == COUNTA; } public boolean isSum() { return this == SUM; } public boolean isCountOrSum() { return this == COUNTA || this == SUM; } }
# Requirements: # pip install PyPDF2 import os from PyPDF2 import PdfFileReader, PdfFileWriter password = 'password' directory = '/path/where/pdfs/are/stored' def decrypt_pdf(input_path, output_path, password): with open(input_path, 'rb') as input_file, \ open(output_path, 'wb') as output_file: reader = PdfFileReader(input_file) reader.decrypt(password) writer = PdfFileWriter() for i in range(reader.getNumPages()): writer.addPage(reader.getPage(i)) writer.write(output_file) if __name__ == '__main__': newDirectory = directory + "/Decoded" if not os.path.exists(newDirectory): os.makedirs(newDirectory) for filename in os.listdir(directory): if filename.endswith(".pdf"): fullFileName = os.path.join(directory, filename) decrypt_pdf(fullFileName, newDirectory + "/" + filename, password)
Click -> Close & Load let Source = Json.Document(File.Contents("Z:\Directory\input.json")), AsTable = Table.FromRecords(Source) in AsTable
<% commits.forEach(function (commit) { %> <% if(!commit.title.startsWith('[maven-release-plugin]')) { %> <%= 'http://jira.com/browse/' + commit.title -%> <% } %> <% }) %>
List<MyClass> distinctByField = myList.stream().reduce(new ArrayList<>(), (List<MyClass> accumulator, MyClass myClass) -> { if (accumulator.stream().noneMatch(item -> item.getField().equals(myClass.getField()))) { accumulator.add(MyClass); } return accumulator; }, (acc1, acc2) -> { acc1.addAll(acc2); return acc1; });