id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
37,700
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java
HylaFaxClientSpi.createHylaFAXClientConnectionFactory
protected final HylaFAXClientConnectionFactory createHylaFAXClientConnectionFactory(String className) { //create new instance HylaFAXClientConnectionFactory factory=(HylaFAXClientConnectionFactory)ReflectionHelper.createInstance(className); //initialize factory.initializ...
java
protected final HylaFAXClientConnectionFactory createHylaFAXClientConnectionFactory(String className) { //create new instance HylaFAXClientConnectionFactory factory=(HylaFAXClientConnectionFactory)ReflectionHelper.createInstance(className); //initialize factory.initializ...
[ "protected", "final", "HylaFAXClientConnectionFactory", "createHylaFAXClientConnectionFactory", "(", "String", "className", ")", "{", "//create new instance", "HylaFAXClientConnectionFactory", "factory", "=", "(", "HylaFAXClientConnectionFactory", ")", "ReflectionHelper", ".", "c...
Creates and returns the hylafax client connection factory. @param className The connection factory class name @return The hylafax client connection factory
[ "Creates", "and", "returns", "the", "hylafax", "client", "connection", "factory", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java#L214-L223
37,701
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java
HylaFaxClientSpi.getHylaFAXClient
protected synchronized HylaFAXClient getHylaFAXClient() { HylaFAXClient client=null; if(this.connection==null) { //create new connection this.connection=this.connectionFactory.createConnection(); } //get client client=this.connection.g...
java
protected synchronized HylaFAXClient getHylaFAXClient() { HylaFAXClient client=null; if(this.connection==null) { //create new connection this.connection=this.connectionFactory.createConnection(); } //get client client=this.connection.g...
[ "protected", "synchronized", "HylaFAXClient", "getHylaFAXClient", "(", ")", "{", "HylaFAXClient", "client", "=", "null", ";", "if", "(", "this", ".", "connection", "==", "null", ")", "{", "//create new connection", "this", ".", "connection", "=", "this", ".", ...
Returns an instance of the hyla fax client. @return The client instance
[ "Returns", "an", "instance", "of", "the", "hyla", "fax", "client", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java#L230-L243
37,702
sagiegurari/fax4j
src/main/java/org/fax4j/util/ReflectionHelper.java
ReflectionHelper.getThreadContextClassLoader
public static ClassLoader getThreadContextClassLoader() { Thread thread=Thread.currentThread(); ClassLoader classLoader=thread.getContextClassLoader(); return classLoader; }
java
public static ClassLoader getThreadContextClassLoader() { Thread thread=Thread.currentThread(); ClassLoader classLoader=thread.getContextClassLoader(); return classLoader; }
[ "public", "static", "ClassLoader", "getThreadContextClassLoader", "(", ")", "{", "Thread", "thread", "=", "Thread", ".", "currentThread", "(", ")", ";", "ClassLoader", "classLoader", "=", "thread", ".", "getContextClassLoader", "(", ")", ";", "return", "classLoade...
This function returns the thread context class loader. @return The thread context class loader
[ "This", "function", "returns", "the", "thread", "context", "class", "loader", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/ReflectionHelper.java#L30-L36
37,703
sagiegurari/fax4j
src/main/java/org/fax4j/util/ReflectionHelper.java
ReflectionHelper.getType
public static Class<?> getType(String className) { ClassLoader classLoader=ReflectionHelper.getThreadContextClassLoader(); Class<?> type=null; try { //load class definition type=classLoader.loadClass(className); } catch(ClassNotFoundException e...
java
public static Class<?> getType(String className) { ClassLoader classLoader=ReflectionHelper.getThreadContextClassLoader(); Class<?> type=null; try { //load class definition type=classLoader.loadClass(className); } catch(ClassNotFoundException e...
[ "public", "static", "Class", "<", "?", ">", "getType", "(", "String", "className", ")", "{", "ClassLoader", "classLoader", "=", "ReflectionHelper", ".", "getThreadContextClassLoader", "(", ")", ";", "Class", "<", "?", ">", "type", "=", "null", ";", "try", ...
This function returns the class based on the class name. @param className The class name of the requested type @return The type
[ "This", "function", "returns", "the", "class", "based", "on", "the", "class", "name", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/ReflectionHelper.java#L45-L60
37,704
sagiegurari/fax4j
src/main/java/org/fax4j/util/ReflectionHelper.java
ReflectionHelper.invokeMethod
public static Object invokeMethod(Class<?> type,Object instance,String methodName,Class<?>[] inputTypes,Object[] input) { Method method=null; try { //get method method=type.getDeclaredMethod(methodName,inputTypes); } catch(Exception exception) ...
java
public static Object invokeMethod(Class<?> type,Object instance,String methodName,Class<?>[] inputTypes,Object[] input) { Method method=null; try { //get method method=type.getDeclaredMethod(methodName,inputTypes); } catch(Exception exception) ...
[ "public", "static", "Object", "invokeMethod", "(", "Class", "<", "?", ">", "type", ",", "Object", "instance", ",", "String", "methodName", ",", "Class", "<", "?", ">", "[", "]", "inputTypes", ",", "Object", "[", "]", "input", ")", "{", "Method", "metho...
This function invokes the requested method. @param type The class type @param instance The instance @param methodName The method name to invoke @param inputTypes An array of input types @param input The method input @return The method output
[ "This", "function", "invokes", "the", "requested", "method", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/ReflectionHelper.java#L118-L146
37,705
sagiegurari/fax4j
src/main/java/org/fax4j/util/ReflectionHelper.java
ReflectionHelper.getField
public static Field getField(Class<?> type,String fieldName) { Field field=null; try { //get field field=type.getDeclaredField(fieldName); } catch(Exception exception) { throw new FaxException("Unable to extract field: "+fieldName+"...
java
public static Field getField(Class<?> type,String fieldName) { Field field=null; try { //get field field=type.getDeclaredField(fieldName); } catch(Exception exception) { throw new FaxException("Unable to extract field: "+fieldName+"...
[ "public", "static", "Field", "getField", "(", "Class", "<", "?", ">", "type", ",", "String", "fieldName", ")", "{", "Field", "field", "=", "null", ";", "try", "{", "//get field", "field", "=", "type", ".", "getDeclaredField", "(", "fieldName", ")", ";", ...
This function returns the field wrapper for the requested field @param type The class type @param fieldName The field name @return The field
[ "This", "function", "returns", "the", "field", "wrapper", "for", "the", "requested", "field" ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/ReflectionHelper.java#L157-L174
37,706
sagiegurari/fax4j
src/main/java/org/fax4j/spi/process/ProcessFaxClientSpi.java
ProcessFaxClientSpi.createProcessOutputValidator
protected ProcessOutputValidator createProcessOutputValidator() { //get process output validator String className=this.getConfigurationValue(FaxClientSpiConfigurationConstants.PROCESS_OUTPUT_VALIDATOR_PRE_FORMAT_PROPERTY_KEY); ProcessOutputValidator validator=null; if(className==null...
java
protected ProcessOutputValidator createProcessOutputValidator() { //get process output validator String className=this.getConfigurationValue(FaxClientSpiConfigurationConstants.PROCESS_OUTPUT_VALIDATOR_PRE_FORMAT_PROPERTY_KEY); ProcessOutputValidator validator=null; if(className==null...
[ "protected", "ProcessOutputValidator", "createProcessOutputValidator", "(", ")", "{", "//get process output validator", "String", "className", "=", "this", ".", "getConfigurationValue", "(", "FaxClientSpiConfigurationConstants", ".", "PROCESS_OUTPUT_VALIDATOR_PRE_FORMAT_PROPERTY_KEY"...
This function creates and returns the process output validator. @return The process output validator
[ "This", "function", "creates", "and", "returns", "the", "process", "output", "validator", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/process/ProcessFaxClientSpi.java#L281-L295
37,707
sagiegurari/fax4j
src/main/java/org/fax4j/spi/process/ProcessFaxClientSpi.java
ProcessFaxClientSpi.createProcessOutputHandler
protected ProcessOutputHandler createProcessOutputHandler() { //get process output handler String className=this.getConfigurationValue(FaxClientSpiConfigurationConstants.PROCESS_OUTPUT_HANDLER_PRE_FORMAT_PROPERTY_KEY); ProcessOutputHandler handler=null; if(className!=null) { ...
java
protected ProcessOutputHandler createProcessOutputHandler() { //get process output handler String className=this.getConfigurationValue(FaxClientSpiConfigurationConstants.PROCESS_OUTPUT_HANDLER_PRE_FORMAT_PROPERTY_KEY); ProcessOutputHandler handler=null; if(className!=null) { ...
[ "protected", "ProcessOutputHandler", "createProcessOutputHandler", "(", ")", "{", "//get process output handler", "String", "className", "=", "this", ".", "getConfigurationValue", "(", "FaxClientSpiConfigurationConstants", ".", "PROCESS_OUTPUT_HANDLER_PRE_FORMAT_PROPERTY_KEY", ")",...
This function creates and returns the process output handler. @return The process output handler
[ "This", "function", "creates", "and", "returns", "the", "process", "output", "handler", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/process/ProcessFaxClientSpi.java#L302-L314
37,708
sagiegurari/fax4j
src/main/java/org/fax4j/spi/process/ProcessFaxClientSpi.java
ProcessFaxClientSpi.executeProcess
protected ProcessOutput executeProcess(FaxJob faxJob,String command,FaxActionType faxActionType) { if(command==null) { this.throwUnsupportedException(); } //update command String updatedCommand=command; if(this.useWindowsCommandPrefix) { ...
java
protected ProcessOutput executeProcess(FaxJob faxJob,String command,FaxActionType faxActionType) { if(command==null) { this.throwUnsupportedException(); } //update command String updatedCommand=command; if(this.useWindowsCommandPrefix) { ...
[ "protected", "ProcessOutput", "executeProcess", "(", "FaxJob", "faxJob", ",", "String", "command", ",", "FaxActionType", "faxActionType", ")", "{", "if", "(", "command", "==", "null", ")", "{", "this", ".", "throwUnsupportedException", "(", ")", ";", "}", "//u...
Executes the process and returns the output. @param faxJob The fax job object @param command The command to execute @param faxActionType The fax action type @return The process output
[ "Executes", "the", "process", "and", "returns", "the", "output", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/process/ProcessFaxClientSpi.java#L467-L498
37,709
sagiegurari/fax4j
src/main/java/org/fax4j/spi/AbstractFaxJob.java
AbstractFaxJob.getFilePath
public String getFilePath() { //get file File fileInstance=this.getFile(); String filePath=null; if(fileInstance!=null) { filePath=fileInstance.getPath(); } return filePath; }
java
public String getFilePath() { //get file File fileInstance=this.getFile(); String filePath=null; if(fileInstance!=null) { filePath=fileInstance.getPath(); } return filePath; }
[ "public", "String", "getFilePath", "(", ")", "{", "//get file", "File", "fileInstance", "=", "this", ".", "getFile", "(", ")", ";", "String", "filePath", "=", "null", ";", "if", "(", "fileInstance", "!=", "null", ")", "{", "filePath", "=", "fileInstance", ...
This function returns the path to the file to fax. @return The path to the file to fax
[ "This", "function", "returns", "the", "path", "to", "the", "file", "to", "fax", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/AbstractFaxJob.java#L29-L41
37,710
sagiegurari/fax4j
src/main/java/org/fax4j/spi/AbstractFaxJob.java
AbstractFaxJob.setFilePath
public void setFilePath(String filePath) { //create a new file File fileInstance=null; if(filePath!=null) { fileInstance=new File(filePath); } //set file this.setFile(fileInstance); }
java
public void setFilePath(String filePath) { //create a new file File fileInstance=null; if(filePath!=null) { fileInstance=new File(filePath); } //set file this.setFile(fileInstance); }
[ "public", "void", "setFilePath", "(", "String", "filePath", ")", "{", "//create a new file", "File", "fileInstance", "=", "null", ";", "if", "(", "filePath", "!=", "null", ")", "{", "fileInstance", "=", "new", "File", "(", "filePath", ")", ";", "}", "//set...
This function sets the path to the file to fax. @param filePath The path to the file to fax
[ "This", "function", "sets", "the", "path", "to", "the", "file", "to", "fax", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/AbstractFaxJob.java#L49-L60
37,711
sagiegurari/fax4j
src/main/java/org/fax4j/spi/AbstractFaxJob.java
AbstractFaxJob.addToStringAttributes
protected StringBuilder addToStringAttributes(String faxJobType) { //init buffer StringBuilder buffer=new StringBuilder(500); buffer.append(faxJobType); buffer.append(":"); //append values buffer.append(Logger.SYSTEM_EOL); buffer.append("ID: "); buffe...
java
protected StringBuilder addToStringAttributes(String faxJobType) { //init buffer StringBuilder buffer=new StringBuilder(500); buffer.append(faxJobType); buffer.append(":"); //append values buffer.append(Logger.SYSTEM_EOL); buffer.append("ID: "); buffe...
[ "protected", "StringBuilder", "addToStringAttributes", "(", "String", "faxJobType", ")", "{", "//init buffer", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", "500", ")", ";", "buffer", ".", "append", "(", "faxJobType", ")", ";", "buffer", ".", "app...
This function adds the common attributes for the toString printing. @param faxJobType The fax job type @return The buffer used
[ "This", "function", "adds", "the", "common", "attributes", "for", "the", "toString", "printing", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/AbstractFaxJob.java#L69-L103
37,712
sagiegurari/fax4j
src/main/java/org/fax4j/spi/comm/CommFaxClientSpi.java
CommFaxClientSpi.createCommPortConnectionFactory
protected final CommPortConnectionFactory createCommPortConnectionFactory() { //create new instance CommPortConnectionFactory factory=(CommPortConnectionFactory)ReflectionHelper.createInstance(this.commConnectionFactoryClassName); //initialize factory.initialize(this); ...
java
protected final CommPortConnectionFactory createCommPortConnectionFactory() { //create new instance CommPortConnectionFactory factory=(CommPortConnectionFactory)ReflectionHelper.createInstance(this.commConnectionFactoryClassName); //initialize factory.initialize(this); ...
[ "protected", "final", "CommPortConnectionFactory", "createCommPortConnectionFactory", "(", ")", "{", "//create new instance", "CommPortConnectionFactory", "factory", "=", "(", "CommPortConnectionFactory", ")", "ReflectionHelper", ".", "createInstance", "(", "this", ".", "comm...
Creates and returns the COMM port connection factory. @return The COMM port connection factory
[ "Creates", "and", "returns", "the", "COMM", "port", "connection", "factory", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/comm/CommFaxClientSpi.java#L191-L200
37,713
sagiegurari/fax4j
src/main/java/org/fax4j/spi/comm/CommFaxClientSpi.java
CommFaxClientSpi.createFaxModemAdapter
protected final FaxModemAdapter createFaxModemAdapter() { //create new instance FaxModemAdapter adapter=(FaxModemAdapter)ReflectionHelper.createInstance(this.faxModemClassName); //initialize adapter.initialize(this); return adapter; }
java
protected final FaxModemAdapter createFaxModemAdapter() { //create new instance FaxModemAdapter adapter=(FaxModemAdapter)ReflectionHelper.createInstance(this.faxModemClassName); //initialize adapter.initialize(this); return adapter; }
[ "protected", "final", "FaxModemAdapter", "createFaxModemAdapter", "(", ")", "{", "//create new instance", "FaxModemAdapter", "adapter", "=", "(", "FaxModemAdapter", ")", "ReflectionHelper", ".", "createInstance", "(", "this", ".", "faxModemClassName", ")", ";", "//initi...
Creates and returns the fax modem adapter. @return The fax modem adapter
[ "Creates", "and", "returns", "the", "fax", "modem", "adapter", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/comm/CommFaxClientSpi.java#L207-L216
37,714
sagiegurari/fax4j
src/main/java/org/fax4j/spi/comm/CommFaxClientSpi.java
CommFaxClientSpi.releaseCommPortConnection
protected void releaseCommPortConnection() { //get reference Connection<CommPortAdapter> connection=this.commConnection; this.commConnection=null; if(connection!=null) { //get logger Logger logger=this.getLogger(); try { ...
java
protected void releaseCommPortConnection() { //get reference Connection<CommPortAdapter> connection=this.commConnection; this.commConnection=null; if(connection!=null) { //get logger Logger logger=this.getLogger(); try { ...
[ "protected", "void", "releaseCommPortConnection", "(", ")", "{", "//get reference", "Connection", "<", "CommPortAdapter", ">", "connection", "=", "this", ".", "commConnection", ";", "this", ".", "commConnection", "=", "null", ";", "if", "(", "connection", "!=", ...
Releases the COMM port connection if open.
[ "Releases", "the", "COMM", "port", "connection", "if", "open", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/comm/CommFaxClientSpi.java#L249-L271
37,715
sagiegurari/fax4j
src/main/java/org/fax4j/spi/comm/CommFaxClientSpi.java
CommFaxClientSpi.getCommPortConnection
protected Connection<CommPortAdapter> getCommPortConnection() { Connection<CommPortAdapter> connection=null; synchronized(this) { boolean connectionValid=true; //if no connection available if(this.commConnection==null) { connect...
java
protected Connection<CommPortAdapter> getCommPortConnection() { Connection<CommPortAdapter> connection=null; synchronized(this) { boolean connectionValid=true; //if no connection available if(this.commConnection==null) { connect...
[ "protected", "Connection", "<", "CommPortAdapter", ">", "getCommPortConnection", "(", ")", "{", "Connection", "<", "CommPortAdapter", ">", "connection", "=", "null", ";", "synchronized", "(", "this", ")", "{", "boolean", "connectionValid", "=", "true", ";", "//i...
Returns the COMM port connection to be used. @return The COMM port connection
[ "Returns", "the", "COMM", "port", "connection", "to", "be", "used", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/comm/CommFaxClientSpi.java#L278-L315
37,716
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/EmbeddedJmxTrans.java
EmbeddedJmxTrans.stop
@PreDestroy public void stop() { logger.info("Stop..."); lifecycleLock.writeLock().lock(); try { if (!State.STARTED.equals(state)) { logger.debug("Ignore stop() command for " + state + " instance"); return; } logger.info("Un...
java
@PreDestroy public void stop() { logger.info("Stop..."); lifecycleLock.writeLock().lock(); try { if (!State.STARTED.equals(state)) { logger.debug("Ignore stop() command for " + state + " instance"); return; } logger.info("Un...
[ "@", "PreDestroy", "public", "void", "stop", "(", ")", "{", "logger", ".", "info", "(", "\"Stop...\"", ")", ";", "lifecycleLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "!", "State", ".", "STARTED", ".", "equ...
Stop scheduled executors and collect-and-export metrics one last time.
[ "Stop", "scheduled", "executors", "and", "collect", "-", "and", "-", "export", "metrics", "one", "last", "time", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/EmbeddedJmxTrans.java#L257-L316
37,717
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/output/CsvWriter.java
CsvWriter.splitQueryResultsByTime
private SortedMap<String, List<QueryResult>> splitQueryResultsByTime(Iterable<QueryResult> results) { SortedMap<String, List<QueryResult>> resultsByTime = new TreeMap<String, List<QueryResult>>(); for (QueryResult result : results) { String epoch = String.valueOf(result.getEpoch(TimeUnit.SE...
java
private SortedMap<String, List<QueryResult>> splitQueryResultsByTime(Iterable<QueryResult> results) { SortedMap<String, List<QueryResult>> resultsByTime = new TreeMap<String, List<QueryResult>>(); for (QueryResult result : results) { String epoch = String.valueOf(result.getEpoch(TimeUnit.SE...
[ "private", "SortedMap", "<", "String", ",", "List", "<", "QueryResult", ">", ">", "splitQueryResultsByTime", "(", "Iterable", "<", "QueryResult", ">", "results", ")", "{", "SortedMap", "<", "String", ",", "List", "<", "QueryResult", ">", ">", "resultsByTime", ...
Often, query results for a given query come in batches so we need to split them up by time @param results from {@link CsvWriter#write(Iterable)} @return {@link Map} from epoch time in seconds --> results list from that time
[ "Often", "query", "results", "for", "a", "given", "query", "come", "in", "batches", "so", "we", "need", "to", "split", "them", "up", "by", "time" ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/CsvWriter.java#L160-L178
37,718
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/output/CsvWriter.java
CsvWriter.alignResults
List<Object> alignResults(List<QueryResult> results, String epoch) { Object[] alignedResults = new Object[results.size() + 1]; List<String> headerList = Arrays.asList(header); alignedResults[0] = epoch; for (QueryResult result : results) { alignedResults[headerList.indexOf(...
java
List<Object> alignResults(List<QueryResult> results, String epoch) { Object[] alignedResults = new Object[results.size() + 1]; List<String> headerList = Arrays.asList(header); alignedResults[0] = epoch; for (QueryResult result : results) { alignedResults[headerList.indexOf(...
[ "List", "<", "Object", ">", "alignResults", "(", "List", "<", "QueryResult", ">", "results", ",", "String", "epoch", ")", "{", "Object", "[", "]", "alignedResults", "=", "new", "Object", "[", "results", ".", "size", "(", ")", "+", "1", "]", ";", "Lis...
We have no guarantee that the results will always be in the same order, so we make sure to align them according to the header on each query.
[ "We", "have", "no", "guarantee", "that", "the", "results", "will", "always", "be", "in", "the", "same", "order", "so", "we", "make", "sure", "to", "align", "them", "according", "to", "the", "header", "on", "each", "query", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/CsvWriter.java#L200-L211
37,719
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/ResultNameStrategy.java
ResultNameStrategy.appendEscapedNonAlphaNumericChars
private void appendEscapedNonAlphaNumericChars(String str, boolean escapeDot, StringBuilder result) { char[] chars = str.toCharArray(); for (int i = 0; i < chars.length; i++) { char ch = chars[i]; if (Character.isLetter(ch) || Character.isDigit(ch) || ch == '-') { ...
java
private void appendEscapedNonAlphaNumericChars(String str, boolean escapeDot, StringBuilder result) { char[] chars = str.toCharArray(); for (int i = 0; i < chars.length; i++) { char ch = chars[i]; if (Character.isLetter(ch) || Character.isDigit(ch) || ch == '-') { ...
[ "private", "void", "appendEscapedNonAlphaNumericChars", "(", "String", "str", ",", "boolean", "escapeDot", ",", "StringBuilder", "result", ")", "{", "char", "[", "]", "chars", "=", "str", ".", "toCharArray", "(", ")", ";", "for", "(", "int", "i", "=", "0",...
Escape all non a-z,A-Z, 0-9 and '-' with a '_'. '.' is escaped with a '_' if {@code escapeDot} is {$code true}. @param str the string to escape @param escapeDot indicates whether '.' should be escaped into '_' or not. @param result the {@linkplain StringBuilder} in which the escaped string is appended
[ "Escape", "all", "non", "a", "-", "z", "A", "-", "Z", "0", "-", "9", "and", "-", "with", "a", "_", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/ResultNameStrategy.java#L292-L306
37,720
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/spring/EmbeddedJmxTransFactory.java
EmbeddedJmxTransFactory.computeConfigurationLastModified
private long computeConfigurationLastModified(List<Resource> configurations) { long result = 0; for (Resource configuration : configurations) { try { long currentConfigurationLastModified = configuration.lastModified(); if (currentConfigurationLastModified > resu...
java
private long computeConfigurationLastModified(List<Resource> configurations) { long result = 0; for (Resource configuration : configurations) { try { long currentConfigurationLastModified = configuration.lastModified(); if (currentConfigurationLastModified > resu...
[ "private", "long", "computeConfigurationLastModified", "(", "List", "<", "Resource", ">", "configurations", ")", "{", "long", "result", "=", "0", ";", "for", "(", "Resource", "configuration", ":", "configurations", ")", "{", "try", "{", "long", "currentConfigura...
Computes the last modified date of all configuration files. @param configurations the list of available configurations as Spring resources @return
[ "Computes", "the", "last", "modified", "date", "of", "all", "configuration", "files", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/spring/EmbeddedJmxTransFactory.java#L128-L141
37,721
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/spring/EmbeddedJmxTransFactory.java
EmbeddedJmxTransFactory.getConfigurations
private List<Resource> getConfigurations() { List<Resource> result = new ArrayList<Resource>(); for (String delimitedConfigurationUrl : configurationUrls) { String[] tokens = StringUtils.commaDelimitedListToStringArray(delimitedConfigurationUrl); tokens = StringUtils.trimArrayElements(tokens); for (String ...
java
private List<Resource> getConfigurations() { List<Resource> result = new ArrayList<Resource>(); for (String delimitedConfigurationUrl : configurationUrls) { String[] tokens = StringUtils.commaDelimitedListToStringArray(delimitedConfigurationUrl); tokens = StringUtils.trimArrayElements(tokens); for (String ...
[ "private", "List", "<", "Resource", ">", "getConfigurations", "(", ")", "{", "List", "<", "Resource", ">", "result", "=", "new", "ArrayList", "<", "Resource", ">", "(", ")", ";", "for", "(", "String", "delimitedConfigurationUrl", ":", "configurationUrls", ")...
Returns the list of all configuration spring resources. @return
[ "Returns", "the", "list", "of", "all", "configuration", "spring", "resources", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/spring/EmbeddedJmxTransFactory.java#L148-L166
37,722
RestComm/load-balancer
jar/src/main/java/org/mobicents/tools/smpp/balancer/impl/ServerConnectionImpl.java
ServerConnectionImpl.sendGenericNack
private void sendGenericNack(Pdu packet){ GenericNack genericNack = new GenericNack(); genericNack.setSequenceNumber(packet.getSequenceNumber()); genericNack.setCommandStatus(SmppConstants.STATUS_INVCMDID); ChannelBuffer buffer = null; try { buffer = transcoder.encode(genericNack); } catch (Un...
java
private void sendGenericNack(Pdu packet){ GenericNack genericNack = new GenericNack(); genericNack.setSequenceNumber(packet.getSequenceNumber()); genericNack.setCommandStatus(SmppConstants.STATUS_INVCMDID); ChannelBuffer buffer = null; try { buffer = transcoder.encode(genericNack); } catch (Un...
[ "private", "void", "sendGenericNack", "(", "Pdu", "packet", ")", "{", "GenericNack", "genericNack", "=", "new", "GenericNack", "(", ")", ";", "genericNack", ".", "setSequenceNumber", "(", "packet", ".", "getSequenceNumber", "(", ")", ")", ";", "genericNack", "...
Send generic_nack to client if unable to convert request from client @param packet PDU packet
[ "Send", "generic_nack", "to", "client", "if", "unable", "to", "convert", "request", "from", "client" ]
54768d0b81004b2653d429720016ad2617fe754f
https://github.com/RestComm/load-balancer/blob/54768d0b81004b2653d429720016ad2617fe754f/jar/src/main/java/org/mobicents/tools/smpp/balancer/impl/ServerConnectionImpl.java#L419-L438
37,723
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/config/EtcdKVStore.java
EtcdKVStore.getKeyValue
public KeyValue getKeyValue(String KeyURI) throws EmbeddedJmxTransException { String etcdURI = KeyURI.substring(0, KeyURI.indexOf("/", 7)); String key = KeyURI.substring(KeyURI.indexOf("/", 7)); try { return getFromEtcd(makeEtcdBaseUris(etcdURI), key); } catch (Throwable t) { throw new Em...
java
public KeyValue getKeyValue(String KeyURI) throws EmbeddedJmxTransException { String etcdURI = KeyURI.substring(0, KeyURI.indexOf("/", 7)); String key = KeyURI.substring(KeyURI.indexOf("/", 7)); try { return getFromEtcd(makeEtcdBaseUris(etcdURI), key); } catch (Throwable t) { throw new Em...
[ "public", "KeyValue", "getKeyValue", "(", "String", "KeyURI", ")", "throws", "EmbeddedJmxTransException", "{", "String", "etcdURI", "=", "KeyURI", ".", "substring", "(", "0", ",", "KeyURI", ".", "indexOf", "(", "\"/\"", ",", "7", ")", ")", ";", "String", "...
Get a key value from etcd. Returns the key value and the etcd modification index as version @param KeyURI URI of the key in the form etcd://ipaddr:port/path for an etcd cluster you can use etcd://[ipaddr1:port1, ipaddr:port2,...]:/path @return a KeyValue object @throws EmbeddedJmxTransException @see org.jmxtrans.embe...
[ "Get", "a", "key", "value", "from", "etcd", ".", "Returns", "the", "key", "value", "and", "the", "etcd", "modification", "index", "as", "version" ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/config/EtcdKVStore.java#L208-L219
37,724
aloha-app/thrift-client-pool-java
src/main/java/com/wealoha/thrift/ThriftUtil.java
ThriftUtil.closeClient
public static void closeClient(TServiceClient client) { if (client == null) { return; } try { TProtocol proto = client.getInputProtocol(); if (proto != null) { proto.getTransport().close(); } } catch (Throwable e) { ...
java
public static void closeClient(TServiceClient client) { if (client == null) { return; } try { TProtocol proto = client.getInputProtocol(); if (proto != null) { proto.getTransport().close(); } } catch (Throwable e) { ...
[ "public", "static", "void", "closeClient", "(", "TServiceClient", "client", ")", "{", "if", "(", "client", "==", "null", ")", "{", "return", ";", "}", "try", "{", "TProtocol", "proto", "=", "client", ".", "getInputProtocol", "(", ")", ";", "if", "(", "...
close internal transport @param client
[ "close", "internal", "transport" ]
7781fc18f81ced14ea7b03d3ffd070c411c33a17
https://github.com/aloha-app/thrift-client-pool-java/blob/7781fc18f81ced14ea7b03d3ffd070c411c33a17/src/main/java/com/wealoha/thrift/ThriftUtil.java#L22-L43
37,725
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java
StackdriverWriter.start
@Override public void start() { try { url = new URL(getStringSetting(SETTING_URL, DEFAULT_STACKDRIVER_API_URL)); } catch (MalformedURLException e) { throw new EmbeddedJmxTransException(e); } apiKey = getStringSetting(SETTING_TOKEN); if (getStringSetting(SETTING_PROXY_HOST, null) != null && !getString...
java
@Override public void start() { try { url = new URL(getStringSetting(SETTING_URL, DEFAULT_STACKDRIVER_API_URL)); } catch (MalformedURLException e) { throw new EmbeddedJmxTransException(e); } apiKey = getStringSetting(SETTING_TOKEN); if (getStringSetting(SETTING_PROXY_HOST, null) != null && !getString...
[ "@", "Override", "public", "void", "start", "(", ")", "{", "try", "{", "url", "=", "new", "URL", "(", "getStringSetting", "(", "SETTING_URL", ",", "DEFAULT_STACKDRIVER_API_URL", ")", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "thr...
Initial setup for the writer class. Loads in settings and initializes one-time setup variables like instanceId.
[ "Initial", "setup", "for", "the", "writer", "class", ".", "Loads", "in", "settings", "and", "initializes", "one", "-", "time", "setup", "variables", "like", "instanceId", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java#L110-L149
37,726
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java
StackdriverWriter.write
@Override public void write(Iterable<QueryResult> results) { logger.debug("Export to '{}', proxy {} metrics {}", url, proxy, results); HttpURLConnection urlConnection = null; try { if (proxy == null) { urlConnection = (HttpURLConnection) url.openConnection(); } else { urlConnection = (HttpURLConn...
java
@Override public void write(Iterable<QueryResult> results) { logger.debug("Export to '{}', proxy {} metrics {}", url, proxy, results); HttpURLConnection urlConnection = null; try { if (proxy == null) { urlConnection = (HttpURLConnection) url.openConnection(); } else { urlConnection = (HttpURLConn...
[ "@", "Override", "public", "void", "write", "(", "Iterable", "<", "QueryResult", ">", "results", ")", "{", "logger", ".", "debug", "(", "\"Export to '{}', proxy {} metrics {}\"", ",", "url", ",", "proxy", ",", "results", ")", ";", "HttpURLConnection", "urlConnec...
Send given metrics to the Stackdriver server using HTTP @param results Iterable collection of data points
[ "Send", "given", "metrics", "to", "the", "Stackdriver", "server", "using", "HTTP" ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java#L157-L208
37,727
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java
StackdriverWriter.getLocalAwsInstanceId
@Nullable private String getLocalAwsInstanceId() { String detectedInstanceId = null; try { final URL metadataUrl = new URL("http://169.254.169.254/latest/meta-data/instance-id"); URLConnection metadataConnection = metadataUrl.openConnection(); BufferedReader in = new BufferedReader(new I...
java
@Nullable private String getLocalAwsInstanceId() { String detectedInstanceId = null; try { final URL metadataUrl = new URL("http://169.254.169.254/latest/meta-data/instance-id"); URLConnection metadataConnection = metadataUrl.openConnection(); BufferedReader in = new BufferedReader(new I...
[ "@", "Nullable", "private", "String", "getLocalAwsInstanceId", "(", ")", "{", "String", "detectedInstanceId", "=", "null", ";", "try", "{", "final", "URL", "metadataUrl", "=", "new", "URL", "(", "\"http://169.254.169.254/latest/meta-data/instance-id\"", ")", ";", "U...
Use the EC2 Metadata URL to determine the instance ID that this code is running on. Useful if you don't want to configure the instance ID manually. Pass detectInstance = "AWS" to have this run in your configuration. @return String containing an AWS instance id, or null if none is found
[ "Use", "the", "EC2", "Metadata", "URL", "to", "determine", "the", "instance", "ID", "that", "this", "code", "is", "running", "on", ".", "Useful", "if", "you", "don", "t", "want", "to", "configure", "the", "instance", "ID", "manually", ".", "Pass", "detec...
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java#L216-L232
37,728
RestComm/load-balancer
jar/src/main/java/org/mobicents/tools/smpp/multiplexer/MServer.java
MServer.start
public void start() { try { this.regularBootstrap.bind(new InetSocketAddress(regularConfiguration.getHost(), regularConfiguration.getPort())); if(logger.isInfoEnabled()) { logger.info(regularConfiguration.getName() + " started at " + regularConfiguration...
java
public void start() { try { this.regularBootstrap.bind(new InetSocketAddress(regularConfiguration.getHost(), regularConfiguration.getPort())); if(logger.isInfoEnabled()) { logger.info(regularConfiguration.getName() + " started at " + regularConfiguration...
[ "public", "void", "start", "(", ")", "{", "try", "{", "this", ".", "regularBootstrap", ".", "bind", "(", "new", "InetSocketAddress", "(", "regularConfiguration", ".", "getHost", "(", ")", ",", "regularConfiguration", ".", "getPort", "(", ")", ")", ")", ";"...
Start load balancer server
[ "Start", "load", "balancer", "server" ]
54768d0b81004b2653d429720016ad2617fe754f
https://github.com/RestComm/load-balancer/blob/54768d0b81004b2653d429720016ad2617fe754f/jar/src/main/java/org/mobicents/tools/smpp/multiplexer/MServer.java#L75-L95
37,729
RestComm/load-balancer
jar/src/main/java/org/mobicents/tools/smpp/multiplexer/MServer.java
MServer.stop
public void stop() { if (this.channels.size() > 0) { logger.info(regularConfiguration.getName() + " currently has [" + this.channels.size() + "] open child channel(s) that will be closed as part of stop()"); } this.channelFactory.shutdown(); this.channels.close().awaitUninterruptibly(...
java
public void stop() { if (this.channels.size() > 0) { logger.info(regularConfiguration.getName() + " currently has [" + this.channels.size() + "] open child channel(s) that will be closed as part of stop()"); } this.channelFactory.shutdown(); this.channels.close().awaitUninterruptibly(...
[ "public", "void", "stop", "(", ")", "{", "if", "(", "this", ".", "channels", ".", "size", "(", ")", ">", "0", ")", "{", "logger", ".", "info", "(", "regularConfiguration", ".", "getName", "(", ")", "+", "\" currently has [\"", "+", "this", ".", "chan...
Stop load balancer server
[ "Stop", "load", "balancer", "server" ]
54768d0b81004b2653d429720016ad2617fe754f
https://github.com/RestComm/load-balancer/blob/54768d0b81004b2653d429720016ad2617fe754f/jar/src/main/java/org/mobicents/tools/smpp/multiplexer/MServer.java#L107-L118
37,730
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/output/AbstractOutputWriter.java
AbstractOutputWriter.getStringSetting
protected String getStringSetting(String name, String defaultValue) { if (settings.containsKey(name)) { return settings.get(name).toString(); } else { return defaultValue; } }
java
protected String getStringSetting(String name, String defaultValue) { if (settings.containsKey(name)) { return settings.get(name).toString(); } else { return defaultValue; } }
[ "protected", "String", "getStringSetting", "(", "String", "name", ",", "String", "defaultValue", ")", "{", "if", "(", "settings", ".", "containsKey", "(", "name", ")", ")", "{", "return", "settings", ".", "get", "(", "name", ")", ".", "toString", "(", ")...
Return the value of the given property. If the property is not found, the <code>defaultValue</code> is returned. @param name name of the property @param defaultValue default value if the property is not defined. @return value of the property or <code>defaultValue</code> if the property is not defined.
[ "Return", "the", "value", "of", "the", "given", "property", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/AbstractOutputWriter.java#L190-L196
37,731
aloha-app/thrift-client-pool-java
src/main/java/com/wealoha/thrift/ThriftClientPool.java
ThriftClientPool.setServices
public void setServices(List<ServiceInfo> services) { if (services == null || services.size() == 0) { throw new IllegalArgumentException("services is empty!"); } this.services = services; serviceReset = true; }
java
public void setServices(List<ServiceInfo> services) { if (services == null || services.size() == 0) { throw new IllegalArgumentException("services is empty!"); } this.services = services; serviceReset = true; }
[ "public", "void", "setServices", "(", "List", "<", "ServiceInfo", ">", "services", ")", "{", "if", "(", "services", "==", "null", "||", "services", ".", "size", "(", ")", "==", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"services is ...
set new services for this pool @param services
[ "set", "new", "services", "for", "this", "pool" ]
7781fc18f81ced14ea7b03d3ffd070c411c33a17
https://github.com/aloha-app/thrift-client-pool-java/blob/7781fc18f81ced14ea7b03d3ffd070c411c33a17/src/main/java/com/wealoha/thrift/ThriftClientPool.java#L175-L181
37,732
aloha-app/thrift-client-pool-java
src/main/java/com/wealoha/thrift/ThriftClientPool.java
ThriftClientPool.getRandomService
private ServiceInfo getRandomService(List<ServiceInfo> serviceList) { if (serviceList == null || serviceList.size() == 0) { return null; } return serviceList.get(RandomUtils.nextInt(0, serviceList.size())); }
java
private ServiceInfo getRandomService(List<ServiceInfo> serviceList) { if (serviceList == null || serviceList.size() == 0) { return null; } return serviceList.get(RandomUtils.nextInt(0, serviceList.size())); }
[ "private", "ServiceInfo", "getRandomService", "(", "List", "<", "ServiceInfo", ">", "serviceList", ")", "{", "if", "(", "serviceList", "==", "null", "||", "serviceList", ".", "size", "(", ")", "==", "0", ")", "{", "return", "null", ";", "}", "return", "s...
get a random service @param serviceList @return
[ "get", "a", "random", "service" ]
7781fc18f81ced14ea7b03d3ffd070c411c33a17
https://github.com/aloha-app/thrift-client-pool-java/blob/7781fc18f81ced14ea7b03d3ffd070c411c33a17/src/main/java/com/wealoha/thrift/ThriftClientPool.java#L205-L210
37,733
aloha-app/thrift-client-pool-java
src/main/java/com/wealoha/thrift/ThriftClientPool.java
ThriftClientPool.getClient
public ThriftClient<T> getClient() throws ThriftException { try { return pool.borrowObject(); } catch (Exception e) { if (e instanceof ThriftException) { throw (ThriftException) e; } throw new ThriftException("Get client from pool failed.",...
java
public ThriftClient<T> getClient() throws ThriftException { try { return pool.borrowObject(); } catch (Exception e) { if (e instanceof ThriftException) { throw (ThriftException) e; } throw new ThriftException("Get client from pool failed.",...
[ "public", "ThriftClient", "<", "T", ">", "getClient", "(", ")", "throws", "ThriftException", "{", "try", "{", "return", "pool", ".", "borrowObject", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "if", "(", "e", "instanceof", "ThriftExcept...
get a client from pool @return @throws ThriftException @throws NoBackendServiceException if {@link PoolConfig#setFailover(boolean)} is set and no service can connect to @throws ConnectionFailException if {@link PoolConfig#setFailover(boolean)} not set and connection fail
[ "get", "a", "client", "from", "pool" ]
7781fc18f81ced14ea7b03d3ffd070c411c33a17
https://github.com/aloha-app/thrift-client-pool-java/blob/7781fc18f81ced14ea7b03d3ffd070c411c33a17/src/main/java/com/wealoha/thrift/ThriftClientPool.java#L232-L241
37,734
RestComm/load-balancer
jar/src/main/java/org/mobicents/tools/sip/balancer/SIPBalancerForwarder.java
SIPBalancerForwarder.checkRouteHeaderForSipNode
private Node checkRouteHeaderForSipNode(SipURI routeSipUri) { Node node = null; String hostNode = routeSipUri.getParameter(ROUTE_PARAM_NODE_HOST); String hostPort = routeSipUri.getParameter(ROUTE_PARAM_NODE_PORT); String hostVersion = routeSipUri.getParameter(ROUTE_PARAM_NODE_VERSION); ...
java
private Node checkRouteHeaderForSipNode(SipURI routeSipUri) { Node node = null; String hostNode = routeSipUri.getParameter(ROUTE_PARAM_NODE_HOST); String hostPort = routeSipUri.getParameter(ROUTE_PARAM_NODE_PORT); String hostVersion = routeSipUri.getParameter(ROUTE_PARAM_NODE_VERSION); ...
[ "private", "Node", "checkRouteHeaderForSipNode", "(", "SipURI", "routeSipUri", ")", "{", "Node", "node", "=", "null", ";", "String", "hostNode", "=", "routeSipUri", ".", "getParameter", "(", "ROUTE_PARAM_NODE_HOST", ")", ";", "String", "hostPort", "=", "routeSipUr...
This will check if in the route header there is information on which node from the cluster send the request. If the request is not received from the cluster, this information will not be present. @param routeHeader the route header to check @return the corresponding Sip Node
[ "This", "will", "check", "if", "in", "the", "route", "header", "there", "is", "information", "on", "which", "node", "from", "the", "cluster", "send", "the", "request", ".", "If", "the", "request", "is", "not", "received", "from", "the", "cluster", "this", ...
54768d0b81004b2653d429720016ad2617fe754f
https://github.com/RestComm/load-balancer/blob/54768d0b81004b2653d429720016ad2617fe754f/jar/src/main/java/org/mobicents/tools/sip/balancer/SIPBalancerForwarder.java#L1650-L1662
37,735
RestComm/load-balancer
jar/src/main/java/org/mobicents/tools/sip/balancer/SIPBalancerForwarder.java
SIPBalancerForwarder.comesFromInternalNode
protected Boolean comesFromInternalNode(Response externalResponse,InvocationContext ctx,String host,Integer port,String transport,Boolean isIpV6) { boolean found = false; if(host!=null && port!=null) { if(ctx.sipNodeMap(isIpV6).containsKey(new KeySip(host, port,isIpV6))) found = true; // for(Node node :...
java
protected Boolean comesFromInternalNode(Response externalResponse,InvocationContext ctx,String host,Integer port,String transport,Boolean isIpV6) { boolean found = false; if(host!=null && port!=null) { if(ctx.sipNodeMap(isIpV6).containsKey(new KeySip(host, port,isIpV6))) found = true; // for(Node node :...
[ "protected", "Boolean", "comesFromInternalNode", "(", "Response", "externalResponse", ",", "InvocationContext", "ctx", ",", "String", "host", ",", "Integer", "port", ",", "String", "transport", ",", "Boolean", "isIpV6", ")", "{", "boolean", "found", "=", "false", ...
need to verify that comes from external in case of single leg
[ "need", "to", "verify", "that", "comes", "from", "external", "in", "case", "of", "single", "leg" ]
54768d0b81004b2653d429720016ad2617fe754f
https://github.com/RestComm/load-balancer/blob/54768d0b81004b2653d429720016ad2617fe754f/jar/src/main/java/org/mobicents/tools/sip/balancer/SIPBalancerForwarder.java#L2283-L2300
37,736
RestComm/load-balancer
jar/src/main/java/org/mobicents/tools/http/urlrewriting/BalancerConf.java
BalancerConf.initialise
public void initialise() { if (log.isDebugEnabled()) { log.debug("now initialising conf"); } initDecodeUsing(decodeUsing); boolean rulesOk = true; for (int i = 0; i < rules.size(); i++) { final Rule rule = (Rule) rules.get(i); if (!rule.initi...
java
public void initialise() { if (log.isDebugEnabled()) { log.debug("now initialising conf"); } initDecodeUsing(decodeUsing); boolean rulesOk = true; for (int i = 0; i < rules.size(); i++) { final Rule rule = (Rule) rules.get(i); if (!rule.initi...
[ "public", "void", "initialise", "(", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"now initialising conf\"", ")", ";", "}", "initDecodeUsing", "(", "decodeUsing", ")", ";", "boolean", "rulesOk", "=", ...
Initialise the conf file. This will run initialise on each rule and condition in the conf file.
[ "Initialise", "the", "conf", "file", ".", "This", "will", "run", "initialise", "on", "each", "rule", "and", "condition", "in", "the", "conf", "file", "." ]
54768d0b81004b2653d429720016ad2617fe754f
https://github.com/RestComm/load-balancer/blob/54768d0b81004b2653d429720016ad2617fe754f/jar/src/main/java/org/mobicents/tools/http/urlrewriting/BalancerConf.java#L331-L366
37,737
RestComm/load-balancer
jar/src/main/java/org/mobicents/tools/http/urlrewriting/BalancerConf.java
BalancerConf.destroy
public void destroy() { for (int i = 0; i < rules.size(); i++) { final Rule rule = (Rule) rules.get(i); rule.destroy(); } }
java
public void destroy() { for (int i = 0; i < rules.size(); i++) { final Rule rule = (Rule) rules.get(i); rule.destroy(); } }
[ "public", "void", "destroy", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "rules", ".", "size", "(", ")", ";", "i", "++", ")", "{", "final", "Rule", "rule", "=", "(", "Rule", ")", "rules", ".", "get", "(", "i", ")", ";", ...
Destory the conf gracefully.
[ "Destory", "the", "conf", "gracefully", "." ]
54768d0b81004b2653d429720016ad2617fe754f
https://github.com/RestComm/load-balancer/blob/54768d0b81004b2653d429720016ad2617fe754f/jar/src/main/java/org/mobicents/tools/http/urlrewriting/BalancerConf.java#L399-L404
37,738
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/output/CopperEggWriter.java
CopperEggWriter.ensure_dashboards
private void ensure_dashboards() { HttpURLConnection urlConnection = null; OutputStreamWriter wr = null; URL myurl = null; try { myurl = new URL(url_str + "/dashboards.json"); urlConnection = (HttpURLConnection) myurl.openConnection(); urlConnection.setR...
java
private void ensure_dashboards() { HttpURLConnection urlConnection = null; OutputStreamWriter wr = null; URL myurl = null; try { myurl = new URL(url_str + "/dashboards.json"); urlConnection = (HttpURLConnection) myurl.openConnection(); urlConnection.setR...
[ "private", "void", "ensure_dashboards", "(", ")", "{", "HttpURLConnection", "urlConnection", "=", "null", ";", "OutputStreamWriter", "wr", "=", "null", ";", "URL", "myurl", "=", "null", ";", "try", "{", "myurl", "=", "new", "URL", "(", "url_str", "+", "\"/...
If dashboard doesn't exist, create it If it does exist, update it.
[ "If", "dashboard", "doesn", "t", "exist", "create", "it", "If", "it", "does", "exist", "update", "it", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/CopperEggWriter.java#L708-L757
37,739
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/Normalization.java
Normalization.normalizeL2
public static double[] normalizeL2(double[] vector) { // compute vector 2-norm double norm2 = 0; for (int i = 0; i < vector.length; i++) { norm2 += vector[i] * vector[i]; } norm2 = (double) Math.sqrt(norm2); if (norm2 == 0) { Arrays.fill(vector, 1); } else { for (int i = 0; i < vector...
java
public static double[] normalizeL2(double[] vector) { // compute vector 2-norm double norm2 = 0; for (int i = 0; i < vector.length; i++) { norm2 += vector[i] * vector[i]; } norm2 = (double) Math.sqrt(norm2); if (norm2 == 0) { Arrays.fill(vector, 1); } else { for (int i = 0; i < vector...
[ "public", "static", "double", "[", "]", "normalizeL2", "(", "double", "[", "]", "vector", ")", "{", "// compute vector 2-norm\r", "double", "norm2", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "vector", ".", "length", ";", "i", "+...
This method applies L2 normalization on a given array of doubles. The passed vector is modified by the method. @param vector the original vector @return the L2 normalized vector
[ "This", "method", "applies", "L2", "normalization", "on", "a", "given", "array", "of", "doubles", ".", "The", "passed", "vector", "is", "modified", "by", "the", "method", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/Normalization.java#L21-L37
37,740
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/Normalization.java
Normalization.normalizeL1
public static double[] normalizeL1(double[] vector) { // compute vector 1-norm double norm1 = 0; for (int i = 0; i < vector.length; i++) { norm1 += Math.abs(vector[i]); } if (norm1 == 0) { Arrays.fill(vector, 1.0 / vector.length); } else { for (int i = 0; i < vector.length; i++) { v...
java
public static double[] normalizeL1(double[] vector) { // compute vector 1-norm double norm1 = 0; for (int i = 0; i < vector.length; i++) { norm1 += Math.abs(vector[i]); } if (norm1 == 0) { Arrays.fill(vector, 1.0 / vector.length); } else { for (int i = 0; i < vector.length; i++) { v...
[ "public", "static", "double", "[", "]", "normalizeL1", "(", "double", "[", "]", "vector", ")", "{", "// compute vector 1-norm\r", "double", "norm1", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "vector", ".", "length", ";", "i", "+...
This method applies L1 normalization on a given array of doubles. The passed vector is modified by the method. @param vector the original vector @return the L1 normalized vector
[ "This", "method", "applies", "L1", "normalization", "on", "a", "given", "array", "of", "doubles", ".", "The", "passed", "vector", "is", "modified", "by", "the", "method", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/Normalization.java#L47-L62
37,741
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/Normalization.java
Normalization.normalizePower
public static double[] normalizePower(double[] vector, double aParameter) { for (int i = 0; i < vector.length; i++) { vector[i] = Math.signum(vector[i]) * Math.pow(Math.abs(vector[i]), aParameter); } return vector; }
java
public static double[] normalizePower(double[] vector, double aParameter) { for (int i = 0; i < vector.length; i++) { vector[i] = Math.signum(vector[i]) * Math.pow(Math.abs(vector[i]), aParameter); } return vector; }
[ "public", "static", "double", "[", "]", "normalizePower", "(", "double", "[", "]", "vector", ",", "double", "aParameter", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "vector", ".", "length", ";", "i", "++", ")", "{", "vector", "[", ...
This method applies power normalization on a given array of doubles. The passed vector is modified by the method. @param vector the original vector @param aParameter the a parameter used @return the power normalized vector
[ "This", "method", "applies", "power", "normalization", "on", "a", "given", "array", "of", "doubles", ".", "The", "passed", "vector", "is", "modified", "by", "the", "method", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/Normalization.java#L74-L79
37,742
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/aggregation/VladAggregator.java
VladAggregator.aggregateInternal
protected double[] aggregateInternal(ArrayList<double[]> descriptors) { double[] vlad = new double[numCentroids * descriptorLength]; if (descriptors.size() == 0) { // when there are 0 local descriptors extracted return vlad; } for (double[] descriptor : descriptors) { int nnIndex = computeNearestCen...
java
protected double[] aggregateInternal(ArrayList<double[]> descriptors) { double[] vlad = new double[numCentroids * descriptorLength]; if (descriptors.size() == 0) { // when there are 0 local descriptors extracted return vlad; } for (double[] descriptor : descriptors) { int nnIndex = computeNearestCen...
[ "protected", "double", "[", "]", "aggregateInternal", "(", "ArrayList", "<", "double", "[", "]", ">", "descriptors", ")", "{", "double", "[", "]", "vlad", "=", "new", "double", "[", "numCentroids", "*", "descriptorLength", "]", ";", "if", "(", "descriptors...
Takes as input an ArrayList of double arrays which contains the set of local descriptors for an image. Returns the VLAD vector representation of the image using the codebook supplied in the constructor. @param descriptors @return the VLAD vector @throws Exception
[ "Takes", "as", "input", "an", "ArrayList", "of", "double", "arrays", "which", "contains", "the", "set", "of", "local", "descriptors", "for", "an", "image", ".", "Returns", "the", "VLAD", "vector", "representation", "of", "the", "image", "using", "the", "code...
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/aggregation/VladAggregator.java#L35-L47
37,743
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/CSLDateParser.java
CSLDateParser.parse
public CSLDate parse(String str) { Map<String, Object> res; try { Map<String, Object> m = runner.callMethod( parser, "parseDateToArray", Map.class, str); res = m; } catch (ScriptRunnerException e) { throw new IllegalArgumentException("Could not update items", e); } CSLDate r = CSLDate.fromJso...
java
public CSLDate parse(String str) { Map<String, Object> res; try { Map<String, Object> m = runner.callMethod( parser, "parseDateToArray", Map.class, str); res = m; } catch (ScriptRunnerException e) { throw new IllegalArgumentException("Could not update items", e); } CSLDate r = CSLDate.fromJso...
[ "public", "CSLDate", "parse", "(", "String", "str", ")", "{", "Map", "<", "String", ",", "Object", ">", "res", ";", "try", "{", "Map", "<", "String", ",", "Object", ">", "m", "=", "runner", ".", "callMethod", "(", "parser", ",", "\"parseDateToArray\"",...
Parses a string to a date @param str the string to parse @return the parsed date
[ "Parses", "a", "string", "to", "a", "date" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/CSLDateParser.java#L80-L95
37,744
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/dimreduction/PCALearningExample.java
PCALearningExample.main
public static void main(String[] args) throws Exception { String indexLocation = args[0]; int numTrainVectors = Integer.parseInt(args[1]); int vectorLength = Integer.parseInt(args[2]); int numPrincipalComponents = Integer.parseInt(args[3]); boolean whitening = true; boolean compact = false; PCA...
java
public static void main(String[] args) throws Exception { String indexLocation = args[0]; int numTrainVectors = Integer.parseInt(args[1]); int vectorLength = Integer.parseInt(args[2]); int numPrincipalComponents = Integer.parseInt(args[3]); boolean whitening = true; boolean compact = false; PCA...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "String", "indexLocation", "=", "args", "[", "0", "]", ";", "int", "numTrainVectors", "=", "Integer", ".", "parseInt", "(", "args", "[", "1", "]", ")"...
This method can be used to learn a PCA projection matrix. @param args [0] full path to the location of the BDB store which contains the training vectors (use backslashes) @param args [1] number of vectors to use for learning (the first vectors will be used), e.g. 10000 @param args [2] length of the supplied vectors, e...
[ "This", "method", "can", "be", "used", "to", "learn", "a", "PCA", "projection", "matrix", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/dimreduction/PCALearningExample.java#L27-L56
37,745
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/mendeley/MendeleyConverter.java
MendeleyConverter.toAuthors
private static CSLName[] toAuthors(List<Map<String, Object>> authors) { CSLName[] result = new CSLName[authors.size()]; int i = 0; for (Map<String, Object> a : authors) { CSLNameBuilder builder = new CSLNameBuilder(); if (a.containsKey(FIELD_FIRSTNAME)) { builder.given(strOrNull(a.get(FIELD_FIRSTNAME)))...
java
private static CSLName[] toAuthors(List<Map<String, Object>> authors) { CSLName[] result = new CSLName[authors.size()]; int i = 0; for (Map<String, Object> a : authors) { CSLNameBuilder builder = new CSLNameBuilder(); if (a.containsKey(FIELD_FIRSTNAME)) { builder.given(strOrNull(a.get(FIELD_FIRSTNAME)))...
[ "private", "static", "CSLName", "[", "]", "toAuthors", "(", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "authors", ")", "{", "CSLName", "[", "]", "result", "=", "new", "CSLName", "[", "authors", ".", "size", "(", ")", "]", ";", "int...
Converts a list of authors @param authors the authors as returned by Mendeley @return the authors in CSL format
[ "Converts", "a", "list", "of", "authors" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/mendeley/MendeleyConverter.java#L264-L280
37,746
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/mendeley/MendeleyConverter.java
MendeleyConverter.toType
private static CSLType toType(String type) { if (type.equalsIgnoreCase(TYPE_BILL)) { return CSLType.BILL; } else if (type.equalsIgnoreCase(TYPE_BOOK)) { return CSLType.BOOK; } else if (type.equalsIgnoreCase(TYPE_BOOK_SECTION)) { return CSLType.CHAPTER; } else if (type.equalsIgnoreCase(TYPE_CASE)) { ...
java
private static CSLType toType(String type) { if (type.equalsIgnoreCase(TYPE_BILL)) { return CSLType.BILL; } else if (type.equalsIgnoreCase(TYPE_BOOK)) { return CSLType.BOOK; } else if (type.equalsIgnoreCase(TYPE_BOOK_SECTION)) { return CSLType.CHAPTER; } else if (type.equalsIgnoreCase(TYPE_CASE)) { ...
[ "private", "static", "CSLType", "toType", "(", "String", "type", ")", "{", "if", "(", "type", ".", "equalsIgnoreCase", "(", "TYPE_BILL", ")", ")", "{", "return", "CSLType", ".", "BILL", ";", "}", "else", "if", "(", "type", ".", "equalsIgnoreCase", "(", ...
Converts a Mendeley type to a CSL type @param type the Mendeley type @return the CSL type
[ "Converts", "a", "Mendeley", "type", "to", "a", "CSL", "type" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/mendeley/MendeleyConverter.java#L287-L330
37,747
googleapis/api-client-staging
generated/java/gapic-google-longrunning-v1/src/main/java/com/google/longrunning/OperationsClient.java
OperationsClient.getOperation
public final Operation getOperation(String name) { GetOperationRequest request = GetOperationRequest.newBuilder().setName(name).build(); return getOperation(request); }
java
public final Operation getOperation(String name) { GetOperationRequest request = GetOperationRequest.newBuilder().setName(name).build(); return getOperation(request); }
[ "public", "final", "Operation", "getOperation", "(", "String", "name", ")", "{", "GetOperationRequest", "request", "=", "GetOperationRequest", ".", "newBuilder", "(", ")", ".", "setName", "(", "name", ")", ".", "build", "(", ")", ";", "return", "getOperation",...
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. <p>Sample code: <pre><code> try (OperationsClient operationsClient = OperationsClient.create()) { String name = ""; Operation response = operationsClient.getOpera...
[ "Gets", "the", "latest", "state", "of", "a", "long", "-", "running", "operation", ".", "Clients", "can", "use", "this", "method", "to", "poll", "the", "operation", "result", "at", "intervals", "as", "recommended", "by", "the", "API", "service", "." ]
126aee68401977b5dc2b1b4be48decd0e9759db7
https://github.com/googleapis/api-client-staging/blob/126aee68401977b5dc2b1b4be48decd0e9759db7/generated/java/gapic-google-longrunning-v1/src/main/java/com/google/longrunning/OperationsClient.java#L176-L180
37,748
googleapis/api-client-staging
generated/java/gapic-google-longrunning-v1/src/main/java/com/google/longrunning/OperationsClient.java
OperationsClient.listOperations
public final ListOperationsPagedResponse listOperations(String name, String filter) { ListOperationsRequest request = ListOperationsRequest.newBuilder().setName(name).setFilter(filter).build(); return listOperations(request); }
java
public final ListOperationsPagedResponse listOperations(String name, String filter) { ListOperationsRequest request = ListOperationsRequest.newBuilder().setName(name).setFilter(filter).build(); return listOperations(request); }
[ "public", "final", "ListOperationsPagedResponse", "listOperations", "(", "String", "name", ",", "String", "filter", ")", "{", "ListOperationsRequest", "request", "=", "ListOperationsRequest", ".", "newBuilder", "(", ")", ".", "setName", "(", "name", ")", ".", "set...
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. <p>NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/&#42;/operations`. <p>Sample code: <pre><code> t...
[ "Lists", "operations", "that", "match", "the", "specified", "filter", "in", "the", "request", ".", "If", "the", "server", "doesn", "t", "support", "this", "method", "it", "returns", "UNIMPLEMENTED", "." ]
126aee68401977b5dc2b1b4be48decd0e9759db7
https://github.com/googleapis/api-client-staging/blob/126aee68401977b5dc2b1b4be48decd0e9759db7/generated/java/gapic-google-longrunning-v1/src/main/java/com/google/longrunning/OperationsClient.java#L253-L257
37,749
googleapis/api-client-staging
generated/java/gapic-google-longrunning-v1/src/main/java/com/google/longrunning/OperationsClient.java
OperationsClient.deleteOperation
public final void deleteOperation(String name) { DeleteOperationRequest request = DeleteOperationRequest.newBuilder().setName(name).build(); deleteOperation(request); }
java
public final void deleteOperation(String name) { DeleteOperationRequest request = DeleteOperationRequest.newBuilder().setName(name).build(); deleteOperation(request); }
[ "public", "final", "void", "deleteOperation", "(", "String", "name", ")", "{", "DeleteOperationRequest", "request", "=", "DeleteOperationRequest", ".", "newBuilder", "(", ")", ".", "setName", "(", "name", ")", ".", "build", "(", ")", ";", "deleteOperation", "(...
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. <p>Sample code: <pre><code> try (OperationsClient operationsClient = Operati...
[ "Deletes", "a", "long", "-", "running", "operation", ".", "This", "method", "indicates", "that", "the", "client", "is", "no", "longer", "interested", "in", "the", "operation", "result", ".", "It", "does", "not", "cancel", "the", "operation", ".", "If", "th...
126aee68401977b5dc2b1b4be48decd0e9759db7
https://github.com/googleapis/api-client-staging/blob/126aee68401977b5dc2b1b4be48decd0e9759db7/generated/java/gapic-google-longrunning-v1/src/main/java/com/google/longrunning/OperationsClient.java#L465-L469
37,750
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/shell/AdditionalShellCommands.java
AdditionalShellCommands.setCommand
@CommandDescList({ @CommandDesc(longName = "load", description = "load an input bibliography from a file", command = ShellLoadCommand.class), @CommandDesc(longName = "get", description = "get values of shell variables", command = ShellGetCommand.class), @CommandDesc(longName = "set", descripti...
java
@CommandDescList({ @CommandDesc(longName = "load", description = "load an input bibliography from a file", command = ShellLoadCommand.class), @CommandDesc(longName = "get", description = "get values of shell variables", command = ShellGetCommand.class), @CommandDesc(longName = "set", descripti...
[ "@", "CommandDescList", "(", "{", "@", "CommandDesc", "(", "longName", "=", "\"load\"", ",", "description", "=", "\"load an input bibliography from a file\"", ",", "command", "=", "ShellLoadCommand", ".", "class", ")", ",", "@", "CommandDesc", "(", "longName", "="...
Configures all additional shell commands @param command the configured command
[ "Configures", "all", "additional", "shell", "commands" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/shell/AdditionalShellCommands.java#L30-L52
37,751
manupsunny/PinLock
pinlock/src/main/java/com/manusunny/pinlock/components/KeypadAdapter.java
KeypadAdapter.vibrateIfEnabled
private void vibrateIfEnabled() { final boolean enabled = styledAttributes.getBoolean(R.styleable.PinLock_vibrateOnClick, false); if(enabled){ Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); final int duration = styledAttributes.getInt(R.styleable.PinL...
java
private void vibrateIfEnabled() { final boolean enabled = styledAttributes.getBoolean(R.styleable.PinLock_vibrateOnClick, false); if(enabled){ Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); final int duration = styledAttributes.getInt(R.styleable.PinL...
[ "private", "void", "vibrateIfEnabled", "(", ")", "{", "final", "boolean", "enabled", "=", "styledAttributes", ".", "getBoolean", "(", "R", ".", "styleable", ".", "PinLock_vibrateOnClick", ",", "false", ")", ";", "if", "(", "enabled", ")", "{", "Vibrator", "v...
Vibrate device on each key press if the feature is enabled
[ "Vibrate", "device", "on", "each", "key", "press", "if", "the", "feature", "is", "enabled" ]
bbb5d53cc57d4e163be01a95157d335231b55dc0
https://github.com/manupsunny/PinLock/blob/bbb5d53cc57d4e163be01a95157d335231b55dc0/pinlock/src/main/java/com/manusunny/pinlock/components/KeypadAdapter.java#L138-L145
37,752
manupsunny/PinLock
pinlock/src/main/java/com/manusunny/pinlock/components/KeypadAdapter.java
KeypadAdapter.setStyle
private void setStyle(Button view) { final int textSize = styledAttributes.getInt(R.styleable.PinLock_keypadTextSize, 12); view.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize); final int color = styledAttributes.getColor(R.styleable.PinLock_keypadTextColor, Color.BLACK); view.setTextC...
java
private void setStyle(Button view) { final int textSize = styledAttributes.getInt(R.styleable.PinLock_keypadTextSize, 12); view.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize); final int color = styledAttributes.getColor(R.styleable.PinLock_keypadTextColor, Color.BLACK); view.setTextC...
[ "private", "void", "setStyle", "(", "Button", "view", ")", "{", "final", "int", "textSize", "=", "styledAttributes", ".", "getInt", "(", "R", ".", "styleable", ".", "PinLock_keypadTextSize", ",", "12", ")", ";", "view", ".", "setTextSize", "(", "TypedValue",...
Setting Button background styles such as background, size and shape @param view Button itself
[ "Setting", "Button", "background", "styles", "such", "as", "background", "size", "and", "shape" ]
bbb5d53cc57d4e163be01a95157d335231b55dc0
https://github.com/manupsunny/PinLock/blob/bbb5d53cc57d4e163be01a95157d335231b55dc0/pinlock/src/main/java/com/manusunny/pinlock/components/KeypadAdapter.java#L152-L162
37,753
manupsunny/PinLock
pinlock/src/main/java/com/manusunny/pinlock/components/KeypadAdapter.java
KeypadAdapter.setValues
private void setValues(int position, Button view) { if (position == 10) { view.setText("0"); } else if (position == 9) { view.setVisibility(View.INVISIBLE); } else { view.setText(String.valueOf((position + 1) % 10)); } }
java
private void setValues(int position, Button view) { if (position == 10) { view.setText("0"); } else if (position == 9) { view.setVisibility(View.INVISIBLE); } else { view.setText(String.valueOf((position + 1) % 10)); } }
[ "private", "void", "setValues", "(", "int", "position", ",", "Button", "view", ")", "{", "if", "(", "position", "==", "10", ")", "{", "view", ".", "setText", "(", "\"0\"", ")", ";", "}", "else", "if", "(", "position", "==", "9", ")", "{", "view", ...
Setting Button text @param position Position of Button in GridView @param view Button itself
[ "Setting", "Button", "text" ]
bbb5d53cc57d4e163be01a95157d335231b55dc0
https://github.com/manupsunny/PinLock/blob/bbb5d53cc57d4e163be01a95157d335231b55dc0/pinlock/src/main/java/com/manusunny/pinlock/components/KeypadAdapter.java#L170-L178
37,754
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java
FeatureIO.writeBinary
public static void writeBinary(String featuresFileName, double[][] features) throws Exception { DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream( featuresFileName))); for (int i = 0; i < features.length; i++) { for (int j = 0; j < features[i].length; j++) { o...
java
public static void writeBinary(String featuresFileName, double[][] features) throws Exception { DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream( featuresFileName))); for (int i = 0; i < features.length; i++) { for (int j = 0; j < features[i].length; j++) { o...
[ "public", "static", "void", "writeBinary", "(", "String", "featuresFileName", ",", "double", "[", "]", "[", "]", "features", ")", "throws", "Exception", "{", "DataOutputStream", "out", "=", "new", "DataOutputStream", "(", "new", "BufferedOutputStream", "(", "new...
Takes a two-dimensional double array with features and writes them in a binary file. @param featuresFileName The binary file's name. @param features The features. @throws Exception
[ "Takes", "a", "two", "-", "dimensional", "double", "array", "with", "features", "and", "writes", "them", "in", "a", "binary", "file", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java#L101-L110
37,755
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java
FeatureIO.writeText
public static void writeText(String featuresFileName, double[][] features) throws Exception { BufferedWriter out = new BufferedWriter(new FileWriter(featuresFileName)); for (double[] feature : features) { for (int j = 0; j < feature.length - 1; j++) { out.write(feature[j] + ","); } out.write(feat...
java
public static void writeText(String featuresFileName, double[][] features) throws Exception { BufferedWriter out = new BufferedWriter(new FileWriter(featuresFileName)); for (double[] feature : features) { for (int j = 0; j < feature.length - 1; j++) { out.write(feature[j] + ","); } out.write(feat...
[ "public", "static", "void", "writeText", "(", "String", "featuresFileName", ",", "double", "[", "]", "[", "]", "features", ")", "throws", "Exception", "{", "BufferedWriter", "out", "=", "new", "BufferedWriter", "(", "new", "FileWriter", "(", "featuresFileName", ...
Takes a two-dimensional double array with features and writes them in a comma separated text file. @param featuresFileName The text file's name. @param features The features. @throws Exception
[ "Takes", "a", "two", "-", "dimensional", "double", "array", "with", "features", "and", "writes", "them", "in", "a", "comma", "separated", "text", "file", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java#L121-L130
37,756
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java
FeatureIO.textToBinary
public static void textToBinary(String featuresFolder, final String featureType, int featureLength) throws Exception { // read the folder containing the description files File dir = new File(featuresFolder); FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { ...
java
public static void textToBinary(String featuresFolder, final String featureType, int featureLength) throws Exception { // read the folder containing the description files File dir = new File(featuresFolder); FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { ...
[ "public", "static", "void", "textToBinary", "(", "String", "featuresFolder", ",", "final", "String", "featureType", ",", "int", "featureLength", ")", "throws", "Exception", "{", "// read the folder containing the description files\r", "File", "dir", "=", "new", "File", ...
Takes a folder with feature files in text format and converts them to binary. @param featuresFolder @param featureType @param featureLength @throws Exception
[ "Takes", "a", "folder", "with", "feature", "files", "in", "text", "format", "and", "converts", "them", "to", "binary", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java#L140-L171
37,757
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java
FeatureIO.binaryToText
public static void binaryToText(String featuresFolder, final String featureType, int featureLength) throws Exception { // read the folder containing the description files File dir = new File(featuresFolder); FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { ...
java
public static void binaryToText(String featuresFolder, final String featureType, int featureLength) throws Exception { // read the folder containing the description files File dir = new File(featuresFolder); FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { ...
[ "public", "static", "void", "binaryToText", "(", "String", "featuresFolder", ",", "final", "String", "featureType", ",", "int", "featureLength", ")", "throws", "Exception", "{", "// read the folder containing the description files\r", "File", "dir", "=", "new", "File", ...
Takes a folder with feature files in binary format and converts them to text. @param featuresFolder @param featureType @param featureLength @throws Exception
[ "Takes", "a", "folder", "with", "feature", "files", "in", "binary", "format", "and", "converts", "them", "to", "text", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java#L181-L223
37,758
manupsunny/PinLock
pinlock/src/main/java/com/manusunny/pinlock/BasePinActivity.java
BasePinActivity.setupButtons
private void setupButtons() { cancelButton = (TextView) findViewById(R.id.cancelButton); cancelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setResult(CANCELLED); finish(); } }); ...
java
private void setupButtons() { cancelButton = (TextView) findViewById(R.id.cancelButton); cancelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setResult(CANCELLED); finish(); } }); ...
[ "private", "void", "setupButtons", "(", ")", "{", "cancelButton", "=", "(", "TextView", ")", "findViewById", "(", "R", ".", "id", ".", "cancelButton", ")", ";", "cancelButton", ".", "setOnClickListener", "(", "new", "View", ".", "OnClickListener", "(", ")", ...
Setting up cancel and forgot buttons and adding onClickListeners to them
[ "Setting", "up", "cancel", "and", "forgot", "buttons", "and", "adding", "onClickListeners", "to", "them" ]
bbb5d53cc57d4e163be01a95157d335231b55dc0
https://github.com/manupsunny/PinLock/blob/bbb5d53cc57d4e163be01a95157d335231b55dc0/pinlock/src/main/java/com/manusunny/pinlock/BasePinActivity.java#L76-L94
37,759
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/CSLTool.java
CSLTool.setOutputFile
@OptionDesc(longName = "output", shortName = "o", description = "write output to FILE instead of stdout", argumentName = "FILE", argumentType = ArgumentType.STRING) public void setOutputFile(String outputFile) { this.outputFile = outputFile; }
java
@OptionDesc(longName = "output", shortName = "o", description = "write output to FILE instead of stdout", argumentName = "FILE", argumentType = ArgumentType.STRING) public void setOutputFile(String outputFile) { this.outputFile = outputFile; }
[ "@", "OptionDesc", "(", "longName", "=", "\"output\"", ",", "shortName", "=", "\"o\"", ",", "description", "=", "\"write output to FILE instead of stdout\"", ",", "argumentName", "=", "\"FILE\"", ",", "argumentType", "=", "ArgumentType", ".", "STRING", ")", "public"...
Sets the name of the output file @param outputFile the file name or null if output should be written to standard out
[ "Sets", "the", "name", "of", "the", "output", "file" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/CSLTool.java#L64-L69
37,760
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/CSLTool.java
CSLTool.setCommand
@CommandDescList({ @CommandDesc(longName = "bibliography", description = "generate a bibliography", command = BibliographyCommand.class), @CommandDesc(longName = "citation", description = "generate citations", command = CitationCommand.class), @CommandDesc(longName = "list", description = "dis...
java
@CommandDescList({ @CommandDesc(longName = "bibliography", description = "generate a bibliography", command = BibliographyCommand.class), @CommandDesc(longName = "citation", description = "generate citations", command = CitationCommand.class), @CommandDesc(longName = "list", description = "dis...
[ "@", "CommandDescList", "(", "{", "@", "CommandDesc", "(", "longName", "=", "\"bibliography\"", ",", "description", "=", "\"generate a bibliography\"", ",", "command", "=", "BibliographyCommand", ".", "class", ")", ",", "@", "CommandDesc", "(", "longName", "=", ...
Sets the command to execute @param command the command
[ "Sets", "the", "command", "to", "execute" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/CSLTool.java#L86-L121
37,761
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/shell/ErrorOutputStream.java
ErrorOutputStream.enableRed
private boolean enableRed() throws IOException { boolean oldwriting = writing; if (!writing) { writing = true; byte[] en = "\u001B[31m".getBytes(); super.write(en, 0, en.length); } return oldwriting; }
java
private boolean enableRed() throws IOException { boolean oldwriting = writing; if (!writing) { writing = true; byte[] en = "\u001B[31m".getBytes(); super.write(en, 0, en.length); } return oldwriting; }
[ "private", "boolean", "enableRed", "(", ")", "throws", "IOException", "{", "boolean", "oldwriting", "=", "writing", ";", "if", "(", "!", "writing", ")", "{", "writing", "=", "true", ";", "byte", "[", "]", "en", "=", "\"\\u001B[31m\"", ".", "getBytes", "(...
Enables colored output @return true if the colored output was already enabled before @throws IOException if writing to the underlying output stream failed
[ "Enables", "colored", "output" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/shell/ErrorOutputStream.java#L62-L70
37,762
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/shell/ErrorOutputStream.java
ErrorOutputStream.disableRed
private void disableRed() throws IOException { byte[] dis = "\u001B[0m".getBytes(); super.write(dis, 0, dis.length); writing = false; }
java
private void disableRed() throws IOException { byte[] dis = "\u001B[0m".getBytes(); super.write(dis, 0, dis.length); writing = false; }
[ "private", "void", "disableRed", "(", ")", "throws", "IOException", "{", "byte", "[", "]", "dis", "=", "\"\\u001B[0m\"", ".", "getBytes", "(", ")", ";", "super", ".", "write", "(", "dis", ",", "0", ",", "dis", ".", "length", ")", ";", "writing", "=",...
Disabled colored output @throws IOException if writing to the underlying output stream failed
[ "Disabled", "colored", "output" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/shell/ErrorOutputStream.java#L76-L80
37,763
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/BibliographyFileReader.java
BibliographyFileReader.readBibliographyFile
public ItemDataProvider readBibliographyFile(File bibfile) throws FileNotFoundException, IOException { //open buffered input stream to bibliography file if (!bibfile.exists()) { throw new FileNotFoundException("Bibliography file `" + bibfile.getName() + "' does not exist"); } try (BufferedInputStrea...
java
public ItemDataProvider readBibliographyFile(File bibfile) throws FileNotFoundException, IOException { //open buffered input stream to bibliography file if (!bibfile.exists()) { throw new FileNotFoundException("Bibliography file `" + bibfile.getName() + "' does not exist"); } try (BufferedInputStrea...
[ "public", "ItemDataProvider", "readBibliographyFile", "(", "File", "bibfile", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "//open buffered input stream to bibliography file", "if", "(", "!", "bibfile", ".", "exists", "(", ")", ")", "{", "throw", "...
Reads all items from an input bibliography file and returns a provider serving these items @param bibfile the input file @return the provider @throws FileNotFoundException if the input file was not found @throws IOException if the input file could not be read
[ "Reads", "all", "items", "from", "an", "input", "bibliography", "file", "and", "returns", "a", "provider", "serving", "these", "items" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/BibliographyFileReader.java#L103-L114
37,764
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/BibliographyFileReader.java
BibliographyFileReader.determineFileFormat
public FileFormat determineFileFormat(File bibfile) throws FileNotFoundException, IOException { if (!bibfile.exists()) { throw new FileNotFoundException("Bibliography file `" + bibfile.getName() + "' does not exist"); } try (BufferedInputStream bis = new BufferedInputStream( new FileInputStream(bi...
java
public FileFormat determineFileFormat(File bibfile) throws FileNotFoundException, IOException { if (!bibfile.exists()) { throw new FileNotFoundException("Bibliography file `" + bibfile.getName() + "' does not exist"); } try (BufferedInputStream bis = new BufferedInputStream( new FileInputStream(bi...
[ "public", "FileFormat", "determineFileFormat", "(", "File", "bibfile", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "if", "(", "!", "bibfile", ".", "exists", "(", ")", ")", "{", "throw", "new", "FileNotFoundException", "(", "\"Bibliography file...
Reads the first 100 KB of the given bibliography file and tries to determine the file format @param bibfile the input file @return the file format (or {@link FileFormat#UNKNOWN} if the format could not be determined) @throws FileNotFoundException if the input file was not found @throws IOException if the input file cou...
[ "Reads", "the", "first", "100", "KB", "of", "the", "given", "bibliography", "file", "and", "tries", "to", "determine", "the", "file", "format" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/BibliographyFileReader.java#L238-L248
37,765
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java
OAuth1.requestCredentials
private Token requestCredentials(URL url, Method method, Token token, Map<String, String> additionalAuthParams) throws IOException { Response r = requestInternal(url, method, token, additionalAuthParams, null); InputStream is = r.getInputStream(); String response = CSLUtils.readStreamToString(is, UTF8); /...
java
private Token requestCredentials(URL url, Method method, Token token, Map<String, String> additionalAuthParams) throws IOException { Response r = requestInternal(url, method, token, additionalAuthParams, null); InputStream is = r.getInputStream(); String response = CSLUtils.readStreamToString(is, UTF8); /...
[ "private", "Token", "requestCredentials", "(", "URL", "url", ",", "Method", "method", ",", "Token", "token", ",", "Map", "<", "String", ",", "String", ">", "additionalAuthParams", ")", "throws", "IOException", "{", "Response", "r", "=", "requestInternal", "(",...
Sends a request to the server and returns a token @param url the URL to send the request to @param method the HTTP request method @param token a token used for authorization (may be null if the app is not authorized yet) @param additionalAuthParams additional parameters that should be added to the <code>Authorization</...
[ "Sends", "a", "request", "to", "the", "server", "and", "returns", "a", "token" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L131-L140
37,766
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java
OAuth1.responseToToken
protected Token responseToToken(Map<String, String> response) { return new Token(response.get(OAUTH_TOKEN), response.get(OAUTH_TOKEN_SECRET)); }
java
protected Token responseToToken(Map<String, String> response) { return new Token(response.get(OAUTH_TOKEN), response.get(OAUTH_TOKEN_SECRET)); }
[ "protected", "Token", "responseToToken", "(", "Map", "<", "String", ",", "String", ">", "response", ")", "{", "return", "new", "Token", "(", "response", ".", "get", "(", "OAUTH_TOKEN", ")", ",", "response", ".", "get", "(", "OAUTH_TOKEN_SECRET", ")", ")", ...
Parses a service response and creates a token @param response the response @return the token
[ "Parses", "a", "service", "response", "and", "creates", "a", "token" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L147-L149
37,767
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java
OAuth1.requestInternal
private Response requestInternal(URL url, Method method, Token token, Map<String, String> additionalAuthParams, Map<String, String> additionalHeaders) throws IOException { //prepare HTTP connection HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setInstanceFollowRedirects(true); con...
java
private Response requestInternal(URL url, Method method, Token token, Map<String, String> additionalAuthParams, Map<String, String> additionalHeaders) throws IOException { //prepare HTTP connection HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setInstanceFollowRedirects(true); con...
[ "private", "Response", "requestInternal", "(", "URL", "url", ",", "Method", "method", ",", "Token", "token", ",", "Map", "<", "String", ",", "String", ">", "additionalAuthParams", ",", "Map", "<", "String", ",", "String", ">", "additionalHeaders", ")", "thro...
Sends a request to the server and returns an input stream from which the response can be read. The caller is responsible for consuming the input stream's content and for closing the stream. @param url the URL to send the request to @param method the HTTP request method @param token a token used for authorization (may b...
[ "Sends", "a", "request", "to", "the", "server", "and", "returns", "an", "input", "stream", "from", "which", "the", "response", "can", "be", "read", ".", "The", "caller", "is", "responsible", "for", "consuming", "the", "input", "stream", "s", "content", "an...
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L167-L224
37,768
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java
OAuth1.appendAuthParam
private static void appendAuthParam(StringBuilder sb, String key, String value) { if (sb.length() > 0) { sb.append(","); } sb.append(key); sb.append("=\""); sb.append(value); sb.append("\""); }
java
private static void appendAuthParam(StringBuilder sb, String key, String value) { if (sb.length() > 0) { sb.append(","); } sb.append(key); sb.append("=\""); sb.append(value); sb.append("\""); }
[ "private", "static", "void", "appendAuthParam", "(", "StringBuilder", "sb", ",", "String", "key", ",", "String", "value", ")", "{", "if", "(", "sb", ".", "length", "(", ")", ">", "0", ")", "{", "sb", ".", "append", "(", "\",\"", ")", ";", "}", "sb"...
Appends an authorization parameter to the given string builder @param sb the string builder @param key the parameter's key @param value the parameter's value
[ "Appends", "an", "authorization", "parameter", "to", "the", "given", "string", "builder" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L232-L240
37,769
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java
OAuth1.makeNonce
private String makeNonce(String timestamp) { byte[] bytes = new byte[10]; random.nextBytes(bytes); StringBuilder sb = new StringBuilder(timestamp); sb.append("-"); for (int i = 0; i < bytes.length; ++i) { String b = Integer.toHexString(bytes[i] & 0xff); if (b.length() < 2) { sb.append("0"); } ...
java
private String makeNonce(String timestamp) { byte[] bytes = new byte[10]; random.nextBytes(bytes); StringBuilder sb = new StringBuilder(timestamp); sb.append("-"); for (int i = 0; i < bytes.length; ++i) { String b = Integer.toHexString(bytes[i] & 0xff); if (b.length() < 2) { sb.append("0"); } ...
[ "private", "String", "makeNonce", "(", "String", "timestamp", ")", "{", "byte", "[", "]", "bytes", "=", "new", "byte", "[", "10", "]", ";", "random", ".", "nextBytes", "(", "bytes", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "ti...
Generates a nonce for a request using a secure random number generator @param timestamp the request's timestamp (generated by {@link #makeTimestamp()}) @return the nonce
[ "Generates", "a", "nonce", "for", "a", "request", "using", "a", "secure", "random", "number", "generator" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L255-L268
37,770
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java
OAuth1.makeBaseUri
private static String makeBaseUri(URL url) { String r = url.getProtocol().toLowerCase() + "://" + url.getHost().toLowerCase(); if ((url.getProtocol().equalsIgnoreCase("http") && url.getPort() != -1 && url.getPort() != 80) || (url.getProtocol().equalsIgnoreCase("https") && url.getPort() != -1 && url....
java
private static String makeBaseUri(URL url) { String r = url.getProtocol().toLowerCase() + "://" + url.getHost().toLowerCase(); if ((url.getProtocol().equalsIgnoreCase("http") && url.getPort() != -1 && url.getPort() != 80) || (url.getProtocol().equalsIgnoreCase("https") && url.getPort() != -1 && url....
[ "private", "static", "String", "makeBaseUri", "(", "URL", "url", ")", "{", "String", "r", "=", "url", ".", "getProtocol", "(", ")", ".", "toLowerCase", "(", ")", "+", "\"://\"", "+", "url", ".", "getHost", "(", ")", ".", "toLowerCase", "(", ")", ";",...
Generates a base URI from a given URL. The base URI consists of the protocol, the host, and also the port if its not the default port for the given protocol. @param url the URL from which the URI should be generated @return the base URI
[ "Generates", "a", "base", "URI", "from", "a", "given", "URL", ".", "The", "base", "URI", "consists", "of", "the", "protocol", "the", "host", "and", "also", "the", "port", "if", "its", "not", "the", "default", "port", "for", "the", "given", "protocol", ...
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L277-L287
37,771
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java
OAuth1.splitAndEncodeParams
private static List<String> splitAndEncodeParams(URL url) { if (url.getQuery() == null) { return new ArrayList<>(); } String[] params = url.getQuery().split("&"); List<String> result = new ArrayList<>(params.length); for (String p : params) { String[] kv = p.split("="); kv[0] = PercentEncoding.decode...
java
private static List<String> splitAndEncodeParams(URL url) { if (url.getQuery() == null) { return new ArrayList<>(); } String[] params = url.getQuery().split("&"); List<String> result = new ArrayList<>(params.length); for (String p : params) { String[] kv = p.split("="); kv[0] = PercentEncoding.decode...
[ "private", "static", "List", "<", "String", ">", "splitAndEncodeParams", "(", "URL", "url", ")", "{", "if", "(", "url", ".", "getQuery", "(", ")", "==", "null", ")", "{", "return", "new", "ArrayList", "<>", "(", ")", ";", "}", "String", "[", "]", "...
Splits the query parameters of the given URL, encodes their keys and values and puts each key-value pair in a list @param url the URL @return the encoded parameters
[ "Splits", "the", "query", "parameters", "of", "the", "given", "URL", "encodes", "their", "keys", "and", "values", "and", "puts", "each", "key", "-", "value", "pair", "in", "a", "list" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L295-L311
37,772
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java
OAuth1.makeSignature
private String makeSignature(String method, URL url, Map<String, String> authParams, Token token) { //encode method and URL StringBuilder sb = new StringBuilder(method + "&" + PercentEncoding.encode(makeBaseUri(url) + url.getPath())); //encode parameters List<String> params = splitAndEncodeParams(url)...
java
private String makeSignature(String method, URL url, Map<String, String> authParams, Token token) { //encode method and URL StringBuilder sb = new StringBuilder(method + "&" + PercentEncoding.encode(makeBaseUri(url) + url.getPath())); //encode parameters List<String> params = splitAndEncodeParams(url)...
[ "private", "String", "makeSignature", "(", "String", "method", ",", "URL", "url", ",", "Map", "<", "String", ",", "String", ">", "authParams", ",", "Token", "token", ")", "{", "//encode method and URL", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ...
Generates a OAuth signature from the HTTP method, the URL, and the authorization parameters @param method the HTTP method @param url the URL @param authParams the authorization parameters @param token the authorization token used for this request (may be null) @return the signature
[ "Generates", "a", "OAuth", "signature", "from", "the", "HTTP", "method", "the", "URL", "and", "the", "authorization", "parameters" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L337-L386
37,773
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/ShellCommand.java
ShellCommand.mainLoop
private String mainLoop(ConsoleReader reader, PrintWriter cout) throws IOException { InputReader lr = new ConsoleInputReader(reader); String line; while ((line = reader.readLine()) != null) { if (line.isEmpty()) { continue; } String[] args = ShellCommandParser.split(line); Result pr; ...
java
private String mainLoop(ConsoleReader reader, PrintWriter cout) throws IOException { InputReader lr = new ConsoleInputReader(reader); String line; while ((line = reader.readLine()) != null) { if (line.isEmpty()) { continue; } String[] args = ShellCommandParser.split(line); Result pr; ...
[ "private", "String", "mainLoop", "(", "ConsoleReader", "reader", ",", "PrintWriter", "cout", ")", "throws", "IOException", "{", "InputReader", "lr", "=", "new", "ConsoleInputReader", "(", "reader", ")", ";", "String", "line", ";", "while", "(", "(", "line", ...
Runs the shell's main loop @param reader the console reader used to read user input from the command line @param cout the output stream @return the last line read or null if the user pressed Ctrl+D and the input stream has ended @throws IOException if an I/O error occurs
[ "Runs", "the", "shell", "s", "main", "loop" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/ShellCommand.java#L137-L196
37,774
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/ShellCommand.java
ShellCommand.augmentCommand
private String[] augmentCommand(String[] args, Class<? extends Command> cmd, boolean acceptsInputFile) { OptionGroup<ID> options; try { if (acceptsInputFile) { options = OptionIntrospector.introspect(cmd, InputFileCommand.class); } else { options = OptionIntrospector.introspect(cmd); } } catch...
java
private String[] augmentCommand(String[] args, Class<? extends Command> cmd, boolean acceptsInputFile) { OptionGroup<ID> options; try { if (acceptsInputFile) { options = OptionIntrospector.introspect(cmd, InputFileCommand.class); } else { options = OptionIntrospector.introspect(cmd); } } catch...
[ "private", "String", "[", "]", "augmentCommand", "(", "String", "[", "]", "args", ",", "Class", "<", "?", "extends", "Command", ">", "cmd", ",", "boolean", "acceptsInputFile", ")", "{", "OptionGroup", "<", "ID", ">", "options", ";", "try", "{", "if", "...
Augments the given command line with context variables @param args the current command line @param cmd the last parsed command in the command line @param acceptsInputFile true if the given command accepts an input file @return the new command line
[ "Augments", "the", "given", "command", "line", "with", "context", "variables" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/ShellCommand.java#L205-L238
37,775
manupsunny/PinLock
pinlock/src/main/java/com/manusunny/pinlock/components/StatusDots.java
StatusDots.addDots
private void addDots(int length) { removeAllViews(); final int pinLength = styledAttributes.getInt(R.styleable.PinLock_pinLength, 4); for (int i = 0; i < pinLength; i++) { Dot dot = new Dot(context, styledAttributes, i < length); addView(dot); } }
java
private void addDots(int length) { removeAllViews(); final int pinLength = styledAttributes.getInt(R.styleable.PinLock_pinLength, 4); for (int i = 0; i < pinLength; i++) { Dot dot = new Dot(context, styledAttributes, i < length); addView(dot); } }
[ "private", "void", "addDots", "(", "int", "length", ")", "{", "removeAllViews", "(", ")", ";", "final", "int", "pinLength", "=", "styledAttributes", ".", "getInt", "(", "R", ".", "styleable", ".", "PinLock_pinLength", ",", "4", ")", ";", "for", "(", "int...
Adding Dot objects to layout @param length Length of PIN entered so far
[ "Adding", "Dot", "objects", "to", "layout" ]
bbb5d53cc57d4e163be01a95157d335231b55dc0
https://github.com/manupsunny/PinLock/blob/bbb5d53cc57d4e163be01a95157d335231b55dc0/pinlock/src/main/java/com/manusunny/pinlock/components/StatusDots.java#L59-L66
37,776
manupsunny/PinLock
pinlock/src/main/java/com/manusunny/pinlock/components/Dot.java
Dot.setBackground
private void setBackground(boolean filled) { if (filled) { final int background = styledAttributes .getResourceId(R.styleable.PinLock_statusFilledBackground, R.drawable.dot_filled); setBackgroundResource(background); } else { final int background =...
java
private void setBackground(boolean filled) { if (filled) { final int background = styledAttributes .getResourceId(R.styleable.PinLock_statusFilledBackground, R.drawable.dot_filled); setBackgroundResource(background); } else { final int background =...
[ "private", "void", "setBackground", "(", "boolean", "filled", ")", "{", "if", "(", "filled", ")", "{", "final", "int", "background", "=", "styledAttributes", ".", "getResourceId", "(", "R", ".", "styleable", ".", "PinLock_statusFilledBackground", ",", "R", "."...
Setting up background for the view. Should pass shapes for both filled and empty dots. Otherwise will use the default backgrounds
[ "Setting", "up", "background", "for", "the", "view", ".", "Should", "pass", "shapes", "for", "both", "filled", "and", "empty", "dots", ".", "Otherwise", "will", "use", "the", "default", "backgrounds" ]
bbb5d53cc57d4e163be01a95157d335231b55dc0
https://github.com/manupsunny/PinLock/blob/bbb5d53cc57d4e163be01a95157d335231b55dc0/pinlock/src/main/java/com/manusunny/pinlock/components/Dot.java#L70-L80
37,777
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java
JsonLexer.readNextToken
public Type readNextToken() throws IOException { int c; if (currentCharacter >= 0 && !Character.isWhitespace(currentCharacter)) { //there's still a character left from the last step c = currentCharacter; currentCharacter = -1; } else { //skip whitespace characters c = skipWhitespace(); } if (c ...
java
public Type readNextToken() throws IOException { int c; if (currentCharacter >= 0 && !Character.isWhitespace(currentCharacter)) { //there's still a character left from the last step c = currentCharacter; currentCharacter = -1; } else { //skip whitespace characters c = skipWhitespace(); } if (c ...
[ "public", "Type", "readNextToken", "(", ")", "throws", "IOException", "{", "int", "c", ";", "if", "(", "currentCharacter", ">=", "0", "&&", "!", "Character", ".", "isWhitespace", "(", "currentCharacter", ")", ")", "{", "//there's still a character left from the la...
Reads the next token from the stream @return the token @throws IOException if the stream could not be read
[ "Reads", "the", "next", "token", "from", "the", "stream" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java#L108-L179
37,778
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java
JsonLexer.skipWhitespace
private int skipWhitespace() throws IOException { int c = 0; do { c = r.read(); if (c < 0) { return -1; } } while (Character.isWhitespace(c)); return c; }
java
private int skipWhitespace() throws IOException { int c = 0; do { c = r.read(); if (c < 0) { return -1; } } while (Character.isWhitespace(c)); return c; }
[ "private", "int", "skipWhitespace", "(", ")", "throws", "IOException", "{", "int", "c", "=", "0", ";", "do", "{", "c", "=", "r", ".", "read", "(", ")", ";", "if", "(", "c", "<", "0", ")", "{", "return", "-", "1", ";", "}", "}", "while", "(", ...
Reads characters from the stream until a non-whitespace character has been found. Reads at least one character. @return the next non-whitespace character @throws IOException if the stream could not be read
[ "Reads", "characters", "from", "the", "stream", "until", "a", "non", "-", "whitespace", "character", "has", "been", "found", ".", "Reads", "at", "least", "one", "character", "." ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java#L187-L197
37,779
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java
JsonLexer.readString
public String readString() throws IOException { StringBuilder result = new StringBuilder(); while (true) { int c = r.read(); if (c < 0) { throw new IllegalStateException("Premature end of stream"); } else if (c == '"') { break; } else if (c == '\\') { int c2 = r.read(); if (c2 == '"' || ...
java
public String readString() throws IOException { StringBuilder result = new StringBuilder(); while (true) { int c = r.read(); if (c < 0) { throw new IllegalStateException("Premature end of stream"); } else if (c == '"') { break; } else if (c == '\\') { int c2 = r.read(); if (c2 == '"' || ...
[ "public", "String", "readString", "(", ")", "throws", "IOException", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "while", "(", "true", ")", "{", "int", "c", "=", "r", ".", "read", "(", ")", ";", "if", "(", "c", "<", ...
Reads a string from the stream @return the string @throws IOException if the stream could not be read
[ "Reads", "a", "string", "from", "the", "stream" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java#L204-L246
37,780
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java
JsonLexer.checkHexDigit
private static void checkHexDigit(int c) { if (!Character.isDigit(c) && !(c >= 'a' && c <= 'f') && !(c >= 'A' && c <= 'F')) { throw new IllegalStateException("Not a hexadecimal digit: " + c); } }
java
private static void checkHexDigit(int c) { if (!Character.isDigit(c) && !(c >= 'a' && c <= 'f') && !(c >= 'A' && c <= 'F')) { throw new IllegalStateException("Not a hexadecimal digit: " + c); } }
[ "private", "static", "void", "checkHexDigit", "(", "int", "c", ")", "{", "if", "(", "!", "Character", ".", "isDigit", "(", "c", ")", "&&", "!", "(", "c", ">=", "'", "'", "&&", "c", "<=", "'", "'", ")", "&&", "!", "(", "c", ">=", "'", "'", "...
Checks if the given character is a hexadecimal character @param c the character @throws IllegalStateException if the character is not hexadecimal
[ "Checks", "if", "the", "given", "character", "is", "a", "hexadecimal", "character" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java#L253-L257
37,781
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java
JsonLexer.readNumber
public Number readNumber() throws IOException { //there should be a character left from readNextToken! if (currentCharacter < 0) { throw new IllegalStateException("Missed first digit"); } //read sign boolean negative = false; if (currentCharacter == '-') { negative = true; currentCharacter = r.r...
java
public Number readNumber() throws IOException { //there should be a character left from readNextToken! if (currentCharacter < 0) { throw new IllegalStateException("Missed first digit"); } //read sign boolean negative = false; if (currentCharacter == '-') { negative = true; currentCharacter = r.r...
[ "public", "Number", "readNumber", "(", ")", "throws", "IOException", "{", "//there should be a character left from readNextToken!", "if", "(", "currentCharacter", "<", "0", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Missed first digit\"", ")", ";", "}", ...
Reads a number from the stream @return the number @throws IOException if the stream could not be read
[ "Reads", "a", "number", "from", "the", "stream" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java#L264-L292
37,782
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java
JsonLexer.readReal
private Number readReal(long prev, boolean negative) throws IOException { StringBuilder b = new StringBuilder(prev + "."); boolean exponent = false; boolean expsign = false; do { currentCharacter = r.read(); if (currentCharacter >= '0' && currentCharacter <= '9') { b.append((char)currentCharacter); ...
java
private Number readReal(long prev, boolean negative) throws IOException { StringBuilder b = new StringBuilder(prev + "."); boolean exponent = false; boolean expsign = false; do { currentCharacter = r.read(); if (currentCharacter >= '0' && currentCharacter <= '9') { b.append((char)currentCharacter); ...
[ "private", "Number", "readReal", "(", "long", "prev", ",", "boolean", "negative", ")", "throws", "IOException", "{", "StringBuilder", "b", "=", "new", "StringBuilder", "(", "prev", "+", "\".\"", ")", ";", "boolean", "exponent", "=", "false", ";", "boolean", ...
Reads a real number from the stream @param prev the digits read to far @param negative true if the number is negative @return the real number @throws IOException if the stream could not be read
[ "Reads", "a", "real", "number", "from", "the", "stream" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/json/JsonLexer.java#L301-L328
37,783
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/PercentEncoding.java
PercentEncoding.decode
public static String decode(String str) { try { return URLDecoder.decode(str, "UTF-8"); } catch (UnsupportedEncodingException e) { //should never happen throw new RuntimeException(e); } }
java
public static String decode(String str) { try { return URLDecoder.decode(str, "UTF-8"); } catch (UnsupportedEncodingException e) { //should never happen throw new RuntimeException(e); } }
[ "public", "static", "String", "decode", "(", "String", "str", ")", "{", "try", "{", "return", "URLDecoder", ".", "decode", "(", "str", ",", "\"UTF-8\"", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "//should never happen", "thr...
Decodes a string @param str the string @return the decoded string
[ "Decodes", "a", "string" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/PercentEncoding.java#L47-L54
37,784
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/AbstractRemoteCommand.java
AbstractRemoteCommand.authorize
private boolean authorize(RemoteConnector mc, InputReader in) { //get authorization URL String authUrl; try { authUrl = mc.getAuthorizationURL(); } catch (IOException e) { error("could not get authorization URL from remote server."); return false; } //ask user to point browser to authorization U...
java
private boolean authorize(RemoteConnector mc, InputReader in) { //get authorization URL String authUrl; try { authUrl = mc.getAuthorizationURL(); } catch (IOException e) { error("could not get authorization URL from remote server."); return false; } //ask user to point browser to authorization U...
[ "private", "boolean", "authorize", "(", "RemoteConnector", "mc", ",", "InputReader", "in", ")", "{", "//get authorization URL", "String", "authUrl", ";", "try", "{", "authUrl", "=", "mc", ".", "getAuthorizationURL", "(", ")", ";", "}", "catch", "(", "IOExcepti...
Request authorization for the tool from remote server @param mc the remote connector @param in a stream from which user input can be read @return true if authorization was successful
[ "Request", "authorization", "for", "the", "tool", "from", "remote", "server" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/AbstractRemoteCommand.java#L248-L299
37,785
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/RandomPermutation.java
RandomPermutation.permute
public double[] permute(double[] vector) { double[] permuted = new double[vector.length]; for (int i = 0; i < vector.length; i++) { permuted[i] = vector[randomlyPermutatedIndices[i]]; } return permuted; }
java
public double[] permute(double[] vector) { double[] permuted = new double[vector.length]; for (int i = 0; i < vector.length; i++) { permuted[i] = vector[randomlyPermutatedIndices[i]]; } return permuted; }
[ "public", "double", "[", "]", "permute", "(", "double", "[", "]", "vector", ")", "{", "double", "[", "]", "permuted", "=", "new", "double", "[", "vector", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "vector", ".", ...
Randomly permutes a vector using the random permutation of the indices that was created in the constructor. @param vector The initial vector @return The randomly permuted vector
[ "Randomly", "permutes", "a", "vector", "using", "the", "random", "permutation", "of", "the", "indices", "that", "was", "created", "in", "the", "constructor", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/RandomPermutation.java#L50-L56
37,786
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/BibliographyCommand.java
BibliographyCommand.checkStyle
private boolean checkStyle(String style) throws IOException { if (CSL.supportsStyle(style)) { //style is supported return true; } //style is not supported. look for alternatives. String message = "Could not find style in classpath: " + style; Set<String> availableStyles = CSL.getSupportedStyles(); ...
java
private boolean checkStyle(String style) throws IOException { if (CSL.supportsStyle(style)) { //style is supported return true; } //style is not supported. look for alternatives. String message = "Could not find style in classpath: " + style; Set<String> availableStyles = CSL.getSupportedStyles(); ...
[ "private", "boolean", "checkStyle", "(", "String", "style", ")", "throws", "IOException", "{", "if", "(", "CSL", ".", "supportsStyle", "(", "style", ")", ")", "{", "//style is supported", "return", "true", ";", "}", "//style is not supported. look for alternatives."...
Checks if the given style exists and output possible alternatives if it does not @param style the style @return true if the style exists, false otherwise @throws IOException if the style could not be loaded
[ "Checks", "if", "the", "given", "style", "exists", "and", "output", "possible", "alternatives", "if", "it", "does", "not" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/BibliographyCommand.java#L106-L126
37,787
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.loadProductQuantizer
public void loadProductQuantizer(String filename) throws Exception { productQuantizer = new double[numSubVectors][numProductCentroids][subVectorLength]; BufferedReader in = new BufferedReader(new FileReader(new File(filename))); for (int i = 0; i < numSubVectors; i++) { for (int j = 0; j < numProductCentro...
java
public void loadProductQuantizer(String filename) throws Exception { productQuantizer = new double[numSubVectors][numProductCentroids][subVectorLength]; BufferedReader in = new BufferedReader(new FileReader(new File(filename))); for (int i = 0; i < numSubVectors; i++) { for (int j = 0; j < numProductCentro...
[ "public", "void", "loadProductQuantizer", "(", "String", "filename", ")", "throws", "Exception", "{", "productQuantizer", "=", "new", "double", "[", "numSubVectors", "]", "[", "numProductCentroids", "]", "[", "subVectorLength", "]", ";", "BufferedReader", "in", "=...
Load the product quantizer from the given file. @param filename Full path to the file containing the product quantizer @throws Exception
[ "Load", "the", "product", "quantizer", "from", "the", "given", "file", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L275-L288
37,788
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.loadCoarseQuantizer
public void loadCoarseQuantizer(String filename) throws IOException { coarseQuantizer = new double[numCoarseCentroids][vectorLength]; coarseQuantizer = AbstractFeatureAggregator.readQuantizer(filename, numCoarseCentroids, vectorLength); }
java
public void loadCoarseQuantizer(String filename) throws IOException { coarseQuantizer = new double[numCoarseCentroids][vectorLength]; coarseQuantizer = AbstractFeatureAggregator.readQuantizer(filename, numCoarseCentroids, vectorLength); }
[ "public", "void", "loadCoarseQuantizer", "(", "String", "filename", ")", "throws", "IOException", "{", "coarseQuantizer", "=", "new", "double", "[", "numCoarseCentroids", "]", "[", "vectorLength", "]", ";", "coarseQuantizer", "=", "AbstractFeatureAggregator", ".", "...
Load the coarse quantizer from the given file. @param filname Full path to the file containing the coarse quantizer @throws Exception
[ "Load", "the", "coarse", "quantizer", "from", "the", "given", "file", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L297-L300
37,789
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.computeKnnIVFADC
private BoundedPriorityQueue<Result> computeKnnIVFADC(int k, double[] qVector) throws Exception { BoundedPriorityQueue<Result> nn = new BoundedPriorityQueue<Result>(new Result(), k); // find the w nearest coarse centroids int[] nearestCoarseCentroidIndices = computeNearestCoarseIndices(qVector, w); for ...
java
private BoundedPriorityQueue<Result> computeKnnIVFADC(int k, double[] qVector) throws Exception { BoundedPriorityQueue<Result> nn = new BoundedPriorityQueue<Result>(new Result(), k); // find the w nearest coarse centroids int[] nearestCoarseCentroidIndices = computeNearestCoarseIndices(qVector, w); for ...
[ "private", "BoundedPriorityQueue", "<", "Result", ">", "computeKnnIVFADC", "(", "int", "k", ",", "double", "[", "]", "qVector", ")", "throws", "Exception", "{", "BoundedPriorityQueue", "<", "Result", ">", "nn", "=", "new", "BoundedPriorityQueue", "<", "Result", ...
Computes and returns the k nearest neighbors of the query vector using the IVFADC approach. @param k The number of nearest neighbors to be returned @param qVector The query vector @return @throws Exception
[ "Computes", "and", "returns", "the", "k", "nearest", "neighbors", "of", "the", "query", "vector", "using", "the", "IVFADC", "approach", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L408-L450
37,790
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.computeNearestCoarseIndex
private int computeNearestCoarseIndex(double[] vector) { int centroidIndex = -1; double minDistance = Double.MAX_VALUE; for (int i = 0; i < numCoarseCentroids; i++) { double distance = 0; for (int j = 0; j < vectorLength; j++) { distance += (coarseQuantizer[i][j] - vector[j]) * (coarseQuantizer[i]...
java
private int computeNearestCoarseIndex(double[] vector) { int centroidIndex = -1; double minDistance = Double.MAX_VALUE; for (int i = 0; i < numCoarseCentroids; i++) { double distance = 0; for (int j = 0; j < vectorLength; j++) { distance += (coarseQuantizer[i][j] - vector[j]) * (coarseQuantizer[i]...
[ "private", "int", "computeNearestCoarseIndex", "(", "double", "[", "]", "vector", ")", "{", "int", "centroidIndex", "=", "-", "1", ";", "double", "minDistance", "=", "Double", ".", "MAX_VALUE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "num...
Returns the index of the coarse centroid which is closer to the given vector. @param vector The vector @return The index of the nearest coarse centroid
[ "Returns", "the", "index", "of", "the", "coarse", "centroid", "which", "is", "closer", "to", "the", "given", "vector", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L547-L564
37,791
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.computeNearestCoarseIndices
protected int[] computeNearestCoarseIndices(double[] vector, int k) { BoundedPriorityQueue<Result> bpq = new BoundedPriorityQueue<Result>(new Result(), k); double lowest = Double.MAX_VALUE; for (int i = 0; i < numCoarseCentroids; i++) { boolean skip = false; double l2distance = 0; for (int j = 0;...
java
protected int[] computeNearestCoarseIndices(double[] vector, int k) { BoundedPriorityQueue<Result> bpq = new BoundedPriorityQueue<Result>(new Result(), k); double lowest = Double.MAX_VALUE; for (int i = 0; i < numCoarseCentroids; i++) { boolean skip = false; double l2distance = 0; for (int j = 0;...
[ "protected", "int", "[", "]", "computeNearestCoarseIndices", "(", "double", "[", "]", "vector", ",", "int", "k", ")", "{", "BoundedPriorityQueue", "<", "Result", ">", "bpq", "=", "new", "BoundedPriorityQueue", "<", "Result", ">", "(", "new", "Result", "(", ...
Returns the indices of the k coarse centroids which are closer to the given vector. @param vector The vector @param k The number of nearest centroids to return @return The indices of the k nearest coarse centroids
[ "Returns", "the", "indices", "of", "the", "k", "coarse", "centroids", "which", "are", "closer", "to", "the", "given", "vector", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L575-L601
37,792
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.computeNearestProductIndex
private int computeNearestProductIndex(double[] subvector, int subQuantizerIndex) { int centroidIndex = -1; double minDistance = Double.MAX_VALUE; for (int i = 0; i < numProductCentroids; i++) { double distance = 0; for (int j = 0; j < subVectorLength; j++) { distance += (productQuantizer[subQuant...
java
private int computeNearestProductIndex(double[] subvector, int subQuantizerIndex) { int centroidIndex = -1; double minDistance = Double.MAX_VALUE; for (int i = 0; i < numProductCentroids; i++) { double distance = 0; for (int j = 0; j < subVectorLength; j++) { distance += (productQuantizer[subQuant...
[ "private", "int", "computeNearestProductIndex", "(", "double", "[", "]", "subvector", ",", "int", "subQuantizerIndex", ")", "{", "int", "centroidIndex", "=", "-", "1", ";", "double", "minDistance", "=", "Double", ".", "MAX_VALUE", ";", "for", "(", "int", "i"...
Finds and returns the index of the centroid of the subquantizer with the given index which is closer to the given subvector. @param subvector The subvector @param subQuantizerIndex The index of the the subquantizer @return The index of the nearest centroid
[ "Finds", "and", "returns", "the", "index", "of", "the", "centroid", "of", "the", "subquantizer", "with", "the", "given", "index", "which", "is", "closer", "to", "the", "given", "subvector", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L613-L631
37,793
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.computeResidualVector
private double[] computeResidualVector(double[] vector, int centroidIndex) { double[] residualVector = new double[vectorLength]; for (int i = 0; i < vectorLength; i++) { residualVector[i] = coarseQuantizer[centroidIndex][i] - vector[i]; } return residualVector; }
java
private double[] computeResidualVector(double[] vector, int centroidIndex) { double[] residualVector = new double[vectorLength]; for (int i = 0; i < vectorLength; i++) { residualVector[i] = coarseQuantizer[centroidIndex][i] - vector[i]; } return residualVector; }
[ "private", "double", "[", "]", "computeResidualVector", "(", "double", "[", "]", "vector", ",", "int", "centroidIndex", ")", "{", "double", "[", "]", "residualVector", "=", "new", "double", "[", "vectorLength", "]", ";", "for", "(", "int", "i", "=", "0",...
Computes the residual vector. @param vector The original vector @param centroidIndex The centroid of the coarse quantizer from which the original vector is subtracted @return The residual vector
[ "Computes", "the", "residual", "vector", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L642-L648
37,794
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.outputItemsPerList
public void outputItemsPerList() { int max = 0; int min = Integer.MAX_VALUE; double sum = 0; for (int i = 0; i < numCoarseCentroids; i++) { // System.out.println("List " + (i + 1) + ": " + perListLoadCounter[i]); if (invertedLists[i].size() > max) { max = invertedLists[i].size(); } if (...
java
public void outputItemsPerList() { int max = 0; int min = Integer.MAX_VALUE; double sum = 0; for (int i = 0; i < numCoarseCentroids; i++) { // System.out.println("List " + (i + 1) + ": " + perListLoadCounter[i]); if (invertedLists[i].size() > max) { max = invertedLists[i].size(); } if (...
[ "public", "void", "outputItemsPerList", "(", ")", "{", "int", "max", "=", "0", ";", "int", "min", "=", "Integer", ".", "MAX_VALUE", ";", "double", "sum", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numCoarseCentroids", ";", "i"...
Utility method that calculates and prints the min, max and avg number of items per inverted list of the index.
[ "Utility", "method", "that", "calculates", "and", "prints", "the", "min", "max", "and", "avg", "number", "of", "items", "per", "inverted", "list", "of", "the", "index", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L654-L673
37,795
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.getPQCodeByte
public byte[] getPQCodeByte(String id) throws Exception { int iid = getInternalId(id); if (iid == -1) { throw new Exception("Id does not exist!"); } if (numProductCentroids > 256) { throw new Exception("Call the short variant of the method!"); } DatabaseEntry key = new DatabaseEntry(); In...
java
public byte[] getPQCodeByte(String id) throws Exception { int iid = getInternalId(id); if (iid == -1) { throw new Exception("Id does not exist!"); } if (numProductCentroids > 256) { throw new Exception("Call the short variant of the method!"); } DatabaseEntry key = new DatabaseEntry(); In...
[ "public", "byte", "[", "]", "getPQCodeByte", "(", "String", "id", ")", "throws", "Exception", "{", "int", "iid", "=", "getInternalId", "(", "id", ")", ";", "if", "(", "iid", "==", "-", "1", ")", "{", "throw", "new", "Exception", "(", "\"Id does not exi...
Returns the pq code of the image with the given id. @param id @return @throws Exception
[ "Returns", "the", "pq", "code", "of", "the", "image", "with", "the", "given", "id", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L801-L824
37,796
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java
IVFPQ.getInvertedListId
public int getInvertedListId(String id) throws Exception { int iid = getInternalId(id); if (iid == -1) { throw new Exception("Id does not exist!"); } DatabaseEntry key = new DatabaseEntry(); IntegerBinding.intToEntry(iid, key); DatabaseEntry data = new DatabaseEntry(); if ((iidToIvfpqDB.get(n...
java
public int getInvertedListId(String id) throws Exception { int iid = getInternalId(id); if (iid == -1) { throw new Exception("Id does not exist!"); } DatabaseEntry key = new DatabaseEntry(); IntegerBinding.intToEntry(iid, key); DatabaseEntry data = new DatabaseEntry(); if ((iidToIvfpqDB.get(n...
[ "public", "int", "getInvertedListId", "(", "String", "id", ")", "throws", "Exception", "{", "int", "iid", "=", "getInternalId", "(", "id", ")", ";", "if", "(", "iid", "==", "-", "1", ")", "{", "throw", "new", "Exception", "(", "\"Id does not exist!\"", "...
Returns the inverted list of the image with the given id. @param id @return @throws Exception
[ "Returns", "the", "inverted", "list", "of", "the", "image", "with", "the", "given", "id", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/IVFPQ.java#L865-L881
37,797
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/bibtex/PageParser.java
PageParser.parse
public static PageRange parse(String pages) { ANTLRInputStream is = new ANTLRInputStream(pages); InternalPageLexer lexer = new InternalPageLexer(is); lexer.removeErrorListeners(); //do not output errors to console CommonTokenStream tokens = new CommonTokenStream(lexer); InternalPageParser parser = new Interna...
java
public static PageRange parse(String pages) { ANTLRInputStream is = new ANTLRInputStream(pages); InternalPageLexer lexer = new InternalPageLexer(is); lexer.removeErrorListeners(); //do not output errors to console CommonTokenStream tokens = new CommonTokenStream(lexer); InternalPageParser parser = new Interna...
[ "public", "static", "PageRange", "parse", "(", "String", "pages", ")", "{", "ANTLRInputStream", "is", "=", "new", "ANTLRInputStream", "(", "pages", ")", ";", "InternalPageLexer", "lexer", "=", "new", "InternalPageLexer", "(", "is", ")", ";", "lexer", ".", "r...
Parses a given page or range of pages. If the given string cannot be parsed, the method will return a page range with a literal string. @param pages the page or range of pages @return the parsed page or page range (never null)
[ "Parses", "a", "given", "page", "or", "range", "of", "pages", ".", "If", "the", "given", "string", "cannot", "be", "parsed", "the", "method", "will", "return", "a", "page", "range", "with", "a", "literal", "string", "." ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/bibtex/PageParser.java#L35-L44
37,798
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/download/ImageDownload.java
ImageDownload.main
public static void main(String args[]) throws Exception { String urlStr = "http://upload.wikimedia.org/wikipedia/commons/5/58/Sunset_2007-1.jpg"; String id = "Sunset_2007-1"; String downloadFolder = "images/"; boolean saveThumb = true; boolean saveOriginal = true; boolean followRedirects = false; I...
java
public static void main(String args[]) throws Exception { String urlStr = "http://upload.wikimedia.org/wikipedia/commons/5/58/Sunset_2007-1.jpg"; String id = "Sunset_2007-1"; String downloadFolder = "images/"; boolean saveThumb = true; boolean saveOriginal = true; boolean followRedirects = false; I...
[ "public", "static", "void", "main", "(", "String", "args", "[", "]", ")", "throws", "Exception", "{", "String", "urlStr", "=", "\"http://upload.wikimedia.org/wikipedia/commons/5/58/Sunset_2007-1.jpg\"", ";", "String", "id", "=", "\"Sunset_2007-1\"", ";", "String", "do...
Example of a single image download using this class. @param args @throws Exception
[ "Example", "of", "a", "single", "image", "download", "using", "this", "class", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/download/ImageDownload.java#L268-L286
37,799
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/bibtex/DateParser.java
DateParser.merge
private static CSLDate merge(CSLDate d1, CSLDate d2) { if (d1 == null) { return d2; } else if (d2 == null) { return d1; } CSLDateBuilder builder = new CSLDateBuilder(); //handle date parts builder.dateParts(d1.getDateParts()[0], d2.getDateParts()[d2.getDateParts().length - 1]); //handle cir...
java
private static CSLDate merge(CSLDate d1, CSLDate d2) { if (d1 == null) { return d2; } else if (d2 == null) { return d1; } CSLDateBuilder builder = new CSLDateBuilder(); //handle date parts builder.dateParts(d1.getDateParts()[0], d2.getDateParts()[d2.getDateParts().length - 1]); //handle cir...
[ "private", "static", "CSLDate", "merge", "(", "CSLDate", "d1", ",", "CSLDate", "d2", ")", "{", "if", "(", "d1", "==", "null", ")", "{", "return", "d2", ";", "}", "else", "if", "(", "d2", "==", "null", ")", "{", "return", "d1", ";", "}", "CSLDateB...
Merges two dates @param d1 the first date @param d2 the second date @return the merged date
[ "Merges", "two", "dates" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/bibtex/DateParser.java#L190-L247