input
stringlengths
10
828
output
stringlengths
5
107
public col multi row with vector matrix a matrix x integer i matrix a1 new matrix a matrix x1 new matrix x list col list of minims new array list col for int j 0 j a1 get cols count j list of minims add min a1 get col i j x1 get col j 0 return maximum list of minims
method return col that is computed as multiplication of concrete row in
public col multi row with vector row a matrix x list col list of minims new array list col for int j 0 j a get cols count j list of minims add min a get cols get j x get col j 0 return maximum list of minims
method return col that is computed as multiplication row in matrix a
public matrix multi matrix with vector matrix a matrix x max min ai1 x1 min ai2 x2 min ai3 x3 bi matrix result new matrix a get rows count 1 for int i 0 i a get rows count i result get rows get i get cols set 0 multi row with vector a x i return result
method return col that is computed as multiplication of multidimension
public boolean is same matrix x1 matrix x2 matrix x new matrix x1 matrix y new matrix x2 boolean same true for int i 0 i x get rows count i for int j 0 j x get cols count j if x1 get col i j get value equals y get col i j get value same false if value of one column is not the same return same
method compare values of two matrices
public col minimum matrix m col min m get col 0 0 for int i 0 i m get rows count i for int j 0 j m get cols count j if m get col i j get value min get value min m get col i j return min
method return minimum value from one matrix
public col minimum row r col min r get cols get 0 for int j 0 j r get cols count j if r get cols get j get value min get value min r get cols get j return min
method return minimum value from one row
public void print for int i 0 i this rows count i system out print row i for int j 0 j this cols count j system out print col j get col i j get value system out println
method print values from all columns to standard output
public void clear for int i 0 i this rows count i for int j 0 j this cols count j set col i j long parse long 0
method set all values in matrix to zero
public void random number generator int max number random cislo new random for int i 0 i this rows count i for int j 0 j this cols count j set col i j cislo next int max number
method set all values in matrix to random number with defined maximum
public col get col int i int j return rows get i get cols get j
method return object col from selected row and column index in matrix
public void set col int i int j integer value rows get i get cols get j set value value long value
method set defined value to selected row and column
public void set col int i int j long value rows get i get cols get j set value value
method set defined value to selected row and column
public int get cols count return cols count
method return number of columns in matrix
public void set rows list row rows this rows rows
method return collection of rows in matrix
public void set jsonobject final jsonobject json object this json object json object
sets the json object to render with the specified json object
public void set renderer final abstract httpresponse renderer renderer this renderer renderer
sets the renderer with the specified renderer
public void set request final http servlet request request this request request
sets the request with the specified request
public void set response final http servlet response response this response response
sets the response with the specified response
private boolean has logged in final http servlet request request final string request uri request get request uri final string request url request get request url to string logger log level finest request uri 0 url 1 new object request uri request url final string user name sessions current user name request logger log level finest session user name 0 user name return null user name true false
determines whether the user for the specified request has logged in
public void set processor class final class processor class this processor class processor class
sets the processor class with the specified processor class
public void set nickname final string nickname this nickname nickname
sets the nickname with the specified nickname
public method get processor method return processor method
gets the processor method
public void notify listeners throws event exception notify listeners null
if this object has changed as indicated by the
public void register listener final abstract event listener event listener synchronized event queue add listener event listener
registers the specified event listener
public void set processor method final method processor method this processor method processor method
sets the processor method with the specified processor method
public string get uripattern return uri pattern
gets the uri pattern
public void set uripattern final string uri pattern this uri pattern uri pattern
sets the uri pattern with the specified uri pattern
public void set data final byte data this data data
sets the data with the specified data
public filter operator get operator return operator
gets the operator
private session get session final properties props new properties props set property mail smtp host get host props set property mail smtp auth true props set property mail smtp port get port props put mail smtp starttls enable true final session ret session get default instance props new smtpauthenticator ret set debug get debug return ret
create session based on the mail properties
public int get current page num return current page num
gets the current page number
private string get host return mail properties get string mail smtp host
get mail smtp host form mail properties
public query set current page num final int current page num this current page num current page num return this
sets the current page number with the specified current page number
private string get user return mail properties get string mail user
get mail user form mail properties
private string get password return mail properties get string mail password
gets mail password from mail properties
protected void process page cache hit final jsonobject cached page content object logger log level finest processing page cache hit
processes page cache hit with the specified cached page content object
public query set page size final int page size this page size page size return this
sets the page size with the specified page size
protected template get template final http servlet request request final string template name get template name request get request uri try return templates get template template name catch final ioexception e logger log level severe can t find template by the specified request uri request get request uri e get message return null
gets a template with the specified http servlet request
public void add recipient final string recipient recipients add recipient
adds the specified recipient
public void set html body final string html body this html body html body
sets the html body with the specified html body
public void set dir final file dir this dir dir init template engine cfg
sets the directory of this plugin with the specified directory
public string get lang final locale locale final string key return langs get locale to string get property key
gets language label with the specified locale and key
public void plug final map string object data model string content string data model get plugin plugins if null content data model put plugin plugins handle langs data model content string data model get plugin plugins final string builder content builder new string builder content content builder append get view content data model final string plugins content content builder to string data model put plugin plugins plugins content logger log level finer plugin name 0 has been plugged get name
plugs with the specified data model
public void set data model final map string object data model this data model data model
sets the data model with the specified data model
public void set view name final string view name this view name view name
sets the name of the template file with the specified name
private string get view content final map string object data model if null configuration init template engine cfg try final template template configuration get template plugin plugin ftl final string writer sw new string writer template process data model sw return sw to string catch final exception e logger get logger get class get name log level severe get plugin name name s view failed will return warning e return div style color red plugin name name runs failed div
gets view content of a plugin
public jsonobject to jsonobject throws jsonexception final jsonobject ret new jsonobject ret put keys object id get id ret put plugin plugin name get name ret put plugin plugin version get version ret put plugin plugin author get author ret put plugin plugin status get status name return ret
converts this plugin to a json object plugin description
public void update final abstract plugin plugin final string view name plugin get view name map string set abstract plugin holder plugin cache get plugin cache name if null holder logger info plugin cache miss reload load holder plugin cache get plugin cache name if null holder throw new illegal state exception plugin cache state error final set abstract plugin set holder get view name refresh set remove plugin set add plugin plugin cache put plugin cache name holder
updates the specified plugin
public void add header final httpheader header headers add header
adds the specified http header
public url get final url return final url
gets the final url
public void set final url final url final url this final url final url
sets the final url with the specified final url
public void set payload final byte payload this payload payload
sets the payload with the specified payload
public void set status final plugin status status this status status
sets the status with the specified status
public httprequest method get request method return request method
gets the request method
private formatter get formatter final string name final string val log manager get log manager get property name try if val null final class clz class for name val return formatter clz new instance catch final exception ex throw new runtime exception ex return new simple formatter
gets formatter in configuration
public void set request method final httprequest method request method this request method request method
sets the request method with the specified request method
protected httpresponse do fetch final httprequest request throws ioexception final http urlconnection http urlconnection prepare connection request config connection http urlconnection request http urlconnection connect final httpresponse ret result connection http urlconnection http urlconnection disconnect return ret
do fetch the template method
public plugin status get status return status
gets the status of this plugin
public void add type final plugin type type types add type
adds the specified type
public database config get database config return database config
gets the database configuration
public jsonobject get uncommitted final string id return cache get id
gets a json object from uncommitted transaction cache with the specified
public boolean has uncommitted final string id return cache contains key id
determines the specified id is in transaction cache or not
public void put uncommitted final string id final jsonobject json object cache put id json object
puts the specified uncommitted json object into transaction cache with
public string get min acceptable version return min acceptable version
returns the lower bound acceptable version
public string get max acceptable version return max acceptable version
returns the upper bound acceptable version
public long get min timestamp return min timestamp
returns the lower bound timestamp
public long get max timestamp return max timestamp
returns the upper bound timestamp
public void set authorized final boolean authorized this authorized authorized
set the user authorization status
public service provider descriptor get service provider descriptor return service provider descriptor
returns the service provider descriptor this consumer is
public void register request signer final request signer signing key verifying key request signer this registry put request signer get signature method request signer
add a new
public int get response code throws oauth exception if this connection null throw new oauth exception impossible get status code connection not open try return this connection get response code catch ioexception e throw new oauth exception impossible get status code e
returns the service provider response code
public void disconnect throws oauth exception if this connection null throw new oauth exception impossible to close connection not open this connection disconnect
closes the wrapped http connection
public void parse final string authorization header throws parse exception if this logger is loggable level fine this logger fine parsing http authorization header authorization header reader reader new string reader authorization header authorization header parser parser new authorization header parser reader parser set message parser this parser parse oauth header try reader close catch ioexception e todo can this exception be ignored
parses the code authorization code http header
public void serialize final parameter parameters throws ioexception for parameter parameter parameters this serialize parameter this finish
serialize one or more
public parameter list builder append final parameter parameters if parameters null parameters length 0 if this ordered this parameter list add all arrays as list parameters else for parameter parameter parameters this append parameter return this
append one or more
public void parse final list parameter parameter list this start parse for parameter parameter parameter list this do param parameter get name parameter get value this end parse
parses the http parameters and builds oauth the request message
public input stream get input stream throws oauth exception if this connection null throw new oauth exception impossible to get input stream connection not open try input stream input this connection get input stream if this is gzip response return new gzipinput stream input return input catch ioexception e throw new oauth exception impossible to get input stream e
returns the http input stream
public parameter list builder append final list parameter parameter list if parameter list null parameter list is empty if this ordered this parameter list add all parameter list else for parameter parameter parameter list this append parameter return this
append a previously created
public parameter list builder append final parameter parameter if parameter null return this if this ordered int param index collections binary search this parameter list parameter if param index 0 parameter is oauth param this parameter list remove param index else param index param index 1 this parameter list add param index parameter else this parameter list add parameter return this
append a previously created
public boolean is oauth param return this name starts with oauth prefix name equals realm
checks if the current parameter is an oauth parameter
public t get message return message
returns the created oauth pojo message
private void print text final string text throws ioexception if this encode this writer write utf8 utils url encode text else this writer write text
serialize a generic input text encoding it if needed
public oauth service get request token service return request token service
returns the service has to be invoked to a href http oauth
public void add signing keys signing key signing key this consumer secrets put signing key get signature method signing key
add a code consumer secret code
public url get authorize token url return authorize token url
returns the url has to be invoked to a href http oauth
private void finish throws ioexception this writer flush this writer close
flushes and closes the writer
public boolean contains refused parameters return this refused parameters is empty
checks if there are parameters that have been refused during parsing
public void remove signing key string signature method this consumer secrets remove signature method
remove the consumer secret related to the signature method
public input stream get error stream throws oauth exception if this connection null throw new oauth exception impossible to get error stream connection not open try input stream input this connection get error stream if this is gzip response return new gzipinput stream input return input catch ioexception e throw new oauth exception impossible to get error stream e
returns the http error stream
public oauth service get access token service return access token service
returns the service has to be invoked to a href http oauth
public protected resources service get protected resources service return protected resources service
returns the service descriptor to a href http oauth
public boolean contains missing parameters return this empty parameters is empty
checks if there are missing parameters
private boolean is gzip response string content encoding this connection get header field content encoding boolean gzip content encoding null content encoding index of gzip compression 1 if this logger is loggable level fine this logger fine message response is gzip compressed gzip return gzip
checks is the service provider replies with code gzip code
public equals builder append super final boolean super equals if this is equals return this this is equals super equals return this
p adds the result of code super
public oauth service new oauth service final url url return new oauth service this get http method url this get supported signature methods this get supported parameters methods
creates a new
public to string builder append super final string super to string this string builder append super to string return this
append the code to string code from the superclass
public hash code builder append final boolean value i total i total i constant value 0 1 return this
append a code hash code code for a code boolean code
public httpmethod get http method return http method
returns the used http method
public hash code builder append final boolean array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for a code boolean code array
public void verify final abstract request message message this verify messages constants consumer key message get consumer key this verify messages constants nonce message get nonce this verify messages constants signature message get signature this verify messages constants signature method message get signature method this verify messages constants timestamp message get timestamp if message instanceof token message this verify messages constants token token message message get token
verifies if every required oauth field in the request message is present