input
stringlengths
10
828
output
stringlengths
5
107
private void update server information shared preferences preferences preference manager get default shared preferences this m host preferences get string ip server preference default ip m port preferences get int port server default port string format update server information connection to s d log v tag string format format m host m port
update host and port value from preferences
private boolean eyes closed return m eyes state tux consts eyes state close
return true if the eyes are closed false otherwise
private int get battery level string status value get status value battery level if status value null return 0 return integer parse int status value
return the level of the battery
private int get charger string status value get status value charger state if status value null integer previous elements get tux consts charger state name if previous null return tux consts charger charging else return previous if status value equals charging return tux consts charger charging else if status value equals trickle return tux consts charger trickle else return tux consts charger discharging
return the state of the charger
private void toggle left led if m left led state tux consts led state on m left led state tux consts led state off if eyes closed m eye set image resource r drawable lefteyeoff send request leds off leds led left else m left led state tux consts led state on if eyes closed m eye set image resource r drawable lefteyeon send request leds on leds led left intensity 1
toggle the left led state
private int get eyes string status value get status value eyes position if status value null integer previous elements get tux consts eyes state name if previous null return tux consts eyes state close else return previous return status value equals close tux consts eyes state close tux consts eyes state open
return the position of the eyes
private int get flippers string status value get status value flippers position if status value null integer previous elements get tux consts flippers state name if previous null return tux consts flippers state down else return previous return status value equals down tux consts flippers state down tux consts flippers state up
return the position of the flippers
private int get led string side string status value get status value side led state if status value null return 1 return status value equals off tux consts led state off tux consts led state on
return the state of the led
private void toggle right led if m right led state tux consts led state on m right led state tux consts led state off if eyes closed m eye set image resource r drawable righteyeoff send request leds off leds led right else m right led state tux consts led state on if eyes closed m eye set image resource r drawable righteyeon send request leds on leds led right intensity 1
toggle the right led state
private int get left led int status get led left if status 0 integer previous elements get tux consts left led state name if previous null return tux consts led state off else return previous return status
return the status of the left led
private int get mouth string status value get status value mouth position if status value null integer previous elements get tux consts mouth state name if previous null return tux consts mouth state open else return previous return status value equals open tux consts mouth state open tux consts mouth state close
return the position of the mouth
private int get right led int status get led right if status 0 integer previous elements get tux consts right led state name if previous null return tux consts led state off else return previous return status
return the state of the right led
private int get spin direction string status value get status value spinning direction if status value null integer previous elements get tux consts spinning name if previous null return tux consts spin none else return previous if status value equals right return tux consts spin right else if status value equals left return tux consts spin left return tux consts spin none
return the direction of the spinning
private string get status value string status document document send request 0 status request one status name status true if document null return null node root document get first child node data root get first child node value data get last child for int i 0 i value get child nodes get length i node item value get child nodes item i if item get node type node text node return item get node value return null
return the value of a status
private void notify modification hash map integer integer list message msg m handler obtain message bundle b new bundle for integer element list key set int value list get element elements put element value string name get name element b put int name value msg set data b m handler send message msg
notify the main thread of modification
private void display layout int layout id boolean display view view find view by id layout id if display view set visibility linear layout visible else view set visibility linear layout gone
display or not the given layout
private void refresh battery level int battery level to have between 0 and 1700 progress bar level progress bar find view by id r id battery level battery level 4800 log i tag current battery level battery level level set progress battery level todo better view for example text view text view text view find view by id r id battery field text view set text battery level
update the level of the battery
private void send tts string locutor string message string command 0 tts speak text s locutor s pitch 100 send request string format command message replace 20 locutor
send the given message with the given locutor
private void start tux status m status new tux status m body handler m host m port m status start
start the tux status
private void stop tux status if m status null m status close
stop the tux status
private void update body update flippers update mouth update leds update eyes update bottom
update the view of the tux
private void update bottom update bottom m charger state m spinning direction
update the bottom of the tux
private void update eyes update eyes m eyes state
update the view of the eyes of the tux
private void update eyes int eyes m eyes state eyes if eyes tux consts eyes state close image view find view by id r id right eye set image resource r drawable righteyeclosed image view find view by id r id left eye set image resource r drawable lefteyeclosed else update leds
update the view of the eyes with the given position
private void update flippers update flippers m flippers state
update the view of the flippers of the tux
private void update flippers int value m flippers state value if value tux consts flippers state down image view find view by id r id body set image resource r drawable flippersdown else image view find view by id r id body set image resource r drawable flippersup
update the view of the flippers with the given value
private void update leds update right led m right led state update left led m left led state
update the view of the leds of the tux
private void update left led int value m left led state value if value tux consts led state off image view find view by id r id left eye set image resource r drawable lefteyeoff else image view find view by id r id left eye set image resource r drawable lefteyeon
update the view of the left led
private void update mouth update mouth m mouth state
update the view of the mouth of the tux
private void update mouth int value m mouth state value if value tux consts mouth state open image view find view by id r id mouth set image resource r drawable mouthopened linear layout tts layout linear layout find view by id r id tts tts layout set visibility linear layout visible else image view find view by id r id mouth set image resource r drawable mouthclosed linear layout tts layout linear layout find view by id r id tts tts layout set visibility linear layout gone
update the view of the mouth with the given position
private void update right led int value m right led state value if value tux consts led state off image view find view by id r id right eye set image resource r drawable righteyeoff else image view find view by id r id right eye set image resource r drawable righteyeon
update the right led with the given state
private void update ttsinformation shared preferences preferences preference manager get default shared preferences this m locutor preferences get string locutor tts preference default locutor m clean message preferences get boolean clean tts preference default clean message
update information about tts
protected void save message string locutor string message content values values new content values values put message list messages locutor locutor values put message list messages message message log v tag insert into content provider get content resolver insert message list messages content uri values
save the message
protected void send request string request send request request false
send a request to the server without any result
public void reset for spot spot get all spots if spot instanceof empty spot spot reset
resets all spots to be off
public start rtp relay create start rtp relay return new start rtp relay
create an instance of
public string get callid return callid
gets the value of the callid property
public void set callid string value this callid value
sets the value of the callid property
public stopt rtp relay response create stopt rtp relay response return new stopt rtp relay response
create an instance of
public no port available exception create no port available exception return new no port available exception
create an instance of
public boolean is result return result
gets the value of the result property
public void set result string value this result value
sets the value of the result property
public transform sdp response create transform sdp response return new transform sdp response
create an instance of
public void set result boolean value this result value
sets the value of the result property
public string get sdp return sdp
gets the value of the sdp property
public stopt rtp relay create stopt rtp relay return new stopt rtp relay
create an instance of
public void set sdp string value this sdp value
sets the value of the sdp property
public transform sdp create transform sdp return new transform sdp
create an instance of
public string get msbc session id return msbc session id
gets the value of the msbc session id property
public void set msbc session id string value this msbc session id value
sets the value of the msbc session id property
public start rtp relay response create start rtp relay response return new start rtp relay response
create an instance of
private call state get call state sip servlet message message object obj message get application session get attribute call state call state if obj null return call state obj else return new initial call state message get application session this sf
get the call state for this message
public void timeout servlet timer timer this logger debug timer fires retrieve data for this timer sip application session app session timer get application session b2 bcontrol control b2 bcontrol app session get attribute call state b2 b control notify b2b agent timer info timer info timer info timer get info this logger debug timer name timer info get timer name check if repeat timer if timer info is repeat app session remove attribute timer info get timer name this b2b agent notify timer hits control timer info get info timer info get timer name this logger debug end timer
indicates that a timer hits
protected sip state get state sip servlet message message object obj message get session get attribute sip state state if obj null return sip state obj else not found create new initial state sip factory sf sip factory this app session get attribute call state sip factory return new initial state sf
retrieve the state for a sip message
protected sip state get other state sip servlet message message throws illegal state exception object obj message get session get attribute call state other leg session if obj null return sip state sip session obj get attribute sip state state else throw new illegal state exception
get the other leg state for a sip message
private boolean is authorized call string caller string callee return this is rule forbiden caller callee
check if the call between the caller and the callee is authorized
public boolean is auth required sip servlet request request list string hosts for string host hosts if request get remote addr equals host return false if request get method equals register request get method equals invite return true else return false
check if authentication is required for this request
public challenge bean get challenge string call id throws challenge not found exception unknow dbexception return dbfactory get auth module get challenge call id
return the stored challenge bean of a dialog
public challenge bean create challenge string call id int expires throws unknow dbexception challenge bean challenge new challenge bean challenge set nonce this generate nonce challenge set opaque this generate opaque challenge set scheme digest challenge set algorythm md5 challenge set qop auth challenge set nc 00000001 challenge set stale false dbfactory get auth module register challenge call id challenge expires return challenge
create a challenge for a dialog and store it
public void add challenge to response sip servlet response rep challenge bean challenge user credential credential string auth header www authenticate string auth value challenge get scheme realm credential get realm qop challenge get qop nonce challenge get nonce opaque challenge get opaque stale challenge get stale algorithm challenge get algorythm nc challenge get nc logger debug generated challenge auth value rep add header auth header auth value
create the response header and populate it with the challenge and user parameter
private boolean has enought credit string user sip uri return true
verify if the user has enougth credit to make a call
public string generate nonce date date new date long time date get time random rand new random long pad rand next long string nonce string new long time to string new long pad to string return this crypt nonce string
generate a random nonce in order to be use in a challenge
private boolean is rule forbiden string caller string callee return false
check if there is an administrators rule against this call
public string generate opaque date date new date long time date get time random rand new random long pad rand next long string opaque string new long time to string new long pad to string return this crypt opaque string
generate opaque parameter in order to be used in a challenge
public string crypt string key try byte hash message digest get instance md5 digest key get bytes return to hex string hash catch no such algorithm exception e throw new error erreur
hash the key with md5
public long get studio file type return studio file type
returns the studio file type
public long get contest general info id return contest general info id
returns the contest general info id
public void set studio file type long studio file type this studio file type studio file type
updates the studio file type with the specified value
public void set contest general info id long contest general info id this contest general info id contest general info id
updates the contest general info id with the specified value
public void set mime types set mime type mime types this mime types mime types
updates the mime types with the specified value
public integer get sort return sort
returns the sort
public void set sort integer sort this sort sort
updates the sort with the specified value
public boolean is image file return image file
returns the image file
public string get target audience return target audience
returns the target audience
public void set id identifier id this id id
set the identifier
public void set image file boolean image file this image file image file
updates the image file with the specified value
public void set target audience string target audience this target audience target audience
updates the target audience with the specified value
public string get branding guidelines return branding guidelines
returns the branding guidelines
public void set branding guidelines string branding guidelines this branding guidelines branding guidelines
updates the branding guidelines with the specified value
public string get disliked sesigns websites return disliked sesigns websites
returns the disliked sesigns websites
public void set disliked sesigns websites string disliked sesigns websites this disliked sesigns websites disliked sesigns websites
updates the disliked sesigns websites with the specified value
public string get other instructions return other instructions
returns the other instructions
public void set other instructions string other instructions this other instructions other instructions
updates the other instructions with the specified value
public string get winning criteria return winning criteria
returns the winning criteria
public contest type get contest type return contest type
returns the contest type
public long get resource id return resource id
returns the resource id
public void set winning criteria string winning criteria this winning criteria winning criteria
updates the winning criteria with the specified value
public void set resource id long resource id this resource id resource id
updates the resource id with the specified value
public void set contest type contest type contest type this contest type contest type
updates the contest type with the specified value
public contest property get property return property
returns the property
public void set property contest property property this property property
updates the property with the specified value
public long get contest status id return contest status id
returns the contest status id
public void set contest status id long contest status id this contest status id contest status id
updates the contest status id with the specified value
public long get status id return status id
returns the status id
public void set status id long status id this status id status id
updates the status id with the specified value
public contest get contest return contest
returns the contest
public long get contest id return contest id
returns the contest id
public void set contest contest contest this contest contest
updates the contest with the specified value
public void set statuses list contest status statuses this statuses statuses
updates the statuses with the specified value
public void set user id long user id this user id user id
updates the user id with the specified value