input
stringlengths
10
828
output
stringlengths
5
107
public void test successful authentication scoped search throws exception username password token token new username password token andham secret authentication info auth info realm get authentication info token assert not null authentication info returned from get authentication info is null auth info assert equals token get username get username auth info
tests authentication with scoped search
public void tear down throws exception this wrapped service tear down
shut down the server
public void test successful authorization1 throws exception principal collection principal collection new simple principal collection andham this realm get name authorization info auth info realm get authorization info principal collection assert not null authorization info returned from get authorization info is null auth info set string expected roles new hash set string expected roles add admin expected roles add user assert roles expected roles auth info
tests successful authorization
public void test failed authentication incorrect password throws exception username password token token new username password token andham badpassword authentication info auth info this realm get authentication info token assert null authentication should have failed but didn t auth info
tests an incorrect password
public void test failed authentication invalid username throws exception username password token token new username password token nobody password authentication info auth info this realm get authentication info token assert null authentication should have failed but didn t auth info
tests an invalid username
public void test successful authorization2 throws exception principal collection principal collection new simple principal collection joebib this realm get name authorization info auth info realm get authorization info principal collection assert not null authorization info returned from get authorization info is null auth info set string expected roles new hash set string expected roles add user assert roles expected roles auth info
tests successful authorization
public void test get user missing attributes throws exception final string user id johndoe plexus user user this user locator get user user id assert not null user
tests name and email attribute value not being set in ldap directory
public void clear cache this lock lock make sure we aren t fiddling with save load process this configuration null this search user filter expr null this search users filter expr null this list users filter expr null this lock unlock
clears any cached configuration information
private jbutton get jbutton entrar if j button entrar null j button entrar new jbutton j button entrar set text entrar j button entrar set bounds new rectangle 277 232 69 26 return j button entrar
this method initializes j button entrar
private jbutton get jbutton salir if j button salir null j button salir new jbutton j button salir set text salir j button salir set bounds new rectangle 390 231 60 26 return j button salir
this method initializes j button salir
private jtext field get jtext field usuario if j text field usuario null j text field usuario new jtext field j text field usuario set bounds new rectangle 358 149 138 20 return j text field usuario
this method initializes j text field usuario
private jpassword field get jpassword field password if j password field password null j password field password new jpassword field j password field password set bounds new rectangle 357 179 139 19 return j password field password
this method initializes j password field password
private jtext pane get jtext pane usuario if j text pane usuario null j text pane usuario new jtext pane j text pane usuario set bounds new rectangle 267 147 50 22 j text pane usuario set text usuario return j text pane usuario
this method initializes j text pane usuario
private jtext pane get jtext pane password if j text pane password null j text pane password new jtext pane j text pane password set bounds new rectangle 270 176 71 22 j text pane password set text contrase a return j text pane password
this method initializes j text pane password
private jpanel get jcontent pane if j content pane null j content pane new jpanel j content pane set layout null j content pane add get jbutton entrar null j content pane add get jbutton salir null j content pane add get jtext field usuario null j content pane add get jpassword field password null j content pane add get jtext pane usuario null j content pane add get jtext pane password null return j content pane
this method initializes j content pane
public void reset m total new big integer initial value
reset to initial value
private etiqueta get jtext pane usuario if j text pane usuario null j text pane usuario new etiqueta j text pane usuario set bounds new rectangle 267 147 50 22 j text pane usuario set text usuario return j text pane usuario
this method initializes j text pane usuario
private etiqueta get jtext pane password if j text pane password null j text pane password new etiqueta j text pane password set bounds new rectangle 270 176 71 22 j text pane password set text contrase a return j text pane password
this method initializes j text pane password
private jbutton get jbutton entrar if j button entrar null j button entrar new jbutton j button entrar set text entrar return j button entrar
this method initializes j button entrar
private jbutton get jbutton salir if j button salir null j button salir new jbutton j button salir set text salir return j button salir
this method initializes j button salir
private jtext field get jtext field usuario if j text field usuario null j text field usuario new jtext field return j text field usuario
this method initializes j text field usuario
private jpassword field get jpassword field password if j password field password null j password field password new jpassword field return j password field password
this method initializes j password field password
private jtext pane get jtext pane usuario if j text pane usuario null j text pane usuario new jtext pane j text pane usuario set text usuario return j text pane usuario
this method initializes j text pane usuario
private jtext pane get jtext pane password if j text pane password null j text pane password new jtext pane j text pane password set text contrase a return j text pane password
this method initializes j text pane password
private jbutton get jbutton entrar if j button entrar null j button entrar new jbutton j button entrar set text entrar j button entrar set bounds new rectangle 290 300 80 30 return j button entrar
this method initializes j button entrar
private jbutton get jbutton entrar cliente if j button entrar cliente null j button entrar cliente new jbutton j button entrar cliente set text entrar cliente j button entrar cliente set bounds new rectangle 277 310 j button entrar cliente get text length 9 26 return j button entrar cliente
this method initializes j button entrar cliente
private jbutton get jbutton salir if j button salir null j button salir new jbutton j button salir set text salir j button salir set bounds new rectangle 420 300 80 30 return j button salir
this method initializes j button salir
private jtext field get jtext field usuario if j text field usuario null j text field usuario new jtext field 10 j text field usuario set bounds new rectangle 420 150 100 30 return j text field usuario
this method initializes j text field usuario
private jpassword field get jpassword field password if j password field password null j password field password new jpassword field 10 j password field password set bounds new rectangle 420 200 100 30 return j password field password
this method initializes j password field password
private etiqueta get jtext pane usuario if j text pane usuario null j text pane usuario new etiqueta j text pane usuario set bounds new rectangle 270 150 150 30 j text pane usuario set text usuario return j text pane usuario
this method initializes j text pane usuario
private etiqueta get jtext pane password if j text pane password null j text pane password new etiqueta j text pane password set bounds new rectangle 270 200 150 30 j text pane password set text clave identificaci n return j text pane password
this method initializes j text pane password
public attribute resolver get resolver return resolver
getter for the current security resolver
public boolean is supported int function boolean supported false switch function case secured supported true case auth type supported true break case principal name supported true break case user in role supported true break case user in all roles supported true break default supported false break return supported
indicate the list of supported functions
public boolean is security enabled faces context ctx return false
return a flag indicating if security is currently switched on
public boolean is security enabled faces context ctx return ctx get external context get remote user null
return a flag indicating if security is currently switched on
public string get authentication type faces context ctx return null
return the authorization type null in this abstract
public string get principal name faces context ctx return ctx get external context get remote user
get the remote user from the faces external context
public boolean is user in role faces context ctx list role definitions return false
default impl of the user in roles check hardcoded to false
public string get authentication type faces context ctx return ctx get external context get auth type
return the authorization type
public boolean is user in all roles faces context ctx list role definitions return false
default impl of the user in all roles check hardcoded to false
public vector get item nodes return item nodes
modified by piotr gwizdala
public string get current state name string state name fsm get current state name return state name substring state name last index of 1
returns the current name of the state of bots finite state machine
static public firing instructions get fast firing instructions firing decision fd map bot base bot vector3f to new vector3f fd enemy info get best visible enemy part bot vector3f fire dir comm fun get normalized direction vector bot get bot position to bot dtalk add to log fast firing return new firing instructions fire dir
point the enemy and shoot
protected void bot logic
in this method all the bots logic is implemented
public void console command string cmd this send console command cmd
sends the given command as a console command
public void say string txt this send console command txt
sends given string as in game chat message
private void run bot jobs for job j bot jobs j run
runs bot jobs stored in bot jobs list
public boolean add bot job job j return bot jobs add j
adds job to bots job list
public float get bot health float h get health if h 0 h 100 0f return h
returns bots current health
public float get bot armor float a get armor if a 0 a 0 0f return a
returns bots armor state
public float get ammunition state int gun index int max player gun get max ammo by gun gun index int ammo world get inventory get count gun index if max 1 return 1 assert float ammo max 0 0 assert float ammo max 1 0 return float ammo max
get how much ammo the bot has for given gun
public string get map name if get bsp null say bspparser is not availible return null string map name get bsp get file name map name map name substring map name last index of 1 map name last index of bsp return map name
gets the name of the current server map
public boolean is opponent visible for object o world get opponents true entity e entity o if get bsp is visible get bot position e get object position return true return false
returns true if some opponent is visible
public vector3f get bot position return new vector3f world get player get player move get origin
gets current bots position
public boolean bot has item int i return has item i
checks if the bot has given item
public int get current weapon index return get weapon index
public method that returns the current weapon index the bot uses
public void change weapon to index int i change weapon by inventory index i
public method allowing to change bots weapon
public string get bot name return get player info get name
get bots name
public void handle command string cmd
gives a command to the bot
public void set pause look at position vector3f look at paused look dir comm fun get normalized direction vector get bot position look at
set in which direction the bot should look when paused
private float get prediction error if predicted pos null return float max value return comm fun get distance between positions get object position predicted pos
the error of the prediction
private float get movement distance if last pos null return float max value return comm fun get distance between positions last pos get object position
the movement between last position and current position
private long get info age long current frame return current frame last update frame
calculates the age of the information
public boolean is outdated long current frame return get info age current frame max enemy info age
checks if the information is out of date
public int get kbsize return get all items size
returns the number of entities being stored in kb
public void add to black list entity ent target blacklist add ent if target blacklist size target blacklist max size target blacklist pop return
adds the given entry to black list
private boolean is pickable type entity e if e get category equals ignore case entity cat items e get category equals ignore case entity cat weapons return true return false
checks whether the entity has a pickable type
static public double lim double x double min double max if x min return min if x max return max return x
returns x limited to min
public void perceive output iter 0 set next value 10 constant value if add random input set next value rand d 2 2 random value update input values
prepares input for the brain by invoking set state values method
protected void set next value double input if output null if is unipolar output output iter mat sigmoid uni input else output output iter mat sigmoid bi input output iter
sets the value of the next input
public void count a select action if tact counter 0 double r perception get reward r t 1 double error r gamma qmax qprev update weights error w t propagate count eligibilities a e t g t tact counter qprev q a
one step of the q learning algorithm
private int select action int a 1 qmax 1 propagate for int i 0 i q length i if use boltzmann boltz values i math exp q i temperature if qmax q i a i qmax q a int a max a if use boltzmann a rr pick best index boltz values if a a max string qstr for int i 0 i q length i qstr q i system out println a a a max a max qstr if rand actions 0 rand success with percent rand actions a rand i q length qmax q a return a
selects an action to execute basing on the values of q function
public void randomize for int l 0 l w length l for int i 0 i w l length i for int j 0 j w l i length j w l i j rand weight
randomizes all the weights of neurons connections
private double rand weight rand d max weight max weight return rand d max weight max weight
gives random weight value
private void propagate double weighted sum 0 double wli for int l 0 l w length l for int i 0 i w l length i weighted sum 0 wli w l i for int j 0 j wli length j weighted sum wli j layer input l j if unipolar activation l i mat sigmoid uni weighted sum else activation l i mat sigmoid bi weighted sum
propagates the input signal throughout the network to the output
private void update weights double change for int l w length 1 l 0 l for int i 0 i w l length i for int j 0 j w l i length j w l i j w l i j alpha change e l i j
used to teach the neural network
public void mutate double percent for int l 0 l w length l for int i 0 i w l length i for int j 0 j w l i length j if rand success with percent percent w l i j rand weight
mutates the neural network by given percent
public void reset for int l 0 l w length l for int i 0 i w l length i for int j 0 j w l i length j e l i j 0 g l i 0 tact counter 0
resets the gradients and eligibility traces
public int get action return a
returns the index of the selected action
public int get execution result return execution result
returns the result of action
public void learn count gradients g t update weights w t
one step of the q learning algorithm
private double rand weight return rand d max weight max weight
gives random weight value
public void propagate double weighted sum 0 double wli for int l 0 l w length l for int i 0 i w l length i weighted sum 0 wli w l i for int j 0 j wli length j weighted sum wli j layer input l j if unipolar activation l i mat sigmoid uni weighted sum else activation l i mat sigmoid bi weighted sum
propagates the input signal throughout the network to the output
private void update weights for int l w length 1 l 0 l for int i 0 i w l length i for int j 0 j w l i length j w delta l i j alpha g l i layer input l j momentum w delta l i j w l i j w l i j w delta l i j
used to teach the neural network
public void reset for int l 0 l w length l for int i 0 i w l length i g l i 0
resets the gradients and eligibility traces
public double get max w double ret 0 0 int no 0 for int l 0 l w length l for int i 0 i w l length i for int j 0 j w l i length j ret math abs w l i j no return ret no
returns the maximal absolute value of all the weights
public void write string text date the date new date try string to write the date to string text n file writer fout new file writer file name true buffered writer out new buffered writer fout out write to write out close catch ioexception e system err println error e get message
writes the given text to the log
public string get recent string a int lines array list string recent changes new array list string try file reader fr new file reader artistmetricslog buffered reader br new buffered reader fr a br read line while a null recent changes add a a br read line lines recent changes size int b lines 20 a for int i b i lines i a recent changes get i a n br close catch ioexception e system err println unable to read from file return a
gets the 10 most recent entries to the log file
public void selection changed iaction action iselection selection user selection changed action selection
selection in the workbench has been changed
public void dispose user dispose
we can use this method to dispose of any system
private void stop tracker array list timer timers focus trackers get current timers get timers size 1 update timer
stops the current timer updating it
private void update server user user timer current timer map string string metric data new hash map string string metric data put time current timer get time passed 1000 metric data put pane current user send metric focus metric data
updates the server with the new data
public string last updated timer return last update
returns the last timer updated by this tracker
public void end tracking user user stop tracker end the current timer array list timer timers focus trackers get current find timer to update timer current timer timers get timers size 1 update log current timer update server user current timer
ends any tracking currently being run by the tracker updating the log
public int get graph val return fitness get graph val
method get graph val
public int compare to fitness o if len 2000 return 1 int other val o vals for int i 0 i other val length i vals length i if vals i other val i return 1 else if vals i other val i return 1 if vals length bfgenerator desired length return 1 else if vals length bfgenerator desired length return 1 return o len len
method compare to
public int get graph val int j 0 for int i 0 i vals length i if vals i 0 j i return j return 0
method get graph val
public string to string return get graph val arrays to string vals len
method to string
public phenotype get phenotype return phenotype
method get phenotype
private genotype single cross bfgenotype other int rand1 int math random genes length int rand2 int math random other genes length byte new bytes new byte rand1 other genes length rand2 system arraycopy genes 0 new bytes 0 rand1 system arraycopy other genes rand2 new bytes rand1 new bytes length rand1 return new bfgenotype new bytes change type single cross
method single cross