id
stringlengths
7
14
text
stringlengths
1
106k
478661_13
public String[] readNext() throws IOException { String[] result = null; do { String nextLine = getNextLine(); if (!hasNext) { return result; // should throw if still pending? } String[] r = parser.parseLineMulti(nextLine); if (r.length > 0) { if (r...
478661_14
public String[] readNext() throws IOException { String[] result = null; do { String nextLine = getNextLine(); if (!hasNext) { return result; // should throw if still pending? } String[] r = parser.parseLineMulti(nextLine); if (r.length > 0) { if (r...
478661_15
public String[] readNext() throws IOException { String[] result = null; do { String nextLine = getNextLine(); if (!hasNext) { return result; // should throw if still pending? } String[] r = parser.parseLineMulti(nextLine); if (r.length > 0) { if (r...
478661_16
public String[] readNext() throws IOException { String[] result = null; do { String nextLine = getNextLine(); if (!hasNext) { return result; // should throw if still pending? } String[] r = parser.parseLineMulti(nextLine); if (r.length > 0) { if (r...
478661_17
public String[] readNext() throws IOException { String[] result = null; do { String nextLine = getNextLine(); if (!hasNext) { return result; // should throw if still pending? } String[] r = parser.parseLineMulti(nextLine); if (r.length > 0) { if (r...
478661_18
public void close() throws IOException { br.close(); }
478661_19
public Iterator<String[]> iterator() { try { return new CSVIterator(this); } catch (IOException e) { throw new RuntimeException(e); } }
478661_20
public Iterator<String[]> iterator() { try { return new CSVIterator(this); } catch (IOException e) { throw new RuntimeException(e); } }
478661_21
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_22
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_23
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_24
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_25
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_26
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_27
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_28
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_29
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_30
public String[] parseLineMulti(String nextLine) throws IOException { return parseLine(nextLine, true); }
478661_31
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_32
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_33
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_34
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_35
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_36
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_37
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_38
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_39
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_40
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_41
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_42
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_43
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_44
protected boolean isNextCharacterEscapable(String nextLine, boolean inQuotes, int i) { return inQuotes // we are in quotes, therefore there can be escaped quotes in here. && nextLine.length() > (i + 1) // there is indeed another character to check. && (nextLine.charAt(i + 1) == quotechar |...
478661_45
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_46
public String[] parseLine(String nextLine) throws IOException { return parseLine(nextLine, false); }
478661_47
public static String[] extractHostPort(@NotNull DbUrl url) { if (url instanceof JdbcDbUrl) { return new String[]{((JdbcDbUrl) url).getHost() + ":" + ((JdbcDbUrl) url).getPort()}; } else if (url instanceof TNSUrl) { final List<String> out = new ArrayList<String>(); NetServiceDesc netServi...
478661_48
@NotNull public ASTNode parse(String input) { TNSNodeBuilder builder = virtualFile != null ? new TNSNodeBuilder(virtualFile, input) : new TNSNodeBuilder(filePath, input); return parser.parse(TNSPsiTokenTypes.FILE, builder); }
478661_49
public Token nextToken() throws TokenStreamException { if (deferred != null) { final Token t = deferred; deferred = null; return t; } final Token token = (input == this) ? super.nextToken() : input.nextToken(); // workaround to get "prompt" and "rem" clauses (SQLPLUS tool) proces...
478661_50
public Token nextToken() throws TokenStreamException { if (deferred != null) { final Token t = deferred; deferred = null; return t; } final Token token = (input == this) ? super.nextToken() : input.nextToken(); // workaround to get "prompt" and "rem" clauses (SQLPLUS tool) proces...
478661_51
public Token nextToken() throws TokenStreamException { if (deferred != null) { final Token t = deferred; deferred = null; return t; } final Token token = (input == this) ? super.nextToken() : input.nextToken(); // workaround to get "prompt" and "rem" clauses (SQLPLUS tool) proces...
478661_52
public Token nextToken() throws TokenStreamException { if (deferred != null) { final Token t = deferred; deferred = null; return t; } final Token token = (input == this) ? super.nextToken() : input.nextToken(); // workaround to get "prompt" and "rem" clauses (SQLPLUS tool) proces...
478661_53
public Token nextToken() throws TokenStreamException { if (deferred != null) { final Token t = deferred; deferred = null; return t; } final Token token = (input == this) ? super.nextToken() : input.nextToken(); // workaround to get "prompt" and "rem" clauses (SQLPLUS tool) proces...
478661_54
static boolean nameExists(StringBuilder sb, String name) { int index = sb.indexOf(name); while (index != -1) { final int end = index + name.length(); if ((sb.length() == end || sb.charAt(end) == '.') && (index == 0 || sb.charAt(index-1) == '.')) { return true; } index...
4805389_0
public String getName() { return name; }
4810329_0
@Override public void define(Context context) { context.addExtension(CustomPythonRuleRepository.class); }
4810329_1
public static boolean areEquivalent(@Nullable Tree leftTree, @Nullable Tree rightTree) { if (leftTree == rightTree) { return true; } if (leftTree == null || rightTree == null) { return false; } if (leftTree.getKind() != rightTree.getKind() || leftTree.children().size() != rightTree.children().size()) ...
4810329_2
public static boolean areEquivalent(@Nullable Tree leftTree, @Nullable Tree rightTree) { if (leftTree == rightTree) { return true; } if (leftTree == null || rightTree == null) { return false; } if (leftTree.getKind() != rightTree.getKind() || leftTree.children().size() != rightTree.children().size()) ...
4810329_3
public static boolean areEquivalent(@Nullable Tree leftTree, @Nullable Tree rightTree) { if (leftTree == rightTree) { return true; } if (leftTree == null || rightTree == null) { return false; } if (leftTree.getKind() != rightTree.getKind() || leftTree.children().size() != rightTree.children().size()) ...
4810329_4
public static boolean areEquivalent(@Nullable Tree leftTree, @Nullable Tree rightTree) { if (leftTree == rightTree) { return true; } if (leftTree == null || rightTree == null) { return false; } if (leftTree.getKind() != rightTree.getKind() || leftTree.children().size() != rightTree.children().size()) ...
4810329_5
public static boolean areEquivalent(@Nullable Tree leftTree, @Nullable Tree rightTree) { if (leftTree == rightTree) { return true; } if (leftTree == null || rightTree == null) { return false; } if (leftTree.getKind() != rightTree.getKind() || leftTree.children().size() != rightTree.children().size()) ...
4810329_6
public static boolean areEquivalent(@Nullable Tree leftTree, @Nullable Tree rightTree) { if (leftTree == rightTree) { return true; } if (leftTree == null || rightTree == null) { return false; } if (leftTree.getKind() != rightTree.getKind() || leftTree.children().size() != rightTree.children().size()) ...
4810329_7
public static ClassDef getParentClassDef(Tree tree) { Tree current = tree.parent(); while (current != null) { if (current.is(Tree.Kind.CLASSDEF)) { return (ClassDef) current; } else if (current.is(Tree.Kind.FUNCDEF, Tree.Kind.LAMBDA)) { return null; } current = current.parent(); } re...
4810329_8
public static ClassDef getParentClassDef(Tree tree) { Tree current = tree.parent(); while (current != null) { if (current.is(Tree.Kind.CLASSDEF)) { return (ClassDef) current; } else if (current.is(Tree.Kind.FUNCDEF, Tree.Kind.LAMBDA)) { return null; } current = current.parent(); } re...
4810329_9
public static Iterable<Class> getChecks() { return Collections.unmodifiableSet(new HashSet<>(Arrays.asList( AfterJumpStatementCheck.class, AllBranchesAreIdenticalCheck.class, ArgumentNumberCheck.class, ArgumentTypeCheck.class, BackslashInStringCheck.class, BackticksUsageCheck.class, BareRa...
4812336_0
public void register(Object object) { if (object == null) { throw new NullPointerException("Object to register must not be null."); } enforcer.enforce(this); Map<Class<?>, EventProducer> foundProducers = handlerFinder.findAllProducers(object); for (Class<?> type : foundProducers.keySet()) { final Even...
4812336_1
public void register(Object object) { if (object == null) { throw new NullPointerException("Object to register must not be null."); } enforcer.enforce(this); Map<Class<?>, EventProducer> foundProducers = handlerFinder.findAllProducers(object); for (Class<?> type : foundProducers.keySet()) { final Even...
4812336_2
public void register(Object object) { if (object == null) { throw new NullPointerException("Object to register must not be null."); } enforcer.enforce(this); Map<Class<?>, EventProducer> foundProducers = handlerFinder.findAllProducers(object); for (Class<?> type : foundProducers.keySet()) { final Even...
4812336_3
public void register(Object object) { if (object == null) { throw new NullPointerException("Object to register must not be null."); } enforcer.enforce(this); Map<Class<?>, EventProducer> foundProducers = handlerFinder.findAllProducers(object); for (Class<?> type : foundProducers.keySet()) { final Even...
4812336_4
Set<Class<?>> flattenHierarchy(Class<?> concreteClass) { Set<Class<?>> classes = flattenHierarchyCache.get(concreteClass); if (classes == null) { Set<Class<?>> classesCreation = getClassesFor(concreteClass); classes = flattenHierarchyCache.putIfAbsent(concreteClass, classesCreation); if (classes == null...
4812336_5
public void register(Object object) { if (object == null) { throw new NullPointerException("Object to register must not be null."); } enforcer.enforce(this); Map<Class<?>, EventProducer> foundProducers = handlerFinder.findAllProducers(object); for (Class<?> type : foundProducers.keySet()) { final Even...
4812336_6
public void unregister(Object object) { if (object == null) { throw new NullPointerException("Object to unregister must not be null."); } enforcer.enforce(this); Map<Class<?>, EventProducer> producersInListener = handlerFinder.findAllProducers(object); for (Map.Entry<Class<?>, EventProducer> entry : produ...
4812336_7
public void register(Object object) { if (object == null) { throw new NullPointerException("Object to register must not be null."); } enforcer.enforce(this); Map<Class<?>, EventProducer> foundProducers = handlerFinder.findAllProducers(object); for (Class<?> type : foundProducers.keySet()) { final Even...
4812336_8
public void register(Object object) { if (object == null) { throw new NullPointerException("Object to register must not be null."); } enforcer.enforce(this); Map<Class<?>, EventProducer> foundProducers = handlerFinder.findAllProducers(object); for (Class<?> type : foundProducers.keySet()) { final Even...
4812336_9
public void handleEvent(Object event) throws InvocationTargetException { if (!valid) { throw new IllegalStateException(toString() + " has been invalidated and can no longer handle events."); } try { method.invoke(target, event); } catch (IllegalAccessException e) { throw new AssertionError(e); } c...
4812472_0
@Override public LocalFeatureList<Keypoint> findFeatures(MBFImage image) { FImage luminance = ColourSpace.convert(image, ColourSpace.LUMINANCE_NTSC).bands.get(0); return findFeatures(image, luminance); }
4812472_1
public double repeatability(double percentageOverlap) { prepare(); double potentialMatches = Math.min(this.validImage2Points.size(), this.validImage1Points.size()); if (potentialMatches == 0) { return 0; } double countMatches = 0; int totalSeen = 0; for (ScoredPair<Integer, Pair<Integer>> d : this.prunedOve...
4812472_2
private FImage processImage( FImage img, FConvolution c ) { return img.process( c ) .abs() .normalise(); }
4812472_3
@Override public void processImage( FImage image ) { PyramidTextExtractor ped = new PyramidTextExtractor(); // Unlike Lowe's SIFT DoG pyramid, we just need a basic pyramid GaussianPyramidOptions<FImage> gpo = new GaussianPyramidOptions<FImage>(); gpo.setScales( 1 ); gpo.setExtraScaleSteps( 1 ); gpo.setPyramidPr...
4812472_4
@Override public void processImage( FImage image) { CannyEdgeDetector2 cad = new CannyEdgeDetector2(); FImage edgeImage = image.process(cad).inverse(); // Detect Lines in the image HoughLines hl = new HoughLines( 360*accuracy ); edgeImage.analyseWith( hl ); if( DEBUG ) debugLines( edgeImage, Matrix.identity(3...
4812472_5
public static int zoom( FImage in, int newX, int newY ) { ResizeFilterFunction filter = new BasicFilter(); return zoom( in, newX, newY, filter, filter.getDefaultSupport() ); }
4812472_6
public void setBruteForce(boolean brute) { setup(brute); }
4812472_7
public static double calculateDeltaE(double [] lab1, double[] lab2) { return calculateDeltaE(lab1[0],lab1[1],lab1[2],lab2[0],lab2[1],lab2[2]); }
4812472_8
public static double calculateDeltaE(double [] lab1, double[] lab2) { return calculateDeltaE(lab1[0],lab1[1],lab1[2],lab2[0],lab2[1],lab2[2]); }
4812472_9
public HoughLines() { this( 360 , 0f); }
4820146_0
public boolean CheckPassword(String password, String storedHash) { String hash = cryptPrivate(password, storedHash); MessageDigest md = null; if (hash.startsWith("*")) { // If not phpass, try some algorythms from unix crypt() if (storedHash.startsWith("$6$")) { try { md =...
4820146_1
public boolean CheckPassword(String password, String storedHash) { String hash = cryptPrivate(password, storedHash); MessageDigest md = null; if (hash.startsWith("*")) { // If not phpass, try some algorythms from unix crypt() if (storedHash.startsWith("$6$")) { try { md =...
4820146_2
public boolean CheckPassword(String password, String storedHash) { String hash = cryptPrivate(password, storedHash); MessageDigest md = null; if (hash.startsWith("*")) { // If not phpass, try some algorythms from unix crypt() if (storedHash.startsWith("$6$")) { try { md =...
4820146_3
public boolean CheckPassword(String password, String storedHash) { String hash = cryptPrivate(password, storedHash); MessageDigest md = null; if (hash.startsWith("*")) { // If not phpass, try some algorythms from unix crypt() if (storedHash.startsWith("$6$")) { try { md =...
4820146_4
public boolean CheckPassword(String password, String storedHash) { String hash = cryptPrivate(password, storedHash); MessageDigest md = null; if (hash.startsWith("*")) { // If not phpass, try some algorythms from unix crypt() if (storedHash.startsWith("$6$")) { try { md =...
4820146_5
public boolean CheckPassword(String password, String storedHash) { String hash = cryptPrivate(password, storedHash); MessageDigest md = null; if (hash.startsWith("*")) { // If not phpass, try some algorythms from unix crypt() if (storedHash.startsWith("$6$")) { try { md =...
4823750_0
@RequestMapping(method = RequestMethod.POST) public String handleLogin(@RequestParam String username, @RequestParam String password, HttpSession session) throws AuthenticationException { Account account = this.accountService.login(username, password); session.setAttribute(ACCOUNT_ATTRIBUTE, account); ...
4835576_0
@SuppressWarnings("rawtypes") public void initialise(Object object) { Set<Field> fields = annotatedFieldRetriever.getAnnotatedFields(object.getClass(), CollectionOfMocks.class); for (Field field : fields) { Collection collection = createCollectionForField(field); new FieldValueMutator(object, field).mutateTo(coll...
4835576_1
@SuppressWarnings("rawtypes") public void initialise(Object object) { Set<Field> fields = annotatedFieldRetriever.getAnnotatedFields(object.getClass(), CollectionOfMocks.class); for (Field field : fields) { Collection collection = createCollectionForField(field); new FieldValueMutator(object, field).mutateTo(coll...
4835576_2
public <T> T createMock(Class<T> clazz) { return mock(clazz); }
4835576_3
@SuppressWarnings("rawtypes") public boolean matches(CollectionOfMocksField collectionOfMocksField) { if (this == collectionOfMocksField) { return true; } return getTypeOfCollection().equals(collectionOfMocksField.getTypeOfCollection()) && getTypeOfElements().equals(collectionOfMocksField.getTypeOfElements()); ...
4835576_4
@SuppressWarnings("rawtypes") public boolean matches(CollectionOfMocksField collectionOfMocksField) { if (this == collectionOfMocksField) { return true; } return getTypeOfCollection().equals(collectionOfMocksField.getTypeOfCollection()) && getTypeOfElements().equals(collectionOfMocksField.getTypeOfElements()); ...
4835576_5
@SuppressWarnings("rawtypes") public boolean matches(CollectionOfMocksField collectionOfMocksField) { if (this == collectionOfMocksField) { return true; } return getTypeOfCollection().equals(collectionOfMocksField.getTypeOfCollection()) && getTypeOfElements().equals(collectionOfMocksField.getTypeOfElements()); ...
4835576_6
@SuppressWarnings("rawtypes") public boolean matches(CollectionOfMocksField collectionOfMocksField) { if (this == collectionOfMocksField) { return true; } return getTypeOfCollection().equals(collectionOfMocksField.getTypeOfCollection()) && getTypeOfElements().equals(collectionOfMocksField.getTypeOfElements()); ...
4835576_7
@SuppressWarnings({ "rawtypes", "unchecked" }) public void add(CollectionOfMocksField collectionOfMocksField) { if (hasMatchingInjectableCollection(collectionOfMocksField)) { throw new IllegalArgumentException("There is more than one CollectionOfMocks of type of collection " + collectionOfMocksField.getTypeOfCol...
4835576_8
@SuppressWarnings("unchecked") public <T> OrderedSet<T> selectMocks(OrderedSet<Object> mocks, Class<T> mockClass) { OrderedSet<T> matchingMocks = new OrderedSet<T>(); for (Object object : mocks) { if (mockClass.isAssignableFrom(object.getClass())) { matchingMocks.add((T) object); } } return matchingMocks; }
4835576_9
@SuppressWarnings("unchecked") public <T> OrderedSet<T> selectMocks(OrderedSet<Object> mocks, Class<T> mockClass) { OrderedSet<T> matchingMocks = new OrderedSet<T>(); for (Object object : mocks) { if (mockClass.isAssignableFrom(object.getClass())) { matchingMocks.add((T) object); } } return matchingMocks; }
4889322_0
public static <T extends UserContext> SendCondition<T> and(final SendCondition<T> first, final SendCondition<T> second) { return new SendCondition<T>() { @Override public boolean isApplicable(T userContext) { return first.isApplicable(userContext) && second.isApplicable(userContext); } }; }
4889322_1
public static <T extends UserContext> SendCondition<T> and(final SendCondition<T> first, final SendCondition<T> second) { return new SendCondition<T>() { @Override public boolean isApplicable(T userContext) { return first.isApplicable(userContext) && second.isApplicable(userContext); } }; }
4889322_2
public static <T extends UserContext> SendCondition<T> and(final SendCondition<T> first, final SendCondition<T> second) { return new SendCondition<T>() { @Override public boolean isApplicable(T userContext) { return first.isApplicable(userContext) && second.isApplicable(userContext); } }; }
4889322_3
public static <T extends UserContext> SendCondition<T> or(final SendCondition<T> first, final SendCondition<T> second) { return new SendCondition<T>() { @Override public boolean isApplicable(T userContext) { return first.isApplicable(userContext) || second.isApplicable(userContext); } }; }
4889322_4
public static <T extends UserContext> SendCondition<T> or(final SendCondition<T> first, final SendCondition<T> second) { return new SendCondition<T>() { @Override public boolean isApplicable(T userContext) { return first.isApplicable(userContext) || second.isApplicable(userContext); } }; }
4889322_5
public static <T extends UserContext> SendCondition<T> or(final SendCondition<T> first, final SendCondition<T> second) { return new SendCondition<T>() { @Override public boolean isApplicable(T userContext) { return first.isApplicable(userContext) || second.isApplicable(userContext); } }; }
4889322_6
public static <T extends UserContext> SendCondition<T> not(final SendCondition<T> condition) { return new SendCondition<T>() { @Override public boolean isApplicable(T userContext) { return !condition.isApplicable(userContext); } }; }
4889322_7
public static <T extends UserContext> SendCondition<T> not(final SendCondition<T> condition) { return new SendCondition<T>() { @Override public boolean isApplicable(T userContext) { return !condition.isApplicable(userContext); } }; }
4889322_8
public void processCommand(WebsocketConnector connector, int operationCode, Object data) { WebsocketOperation operation = operations.get(operationCode); if (operation != null) { operation.performOperation(connector, usersContainer, data); } else { log.warn("Cannot perform operation with code " + operation...
4889322_9
public void processCommand(WebsocketConnector connector, int operationCode, Object data) { WebsocketOperation operation = operations.get(operationCode); if (operation != null) { operation.performOperation(connector, usersContainer, data); } else { log.warn("Cannot perform operation with code " + operation...