query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
This method was generated by Abator for iBATIS. This method sets the value of the database column HBDW1.EP_TASK_STEP.DEVICE_TYPE | public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDeviceType(com.sforce.soap._2006._04.metadata.DeviceType deviceType) {\r\n this.deviceType = deviceType;\r\n }",
"public String getDevice_type() {\r\n\t\treturn device_type;\r\n\t}",
"public String getDeviceType() {\n return deviceType;\n }",
"public com.sforce.soap._2006._... | [
"0.6781715",
"0.5867084",
"0.5832732",
"0.5700322",
"0.5578186",
"0.5485166",
"0.5440626",
"0.52843004",
"0.52653015",
"0.52270275",
"0.5137665",
"0.5137505",
"0.4896131",
"0.4888178",
"0.48817226",
"0.4876523",
"0.48743343",
"0.48690724",
"0.48476106",
"0.48460874",
"0.48381... | 0.6530357 | 1 |
The handleMessage method takes in the message and processes the command based on what has been typed after the "/". This method first checks whether it is day or night as if it is night there is only one command accepted. | @Override
public void handleMessage(Message message, int origin) {
String text = message.messageText;
String remText = "";
String command = "";
if (text.indexOf(' ') < 0) {
remText = "";
command = message.messageText;
} else {
command = message.messageText.substring(0, text.indexOf(' '));
remText = text.substring(text.indexOf(' ') + 1);
}
if (!gameInProgress) {
if (command.equals("/ready")) { // no trailing text after /ready
if (!remText.isEmpty()) {
server.privateMessage("The command \"/ready\" cannnot have characters after it", origin);
} else {
ready(origin);
}
} else if (command.equals("/unready")) {
if (!remText.isEmpty()) {
server.privateMessage("The command \"/unready\" cannnot have characters after it", origin);
} else {
unready(origin);
}
} else if (command.equals("/start")) {// no trailing text after
// /start
if (!remText.isEmpty()) {
server.privateMessage("The command \"/start\" cannnot have characters after it", origin);
} else {
voteStart(origin);
}
} else {
server.privateMessage(message.messageText + " does not contain a valid command", origin);
}
} else {
if (day == true) {
if (command.equals("/elim")) { // space between /elim and player
// name, no trailing text after
// player name
if (remText.isEmpty() || remText.contains(" ")) {
server.privateMessage(
"The command \"/elim\" needs to be followed by a player's name with no spaces/characters thereafter",
origin);
} else {
elimDayVote(remText, origin);
}
} else if (command.equals("/save")) {
if (remText.isEmpty() || remText.contains(" ")) {
server.privateMessage(
"The command \"/save\" needs to be followed by a player's name with no spaces/characters thereafter",
origin);
} else {
saveVote(remText, origin);
}
} else if (command.equals("/night")) {
if (!remText.isEmpty()) {
server.privateMessage("The command \"/night\" cannnot have characters after it", origin);
} else {
voteNight(origin);
}
} else if (command.equals("/day")) {
if (!remText.isEmpty()) {
server.privateMessage("The command \"/day\" cannnot have characters after it", origin);
} else {
voteDay(origin);
}
} else {
server.privateMessage(message.messageText + " does not contain a valid command", origin);
}
} else {
if (command.equals("/elim")) {
if (remText.isEmpty() || remText.contains(" ")) {
server.privateMessage(
"The command \"/elim\" needs to be followed by a player's name with no spaces/characters thereafter",
origin);
} else {
elimNightVote(remText, origin);
}
} else {
server.privateMessage(
"The only valid command during the night is \"/elim\" followed a player's name (separated by a space)",
origin);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void handleMessage(String message){\n\t\tString[] parts = message.split(\" \");\n\t\tboolean prevFor = false;\n//\t\tSystem.out.println(\"parts0 = \" + parts[0]);\n\t\tswitch(parts[0]){\n\t\t\tcase \"#quit\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#quit\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\... | [
"0.68317443",
"0.65230453",
"0.63762015",
"0.630106",
"0.6221496",
"0.6145196",
"0.6144832",
"0.6138207",
"0.61065996",
"0.60295665",
"0.59825635",
"0.5973086",
"0.59350836",
"0.589208",
"0.5847148",
"0.5842904",
"0.5824263",
"0.58139557",
"0.58028424",
"0.57702184",
"0.57539... | 0.7616591 | 0 |
TODO: implement muting players that are not in the game | private void gameStart() {
ready.clear();
players = new TreeBidiMap<>();
mafia = new ArrayList<>();
innocentIDs = new ArrayList<>();
for (int i = 0; i < votedStart.size(); i++) {
int id = votedStart.get(i);
// playerIDs.add(id);
players.put(id, server.getUsername(id));
}
int numMafia = (int) Math.round((double) votedStart.size() / 3);
mafiaAtStart = new String[numMafia];
for (int j = 0; j < numMafia; j++) {
// int index = mafiaPicker.nextInt(votedStart.size());
int index = ThreadLocalRandom.current().nextInt(votedStart.size());
int id = votedStart.get(index);
mafia.add(id);
mafiaAtStart[j] = server.getUsername(id);
votedStart.remove(index);
}
for (int k = 0; k < votedStart.size(); k++) {
int id = votedStart.get(k);
innocentIDs.add(id);
}
votedStart.clear();
int[] innocentIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();
server.privateMessage("you are an innocent", innocentIDArray);
int[] mafiaIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();
String[] mafiaNameArray = new String[mafiaIDArray.length];
for (int l = 0; l < mafiaIDArray.length; l++) {
mafiaNameArray[l] = server.getUsername(mafiaIDArray[l]);
}
// currently uses the default toSting method for array. Also i think it
// will display the id numbers rather than the players names - need to
// convert if so would be good to only show only the other mafia members
// rather than including the players own name in the list
server.privateMessage("you are one of the mafia, the mafia members (including " + "you) are " + mafiaIDArray,
mafiaIDArray);
day = true;
gameInProgress = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Player updatePlayer(Player player);",
"void updatePlayer(Player player);",
"public static void overridePlayers(Player... players)\n {\n getBackgammonTournamentData().setPlayers(players);\n\n storeTournamentData();\n }",
"protected void updatePlayer(Player player, PacketBuilder pack... | [
"0.7006622",
"0.69356364",
"0.67229474",
"0.6670169",
"0.66506803",
"0.6644181",
"0.6638765",
"0.658141",
"0.65694034",
"0.65651256",
"0.65308076",
"0.65084594",
"0.6502714",
"0.6492385",
"0.64894706",
"0.6488754",
"0.6461402",
"0.6443889",
"0.6440921",
"0.6412721",
"0.641181... | 0.0 | -1 |
The elimDay method either starts the vote to eliminate a player during the day or adds subsequent votes to the total number of votes for the player on trial. It also takes the origin of the message and checks whether the player it corresponds to has already voted to eliminate said player (in which case doesn't add their vote) and checks if they have already voted to save said payer (in which case it removes their vote from the save vote and adds their vote to the eliminate vote). | private void elimDayVote(String player, int origin) {
// int playerID = server.getUserID(player);
if (players.containsValue(player)) {
OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();
int playerID = invPlayers.get(player);
// if (nightVote.size() > 0) {
if (nightVoteInProgress) {
server.privateMessage(
"cannot vote to eliminate a player while there is a vote to change the game to night", origin);
// } else if (!playerIDs.contains(playerID)) { // this is for
// when
// using ArrayList of playerIDs
} else if (playerID == origin) {
server.privateMessage("you cannot vote for yourself", origin);
} else if (elimDay.contains(origin)) {
server.privateMessage("you have already voted to start", origin);
} else if (!players.containsKey(origin)) {
server.privateMessage("you are not in the game, so cannot participate", origin);
} else if (playerOnTrialID == null) {
elimDayVoteInProgress = true;
playerOnTrialID = playerID;
elimDay.add(origin);
TimerTask dayElimVoteTimeout = new TimerTask() { // not sure if
// this
// will work
// properly
// (method
// should
// continue
// without
// waiting for
// it
// to finish
@Override
public void run() {
dayElimVoteTimeout(); // this might need a catch
}
};
dayElimTimer = new Timer();
dayElimTimer.schedule(dayElimVoteTimeout, 20000);
} else {
if (playerOnTrialID != playerID) {
server.privateMessage("cannot vote for " + player + " while the vote for "
+ server.getUsername(playerOnTrialID) + " is in progress", origin);
} else {
if (save.contains(origin)) {
int index = save.indexOf(origin);
save.remove(index);
}
elimDay.add(origin);
checkElim(origin);
}
}
} else if (!players.containsValue(player)) {
server.privateMessage(player + " is not in this game/has already been eliminated", origin);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void checkElim(int origin) {\r\n\r\n\t// if (elimDay.size() > playerIDs.size() / 2) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted to eliminate \" + server.getUsername(playerOnTrialID));\r\n\r\n\tif (elimDay.size() > players.size() / 2) {\r\n\t eliminateDay();\r\n\t}\r\n\r\n }",
"pr... | [
"0.7121534",
"0.69938684",
"0.6870113",
"0.66820484",
"0.6518131",
"0.6412242",
"0.57271445",
"0.5095296",
"0.5051986",
"0.48272043",
"0.48155713",
"0.47280902",
"0.4709248",
"0.46927255",
"0.46689442",
"0.4658115",
"0.45813325",
"0.45591506",
"0.45417717",
"0.4526072",
"0.44... | 0.80566037 | 0 |
not sure if this will work properly (method should continue without waiting for it to finish | @Override
public void run() {
dayElimVoteTimeout(); // this might need a catch
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean waitToProceed() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return true;\n }",
"@Override\n protected boolean isFinished() \n {\n return false;\n }",
"@Override\r\n\tpublic void done() {\n\t\t\r\n\t}",
"protected abstr... | [
"0.6772597",
"0.6393295",
"0.63385785",
"0.6313639",
"0.63075316",
"0.63059855",
"0.6280099",
"0.62652403",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
... | 0.0 | -1 |
The checkElim method checks to see if there are enough votes to eliminate the suscipiousPlayer. If the number of elim votes has passed half the number of players left, then the suscipiousPlayer is eliminated. If this is not the case then the method sends a public message stating who has voted for the suscipiousPlayer. | private void checkElim(int origin) {
// if (elimDay.size() > playerIDs.size() / 2) {
server.publicMessage(players.get(origin) + " has voted to eliminate " + server.getUsername(playerOnTrialID));
if (elimDay.size() > players.size() / 2) {
eliminateDay();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size... | [
"0.5849808",
"0.5523759",
"0.5413133",
"0.5231059",
"0.5191919",
"0.5114452",
"0.5107237",
"0.5062321",
"0.49287063",
"0.49201384",
"0.49056268",
"0.48958045",
"0.48666972",
"0.48613563",
"0.4842172",
"0.48126578",
"0.478948",
"0.47637585",
"0.4736943",
"0.47301537",
"0.47237... | 0.72950363 | 0 |
The eliminate method removes the player whose username matches the suscipiousPlayer field variable from the game. This involves clearing the elim and save voting lists, removing the player from the list of active players,removing them from the list of innocent/mafia and muting the player in chat. | private void eliminateDay() {
dayElimTimer.cancel();
dayElimTimer.purge();
// playerIDs.remove(playerOnTrialID);
players.remove(playerOnTrialID);
if (mafia.contains(playerOnTrialID)) {
int index = mafia.indexOf(playerOnTrialID);
mafia.remove(index);
} else {
int index = innocentIDs.indexOf(playerOnTrialID);
innocentIDs.remove(index);
}
server.setPlayerMuted(playerOnTrialID, true);
server.publicMessage(server.getUsername(playerOnTrialID) + " has been eliminated");
playerOnTrialID = null;
elimDay.clear();
save.clear();
elimDayVoteInProgress = false;
checkWin();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void eliminatePlayer(Player loser){\n players.remove(loser);\n }",
"private void eliminatePlayers() {\n \n Iterator<Player> iter = players.iterator();\n\n while (iter.hasNext()) {\n Player player = iter.next();\n\n if (player.getList().isEmpty()) {\n it... | [
"0.6946225",
"0.6898461",
"0.67437947",
"0.6733237",
"0.6607885",
"0.6412194",
"0.63793993",
"0.63731354",
"0.6329799",
"0.6323359",
"0.63175696",
"0.6309831",
"0.62518144",
"0.6249274",
"0.61808366",
"0.61713904",
"0.6158307",
"0.6137078",
"0.61324763",
"0.613195",
"0.611237... | 0.65242606 | 5 |
The save method is used to vote against eliminating the current player on trial. The method takes the origin of the message and checks whether the player it corresponds to has already voted (in which case doesn't add their vote) and checks if they had previously voted to eliminate said player (in which case it removes their vote to eliminate the player and adds their vote to save the player). | private void saveVote(String player, int origin) {// suspicious player do
// need
// to vote for themselves
if (players.containsValue(player)) {
OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();
// int playerID = server.getUserID(player);
int playerID = invPlayers.get(player);
if (playerOnTrialID == null) {
server.privateMessage("you cannot vote to save someone when there is no-one on trial", origin);
// } else if (!playerIDs.contains(playerID)) {
} else {
if (playerOnTrialID != playerID) {
server.privateMessage("cannot vote for " + player + " while the vote for "
+ server.getUsername(playerOnTrialID) + " is in progress", origin);
} else if (!players.containsKey(origin)) {
server.privateMessage("you are not in the game, so cannot participate", origin);
} else {
if (elimDay.contains(origin)) {
int index = elimDay.indexOf(origin);
elimDay.remove(index);
}
save.add(origin);
checkSave(origin);
}
}
} else if (!players.containsValue(player)) {
server.privateMessage(player + " is not in this game/has already been eliminated", origin);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size... | [
"0.57768923",
"0.5517959",
"0.55023736",
"0.5431684",
"0.5266996",
"0.5247911",
"0.5187668",
"0.5141809",
"0.5133842",
"0.5132507",
"0.51284164",
"0.51078767",
"0.5105188",
"0.509159",
"0.5044511",
"0.50381064",
"0.50144523",
"0.50117123",
"0.49788782",
"0.49732694",
"0.49700... | 0.7939487 | 0 |
The voteNight method either starts the vote to change the game to night or adds subsequent votes to the total number of night votes. It also takes the origin of the message and checks whether the player it corresponds to has already voted to change to night (in which case doesn't add their vote) and checks if they have already voted for day (in which case it removes their vote from night and adds their vote to night). | private void voteNight(int origin) {
// if (playerOnTrialID != null) {
if (elimDayVoteInProgress) {
server.privateMessage("you cannot start a vote for it to be night when there is a vote in progress "
+ "to eliminate a player", origin);
} else if (nightVote.contains(origin)) {
server.privateMessage("you have already voted to change the game to night", origin);
} else if (!players.containsKey(origin)) {
server.privateMessage("you are not in the game, so cannot participate", origin);
} else {
nightVoteInProgress = true;
if (dayVote.contains(origin)) {
int index = dayVote.indexOf(origin);
dayVote.remove(index);
}
nightVote.add(origin);
if (nightVote.size() == 1) {
TimerTask nightVoteTimeout = new TimerTask() {
@Override
public void run() {
nightVoteTimeout(); // this might need a catch
}
};
nightVoteTimer = new Timer();
nightVoteTimer.schedule(nightVoteTimeout, 20000);
} else {
checkNight(origin);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void voteDay(int origin) {\r\n\tif (!nightVoteInProgress) {\r\n\t server.privateMessage(\"cannot use this command when there isn't a vote to change to night\", origin);\r\n\r\n\t} else if (dayVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to keep the game in the day pha... | [
"0.71044135",
"0.7103168",
"0.63611203",
"0.5590847",
"0.5243205",
"0.5177686",
"0.4953025",
"0.4795664",
"0.47905076",
"0.47620767",
"0.47497547",
"0.4733068",
"0.47033054",
"0.46626353",
"0.46589062",
"0.465473",
"0.46534377",
"0.46030506",
"0.4570109",
"0.4565553",
"0.4530... | 0.7912831 | 0 |
The voteDay method is used to vote against the vote to change the game to night. The method takes the origin of the message and checks whether the player it corresponds to has already voted to keep it day (in which case doesn't add their vote) and checks if they have already voted for night (in which case it removes their vote from night and adds their vote to day). | private void voteDay(int origin) {
if (!nightVoteInProgress) {
server.privateMessage("cannot use this command when there isn't a vote to change to night", origin);
} else if (dayVote.contains(origin)) {
server.privateMessage("you have already voted to keep the game in the day phase", origin);
} else if (!players.containsKey(origin)) {
server.privateMessage("you are not in the game, so cannot participate", origin);
} else {
if (nightVote.contains(origin)) {
int index = nightVote.indexOf(origin);
nightVote.remove(index);
}
dayVote.add(origin);
checkDay(origin);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size... | [
"0.7019773",
"0.6958009",
"0.681003",
"0.5887646",
"0.5523012",
"0.5181774",
"0.51642555",
"0.50088614",
"0.50052357",
"0.50052357",
"0.50052357",
"0.50052357",
"0.50052357",
"0.49652782",
"0.49550644",
"0.4899019",
"0.4882739",
"0.4882739",
"0.4880311",
"0.4844544",
"0.48262... | 0.7927731 | 0 |
The checkDay method checks if the votes for to keep the game as day, are in the majority. If so then the vote for night is unsuccessful and the votes cleared. | private void checkDay(int origin) {
server.publicMessage(players.get(origin) + " has voted for it to remain day");
// if (dayVote.size() > playerIDs.size() / 2) {
if (dayVote.size() > players.size() / 2) {
day();
} else if (dayVote.size() == players.size() / 2 && players.size() % 2 == 0) {
day();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void voteDay(int origin) {\r\n\tif (!nightVoteInProgress) {\r\n\t server.privateMessage(\"cannot use this command when there isn't a vote to change to night\", origin);\r\n\r\n\t} else if (dayVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to keep the game in the day pha... | [
"0.61771977",
"0.60001826",
"0.57496643",
"0.5747044",
"0.57036054",
"0.5645454",
"0.5561454",
"0.5510661",
"0.54561394",
"0.5361419",
"0.53197074",
"0.52677524",
"0.5191157",
"0.5191157",
"0.50555426",
"0.5043042",
"0.5042498",
"0.5015262",
"0.50122875",
"0.5001154",
"0.4992... | 0.6776941 | 0 |
The checkNight method checks if the votes to change the game to night, are in the majority. If so then the vote for night is successful, the votes cleared, game changed to night and chat set to inactive. | private void checkNight(int origin) {
server.publicMessage(players.get(origin) + " has voted for it to remain night");
// if (nightVote.size() > playerIDs.size() / 2) {
if (nightVote.size() > players.size() / 2) {
night();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void voteNight(int origin) {\r\n\t// if (playerOnTrialID != null) {\r\n\tif (elimDayVoteInProgress) {\r\n\t server.privateMessage(\"you cannot start a vote for it to be night when there is a vote in progress \"\r\n\t\t + \"to eliminate a player\", origin);\r\n\r\n\t} else if (nightVote.contains(origi... | [
"0.66301686",
"0.60020095",
"0.5762093",
"0.552674",
"0.55111057",
"0.54680586",
"0.53649426",
"0.53543234",
"0.5300513",
"0.5248809",
"0.5220297",
"0.5194092",
"0.5154995",
"0.5092643",
"0.50770336",
"0.5066728",
"0.5053439",
"0.50309116",
"0.50173116",
"0.50157595",
"0.5014... | 0.68852437 | 0 |
could make public to force the game to end | private void gameEnd() {
server.publicMessage("The mafia were: " + mafiaAtStart);
gameInProgress = false;
players.clear();
mafia.clear();
innocentIDs.clear();
server.unMuteAllPlayers();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void endGame() {\n\t\tsuper.endGame();\n\t}",
"@Override\n\tpublic void OnGameEnd() {\n\t\tsuper.OnGameEnd();\n\t}",
"public void finishGame(){\r\n\t\t\t\tgameStarted = false;\r\n\t\t\t}",
"@Override\n public void endGame(){\n gameOver = true;\n }",
"@Override\n\tpublic voi... | [
"0.8058109",
"0.7837002",
"0.77753985",
"0.7680899",
"0.7669035",
"0.7662278",
"0.762069",
"0.7509928",
"0.7496087",
"0.74651295",
"0.74608326",
"0.7458559",
"0.7452097",
"0.7423565",
"0.7419669",
"0.74071306",
"0.7396095",
"0.7388357",
"0.7377519",
"0.73553926",
"0.733097",
... | 0.69180346 | 67 |
Method used to convert Strings to BitStrings, in order to allow the instructions to be entered more easily above. | private static BitString convertToBitString(final String theBits) {
return BitString.fromBits(32, theBits.toCharArray());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static BitSet BitStringToBitSet(String s) {\n BitSet result = new BitSet();\n for (int i = 0; i < s.length(); i++) {\n if (s.charAt(i) == '1') {\n result.set(i);\n }\n }\n return result;\n }",
"public static Bits fromBinaryString(String b... | [
"0.66984737",
"0.6483191",
"0.64235395",
"0.621255",
"0.62057835",
"0.6183111",
"0.6182281",
"0.6136546",
"0.6106903",
"0.5990568",
"0.58885336",
"0.5883836",
"0.5881793",
"0.587821",
"0.5874716",
"0.58272755",
"0.5818065",
"0.5807603",
"0.57982963",
"0.5739919",
"0.5638422",... | 0.7399548 | 0 |
Entry point into the program. | public static void main(String... strings) {
final MipsComputer comp = new MipsComputer();
File f = new File(filePath);
if (f.exists() && !f.isDirectory()) {
comp.setFromMars(true);
readInstructionsFromFile(f, comp);
} else {
comp.setFromMars(false);
readInstructionsFromArray(comp);
}
comp.execute();
comp.print();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main() {\n \n }",
"public static void main()\n\t{\n\t}",
"public static void main(){\n\t}",
"public static void main() {\n }",
"public static void main(String[] args){\n\n MyApp myApp = new MyApp(); //1\n myApp.runMyApp(); //2\n System.out.println(\"End ... | [
"0.7761774",
"0.76646066",
"0.7555626",
"0.75300765",
"0.7324681",
"0.7312442",
"0.7277643",
"0.7264781",
"0.7225461",
"0.7205256",
"0.7191637",
"0.71787584",
"0.7168591",
"0.71482104",
"0.71448934",
"0.7136887",
"0.7136887",
"0.7124166",
"0.7119622",
"0.71029055",
"0.7089281... | 0.0 | -1 |
Method used to load computer with instructions that are found in the given file. | public static void readInstructionsFromFile(final File file, final MipsComputer comp) {
System.out.println("Loading instructions from file...");
final Scanner s;
try {
s = new Scanner(file);
while(s.hasNextLine()){
comp.loadInstruction(convertToBitString(s.nextLine().replaceAll("\\s", "")));
}
} catch (final IOException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Interpreter(String fileName) throws FileNotFoundException {\n super(fileName);\n instructionsStack.push(new ArrayList<>());\n }",
"public void readInstFromFile(int exeCycle, String fileName){\n\t\ttry (FileReader fp = new FileReader(fileName)) {\n\t\t\tBufferedReader lineReader = new Buff... | [
"0.6053166",
"0.5876184",
"0.5832916",
"0.58204174",
"0.5806581",
"0.5768463",
"0.5764265",
"0.575017",
"0.5744006",
"0.56932044",
"0.5630625",
"0.562786",
"0.56245446",
"0.55780804",
"0.5552043",
"0.55520225",
"0.5534264",
"0.5528546",
"0.5527045",
"0.548107",
"0.54731864",
... | 0.68011373 | 0 |
Method used to load computer with instructions that are found in the static array found above. | public static void readInstructionsFromArray(final MipsComputer comp) {
System.out.println("Loading instructions from array...");
for (int i = 0; i < INSTRUCTIONS.length; i++) {
comp.loadInstruction(convertToBitString(INSTRUCTIONS[i].replaceAll("\\s", "")));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void loadInstructions(byte... codes) {\r\n\t\tint instructionLocation = instructionBase;\r\n\t\tfor (int i = -128; i < 128; i++) {\r\n\t\t\tfor (byte code : codes) {\r\n\t\t\t\tcpuBuss.write(instructionLocation++, code);\r\n\t\t\t} // for codes\r\n\t\t\tcpuBuss.write(instructionLocation++, (byte) i);\r\n\t... | [
"0.6006972",
"0.58888984",
"0.57816994",
"0.5749469",
"0.57266605",
"0.56051636",
"0.5576413",
"0.5320868",
"0.5310349",
"0.5308396",
"0.5301354",
"0.5297015",
"0.52719927",
"0.5266544",
"0.5241954",
"0.51618874",
"0.51054347",
"0.50802004",
"0.5078704",
"0.5075079",
"0.50579... | 0.59227586 | 1 |
/////////////////////////////////////////////////// ///////////////// Accessors /////////////////////// /////////////////////////////////////////////////// | public Long getId() {
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\n void init() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n public void init() {\n }",
"@Overri... | [
"0.644737",
"0.6362254",
"0.6319382",
"0.62872803",
"0.625894",
"0.6236339",
"0.6227045",
"0.6220644",
"0.621739",
"0.62006336",
"0.62006336",
"0.62006336",
"0.62006336",
"0.62006336",
"0.62006336",
"0.6197319",
"0.616872",
"0.6162864",
"0.6119834",
"0.61016506",
"0.61007375"... | 0.0 | -1 |
/////////////////////////////////////////////////// ///////////// API Implementation/////////////////// /////////////////////////////////////////////////// | @Override
public String getCommandName() {
return s_name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"private stendhal() {\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n... | [
"0.6435311",
"0.64057505",
"0.6368641",
"0.6303162",
"0.6243861",
"0.62225485",
"0.6085387",
"0.6036507",
"0.6036507",
"0.60160315",
"0.5996769",
"0.59933645",
"0.59924936",
"0.5991928",
"0.5991928",
"0.5991928",
"0.5991928",
"0.5991928",
"0.5991928",
"0.5974011",
"0.5972177"... | 0.0 | -1 |
Creates the underlying database table. | public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
String constraint = ifNotExists ? "IF NOT EXISTS " : "";
db.execSQL("CREATE TABLE " + constraint + "'District' (" + //
"'districtID' INTEGER PRIMARY KEY NOT NULL ," + // 0: districtID
"'districtName' TEXT," + // 1: districtName
"'cityID' INTEGER NOT NULL );"); // 2: cityID
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"TABLE createTABLE();",
"public void create(Connection db) throws SQLException {\n if (tableName == null) {\n throw new SQLException(\"Table Name not specified\");\n }\n\n Statement st = db.createStatement();\n\n if (dbType == DatabaseUtils.POSTGRESQL) {\n if (hasSequence()) {\n st.ex... | [
"0.79101866",
"0.7793976",
"0.743263",
"0.7322325",
"0.7319247",
"0.7311423",
"0.72925323",
"0.7260437",
"0.7250569",
"0.71505904",
"0.7139253",
"0.712509",
"0.7106536",
"0.7105378",
"0.70643353",
"0.70631653",
"0.70609426",
"0.70266443",
"0.70199645",
"0.7007978",
"0.7001975... | 0.0 | -1 |
Drops the underlying database table. | public static void dropTable(SQLiteDatabase db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "'District'";
db.execSQL(sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void dropTable();",
"@Override\r\n public void dropTable() {\n if(tableIsExist(TABLE_NAME)){\r\n String sql = \"drop table \" + TABLE_NAME;\r\n database.execSQL(sql);\r\n }\r\n }",
"public void wipeTable() {\n SqlStorage.wipeTable(db, TABLE_NAME);\n }"... | [
"0.77905864",
"0.7629071",
"0.7504763",
"0.74629456",
"0.7318787",
"0.7296518",
"0.72926134",
"0.7282501",
"0.7266185",
"0.7200686",
"0.7198106",
"0.71702343",
"0.71055806",
"0.7093738",
"0.70920646",
"0.7038983",
"0.6929047",
"0.6885167",
"0.6788234",
"0.6783074",
"0.6777363... | 0.618127 | 91 |
Reads all available rows from the given cursor and returns a list of new ImageTO objects. | public List<District> loadAllDeepFromCursor(Cursor cursor) {
int count = cursor.getCount();
List<District> list = new ArrayList<District>(count);
if (cursor.moveToFirst()) {
if (identityScope != null) {
identityScope.lock();
identityScope.reserveRoom(count);
}
try {
do {
list.add(loadCurrentDeep(cursor, false));
}
while (cursor.moveToNext());
}
finally {
if (identityScope != null) {
identityScope.unlock();
}
}
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<BigMonsters> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<BigMonsters> list = new ArrayList<BigMonsters>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n ... | [
"0.6065496",
"0.6041164",
"0.594881",
"0.57803655",
"0.5755956",
"0.574083",
"0.5716205",
"0.5715267",
"0.5700741",
"0.5699952",
"0.5677734",
"0.5625836",
"0.561281",
"0.5594811",
"0.5589965",
"0.55698264",
"0.55472285",
"0.5514085",
"0.5491351",
"0.54808956",
"0.54664177",
... | 0.0 | -1 |
A rawstyle query where you can pass any WHERE clause and arguments. | public List<District> queryDeep(String where, String... selectionArg) {
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
return loadDeepAllAndCloseCursor(cursor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Query query();",
"public List sqlQuery(String sql,Object... params);",
"public abstract ResultList executeSQL(RawQuery rawQuery);",
"String getWhereClause();",
"public QbWhere where();",
"public Cursor rawQuery(String sql, String[] selectionArgs) {\n sqLiteDatabase.beginTransaction();\n Cur... | [
"0.6377732",
"0.6370847",
"0.6192332",
"0.6159502",
"0.61246324",
"0.606008",
"0.60413194",
"0.6011913",
"0.5929633",
"0.59272194",
"0.5905693",
"0.5884991",
"0.58732295",
"0.58611894",
"0.58499575",
"0.5843732",
"0.58225197",
"0.5804529",
"0.5788572",
"0.57828075",
"0.577898... | 0.0 | -1 |
Constructor of the object. | public TrolleyDetail() {
super();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Constructor() {\r\n\t\t \r\n\t }",
"public Constructor(){\n\t\t\n\t}",
"public Curso() {\r\n }",
"private Instantiation(){}",
"public CyanSus() {\n\n }",
"public RngObject() {\n\t\t\n\t}",
"public PSRelation()\n {\n }",
"public Orbiter() {\n }",
"private SingleObject()\r\n {\r\n }",
... | [
"0.85453546",
"0.83174706",
"0.72354287",
"0.7234532",
"0.7211791",
"0.71650505",
"0.71315366",
"0.71215373",
"0.7097914",
"0.7087967",
"0.7087348",
"0.7070951",
"0.7054235",
"0.70462006",
"0.70424324",
"0.70329",
"0.6996156",
"0.69732815",
"0.69716096",
"0.6948889",
"0.69442... | 0.0 | -1 |
Destruction of the servlet. | public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void destroy() {\n\t\tsuper.destroy(); \n\t\tSystem.out.println(\"=====destory servlet=========\");\n\t}",
"public final void destroy()\n {\n log.info(\"PerformanceData Servlet: Done shutting down!\");\n }",
"@Override\r\n\tpublic void destroy() {\n\t\tSystem.out.println(\"second servlet de... | [
"0.8358668",
"0.8068802",
"0.7902813",
"0.750188",
"0.74449927",
"0.6997688",
"0.6951129",
"0.6784333",
"0.66453546",
"0.662955",
"0.6534266",
"0.6458207",
"0.6419172",
"0.6386573",
"0.6369197",
"0.6355449",
"0.6355449",
"0.6355449",
"0.6355449",
"0.63451165",
"0.6335389",
... | 0.0 | -1 |
The doGet method of the servlet. This method is called when a form has its tag value method equals to get. | public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOEx... | [
"0.74321973",
"0.7351684",
"0.7254353",
"0.72517896",
"0.7243276",
"0.72414607",
"0.720676",
"0.720676",
"0.7205302",
"0.7200583",
"0.72004616",
"0.71830994",
"0.717302",
"0.7170418",
"0.7159133",
"0.71552026",
"0.7151952",
"0.7150853",
"0.71395576",
"0.7138539",
"0.7138539",... | 0.0 | -1 |
The doPost method of the servlet. This method is called when a form has its tag value method equals to post. | public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Object memberIDs = request.getSession().getAttribute("memberID");
String uri = request.getRequestURI();
String from = uri.substring(uri.indexOf("/", 2));
if(memberIDs != null ){
if(memberIDs.toString() != null || memberIDs.toString() != ""){
int memberID = Integer.parseInt(memberIDs.toString());
List<MyTrolleyVo> list1 = mts.getTrolleyID(memberID);
int trolleyID = 0;
TrollyDetailPo tdp = new TrollyDetailPo();
for (MyTrolleyVo myTrolleyVo : list1) {
trolleyID = myTrolleyVo.getTrolleyID();
}
List<TrolleyDetailVo> list = tds.checkTroDetail(trolleyID);
List<GoodsVo> glist = new ArrayList<GoodsVo>();
GoodsVo gv = null;
//给glist赋值
for (TrolleyDetailVo tli : list) {
List<GoodsVo> one = gs.checkGoods(tli.getGoodsID());
for (GoodsVo gone : one) {
gv = gone;
}
gv.setGoodsCoun(tli.getGoodsCoun());
glist.add(gv);
for (GoodsVo goodsVo : one) {
if(goodsVo.getIsValid() == 0){
glist.remove(goodsVo);//如果商品已过期,则list中移除这个商品
}
}
System.out.println(gv.getGoodsCoun()+"----");
}
double totle = 0.0;
for (GoodsVo goodsVo : glist) {
totle = totle+goodsVo.getGoodsMemberPrice()*goodsVo.getGoodsCoun();
}
//计算总价格
// List<Double> listPrice = tds.totle(trolleyID);
//
// for (Double price : listPrice) {
// totle += price;
// }
System.out.println("totle:" + totle);
// if(list != null){
// request.getSession().setAttribute("trodetlist", list);
// request.getSession().setAttribute("totle", totle);
// request.getRequestDispatcher("carGoods").forward(request, response);
// }
if(glist != null){
request.getSession().setAttribute("totle", totle);
request.getSession().setAttribute("glist", glist);
request.getSession().setAttribute("carId", trolleyID);
response.sendRedirect(request.getContextPath()+"/otherpage/mytrolley.jsp");/////
}
}else{
response.sendRedirect(request.getContextPath()+"/member/login.jsp?from="+from);
}
}else{
response.sendRedirect(request.getContextPath()+"/member/login.jsp?from="+from);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }",
"protected void doPost(HttpServletRequest request, H... | [
"0.76588804",
"0.7604264",
"0.7526298",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.7469177",
"0.74289393",
"0.74130076",
"0.74035096",
"0.73867726",
"0.7372807",
... | 0.0 | -1 |
Initialization of the servlet. | public void init() throws ServletException {
// Put your code here
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void init() throws ServletException {\r\n\r\n\t}",
"public void init() throws ServletException {\n }",
"public void init() throws ServletException {\n\t\t\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t... | [
"0.81776613",
"0.8165632",
"0.8125925",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
... | 0.80423874 | 67 |
main method to launch the game | public static void main(String[] args) {
launch(args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n Game game = new Game(\"Programming 2 Project\",600,600);\n game.start();\n \n }",
"public static void main(String[] args) {\n MainGameClass mg=new MainGameClass();\n mg.start();\n \n \n \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"publi... | [
"0.82763016",
"0.810269",
"0.8100126",
"0.8038911",
"0.79624283",
"0.79453444",
"0.7876481",
"0.7847224",
"0.78344727",
"0.7832188",
"0.7811518",
"0.77895594",
"0.7776925",
"0.7714857",
"0.77115464",
"0.7699207",
"0.7662241",
"0.7659976",
"0.7657963",
"0.76570976",
"0.7652119... | 0.0 | -1 |
the start method for the app set up the stage | @Override
public void start(Stage primaryStage) {
root = new VBox(10);
root.setPadding(new Insets(30));
initLabel();
//set up scene
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.sizeToScene();
primaryStage.setTitle("Mastermind");
primaryStage.show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void start() {\r\n\t\tsetupWWD();\r\n\t\tsetupStatusBar();\r\n\t\tsetupViewControllers();\r\n\t\tsetupSky();\r\n\t\t//setupAnnotationToggling();\r\n\r\n\t\t// Center the application on the screen.\r\n\t\tWWUtil.alignComponent(null, this, AVKey.CENTER);\r\n\t\t\r\n\t\tgetLayerEnableCmd().run(); // Enable/di... | [
"0.7613939",
"0.747283",
"0.743417",
"0.7404011",
"0.7395021",
"0.7382308",
"0.73521686",
"0.7302529",
"0.72267747",
"0.7223551",
"0.7208558",
"0.7196861",
"0.71900725",
"0.7177994",
"0.7173534",
"0.7166832",
"0.71318895",
"0.7115436",
"0.71137094",
"0.71132344",
"0.71027327"... | 0.69923246 | 39 |
initialize the simulate label actions | private void initSimulateModeController() {
simulateMode.setOnMouseClicked(event -> {
SimulatorMain sm = null;
try { sm = new SimulatorMain(); }
catch (Exception e) { e.printStackTrace(); }
sm.start(SimulatorMain.stage);
});
simulateMode.setOnMouseEntered(event -> { simulateMode.setGraphic(new Circle(5)); });
simulateMode.setOnMouseExited(event -> { simulateMode.setGraphic(null); });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}",
"private void initActions() \n {\n // Quits the application\n this.quitAction = new AbstractAction (\"Quit\") \n {\n public static final long serialVersionUID = 2L;\n\n @Override\n publi... | [
"0.664329",
"0.66357625",
"0.62738335",
"0.6243266",
"0.6187252",
"0.6131818",
"0.6093363",
"0.6086593",
"0.6018861",
"0.6008564",
"0.5994663",
"0.5983715",
"0.5979419",
"0.59718615",
"0.59652746",
"0.59535927",
"0.5951332",
"0.59268016",
"0.5896266",
"0.58920497",
"0.5876011... | 0.5946296 | 17 |
initialize the exit label | private void initExit() {
initExitView();
initExitController();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initExitView() {\n exit = new Label(\"Exit Game\");\n exit.setPrefSize(200, 100);\n exit.setFont(Font.font(null, FontWeight.BOLD, 30));\n exit.setTextFill(Color.RED);\n exit.setEffect(getDropShadow());\n }",
"private void initExitController() {\n exit.set... | [
"0.69901896",
"0.64447916",
"0.64250034",
"0.6361262",
"0.63216674",
"0.62782973",
"0.6270893",
"0.62607396",
"0.62607396",
"0.62597233",
"0.6240498",
"0.62393934",
"0.6233774",
"0.6228558",
"0.61842954",
"0.61759835",
"0.61432326",
"0.6136798",
"0.612116",
"0.6107895",
"0.61... | 0.6721557 | 1 |
add the function to the exit label, it will exit system after clicked it will have the circle appear to indicate you are selected | private void initExitController() {
exit.setOnMouseClicked(event -> { System.exit(1); });
exit.setOnMouseExited(event -> { exit.setGraphic(null); });
exit.setOnMouseEntered(event -> { exit.setGraphic(new Circle(5)); });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\texit_click(e);\r\n\t\t\t}",
"public void mouseClicked(MouseEvent e) {\n\t\t\tif(e.getSource()==exit){\n\t\t\t\tm.jumpTomanagerMenuUI();\t\t\t\n\t\t\t}\n\t\t\trepaint();\n\t\t}",
"public void showExit();",
"@Override\n\t\t\tpublic void m... | [
"0.74208236",
"0.7366361",
"0.7336733",
"0.70751345",
"0.6920928",
"0.68931246",
"0.6890457",
"0.6856787",
"0.68511534",
"0.68371314",
"0.6830749",
"0.6798787",
"0.6790856",
"0.677995",
"0.67731476",
"0.67657006",
"0.67516583",
"0.67320067",
"0.6716764",
"0.6711638",
"0.67004... | 0.66734755 | 25 |
the appearance of the exit view | private void initExitView() {
exit = new Label("Exit Game");
exit.setPrefSize(200, 100);
exit.setFont(Font.font(null, FontWeight.BOLD, 30));
exit.setTextFill(Color.RED);
exit.setEffect(getDropShadow());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ExitControlView() {\n this.setSize(180,560);\n initSubviews();\n }",
"@FXML\n void exitAddWindow() {\n drawMenuElements(false);\n window.setTitle(\"Timelines: Menu\");\n\n toggleMenuButtonVisibility(true);\n cancelTimelineButton.setVisible(false);\n c... | [
"0.71553946",
"0.6811288",
"0.67881924",
"0.6623195",
"0.65080154",
"0.6485635",
"0.6340896",
"0.6275456",
"0.6212231",
"0.6210195",
"0.61330014",
"0.61317337",
"0.60822487",
"0.6014504",
"0.59904826",
"0.59503347",
"0.59423375",
"0.59416366",
"0.5940294",
"0.5921547",
"0.591... | 0.7582104 | 0 |
initialize the simulate mode | private void initSimulateMode() {
initSimulateModeView();
initSimulateModeController();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initSimulateModeController() {\n simulateMode.setOnMouseClicked(event -> {\n SimulatorMain sm = null;\n try { sm = new SimulatorMain(); }\n catch (Exception e) { e.printStackTrace(); }\n sm.start(SimulatorMain.stage);\n });\n simulateMod... | [
"0.7103385",
"0.69431365",
"0.6786856",
"0.6735354",
"0.67192423",
"0.6705072",
"0.6681061",
"0.66771865",
"0.66047853",
"0.6496921",
"0.64274704",
"0.63943595",
"0.62766606",
"0.62618184",
"0.625318",
"0.62402016",
"0.6232433",
"0.6200221",
"0.6194658",
"0.6183852",
"0.61689... | 0.81990445 | 0 |
initialize the simulated mode label appearance | private void initSimulateModeView() {
simulateMode = new Label("SIMULATE");
simulateMode.setPrefSize(200, 100);
simulateMode.setFont(Font.font(null, FontWeight.BOLD, 30));
simulateMode.setTextFill(Color.ORANGE);
simulateMode.setEffect(getDropShadow());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initSimulateMode() {\n initSimulateModeView();\n initSimulateModeController();\n }",
"public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }",
"private void initSimulateModeController() {\n simulateMode.setOnMouseClicked(eve... | [
"0.656844",
"0.6517029",
"0.6467335",
"0.6263048",
"0.6138681",
"0.60616475",
"0.60005605",
"0.59772617",
"0.5882609",
"0.5839086",
"0.5794727",
"0.57931376",
"0.57593536",
"0.57528",
"0.5749024",
"0.57452905",
"0.5731809",
"0.569517",
"0.5682251",
"0.56714314",
"0.5670365",
... | 0.7926995 | 0 |
setup the drop shadow the drop shadow | private DropShadow getDropShadow() {
DropShadow shadow = new DropShadow();
shadow.setOffsetX(10);
shadow.setOffsetY(10);
shadow.setHeight(10);
shadow.setHeight(10);
shadow.setBlurType(BlurType.THREE_PASS_BOX);
shadow.setColor(Color.GRAY);
return shadow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addShadow() {\n startShadow();\n }",
"private void setupShadow()\n {\n int maximumPortNumber = Math.max(module_.getInputs().size(), module_.getOutputs().size());\n shadow_ = new BufferedImage(200 + 1 + 20, maximumPortNumber * 20 + 30 + 1 + 20, BufferedImage.TYPE_INT_ARGB);\n Graph... | [
"0.72321904",
"0.6806925",
"0.60420156",
"0.59717995",
"0.5939771",
"0.5933339",
"0.5874216",
"0.57700926",
"0.5738968",
"0.5696164",
"0.5571807",
"0.5457146",
"0.5412851",
"0.5331099",
"0.5325324",
"0.52984375",
"0.52772284",
"0.5245156",
"0.52305377",
"0.5225828",
"0.521463... | 0.64410853 | 2 |
initialize the play mode label | private void initPlayMode() {
initPlayModeView();
initPlayModeController();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initPlayModeView() {\n playMode = new Label(\"PLAY\");\n playMode.setPrefSize(200,100);\n playMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n playMode.setTextFill(Color.BLUE);\n playMode.setEffect(getDropShadow());\n }",
"public void initPlayerStateUI() {\... | [
"0.80073893",
"0.6759003",
"0.64353144",
"0.6383611",
"0.62622774",
"0.62546176",
"0.62437844",
"0.620396",
"0.62037206",
"0.6161553",
"0.6110683",
"0.6101333",
"0.60592186",
"0.6036314",
"0.60337687",
"0.60172963",
"0.59983975",
"0.5998277",
"0.59980386",
"0.5978218",
"0.596... | 0.7039765 | 1 |
add the action to the play mode label | private void initPlayModeController() {
playMode.setOnMouseClicked(event -> {
MasterMindMain mm = null;
try { mm = new MasterMindMain(); }
catch (Exception e) { e.printStackTrace(); }
mm.start(SimulatorMain.stage);
});
playMode.setOnMouseEntered(event -> { playMode.setGraphic(new Circle(5)); });
playMode.setOnMouseExited(event -> { playMode.setGraphic(null); });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tgameType = \"Quick Play\"; \n\t\t\t\t\t\n\t\t\t\t}",
"public static void setEventLabel(String action){\n static_label.setText(action + \" \");\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tmainF... | [
"0.7463089",
"0.67957807",
"0.672024",
"0.6699686",
"0.6597586",
"0.63697314",
"0.6338634",
"0.62653685",
"0.6250427",
"0.61781585",
"0.61440676",
"0.6114482",
"0.6077879",
"0.6064084",
"0.6036411",
"0.60276604",
"0.6016883",
"0.60013396",
"0.5999286",
"0.5983485",
"0.5958105... | 0.0 | -1 |
initialize the play mode view | private void initPlayModeView() {
playMode = new Label("PLAY");
playMode.setPrefSize(200,100);
playMode.setFont(Font.font(null, FontWeight.BOLD, 30));
playMode.setTextFill(Color.BLUE);
playMode.setEffect(getDropShadow());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initPlayMode() {\n initPlayModeView();\n initPlayModeController();\n }",
"private void initView() {\n\t\t//buttonPlayPause = (ImageButton)getView().findViewById(R.id.ButtonTestPlayPause);\n\t\t//buttonPlayPause.setOnClickListener(this);\n\t\t\n\t\t//seekBarProgress = (SeekBar)getVie... | [
"0.8527113",
"0.7549778",
"0.74161005",
"0.7236023",
"0.68821657",
"0.6680504",
"0.65717816",
"0.65504694",
"0.65489537",
"0.6497012",
"0.6486736",
"0.64773774",
"0.6466374",
"0.64571846",
"0.6447194",
"0.64427996",
"0.6440443",
"0.6440357",
"0.6424275",
"0.64008456",
"0.6390... | 0.85780746 | 0 |
TODO Autogenerated method stub | public static void main(String[] args) {
Scanner obj = new Scanner(System.in);
int[] id = new int[3];
int[] salary = new int[3];
String[] name = new String[3];
for (int i = 0; i < 3 ; i++) {
System.out.println("Enter employee id: ");
int empId = obj.nextInt();
id[i] = empId;
System.out.println("Enter employee salary: ");
int empSalary = obj.nextInt();
salary[i] = empSalary;
System.out.println("Enter employee name: ");
obj.nextLine();
String empName = obj.nextLine();
name[i] = empName;
}
for (int i=0;i<
id.length;i++) {
System.out.println(id[i]);
System.out.println(salary[i]);
System.out.println(name[i]);
}
int max = salary[0];
int index = 0;
for (int i = 1; i < salary.length; i++) {
if (salary[i]>max) {
max = salary[i];
index = i;
}
}
System.out.println(id[index]);
System.out.println(name[index]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
String[] languages = getResources().getStringArray(R.array.languages); | @Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadCompliments(){\n compliments = getResources().getStringArray(R.array.compliments_array);\n }",
"public String[] getLanguages() {\n/* 238 */ return getStringArray(\"language\");\n/* */ }",
"public String[] getLanguages()\n {\n return languages;\n }",
"String ge... | [
"0.71919304",
"0.7180608",
"0.6295264",
"0.62355006",
"0.6230085",
"0.61931944",
"0.60705423",
"0.60535014",
"0.5989425",
"0.598456",
"0.593683",
"0.5931349",
"0.59047097",
"0.5878472",
"0.58592093",
"0.58578837",
"0.58435345",
"0.5838076",
"0.58374727",
"0.5819309",
"0.58193... | 0.0 | -1 |
String[] countries = getResources().getStringArray(R.array.colors); | @Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadCompliments(){\n compliments = getResources().getStringArray(R.array.compliments_array);\n }",
"public static String[] localizeCountries(Context context, String[] toLocalize){\n String language = Locale.getDefault().getLanguage();\n if(!language.equals(lastLanguage)){\n ... | [
"0.68345064",
"0.61329603",
"0.60308945",
"0.5996853",
"0.5916384",
"0.5717338",
"0.5702808",
"0.56982255",
"0.5691909",
"0.5628091",
"0.5625466",
"0.56045747",
"0.559297",
"0.55697215",
"0.5497698",
"0.54630256",
"0.54573375",
"0.5452863",
"0.54451555",
"0.5439726",
"0.54386... | 0.0 | -1 |
Constructs a new DisorderException | public DisorderException() {
super("A process was run after its parent");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DynamicDeckDynamoException() {\n }",
"public PropagationException() {\n }",
"public OperationException() {\n super();\n }",
"SpaceInvaderTest_test_UnNouveauVaisseauPositionneHorsEspaceJeu_DoitLeverUneException createSpaceInvaderTest_test_UnNouveauVaisseauPositionneHorsEspaceJeu_DoitLev... | [
"0.67090505",
"0.6641601",
"0.6193778",
"0.608054",
"0.6040204",
"0.599005",
"0.5989253",
"0.5984042",
"0.5969757",
"0.5956021",
"0.59469587",
"0.5917267",
"0.59056705",
"0.59051865",
"0.58687735",
"0.58647823",
"0.58330643",
"0.5822153",
"0.58110255",
"0.58040935",
"0.577377... | 0.62542164 | 2 |
Will override existing object instead of returning false. | @Override
public boolean add(Building object) {
if (contains(object)) {
super.remove(object);
}
super.add(object);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic boolean isExisting() {\n\t\treturn false;\r\n\t}",
"@Override\n public boolean exists()\n {\n return orig.exists();\n }",
"@Override\n\tpublic boolean update(Dynamic object) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void updateFalse(MetodoPagamento object) {\n\t\t... | [
"0.70096207",
"0.6966421",
"0.68306017",
"0.6686205",
"0.6600052",
"0.65641814",
"0.6524878",
"0.650761",
"0.64159065",
"0.64159065",
"0.64159065",
"0.6375276",
"0.63592815",
"0.62068206",
"0.61422646",
"0.61422646",
"0.61422646",
"0.61377287",
"0.61320215",
"0.61043656",
"0.... | 0.0 | -1 |
TODO Autogenerated method stub | @SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReciveOneMailDB = (ReciveOneMailDB) (savedInstanceState != null ? savedInstanceState
.getSerializable("mReciveOneMail") : getIntent()
.getSerializableExtra("mReciveOneMail"));
emailUsername = (savedInstanceState != null ? savedInstanceState
.getString("emailUsername") : getIntent().getStringExtra(
"emailUsername"));
if (mReciveOneMailDB == null) {
finish();
}
dialog = DialogUtils.showLoading(mContext,
mContext.getString(R.string.dialog_loading), true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
emailUid = mReciveOneMailDB.getUserid();
sjx_layout_006.setVisibility(View.GONE);
String mSubject = TextUtils.isEmpty(mReciveOneMailDB.getSubject()) ? "无标题文档"
: mReciveOneMailDB.getSubject();
// String mFrom = TextUtils.isEmpty(mReciveOneMailDB.getForm()) ? ""
// : mReciveOneMailDB.getForm();
// String mTo = TextUtils.isEmpty(mReciveOneMailDB.getTopeople()) ? ""
// : mReciveOneMailDB.getTopeople();
// String mCC = TextUtils.isEmpty(mReciveOneMailDB.getCcpeople()) ? ""
// : mReciveOneMailDB.getCcpeople();
// String mTime = TextUtils.isEmpty(mReciveOneMailDB.getSentDate()) ? ""
// : mReciveOneMailDB.getSentDate();
tv_title.setText(mSubject);
// sjx_yj_fjr.setText(mFrom);
// sjx_yj_sjr.setText(mTo);
// if (TextUtils.isEmpty(mCC)) {
// findViewById(R.id.lyout_caosong).setVisibility(View.GONE);
// } else
// sjx_yj_cs.setText(mCC);
// sjx_yj_fssj.setText(mTime);
path = StorageUtils.getStorageFile().toString()
+ Constants.ROOT_DIRECTION + "/tmp";
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
// String AppfileName = mReciveOneMailDB.getAppfileName();
List<ATTACH> mAttachs = SQLiteUtils.getInstance(mContext)
.getEmailAttachsFromDb(emailUsername, emailUid);
// feed = readFile(path + "/" + AppfileName);
mDetails = SQLiteUtils.getInstance(mContext)
.getEmailDetailFromDb(emailUsername, emailUid);
android.os.Message msg = mHandler.obtainMessage();
msg.what = 1;
msg.obj = mAttachs;
mHandler.sendMessage(msg);
}
}).start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub String AppfileName = mReciveOneMailDB.getAppfileName(); | @Override
public void run() {
List<ATTACH> mAttachs = SQLiteUtils.getInstance(mContext)
.getEmailAttachsFromDb(emailUsername, emailUid);
// feed = readFile(path + "/" + AppfileName);
mDetails = SQLiteUtils.getInstance(mContext)
.getEmailDetailFromDb(emailUsername, emailUid);
android.os.Message msg = mHandler.obtainMessage();
msg.what = 1;
msg.obj = mAttachs;
mHandler.sendMessage(msg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFileName()\n {\n return getString(\"FileName\");\n }",
"@Column(length = 500, name = \"FILE_NAME\")\r\n public String getFileName() {\r\n return this.fileName == null ? null : this.fileName.substring(this.fileName.lastIndexOf(File.separator) + 1);\r\n }",
"public Stri... | [
"0.6309197",
"0.62721",
"0.6195964",
"0.6136243",
"0.6100749",
"0.6059064",
"0.6041043",
"0.6020658",
"0.60060775",
"0.60055745",
"0.60027355",
"0.5999785",
"0.5996406",
"0.59432703",
"0.5938304",
"0.5928301",
"0.5920293",
"0.5917208",
"0.5913456",
"0.5908247",
"0.5908247",
... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onClick(View v) {
try {
File myFile = new File(path + "/" + fileName + "."
+ fileType);
String string = myFile.getAbsolutePath();
if (string.endsWith(".rar")) {
} else if (string.endsWith(".apk")) {
return;
} else {
CallOtherOpeanFile.openFile(mContext, myFile);
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onClick(View v) {
ToastUtils.show(mContext, "已删除该邮件");
int index = SQLiteUtils.getInstance(mContext)
.emailUpdate(mReciveOneMailDB.getUserid(),
"emailVisual");
LogUtils.e("index = " + index);
if (index > 0) {
setResult(RESULT_OK);
finish();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Create button onClick handler. Creates the numbers.txt file, with 1..10, one number per line. | public void createFile(View view) {
// start the background file creation task
CreateFileTask task = new CreateFileTask();
task.execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws IOException\n {\n \n // Declare Variables \n int count = 0;\n \n // PrintWriter class to create and open new file\n PrintWriter outputFile = new PrintWriter(\"NumbersJamesM.txt\"); \n \n // For loop to add 1 to the number each time\n... | [
"0.6609609",
"0.6200563",
"0.61131126",
"0.5838026",
"0.58350974",
"0.5770209",
"0.5643823",
"0.5640331",
"0.5579948",
"0.5526979",
"0.54935867",
"0.54868746",
"0.5465847",
"0.5459456",
"0.5450006",
"0.54392934",
"0.54257333",
"0.5419778",
"0.5411668",
"0.5389393",
"0.5378592... | 0.47828314 | 92 |
Load button onClick handler. Loads the numbers.txt file and populates a ListView with each number on a separate line. | public void loadFile(View view) {
// start the background file loading task
LoadFileTask task = new LoadFileTask();
task.execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@FXML\n void loadButtonClicked(ActionEvent event) throws FileNotFoundException\n {\n FileChooser file = new FileChooser();\n\n file.setTitle(\"Load file (.txt)\");\n\n file.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n\n File selectedF... | [
"0.6834371",
"0.6606782",
"0.6400561",
"0.6064404",
"0.5964384",
"0.57811123",
"0.5719406",
"0.57096595",
"0.5677936",
"0.5662896",
"0.5604541",
"0.5557453",
"0.5548776",
"0.55164534",
"0.55135095",
"0.55048573",
"0.5472068",
"0.54182076",
"0.5414057",
"0.53832024",
"0.535019... | 0.52245426 | 30 |
Clear button onClick handler. Clears the ListView containing the numbers list. | public void clearFile(View view) {
// clear the displayed list of numbers
ListView lvNumbers = (ListView) findViewById(R.id.lvNumbers);
ArrayAdapter aaNumbers = (ArrayAdapter) lvNumbers.getAdapter();
if (aaNumbers != null) {
aaNumbers.clear();
aaNumbers.notifyDataSetChanged();
}
// clear progress bar
ProgressBar pbFileIO = (ProgressBar) findViewById(R.id.pbFileIO);
pbFileIO.setProgress(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void listClear(View view){\n ProgressBar myBar = (ProgressBar) findViewById(R.id.progressBar);\n myBar.setProgress(0);\n\n ListView listView = (ListView) findViewById(R.id.listView);\n ArrayAdapter<Integer> myAdapter = (ArrayAdapter<Integer>) listView.getAdapter();\n if(my... | [
"0.7241737",
"0.715555",
"0.6778984",
"0.6778984",
"0.66800183",
"0.65658563",
"0.6538498",
"0.6410758",
"0.63852715",
"0.6381883",
"0.6349517",
"0.6309617",
"0.6295457",
"0.62703365",
"0.62305737",
"0.6220627",
"0.6209089",
"0.6192311",
"0.61890393",
"0.6168538",
"0.6159685"... | 0.6721091 | 4 |
create a file with the numbers 1..10, each on its own line. | @Override
protected Void doInBackground(Void... params) {
File file = new File(getApplicationContext().getFilesDir(), FILENAME);
PrintWriter writer = null;
try {
writer = new PrintWriter(file);
for (int i = 1; i <= 10; i++) {
writer.println(i);
Thread.sleep(250);
publishProgress(i * 10);
}
}
catch (FileNotFoundException | InterruptedException ex) {
Log.e(LOG_TAG, "createFile:" + ex.toString());
}
finally {
if (writer != null) {
writer.close();
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws IOException\n {\n \n // Declare Variables \n int count = 0;\n \n // PrintWriter class to create and open new file\n PrintWriter outputFile = new PrintWriter(\"NumbersJamesM.txt\"); \n \n // For loop to add 1 to the number each time\n... | [
"0.71012115",
"0.62990016",
"0.61574644",
"0.61409706",
"0.6052335",
"0.5985886",
"0.59809095",
"0.5797125",
"0.57791656",
"0.57476336",
"0.5692907",
"0.5688058",
"0.56084967",
"0.5569259",
"0.5549093",
"0.54970646",
"0.54434264",
"0.5422138",
"0.54088086",
"0.536705",
"0.536... | 0.5279286 | 26 |
load the file of numbers, linebyline, into an array. | @Override
protected List<String> doInBackground(Void... params) {
File file = new File(getApplicationContext().getFilesDir(), FILENAME);
BufferedReader reader = null;
List<String> list = new ArrayList<>();
try {
reader = new BufferedReader(new FileReader(file));
String s;
int progress = 0;
while ((s = reader.readLine()) != null) {
list.add(s);
Thread.sleep(250);
progress += 10;
publishProgress(progress);
}
}
catch (IOException | InterruptedException ex) {
Log.e(LOG_TAG, "loadFile:" + ex.toString());
}
finally {
if (reader != null) {
try {
reader.close();
}
catch(IOException ex) {
// do nothing
}
}
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int[] readMysteriousNumbers(String filename) throws Exception {\n File file = new File(filename);\n Scanner counter = new Scanner(file);\n int numLines = 0;\n while(counter.hasNextLine()){\n counter.nextLine();\n numLines++;\n }\n int[] ... | [
"0.7256715",
"0.7089987",
"0.70297956",
"0.6990646",
"0.661834",
"0.66032505",
"0.64950687",
"0.64647824",
"0.64349294",
"0.64019865",
"0.63433516",
"0.6310875",
"0.6252244",
"0.6183573",
"0.61818224",
"0.6140183",
"0.6138576",
"0.61237115",
"0.6113065",
"0.6110656",
"0.60920... | 0.0 | -1 |
update the ListView using the list of numbers | @Override
protected void onPostExecute(List<String> list) {
ArrayAdapter<String> aaNumbers = new ArrayAdapter<>(MainActivity.this,
android.R.layout.simple_list_item_1, list);
ListView lvNumbers = (ListView)findViewById(R.id.lvNumbers);
lvNumbers.setAdapter(aaNumbers);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateListViewAndCount() {\n \t\n \t//updating the currentTaskItems then getting a array of the list\n \tListView items = (ListView)findViewById(R.id.showAttachedItems);\n \t\n \tArrayList<ItemListElement> item = formatOutputForList();\n \tItemListElement[] elm = new ItemListElement[i... | [
"0.74513626",
"0.67717725",
"0.67506194",
"0.6599665",
"0.65966755",
"0.6592732",
"0.6501422",
"0.64818776",
"0.64544487",
"0.6430952",
"0.6429277",
"0.62944627",
"0.6256717",
"0.6251804",
"0.624126",
"0.6239784",
"0.6237308",
"0.62193066",
"0.62173253",
"0.62164766",
"0.6208... | 0.624599 | 14 |
update the progress bar | @Override
protected void onProgressUpdate(Integer... progress) {
ProgressBar pbFileIO = (ProgressBar)findViewById(R.id.pbFileIO);
pbFileIO.setProgress(progress[0]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void updateProgressBar() {\n\t\tdouble current = model.scannedCounter;\n\t\tdouble total = model.fileCounter;\n\t\tdouble percentage = (double)(current/total);\n\t\t\n\t\t//Update Progress indicators\n\t\ttxtNumCompleted.setText((int) current + \" of \" + (int) total + \" Completed (\" + Math.round(percent... | [
"0.85783255",
"0.83360285",
"0.8230385",
"0.80830723",
"0.79651105",
"0.7742066",
"0.7711375",
"0.7711375",
"0.7664675",
"0.7664433",
"0.7582961",
"0.7560532",
"0.7549758",
"0.75328493",
"0.75165164",
"0.7510565",
"0.7502033",
"0.7482632",
"0.7482505",
"0.73731947",
"0.735844... | 0.72034013 | 27 |
Test get all product method | @Test
public void testGetAllProducts() throws Exception {
when(repository.findAll()).thenReturn(Collections.singletonList(this.product));
assertEquals(Collections.singletonList(this.product), service.getAllProducts());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testGetAllProduct() throws Exception {\n System.out.println(\"getAllProduct\");\n prs = dao.getAllProduct();\n \n assertArrayEquals(products.toArray(), prs.toArray());\n }",
"@Test\n public void testFindAllProduct() throws Exception {\n // Mock meth... | [
"0.78353167",
"0.77034056",
"0.7641449",
"0.71475226",
"0.71466684",
"0.6997231",
"0.6984412",
"0.6984412",
"0.6984412",
"0.69556767",
"0.69386786",
"0.68810064",
"0.6846667",
"0.6814431",
"0.6807709",
"0.68067867",
"0.6749895",
"0.6712061",
"0.6704337",
"0.66934323",
"0.6692... | 0.7735288 | 1 |
Test get all product method | @Test
public void testGetAllProductsEmpty() throws Exception {
when(repository.findAll()).thenReturn(Collections.emptyList());
assertEquals(Collections.emptyList(), service.getAllProducts());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testGetAllProduct() throws Exception {\n System.out.println(\"getAllProduct\");\n prs = dao.getAllProduct();\n \n assertArrayEquals(products.toArray(), prs.toArray());\n }",
"@Test\n public void testGetAllProducts() throws Exception {\n when(reposit... | [
"0.78353167",
"0.7735288",
"0.77034056",
"0.7641449",
"0.71475226",
"0.71466684",
"0.6997231",
"0.6984412",
"0.6984412",
"0.6984412",
"0.69556767",
"0.69386786",
"0.68810064",
"0.6846667",
"0.6814431",
"0.6807709",
"0.68067867",
"0.6749895",
"0.6712061",
"0.6704337",
"0.66934... | 0.64448625 | 44 |
Test get product by key | @Test
public void testGetByKey() throws Exception {
when(repository.findByKey(this.product.getKey())).thenReturn(Optional.of(this.product));
assertEquals(this.product, service.getByKey(this.product.getKey()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getProductKey();",
"@Test\n public void testFindProduct() {\n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n Product p2 = new Product(\"Raton\", 85.6);\n \n instance.addItem(p1);\n instance.addItem(p2);\n \n ... | [
"0.66447175",
"0.65897316",
"0.65484303",
"0.65166545",
"0.64171875",
"0.6399943",
"0.63438296",
"0.6314026",
"0.6305564",
"0.62794054",
"0.62566996",
"0.62354624",
"0.6220097",
"0.6185286",
"0.6159886",
"0.61516577",
"0.6133351",
"0.6094932",
"0.6093844",
"0.6074958",
"0.606... | 0.7748314 | 0 |
Test get product by key empty | @Test
public void testGetByKeyEmpty() throws Exception {
thrown.expect(ProductNotFoundException.class);
thrown.expectMessage("Product with key " + this.product.getKey() + " not found!");
when(repository.findByKey(this.product.getKey())).thenReturn(Optional.empty());
service.getByKey(this.product.getKey());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testGetByKey() throws Exception {\n when(repository.findByKey(this.product.getKey())).thenReturn(Optional.of(this.product));\n\n assertEquals(this.product, service.getByKey(this.product.getKey()));\n }",
"@Test(expected = ProductNotFoundException.class)\n public void Te... | [
"0.72810507",
"0.6336856",
"0.63116515",
"0.6250027",
"0.6227852",
"0.622218",
"0.61679065",
"0.6116013",
"0.611243",
"0.6062983",
"0.6062823",
"0.6055878",
"0.5942935",
"0.5931793",
"0.5930841",
"0.59250164",
"0.580813",
"0.57873267",
"0.5780964",
"0.57698095",
"0.576151",
... | 0.7671421 | 0 |
Test delete when the product is added to an event | @Test
public void testDeleteProductAddedToEvent() throws Exception {
thrown.expect(ProductAlreadyLinkedException.class);
thrown.expectMessage("Product is already added to an Event");
this.product.setLinked(true);
service.delete(this.product);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testDeleteProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n doNothing().when(productRepository).delete(product);\n\n testResponseData(RequestInfo.builder()\n .request(del... | [
"0.69519454",
"0.6876556",
"0.6837106",
"0.6810867",
"0.6581527",
"0.6581084",
"0.649542",
"0.6474175",
"0.6469474",
"0.6452925",
"0.6398238",
"0.6397354",
"0.63369435",
"0.6334244",
"0.63256127",
"0.6321053",
"0.6306126",
"0.6303876",
"0.62893015",
"0.6288236",
"0.6250406",
... | 0.8053939 | 0 |
Insere a pessoa na lista e em seguida serializa | @Override
public boolean inserir(Pessoa p) {
try {
pessoa.getPessoas().add(p);
serializar(arquivo2Serializado, pessoa);
} catch (Exception ex) {
Logger.getLogger(PessoaDAO.class.getName()).log(Level.SEVERE, null, ex);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void crearPoblacion() {\n\t\tif(this.terminales == null || this.funciones == null) {\n\t\t\tSystem.out.println(\"Error. Los terminales y las funciones tienen que estar inicializados\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tpoblacion = new ArrayList<>();\n\t\tfor(int i = 0; i < this.numIndividuos; i... | [
"0.6361699",
"0.6279124",
"0.62534124",
"0.60211414",
"0.5985645",
"0.5922929",
"0.59180665",
"0.59060955",
"0.59008455",
"0.5866918",
"0.5857605",
"0.5838506",
"0.58318454",
"0.5823327",
"0.5821497",
"0.58203995",
"0.58164644",
"0.5810302",
"0.5801764",
"0.57908565",
"0.5789... | 0.6017512 | 4 |
Busca por um nome de uma pessoa cadastrada | @Override
public Pessoa buscar(int id) {
try {
for (Pessoa p : pessoa.getPessoas()){
if(p.getCodPessoa()== id){
return p;
}
}
} catch (Exception ex) {
Logger.getLogger(AnimalDAO.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void pesquisarNome() {\n\t\tSystem.out.println(this.nomePesquisa);\n\t\tthis.alunos = this.alunoDao.listarNome(this.nomePesquisa);\n\t\tthis.quantPesquisada = this.alunos.size();\n\t}",
"public String lerNome() {\n\t\treturn JOptionPane.showInputDialog(\"Digite seu Nome:\");\n\t\t// janela de entrada\n\t}... | [
"0.6452094",
"0.6385538",
"0.6345649",
"0.62783533",
"0.60947824",
"0.60817695",
"0.6010619",
"0.600129",
"0.59904164",
"0.59386575",
"0.5930306",
"0.59180975",
"0.5910581",
"0.5902152",
"0.58829135",
"0.58149403",
"0.5764271",
"0.5756464",
"0.57524335",
"0.5693116",
"0.56883... | 0.0 | -1 |
Find acccount by email | @PostMapping("/findByEmail")
public Account findAccountByEmail(@RequestBody String email) {
return getService().findByEmail(email);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long countUserByEmail(String email);",
"long countByExample(EmailCriteria example);",
"long countByExample(mailIdentifyExample example);",
"public int getEmailAmount(String email);",
"public static synchronized int checkCred(String email){\n\t\t\tConnection connection;\n\t\t\tint count = 1;\n\t\t \tPrepare... | [
"0.7582953",
"0.7051364",
"0.6691928",
"0.6686234",
"0.6668885",
"0.6440322",
"0.6350423",
"0.6323846",
"0.61478984",
"0.6073987",
"0.604199",
"0.60294557",
"0.60010374",
"0.5993344",
"0.598033",
"0.59739333",
"0.5963259",
"0.59317243",
"0.58836913",
"0.58786863",
"0.58742005... | 0.5622962 | 40 |
find account by username | @GetMapping("/findByUsername/{username}")
public Account getAccountByUsername(@PathVariable String username) {
return getService().findByUsername(username);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Account findByUsername(String username);",
"public AgtUser findUserByName(String username);",
"public CarerAccount getAccountWithUsername(String search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getUsern... | [
"0.78430635",
"0.76875347",
"0.76028365",
"0.7589141",
"0.74848074",
"0.7431485",
"0.7412727",
"0.74076957",
"0.74076957",
"0.74076957",
"0.7389512",
"0.7345687",
"0.73419297",
"0.7307459",
"0.73051876",
"0.7287535",
"0.7271633",
"0.7250868",
"0.7250868",
"0.72264254",
"0.719... | 0.703749 | 30 |
Using 1 DButilities instance | @Override
public void initialize(URL url, ResourceBundle rb) {
this.db = LoginController.db;
this.loggedInUser = SidePaneController.employeeFullName;
System.out.println(loggedInUser);
refreshTable();
tblTrainingList.getColumns().get(2).setStyle("-fx-alignment: CENTER;");
initializedComboBox();
backgroundRefresh();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Object getDB();",
"@Override\r\n public Db_db currentDb(){return curDb_;}",
"public static DbHelper getInstance(){\n\t\treturn _DbHelperHold.INSTANCE;\n\t}",
"public static void main(String[] args){\n\n DbSingleton instance = DbSingleton.getInstance();\n\n //DbSingleton test = new DbSingleto... | [
"0.63495344",
"0.6254974",
"0.61919343",
"0.6187064",
"0.61075485",
"0.60823935",
"0.60518783",
"0.6033412",
"0.60309976",
"0.6024821",
"0.59962916",
"0.59854966",
"0.5938006",
"0.59295446",
"0.5928522",
"0.5925436",
"0.5918601",
"0.58642346",
"0.5861838",
"0.5855113",
"0.584... | 0.0 | -1 |
JFXDialogLayout layout = new JFXDialogLayout(); JFXDialog dialog = new JFXDialog(); layout.setHeading(new Text("Heading")); scn.loadModal(layout, dialog); | @FXML
private void search(){
String s = tfSearch.getText().trim();
String type = cmbType.getSelectionModel().getSelectedItem();
String col = cmbFilterBy.getSelectionModel().getSelectedItem();
/**
* Column Filters
*
*/
if(!s.isEmpty()){
if(!chbtoggleInActiveTraining.isSelected()){
db.populateTable(trainingFields+ " WHERE title LIKE '%"+s+"%' AND status<>'active'", tblTrainingList);
}
if(chbtoggleInActiveTraining.isSelected()){
db.populateTable(trainingFields+ " WHERE title LIKE '%"+s+"%'", tblTrainingList);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void waitDialog(String title) {\n Stage dialog = new Stage();\n Parent root = null;\n try {\n root = FXMLLoader.load(Objects.requireNonNull(getClass().getClassLoader().getResource(\"wait.fxml\")));\n Scene s1 = new Scene(root);\n dialog.setScene(s1);\n ... | [
"0.6914522",
"0.65988886",
"0.6563046",
"0.65066457",
"0.64979726",
"0.6473011",
"0.64429665",
"0.6439012",
"0.64151907",
"0.6290382",
"0.61646646",
"0.61102945",
"0.6105415",
"0.6102096",
"0.6061362",
"0.6060167",
"0.5996114",
"0.59907687",
"0.5941149",
"0.5926677",
"0.59250... | 0.0 | -1 |
Processes requests for both HTTP GET and POST methods. | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
Usuario usuario = new Usuario();
DaoUsuario usu = new DaoUsuario();
Aluguel aluguel = new Aluguel();
DaoAluguel alu = new DaoAluguel();
try{
String cod = (String) request.getSession().getAttribute("usu_cod");
usuario = usu.buscar(Integer.parseInt(cod));
} catch (Exception erro) {
request.getSession().setAttribute("Mensagem", "Sua sessão expirou, faça login novamente;");
request.getSession().setAttribute("Link", "../index.jsp");
response.sendRedirect("Status_Imovel.jsp");
}
for (int i = 0; i < alu.listar().size(); i++) {
if (alu.listar().get(i).getAlu_usu_cod() == usuario.getUsu_cod()) {
aluguel=alu.buscar(alu.listar().get(i).getAlu_cod());
aluguel.setAlu_pagamento(false);
alu.altera(aluguel);
}
}
request.getSession().setAttribute("Mensagem", "Todos os alugueis foram resetados.");
request.getSession().setAttribute("Link", "Painel_Aluguel.jsp");
response.sendRedirect("Views/Status_Imovel.jsp");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_... | [
"0.7003337",
"0.66585124",
"0.66023004",
"0.65085584",
"0.6446528",
"0.6441425",
"0.64401287",
"0.64316165",
"0.64271754",
"0.64235586",
"0.64235586",
"0.6418961",
"0.6418961",
"0.6418961",
"0.6417602",
"0.64138156",
"0.64138156",
"0.6399609",
"0.63932025",
"0.63932025",
"0.6... | 0.0 | -1 |
Handles the HTTP GET method. | @Override
protected void doGet
(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doGet( )\n {\n \n }",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) thro... | [
"0.7588987",
"0.7165731",
"0.7114584",
"0.70562947",
"0.7030403",
"0.7029135",
"0.69961035",
"0.697584",
"0.6888159",
"0.68733263",
"0.68536866",
"0.68436044",
"0.68436044",
"0.6835487",
"0.6835487",
"0.6835487",
"0.68192834",
"0.681755",
"0.6797782",
"0.67811096",
"0.676131"... | 0.6182668 | 94 |
Handles the HTTP POST method. | @Override
protected void doPost
(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }",
"public void doPost( )\n {\n \n }",
"@Override\n public String getMethod() {\n return \"POST\";\n ... | [
"0.73289514",
"0.71383566",
"0.7116213",
"0.7105215",
"0.7100045",
"0.70236707",
"0.7016248",
"0.6964149",
"0.6889435",
"0.6784954",
"0.67733276",
"0.67482096",
"0.66677034",
"0.6558593",
"0.65582114",
"0.6525548",
"0.652552",
"0.652552",
"0.652552",
"0.65229493",
"0.6520197"... | 0.6136717 | 91 |
Returns a short description of the servlet. | @Override
public String getServletInfo
() {
return "Short description";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getServletInfo()\n {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short d... | [
"0.8763362",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8531154",
"0.8531154",
"0.85280526",
"0.85... | 0.0 | -1 |
TODO Autogenerated method stub | private static void tableObjAutofit() {
tableObj.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
for (int column = 0; column < tableObj.getColumnCount(); column++) {
final TableColumn tableObjColumn = tableObj.getColumnModel().getColumn(column);
int preferredWidth = tableObjColumn.getMinWidth();
final int maxWidth = tableObjColumn.getMaxWidth();
for (int row = 0; row < tableObj.getRowCount(); row++) {
final TableCellRenderer cellRenderer = tableObj.getCellRenderer(row, column);
final Component c = tableObj.prepareRenderer(cellRenderer, row, column);
final int width = c.getPreferredSize().width + tableObj.getIntercellSpacing().width;
preferredWidth = Math.max(preferredWidth, width);
// We've exceeded the maximum width, no need to check other rows
if (preferredWidth >= maxWidth) {
preferredWidth = maxWidth;
break;
}
}
tableObjColumn.setPreferredWidth(preferredWidth);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
if (currentFragment == HOME_FRAGMENT) {
getMenuInflater().inflate(R.menu.main, menu);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {... | [
"0.7249201",
"0.7204109",
"0.7197405",
"0.71792436",
"0.7109801",
"0.7041446",
"0.7040234",
"0.70145714",
"0.7011273",
"0.6983118",
"0.6946729",
"0.6940447",
"0.6936383",
"0.6920103",
"0.6920103",
"0.6893587",
"0.6885479",
"0.6877562",
"0.6877041",
"0.6864375",
"0.6864375",
... | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.main_search_icon) {
return true;
} else if (id == R.id.main_cart_icon) {
myCart();
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ... | [
"0.79052806",
"0.7806316",
"0.7767438",
"0.772778",
"0.76324606",
"0.7622031",
"0.758556",
"0.7531728",
"0.7489057",
"0.74576724",
"0.74576724",
"0.743964",
"0.7422121",
"0.74037784",
"0.73926556",
"0.7387903",
"0.73803806",
"0.73715395",
"0.7362778",
"0.7357048",
"0.7346653"... | 0.0 | -1 |
Handle navigation view item clicks here. | @Override
public boolean onNavigationItemSelected(MenuItem item) {
int id = item.getItemId();
if (id==R.id.nav_my_mall){
getSupportActionBar().setDisplayShowTitleEnabled(false);
setFragment(new HomeFragment(),HOME_FRAGMENT);
}else if (id == R.id.nav_my_orders) {
} else if (id == R.id.nav_my_rewards) {
} else if (id == R.id.nav_my_cart) {
myCart();
} else if (id == R.id.nav_my_wishlist) {
} else if (id == R.id.nav_my_account) {
gotoFragment("My Account",new MyAccountFragment(),ACCOUNT_FRAGMENT);
}else if (id == R.id.nav_sign_out){
}
DrawerLayout drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onNavigationItemClicked(Element element);",
"@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }",
"void onDialogNavigationItemClicked(Element element);",
"@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tr... | [
"0.78807783",
"0.723447",
"0.69863516",
"0.6943918",
"0.69152725",
"0.69152725",
"0.68832517",
"0.6873738",
"0.6865404",
"0.6766271",
"0.6740349",
"0.67190737",
"0.671563",
"0.6712706",
"0.669685",
"0.66966915",
"0.6677797",
"0.6662864",
"0.6658379",
"0.66458774",
"0.6639868"... | 0.0 | -1 |
Create the correct answer of a T/F question | public void create() {
io.writeLine("Enter correct answer(T/F)");
String answer = io.readLine();
while (!answer.equals("T") && !answer.equals("F")) {
io.writeLine("Please put in T or F");
answer = io.readLine();
}
rightAnswers.add(answer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getCorrectAnswer();",
"public static void main(){\n \n \n String question = \"There are 10 types of people in this world, those who understand binary and those who don't.\";\n String answer = \"true\";\n \n Question tfQuest = new Question (question, answer);\n tf... | [
"0.7193753",
"0.6483561",
"0.6297395",
"0.6273104",
"0.6217082",
"0.6216508",
"0.6081003",
"0.6079308",
"0.60337293",
"0.5994447",
"0.5930246",
"0.5927284",
"0.5923451",
"0.5851789",
"0.5849765",
"0.58410025",
"0.5840373",
"0.5799988",
"0.5778149",
"0.577394",
"0.5752287",
... | 0.5967078 | 10 |
Display the correct answer of a T/F question | public void display() {
io.writeLine("The correct answer is " + rightAnswers.get(0));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getCorrectAnswer();",
"public void showQuestion()\n\t{\n\t\tSystem.out.println(ans);\n\t\tfor(int k = 0; k<numAns; k++)\n\t\t{\n\t\t\tSystem.out.println(k+\". \"+answers[k]);\n\t\t}\n\t}",
"public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\ti... | [
"0.77704936",
"0.71621865",
"0.68923753",
"0.6856392",
"0.6788283",
"0.6785392",
"0.670423",
"0.6638775",
"0.6533943",
"0.651586",
"0.648518",
"0.64841497",
"0.64389306",
"0.6438103",
"0.6430635",
"0.64288104",
"0.6401641",
"0.6348183",
"0.6323852",
"0.63205504",
"0.63131034"... | 0.6583262 | 8 |
Modify the correct answer of a T/F question | public void modify() {
io.writeLine("Enter the new correct answer");
String newAnswer = io.readLine();
while (!newAnswer.equals("T") && !newAnswer.equals("F")) {
io.writeLine("Please put in T or F");
newAnswer = io.readLine();
}
rightAnswers.set(0, newAnswer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getCorrectAnswer();",
"@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID =... | [
"0.67303824",
"0.62397367",
"0.6223092",
"0.6122589",
"0.61184144",
"0.60924095",
"0.6089252",
"0.6077811",
"0.6006732",
"0.5968584",
"0.594839",
"0.5893194",
"0.58742774",
"0.58537614",
"0.5850749",
"0.584702",
"0.581117",
"0.5802317",
"0.5800102",
"0.5793951",
"0.5793083",
... | 0.6645291 | 1 |
IEggLayer Should be implemented for every Genetic Mob that has the chance to lay eggs. Should NOT be implemented if the mob periodically drops something other than an egg. | public interface IEggLayer {
/**
* canLayEgg
* Whether this mob can currently lay an egg.
* @param geneticMob the mob being checked
* @return true if egglaying is possible
*/
boolean canLayEgg(IGeneticMob geneticMob);
/**
* getEggItem
* The ItemStack that this mob would currently drop as an egg.
* @param geneticMob the mob being checked
* @return the egg
*/
ItemStack getEggItem(IGeneticMob geneticMob);
/**
* willEggHatch
* Whether an egg laid right now by this mob is fertilized and will hatch into a baby mob.
* @param geneticMob the mob being checked
* @return true if it will eventually hatch
*/
boolean willEggHatch(IGeneticMob geneticMob);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean canLayEgg(IGeneticMob geneticMob);",
"boolean willEggHatch(IGeneticMob geneticMob);",
"ItemStack getEggItem(IGeneticMob geneticMob);",
"@Override\n\tpublic void laysEgg() {\n\t\t\n\t}",
"public void livingTick() {\n super.livingTick();\n this.oFlap = this.wingRotation;\n this.oFlapSp... | [
"0.7057573",
"0.67806756",
"0.619054",
"0.5913889",
"0.5820711",
"0.58069754",
"0.57917666",
"0.5697959",
"0.56947106",
"0.5689847",
"0.5610967",
"0.5552688",
"0.55395246",
"0.5490565",
"0.546897",
"0.5446012",
"0.5420287",
"0.53651756",
"0.5346135",
"0.53326386",
"0.5319351"... | 0.8539025 | 0 |
canLayEgg Whether this mob can currently lay an egg. | boolean canLayEgg(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface IEggLayer {\n /**\n * canLayEgg\n * Whether this mob can currently lay an egg.\n * @param geneticMob the mob being checked\n * @return true if egglaying is possible\n */\n boolean canLayEgg(IGeneticMob geneticMob);\n\n /**\n * ge... | [
"0.6522236",
"0.6019913",
"0.60091484",
"0.5702493",
"0.5669842",
"0.56093735",
"0.557863",
"0.5562793",
"0.5536217",
"0.5522876",
"0.5370208",
"0.53461325",
"0.5333508",
"0.52498436",
"0.5204012",
"0.51795024",
"0.51634336",
"0.51634336",
"0.51634336",
"0.51634336",
"0.51634... | 0.6969838 | 0 |
getEggItem The ItemStack that this mob would currently drop as an egg. | ItemStack getEggItem(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private ItemStack getToolWhenHasnt() {\r\n\t\treturn this.item;\r\n\t}",
"public ItemStack getItem() {\n return this.item;\n }",
"public ItemStack getItem() {\r\n\t\treturn item;\r\n\t}",
"protected Item getDropItem() {\r\n\t\treturn SorceryItems.goldfeather;\r\n\t}",
"ItemStack getItem();",
"p... | [
"0.6986963",
"0.68693334",
"0.68264997",
"0.6769484",
"0.66745627",
"0.6486993",
"0.64372724",
"0.6388022",
"0.62935346",
"0.6282115",
"0.612678",
"0.60289335",
"0.6026195",
"0.6005827",
"0.59885335",
"0.59791404",
"0.5965559",
"0.5957119",
"0.5903732",
"0.5893404",
"0.588192... | 0.75630265 | 0 |
willEggHatch Whether an egg laid right now by this mob is fertilized and will hatch into a baby mob. | boolean willEggHatch(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity);",
"public void makeHappy() {\n while (statusEnum() != TamagotchiMood.HAPPY) {\n if (!isHungry() && !isTired()) {\n play();\n } else if (isHungry() && !isTired()) {\n eat();\n ... | [
"0.62969786",
"0.62842077",
"0.6239384",
"0.6228483",
"0.6195542",
"0.6174463",
"0.6114921",
"0.60999835",
"0.60918343",
"0.60904145",
"0.60732335",
"0.6065542",
"0.6057931",
"0.6024476",
"0.6022533",
"0.59921",
"0.5990436",
"0.5965221",
"0.5946043",
"0.59203887",
"0.58854026... | 0.7793979 | 0 |
IHitAggro Should be implemented if the mob has the chance to strike back at an attacker. | public interface IHitAggro {
/**
* shouldAggroOnHit
* The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity
* Should NOT trigger the aggro itself! That should only occur when actually hit!
* @param geneticMob the mob being checked
* @param attacker the entity that could attack
* @return the chance of aggro (1.0F = 100%, 0.0F = 0%)
*/
float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);
/**
* aggroHitTimer
* How long this mob would stay angry at this attacker if aggroed via hit
* @param geneticMob the mob being checked
* @param attacker the entity that could attack
* @return the length, in ticks, of the timer
*/
int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"@Override\n\t\tpublic void hit(Npc attacker, Mob defender, Hit hit) {\n\t\t}",
"int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);",
"public void addDamageHate(final L2Character attacker, final int damage, int aggro)\n\t... | [
"0.749741",
"0.6768815",
"0.6624469",
"0.64954394",
"0.64746946",
"0.6432647",
"0.6313851",
"0.6288893",
"0.6263491",
"0.6259145",
"0.6171664",
"0.61462003",
"0.6104907",
"0.61030376",
"0.6045125",
"0.5997147",
"0.59819573",
"0.59786975",
"0.5972618",
"0.59584165",
"0.5943287... | 0.80859953 | 0 |
shouldAggroOnHit The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity Should NOT trigger the aggro itself! That should only occur when actually hit! | float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface IHitAggro {\n /**\n * shouldAggroOnHit\n * The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity\n * Should NOT trigger the aggro itself! That should only occur when actually hit!\n * @param geneticMob the mob being checked\n ... | [
"0.74945277",
"0.70437485",
"0.687789",
"0.67123026",
"0.6521473",
"0.63444614",
"0.63444614",
"0.63444614",
"0.63444614",
"0.63444614",
"0.62976587",
"0.62660164",
"0.6234342",
"0.6199864",
"0.61125475",
"0.60712814",
"0.6032157",
"0.5999861",
"0.5973536",
"0.5967822",
"0.59... | 0.79591376 | 0 |
aggroHitTimer How long this mob would stay angry at this attacker if aggroed via hit | int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"public interface IHitAggro {\n /**\n * shouldAggroOnHit\n * The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity\n * Should NOT trigger the aggro itself! That should only occ... | [
"0.688876",
"0.6758555",
"0.6490412",
"0.64149743",
"0.63874286",
"0.63290006",
"0.6230141",
"0.6131724",
"0.6101909",
"0.6071835",
"0.6037663",
"0.6022642",
"0.6011783",
"0.6002283",
"0.59953773",
"0.59373164",
"0.5915731",
"0.58806574",
"0.5865827",
"0.5856175",
"0.58493847... | 0.8607811 | 0 |
shouldAggroTowardsMob Whether this mob should go attack that mob by seeing it | boolean shouldAutoAggro(IGeneticMob geneticMob, EntityLiving otherEntity); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"@Override\r\n\tpublic boolean attackEntityAsMob(Entity target) {\r\n\t\t\r\n\t\tboolean flag = super.attackEntityAsMob(target);\r\n\t\tflag = target.attackEntityFrom(DamageSource.causeMobDamage(this), (float)((int)this.getEntityAttribute(S... | [
"0.742728",
"0.6908835",
"0.68257934",
"0.6736443",
"0.66751146",
"0.65000975",
"0.6439552",
"0.6405393",
"0.63933146",
"0.63779145",
"0.63771766",
"0.63237077",
"0.6305707",
"0.62485677",
"0.6140846",
"0.61147404",
"0.6091959",
"0.60728",
"0.6066074",
"0.6050489",
"0.6032344... | 0.7504001 | 0 |
shouldEatOffTheGround The desirability of this item to this mob | float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }",
"public boolean canAttackWithItem() {\n/* 215 */ return false;\n/* */ }",
"public boolean damagable() {\n return !this.state.equals(\"knockedBack\")\n ... | [
"0.68794197",
"0.6655902",
"0.6641247",
"0.6575853",
"0.65440196",
"0.64550143",
"0.6298038",
"0.6269937",
"0.6267241",
"0.62417036",
"0.6131832",
"0.61259353",
"0.6121531",
"0.60843086",
"0.60811144",
"0.6055492",
"0.6049359",
"0.6035561",
"0.60307896",
"0.6018652",
"0.60144... | 0.7033267 | 0 |
getHomeCoords Returns the current coordinates of this mob's home, if they exist | Vec3 getHomeCoords(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double[] getHomePosition()\r\n\t{\r\n\t\treturn dataStorage.getHomePosition();\r\n\t}",
"public Location getHome() {\n return home;\n }",
"private int[] findHome() {\n int[] loc = new int[2];\n switch (playerNum) {\n case 0: //player RED's home\n loc[0] ... | [
"0.7364839",
"0.64021313",
"0.6168838",
"0.5885873",
"0.5843075",
"0.5825167",
"0.5769801",
"0.5596718",
"0.55674416",
"0.5497497",
"0.5474314",
"0.5464747",
"0.5461798",
"0.5459704",
"0.543538",
"0.54248106",
"0.54110634",
"0.53977203",
"0.53614193",
"0.53476524",
"0.5252272... | 0.6783583 | 1 |
isValidHome whether the block at the given coords is a valid home for this mob | boolean isValidHome(IGeneticMob geneticMob, Vec3 coords); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean wouldBeValidHome(IGeneticMob geneticMob, Vec3 coords, Block block, int metadata, TileEntity te);",
"boolean setHome(IGeneticMob geneticMob, Vec3 coords);",
"@Override\n public boolean isLocationValid(XYCoord coords)\n {\n return master.isLocationValid(coords);\n }",
"private boolean checkM(){\n... | [
"0.7989653",
"0.62144995",
"0.59624064",
"0.5941752",
"0.5725879",
"0.5682741",
"0.56035316",
"0.5571968",
"0.55376375",
"0.55292743",
"0.5527048",
"0.5523266",
"0.5520648",
"0.5514577",
"0.55023277",
"0.54946434",
"0.5470993",
"0.5447642",
"0.5440407",
"0.53769505",
"0.53730... | 0.7845156 | 1 |
wouldBeValidHome whether the block at the given coords would be a valid home for this mob if the given block was placed there | boolean wouldBeValidHome(IGeneticMob geneticMob, Vec3 coords, Block block, int metadata, TileEntity te); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isValidHome(IGeneticMob geneticMob, Vec3 coords);",
"private boolean quickVerify(Location loc)\n {\n //quickly check if 2 blocks above this is clear\n Block oneAbove = loc.getBlock();\n Block twoAbove = oneAbove.getRelative(BlockFace.UP, 1);\n return oneAbove.getType().equa... | [
"0.7205015",
"0.6145603",
"0.6105076",
"0.6025025",
"0.59262276",
"0.58691007",
"0.5837147",
"0.58280915",
"0.5798142",
"0.5776919",
"0.57474846",
"0.571689",
"0.5683978",
"0.5681744",
"0.56401634",
"0.56299436",
"0.55582213",
"0.55089045",
"0.54875064",
"0.54754335",
"0.5474... | 0.803842 | 0 |
setHome Try to set the home of this mob to the specified coords | boolean setHome(IGeneticMob geneticMob, Vec3 coords); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setHome(Location home) {\n this.home = home;\n }",
"public void setHome(int home) {\n m_home = home;\n }",
"public void setHomePosition(String latlng) {\r\n\t\t\r\n\t\tdataStorage.setHomePosition(latlng);\r\n\t\t\r\n\t}",
"public void setIsHome(boolean isHome) {\n this.... | [
"0.76402044",
"0.72265",
"0.68831867",
"0.65164",
"0.6482401",
"0.6410484",
"0.6387669",
"0.6291238",
"0.6177199",
"0.61439574",
"0.6067667",
"0.5970028",
"0.5900061",
"0.5891986",
"0.58805376",
"0.5833806",
"0.5830301",
"0.5820017",
"0.58107066",
"0.58057207",
"0.5799349",
... | 0.7278473 | 1 |
removeHome Attempt to remove the current home coordinates of this mob without setting a new home | boolean removeHome(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeHome(UUID uuid, String name){\r\n\t\t//Load Map (Update)\r\n\t\tloadMap();\r\n\r\n\t\t//Combovar of Homename & UUID of Player\r\n\t\tString uniqhome = uuid.toString() + name;\r\n\r\n\t\t//Remove HomePoint from Map\r\n\t\tmap.remove(uniqhome);\r\n\r\n\t\t//Save Map\r\n\t\ttry {\r\n\t\t\tObjectOutp... | [
"0.6608096",
"0.58763444",
"0.585116",
"0.5817634",
"0.5696138",
"0.564722",
"0.5547578",
"0.5534023",
"0.548113",
"0.5414235",
"0.54064804",
"0.5399175",
"0.5393153",
"0.53732526",
"0.53494275",
"0.52807117",
"0.5280127",
"0.52493286",
"0.52387536",
"0.52011544",
"0.51844394... | 0.71516204 | 0 |
goHome Try to send this mob to its current home coordinates | boolean goHome(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void go_to_home_position() {\n stop_hold_arm();\n Pneumatics.get_instance().set_solenoids(false);\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_home, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }",
"@Override\n\tpublic void returnHome()... | [
"0.77481216",
"0.74796987",
"0.7048764",
"0.69208246",
"0.68701077",
"0.6828129",
"0.6818263",
"0.6631181",
"0.6623191",
"0.65947247",
"0.6556591",
"0.6376272",
"0.6345812",
"0.6322431",
"0.6274678",
"0.6220312",
"0.6210703",
"0.61943984",
"0.61922115",
"0.618218",
"0.6176503... | 0.68130887 | 7 |
isHome Checks to see if this mob is close enough to its home to count as being at home | boolean isHome(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean getIsHome() {\n return isHome;\n }",
"public void setIsHome(boolean isHome) {\n this.isHome = isHome;\n }",
"public boolean isHome() {\n return getHomePackageNames().contains(\n mActivityManager.getRunningTasks(1).get(0).topActivity.getPackageName());\n ... | [
"0.7159767",
"0.7037034",
"0.6904173",
"0.6386713",
"0.63694566",
"0.62990826",
"0.6237692",
"0.618573",
"0.61616707",
"0.6161035",
"0.6138407",
"0.6136529",
"0.61137396",
"0.61113036",
"0.61055124",
"0.60961914",
"0.6070881",
"0.6067027",
"0.60661554",
"0.6011901",
"0.598526... | 0.734149 | 0 |
getting all the matches | @Override
public void onResults(Bundle results) {
ArrayList<String> matches = results
.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
//displaying the first match
if (matches != null)
editText.setText(matches.get(0));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Match getMatches();",
"public List<Match> getAllMatches() {\n\t\treturn matchers.stream()\n\t\t\t\t.flatMap(m -> m.getMatches().stream())\n\t\t\t\t.distinct()\n\t\t\t\t.collect(Collectors.toList());\n\t}",
"public List<Match> listAllMatch() {\n\t\treturn matchDao.list(\"from Match\");\r\n\t}",
"public List<M... | [
"0.80759805",
"0.72830695",
"0.6935073",
"0.6904236",
"0.6869159",
"0.65027815",
"0.6385258",
"0.618343",
"0.6151057",
"0.61478305",
"0.61444956",
"0.6122036",
"0.61217093",
"0.6088543",
"0.6085373",
"0.6056622",
"0.603643",
"0.5976066",
"0.59593135",
"0.5935304",
"0.59124756... | 0.0 | -1 |
/ replace the propertyResolver with one that does our bidding for this test. | public void replacePropertyResolver(ActionEvent action) {
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
// see if we need to take action-
if (null == context.getExternalContext().getSessionMap().get("systest.replacePropertyResolver")) {
final PropertyResolver oldProp = app.getPropertyResolver();
PropertyResolver
newProp = new PropertyResolver() {
public Object getValue(Object base, Object property)
throws EvaluationException, PropertyNotFoundException {
return oldProp.getValue(base, property);
}
public Object getValue(Object base, int index)
throws EvaluationException, PropertyNotFoundException {
return oldProp.getValue(base, index);
}
public void setValue(Object base, Object property, Object value)
throws EvaluationException, PropertyNotFoundException {
TestBean.this.setValueChangeMessage("setValue() called");
oldProp.setValue(base, property, value);
}
public void setValue(Object base, int index, Object value)
throws EvaluationException, PropertyNotFoundException {
TestBean.this.setValueChangeMessage("setValue() called");
oldProp.setValue(base, index, value);
}
public boolean isReadOnly(Object base, Object property)
throws EvaluationException, PropertyNotFoundException {
return oldProp.isReadOnly(base, property);
}
public boolean isReadOnly(Object base, int index)
throws EvaluationException, PropertyNotFoundException {
return oldProp.isReadOnly(base, index);
}
public Class getType(Object base, Object property)
throws EvaluationException, PropertyNotFoundException {
return oldProp.getType(base, property);
}
public Class getType(Object base, int index)
throws EvaluationException, PropertyNotFoundException {
return oldProp.getType(base, index);
}
};
app.setPropertyResolver(newProp);
context.getExternalContext().getSessionMap().put("systest.replacePropertyResolver", oldProp);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setResolver( final PropertyResolver propertyResolver )\n {\n m_propertyResolver = propertyResolver;\n }",
"@Test\n public void testResolveWithSysPropResolver() {\n Resolver sysPropResolver = VariableExpansion.SYS_PROP_RESOLVER;\n\n assertNull(\"System property value u... | [
"0.6673479",
"0.629805",
"0.6243793",
"0.6045432",
"0.6038588",
"0.57540816",
"0.5719035",
"0.5617479",
"0.5607412",
"0.55774325",
"0.55176014",
"0.54933447",
"0.5431183",
"0.5401168",
"0.5379556",
"0.536488",
"0.53642625",
"0.53364664",
"0.5297101",
"0.5274983",
"0.5262303",... | 0.62167454 | 3 |
/ restore the original PropertyResolver. | public void restorePropertyResolver(ActionEvent action) {
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
PropertyResolver oldProp = null;
// see if we need to take action-
if (null != (oldProp = (PropertyResolver) context.getExternalContext().getSessionMap().get("systest.replacePropertyResolver"))) {
app.setPropertyResolver(oldProp);
context.getExternalContext().getSessionMap().remove("systest.replacePropertyResolver");
setValueChangeMessage(null);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void replacePropertyResolver(ActionEvent action) {\n FacesContext context = FacesContext.getCurrentInstance();\n Application app = context.getApplication();\n \n // see if we need to take action-\n if (null == context.getExternalContext().getSessionMap().get(\"systest.replacePropertyResolver... | [
"0.63226587",
"0.6070676",
"0.58032113",
"0.5686828",
"0.56485754",
"0.56336933",
"0.54001844",
"0.5313503",
"0.5294512",
"0.5288753",
"0.5241778",
"0.52223665",
"0.5221265",
"0.5211519",
"0.5157029",
"0.51502603",
"0.5135488",
"0.51281637",
"0.5119545",
"0.5077623",
"0.50679... | 0.7490115 | 0 |
Getter for property setPropertyTarget. | public String getSetPropertyTarget() {
return this.setPropertyTarget;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setSetPropertyTarget(String setPropertyTarget) {\n \n this.setPropertyTarget = setPropertyTarget;\n }",
"Property getProperty();",
"Property getProperty();",
"public String propertyName() {\n\t\t\treturn target != null ? target : name;\n\t\t}",
"String getTarget() {\r\n retur... | [
"0.73731506",
"0.62644106",
"0.62644106",
"0.61308",
"0.6055199",
"0.601758",
"0.5983369",
"0.5981977",
"0.59547955",
"0.59547955",
"0.59547955",
"0.58336264",
"0.58280826",
"0.5804406",
"0.58024687",
"0.58024687",
"0.57713085",
"0.5769123",
"0.571878",
"0.5679757",
"0.566878... | 0.82209975 | 0 |
Setter for property setPropertyTarget. | public void setSetPropertyTarget(String setPropertyTarget) {
this.setPropertyTarget = setPropertyTarget;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getSetPropertyTarget() {\n \n return this.setPropertyTarget;\n }",
"protected void setValue(Object target, String targetName, String propName,\n\t\t\tObject valToSet) throws WekaException {\n\n\t\ttry {\n\t\t\tgetStepManager().logDebug(\n\t\t\t\t\t\"Attempting to set property '\" + prop... | [
"0.70539385",
"0.64112264",
"0.63356054",
"0.6262528",
"0.61386913",
"0.6113934",
"0.61058974",
"0.60720223",
"0.59967965",
"0.5949177",
"0.58943325",
"0.5881766",
"0.58252823",
"0.58252823",
"0.5821029",
"0.5814518",
"0.5789569",
"0.57798517",
"0.5716645",
"0.5706041",
"0.56... | 0.8505647 | 0 |
Getter for property counter. | public String getCounter() {
counter = Integer.valueOf(counterInt++).toString();
return counter;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getCounter() {\r\n return counter;\r\n }",
"public int getCounter(){\n return counter;\n }",
"public int getCounter() {\n return counter;\n }",
"public int getCounter()\n {\n return counter;\n }",
"public Integer getCounter() {\n return counter;\... | [
"0.7566968",
"0.7535598",
"0.7532318",
"0.7488184",
"0.74614793",
"0.7431591",
"0.7324225",
"0.7256066",
"0.7252001",
"0.69623756",
"0.6773025",
"0.67710674",
"0.6769036",
"0.6721143",
"0.6701539",
"0.67007136",
"0.6643195",
"0.6632502",
"0.6554182",
"0.6550067",
"0.653914",
... | 0.663302 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.