input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public string get value string name string values try string s values other field positions get name return null if the string is empty return string util is null string s null s catch exception e return null
|
get the value of the field from the array using the mapping
|
public int get row count return m table data size
|
get row count
|
public object get value at int row index int column index return object m table data element at row index column index
|
get value at
|
public void remove row data int row if row data size row row 0 row data remove row fire table data changed
|
remove row data
|
public void notifiy params changed update params m data
|
notifiy params changed
|
public int get row count if is expert mode return inspector entries length else return required entries length
|
get row count
|
private string escape reserved chars string str if str null return string builder sb new string builder for int ci 0 ci str length ci char ch str char at ci if reserved string index of ch 0 sb append sb append ch return escape printf chars sb to string
|
return a copy of the string with all reserved regexp chars
|
public object get value at int row index int column index object obj data row index column index if obj instanceof edpcell data edpcell data cell data edpcell data obj object value cell data get data if inspector entries row index m editor inspector cell editor return value return cell data return obj
|
get value at
|
public input stream get unfiltered input stream throw new unsupported operation exception not implemented
|
get unfiltered input stream
|
public void test main throws exception output file file create temp file test run kbart report csv system err println saving report to temp file output file for boolean b new boolean true false hide empty columns b show tdb status b for predefined field ordering fo predefined field ordering values system err println testing report with ordering fo display name run test with field ordering fo
|
test the main method
|
public void test kbart csv iterator throws exception kbart csv iterator it new kbart csv iterator new string input stream string utils join lines n to string check the properties of each item in the iterator items in the iterator should be in the same order as the lines omitting empty ones int line num 0 while it has next bibliographic item item it next assert not null item line num check item against record item line num check next failure try it next fail next should throw no such element exception catch no such element exception e expected
|
create iterator on input stream ensure it iterates over everything
|
public input stream open for hashing throw new unsupported operation exception not implemented
|
open for hashing
|
private string as issn string s return metadata util is issn s s null
|
if the input string is a valid issn returns the string
|
public void test tdb diff print tdb tdb1 new tdb tdb tdb2 new tdb tdb diff tdb diff new tdb diff plugin mgr tdb1 tdb2 tdb diff show fields true tdb diff show all true byte array output stream bos new byte array output stream print stream ps new print stream bos tdb diff print tdb diffs by au ps string output bos to string assert equals 0 output length
|
test printing of differences between tdbs
|
public hash map get printf descrs return get printf descrs true
|
p same as calling
|
public t find by id pk pk boolean lock t entity if lock entity t super get session load get persistent class pk lock mode upgrade entity t get hibernate template load get persistent class pk lock mode upgrade else entity t super get session load get persistent class pk entity t get hibernate template load get persistent class pk return entity
|
lookup an entity by id
|
public t find by id pk pk return find by id pk false
|
convenience lookup method the default mode using no tt upgrade tt lock
|
public void set subject subject subject if this subject null this subject remove objective this this subject null if subject null this subject subject this subject add objective this
|
sets the subject of this objective
|
public void activate assert is true status user status inactive cannot activate user with status status status user status active
|
marks this user as i active i
|
public void deactivate assert is true status user status active cannot inactivate user with status status status user status inactive
|
marks this user as i inactive i
|
public void delete assert not null id cannot delete a non saved user assert is true status user status deleted cannot delete user with status status status user status deleted username username id
|
marks this user as i deleted i
|
protected void flush and clear entity manager flush entity manager clear
|
convenience method that flushes and clear entities the current
|
public t build before build entity manager persist entity after build return entity
|
builds the instance and makes it persistent
|
protected void before build
|
invoked just before executing
|
protected void after build
|
invoked just after executing the method
|
public void test register default value factories as needed assert sensibility assert reflexive assert symmetric assert transitive assert supports null assert consistent
|
tests the class and thows an exception if any problem is detected
|
public void set return to string return to try this return to url encode utils url encode return to catch unsupported encoding exception e throw new open id exception e this return to return to
|
set returning address after authentication
|
public authentication get authentication http servlet request request byte key return get authentication request key endpoint default alias
|
get authentication information from http request and key
|
public endpoint lookup endpoint string name or url string url null string alias null if name or url starts with http name or url starts with https url name or url else url short name lookup url by name name or url if url null throw new open id exception cannot find op url by name name or url alias short name lookup alias by name name or url endpoint endpoint endpoint cache get url if endpoint null endpoint is expired return endpoint endpoint request endpoint url alias null endpoint default alias alias endpoint cache put url endpoint return endpoint
|
lookup end point by name or full url
|
private void parse annotations element element annotation annotations clazz get annotations annotation parsees parse element annotations
|
deal with the clazzs annotations
|
public void set special int filter string on if filter 0 this browser new sng browse control main all music get all by album on else if filter 1 this browser new sng browse control main all music get all by artist on
|
set special filter for a browser
|
public void add play button pbutton int filter this play pbutton this filter play filter
|
adds handler for play button and a filter
|
public browse get browse return this browser
|
returns the current browser
|
protected void populate item list item string item string hours list item get model object item add new label hours list hours list
|
indicate here how each item will be displayed in the page
|
public string get time date format date format new simple date format hh locale us date date new date return date format format date
|
get the current time
|
public string get hour time date format date format new simple date format h mm ss a locale us date date new date return date format format date
|
get the hour for the meter
|
private string get color int value if value 0 return green bmp else if value 1 return red bmp else return yellow bmp
|
get the color of the spotlight
|
public string get day date format date format new simple date format yyyy mm dd locale us date date new date return date format format date
|
get the current day
|
private string get google url int value if value 0 return http sites google com site edwinyounglim meterg bmp else if value 1 return http sites google com site edwinyounglim meterr bmp else return http sites google com site edwinyounglim metery bmp
|
gets the url for the google meter according to the current threshold
|
public source image set model imodel new model model new model return new source image id model
|
set the model to the input parameter
|
public string get empty return http chart apis google com chart chs 800x300 cht lc chf c ls 90 ffffff chxt x y chbh a chtt carbon density chxl 0 12am 1am 2am 3am 4am 5am 6am 7am 8am 9am 10am 11am 12pm 1pm 2pm 3pm 4pm 5pm 6pm 7pm 8pm 9pm 10pm 11pm 1 0 500 1000 1500 2000
|
get an empty graph using the google charts url with zero values
|
public string to string return interval choice
|
returns a string containing the selected source
|
public date operations empty constructor new instance created
|
the constructor class for date modification
|
public string reformat string date string tokenizer date token new string tokenizer date string sample month date token next token string sample day date token next token string sample year date token next token for the timestamp to accept these values sample month 0 sample month sample day 0 sample day return sample year sample month sample day
|
reformats the date inputed in order to be used for a timestamp
|
public string get configuration type return application deployment
|
outputs a deployment message at the start of every greendepot run
|
public session new session request request response response return new green depot session this request
|
creates a new session per user using session class
|
public double get min list double list double min 10000 0 for double var list if var min min var return min
|
get the minimum out of the list
|
public void set end date string date this end date date
|
method that receives input from the form for when to end the interval
|
public double get max list double list double max 0 0 for double var list if var max max var return max
|
get the maximum out of the list
|
public void inc load count count
|
increment the amount of times the page has reloaded
|
public int get load count return this count
|
get the amount of the times the page has reloaded
|
public void action performed action event evt if n 0 own color color dark gray friendly color color gray adversary color color red repaint n 1 else own color color white friendly color color white adversary color color white repaint n 0
|
alternates between color vehicle display settings
|
static public string get internet base url return know get internet base url
|
to get the most secure url to connect on this machine
|
static public string get internet non secure base url return know get internet non secure base url
|
to get the http url to connect on this machine
|
static public string get internet secure base url return know get internet secure base url
|
to get the https url to connect on this machine
|
static public string get core version return major minor fix
|
to get the current core library version
|
private boolean check if command line string line string str line trim try if str starts with start flag true return true catch null pointer exception ne system err println ne return false
|
check whether the line is a command line
|
private boolean check end command line string line string str line trim try if str ends with end flag true return true catch null pointer exception ne system err println ne return false
|
check whether it is the end of the command line
|
private int get no vars string line int counter 0 string tokenizer string new string tokenizer line counter string count tokens 1 return counter
|
get number of variables in the string base on counting
|
public string parse file string filename source file tmp1 file fp new file filename random access file access null boolean delete fp delete try fp create new file catch ioexception ie system err println couldn t create temporary file filename ie system exit 1 try access new random access file fp rw catch ioexception ie system err println error in accessin the temporary file ie system exit 1 try access write bytes new string final string buffer access close catch ioexception ie system err println error in writing to the temporary file ie system exit 1 return filename
|
return the string that contain the final file name after parsing
|
public string parse file return new string final file
|
return the string that contain the final file after parsing
|
public void display url string str try html set page str catch ioexception e system err println attempt to read a bad url str
|
set the new url for viewing on the pane
|
private string set fscan string string result new string string arg str new string string var str new string element info element new element info for int i 0 i no of var i element element info var info element at i if element data type equals int element data type equals string arg str d else arg str f var str jpot i 1 insert the varibale for code swapping control if it exists if swap info is code swap arg str d var str jpot swap result fscanf fp arg str var str return result
|
create the fscanf statement to read data from the link file to
|
private boolean is function string str string type string function if str index of type 1 if str index of function 1 return true return false
|
check whether the string is a functions declaration
|
private boolean is include statement string str if str trim starts with include true return true else return false
|
check whether the string is the include statement
|
public void create web album if reduce reduce images if webpage create web page if upload start ftp
|
create a full webalbum with photos
|
private void create web page web page web page new web page title web page create web pages web album web page get web album
|
create all the website elements
|
private void send line string line throws ioexception if socket null throw new ioexception simple ftp is not connected try writer write line r n writer flush if debug message logger log 3 line catch ioexception e socket null throw e
|
sends a raw command to the ftp server
|
public long start route string route name string r name route name date b time new date long time b time get time content values values new content values values put route name r name values put begin time time values put end time time it will be update on stop route actual route db handler insert sfid gpsroutes table null values return actual route
|
create a new route in the database
|
public void close db close
|
convenience method for closing database
|
public void stop route long route id date e time new date long time e time get time content values values new content values values put end time time db handler update sfid gpsroutes table values id route id null
|
this method finalize a route saving its end time
|
public void store route location long route id location loc date t new date content values values new content values values put route id route id values put latitude loc get latitude values put longitude loc get longitude values put altitude loc get altitude values put bearing loc get bearing values put timestamp t get time db handler insert sfid gpslocations table null values
|
stores a location for a given route
|
public route get route long route id string columns id name begin end cursor c db handler query sfid false gpsroutes table columns id string value of route id null null null null if c first false return null else route r new route r id c get long 0 r name c get string 1 r begin new date c get long 2 r end new date c get long 3 return r
|
convenience method to retrieve data of a route in database
|
public boolean unlink int son id try iterator linkable it f son list iterator while it f has next linkable so it f next if so get id son id linkable fa so get linked 0 if fa null fa delete link so so delete link fa return false catch exception e return false
|
unlink a son from its father thanks to sons id
|
public void delete route long id db handler delete sfid gpsroutes table id id null db handler delete sfid gpslocations table route id id null
|
this method delete the route and all its positions from the database
|
public boolean unlink linkable son try linkable father son get linked 0 if father null son delete link father father delete link son return true return false catch exception e return false
|
unlink a son from its father
|
public boolean add link linkable li iterator linkable it linked iterator check that id is unic while it has next linkable l it next if l get id li get id return false if unic add it to the list linked add li return true
|
add a link to the linkable object
|
public void hide button m button assign set visibility invisible m button view set visibility invisible
|
method to hide the assign and view button
|
public void create table string sfid string tablename string sentence visibility visibility access access throws sqlexception if exist table tablename else creating new table in db try db exec sql sentence catch sqlexception e log e booga e to string system out print e check visibility and access values if visibility null visibility visibility public if access null access access write registering new table in security table content values values new content values values put sfid sfid values put tablename tablename values put visibility visibility get value values put access access get value db insert security null values
|
this method create a table in the database
|
public boolean unlink all try linkable tab son int i iterator linkable it f father list iterator while it f has next linkable fa it f next if fa get linked null tab son fa get linked for i 0 i tab son length i unlink tab son i catch exception e return false return true
|
delete all links between father list and son list
|
public void display button m button view request focus m button assign set visibility visible m button view set visibility visible
|
method to display the assign and view button
|
public boolean delete link by id int id iterator linkable it linked iterator while it has next linkable l it next if l get id id linked remove l return true return false
|
unlink a linkable object thanks to its id
|
public linker load linker int id son int id father cursor m cursor get table rows while m cursor next id father m cursor get int m cursor get column index id father id son m cursor get int m cursor get column index id son m linker link to father id father id son return m linker
|
read the database and update the m linker attribute
|
public void update label if m linker get son list list position get linked null m title set text m linker get son list list position get description m linker get son list list position get linked 0 get description else m title set text m linker get son list list position get description
|
update the row title
|
public boolean delete link linkable l if linked contains l linked remove l return true return false
|
unlink a linkable object
|
public boolean save linker int i j int id father int id son linkable father m linker get father list linkable son for i 0 i father length i id father father i get id son father i get linked if son null for j 0 j son length j id son son j get id if add row id father id son 1 return false return true
|
save m linker attribute to the database
|
public linkable get linked by id int id iterator linkable it linked iterator while it has next linkable l it next if l get id id return l return null
|
get the linked linkable object instance thanks to its id
|
public long add row int id father int id son content values values new content values values put id father id father values put id son id son return db handler insert sfid table name null values
|
save a link to the database by adding a row
|
public void delete table string sfid string table if exist table table is owner sfid table delete table table
|
this method is used to delete tables in my droid database
|
protected void reset all links my linker unlink all list view l get list view int i for i 0 i l get child count i linker view lv linker view l get child at i lv update label
|
method called when user click on the reset button
|
public int delete all return db handler delete sfid table name null null
|
delete all values of the move on mood linker table
|
public boolean link to father linkable father linkable son if father add link son true if father list contains father father list add father if son list contains son son list add son son add link father return true return false
|
link a father instance to a son instance
|
public void set flist linkable new flist father list clear list linkable fl arrays as list new flist father list add all fl
|
replace the current father list to a new one
|
public cursor query string sfid boolean distinct string table string columns string selection string selection args string group by string having string order by if exist table table check permissions sfid table access read return db query distinct table columns selection selection args group by having order by else return null
|
convenience method for query tables in my droid database
|
public void set slist linkable new slist son list clear list linkable sl arrays as list new slist son list add all sl
|
replace the current son list to a new one
|
public void set list linkable new flist linkable new slist set flist new flist set slist new slist
|
replace father and son list to new ones
|
public long insert string sfid string table string null column hack content values values if exist table table check permissions sfid table access write return db insert table null column hack values else return 1
|
convenience method for inserting rows in my droid database tables
|
public int update string sfid string table content values values string where clause string where args if exist table table check permissions sfid table access write return db update table values where clause where args else return 1
|
convenience method for updating rows in my droid database tables
|
public long insert string sfid string table string null column hack content values values if exist table table check permissions sfid table access write return db insert table null column hack values return 1
|
convenience method for insert rows in my droid database tables
|
public int delete string sfid string table string where clause string where args if exist table table check permissions sfid table access write return db delete table where clause where args else return 1
|
convenience method for deleting rows in my droid database tables
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.