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 time | |
| kernel_cols = 2 | |
| kernel_rows = 3 | |
| rows = 180 | |
| cols = 160 | |
| data = np.array(np.arange(0, cols * rows).reshape((rows, cols))) | |
| print('DATA') | |
| print(data) |
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
| SELECT | |
| constraint_type, | |
| tc.constraint_name, | |
| tc.table_name, | |
| kcu.column_name, | |
| format('ALTER TABLE "%s" RENAME CONSTRAINT %s TO unq_%s_%s;', | |
| tc.table_name, tc.constraint_name, tc.table_name, kcu.column_name) | |
| FROM | |
| information_schema.table_constraints AS tc | |
| JOIN information_schema.key_column_usage AS kcu |
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
| SELECT | |
| tc.constraint_name, | |
| tc.table_name, | |
| kcu.column_name, | |
| ccu.table_name AS foreign_table_name, | |
| ccu.column_name AS foreign_column_name, | |
| format('ALTER TABLE "%s" RENAME CONSTRAINT %s TO fk_%s_%s;', | |
| tc.table_name, tc.constraint_name, tc.table_name, kcu.column_name) | |
| FROM | |
| information_schema.table_constraints AS tc |
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
| @Getter | |
| @Setter | |
| @AllArgsConstructor | |
| private static class GeometryHandle | |
| { | |
| Geometry geometry; | |
| } | |
| public static Collector<Geometry, GeometryHandle, Geometry> collectorUnion(@NonNull GeometryFactory factory) | |
| { |
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
| @Override | |
| public void init(FilterConfig filterConfig) throws ServletException | |
| { | |
| List<String> urlPatterns = requestMappingHandlerMapping.getHandlerMethods().keySet().stream() | |
| .map(info -> info.getPatternsCondition().getPatterns().iterator().next()) | |
| .filter(pattern -> pattern.contains("{")) | |
| .distinct() | |
| .collect(toList()); | |
| endpoints = new Endpoint[urlPatterns.size()]; | |
| for (int index = 0; index < urlPatterns.size(); index++) |
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 groovy.json.JsonSlurper | |
| log.info("Verifying JSON translation files ...") | |
| def root = new File(sprintf('%s/src/main/resources/static/i18n/', project.basedir)) | |
| def slurper = new JsonSlurper() | |
| def allKeys = [] as Set | |
| def tables = [:] | |
| root.listFiles().each { |
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
| final double maxDistance = Util.distance(centerX, chief, 0, 0); | |
| final float[] hsb = new float[3]; | |
| for (int y = 0; y < size; ++y) | |
| { | |
| for (int x = 0; x < size; ++x) | |
| { | |
| final int oldARGB = image.getRGB(x, y); | |
| final int oldA = (oldARGB >> 24) & 0xFF; | |
| final int oldR = (oldARGB >> 16) & 0xFF; | |
| final int oldG = (oldARGB >> 8) & 0xFF; |