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 |
|---|---|---|---|---|---|---|
PO: Moves this actor to a new location. If there is another actor at the given location, it is removed. Precondition: (1) This actor is contained in a grid (2) newLocation is valid in the grid of this actor | public void moveTo(Actor actor, Location newLocation)
{
//creating the variables to make the code easier to read
Grid<Actor> grid = actor.getGrid();
Location location = actor.getLocation();
if (grid == null)
throw new IllegalStateException("This actor is not in a grid.");
if (grid.get(location) != actor)
throw new IllegalStateException(
"The grid contains a different actor at location "
+ location + ".");
if (!grid.isValid(newLocation))
throw new IllegalArgumentException("Location " + newLocation
+ " is not valid.");
if (newLocation.equals(location))
return;
//this line below was added
actor.removeSelfFromGrid();
//changed the code slightly to make sure now that not being called from within the actor that we refer to the
//actor itself when removing and placing actor on grid
//grid.remove(location);
Actor other = grid.get(newLocation);
if (other != null)
other.removeSelfFromGrid();
location = newLocation;
actor.putSelfInGrid(grid, location);
//grid.put(location, actor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic boolean move(Tile newLocation){\r\n\t\tif(!newLocation.checkOccupied() && newLocation.attribute != Tile.typeAttributes.get(TileType.WALL_TILE)){\r\n\t\t\tcurrentPosition.pullUnit();\r\n\t\t\tthis.currentPosition = newLocation;\r\n\t\t\tthis.currentPosition.pushUnit(this);\r\n\t\t\treturn true... | [
"0.7242688",
"0.71756965",
"0.6996713",
"0.6746841",
"0.67115504",
"0.6632291",
"0.6470968",
"0.6324901",
"0.6215709",
"0.6200773",
"0.6174651",
"0.6165584",
"0.61594313",
"0.6156949",
"0.61397886",
"0.6130017",
"0.61175215",
"0.608951",
"0.60791254",
"0.6019464",
"0.6013554"... | 0.83657277 | 0 |
Tests whether this bug can move forward into a location that is empty or contains a flower. | public boolean canMove(Actor actor)
{
//PO: updated the methods after the move from the Bug Class to be called from
//PO: the passed actor
Grid<Actor> gr = actor.getGrid();
if (gr == null)
return false;
Location loc = actor.getLocation();
Location next = loc.getAdjacentLocation(actor.getDirection());
if (!gr.isValid(next))
return false;
Actor neighbor = gr.get(next);
return (neighbor == null) || (neighbor instanceof Flower);
// ok to move into empty location or onto flower
// not ok to move onto any other actor
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean canMoveForward()\n {\n boolean ans = true;\n\n Iterator<WallMulti> walls = this.walls.iterator();\n\n while(walls.hasNext ())\n {\n WallMulti wall = walls.next();\n\n if(wall.getType ().equals (\"H\"))\n {\n if(locX>=wall... | [
"0.6536339",
"0.64703673",
"0.6430293",
"0.635493",
"0.6331816",
"0.62543666",
"0.6225393",
"0.61649424",
"0.6157155",
"0.61149",
"0.6107254",
"0.6092737",
"0.60610604",
"0.60569406",
"0.6055393",
"0.6033172",
"0.60091025",
"0.60077155",
"0.60024655",
"0.59948653",
"0.5992407... | 0.65873444 | 0 |
Moves the bug forward, putting a flower into the location it previously occupied. | public void move(Actor actor)
{
//PO: updated the methods after the move from the Bug Class to be called from
//PO: the passed actor
Grid<Actor> gr = actor.getGrid();
if (gr == null)
return;
Location loc = actor.getLocation();
Location next = loc.getAdjacentLocation(actor.getDirection());
if (gr.isValid(next))
//PO: alter the original code instead of calling the
//PO: moveTo method in Actor call the method that is from this current behaviour
this.moveTo(actor, next);
else
actor.removeSelfFromGrid();
Flower flower = new Flower(actor.getColor());
flower.putSelfInGrid(gr, loc);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void move() {\r\n Grid<Actor> gr = getGrid();\r\n if (gr == null) {\r\n return;\r\n }\r\n Location loc = getLocation();\r\n if (gr.isValid(next)) {\r\n setDirection(getLocation().getDirectionToward(next));\r\n moveTo(next);... | [
"0.69086903",
"0.6875838",
"0.6756886",
"0.62560964",
"0.6204533",
"0.61993456",
"0.602484",
"0.5981714",
"0.59634155",
"0.5945705",
"0.5863505",
"0.58079463",
"0.5800861",
"0.5794943",
"0.5766349",
"0.5761529",
"0.5750345",
"0.57409793",
"0.5724312",
"0.5712281",
"0.56904507... | 0.6425735 | 3 |
A timer, so info can be displayed at the beginning of every battle Creates a new battle against a trainer, reading in a Pokemon from a file. | public BattleWorld(int enemyPokemonID)
{
wildPokemon = false;
isBattleOver = false;
initWorld("", 0, enemyPokemonID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void load(){\n\t\tinbattle=true;\n\t\ttry{\n\t\t\tFile f=new File(Constants.PATH+\"\\\\InitializeData\\\\battlesavefile.txt\");\n\t\t\tScanner s=new Scanner(f);\n\t\t\tturn=s.nextInt();\n\t\t\ts.nextLine();\n\t\t\tString curr=s.next();\n\t\t\tif(curr.equals(\"WildTrainer:\"))\n\t\t\t\topponent=WildTr... | [
"0.6257378",
"0.6034262",
"0.6030672",
"0.5990752",
"0.59399617",
"0.59213126",
"0.5847182",
"0.58384734",
"0.5825083",
"0.5806089",
"0.57246614",
"0.5722113",
"0.5695576",
"0.5685689",
"0.56542957",
"0.5579471",
"0.5574777",
"0.5570244",
"0.55442077",
"0.55311984",
"0.549168... | 0.0 | -1 |
Creates a battle against a wild Pokemon. | public BattleWorld(String pokemonName, int level)
{
wildPokemon = true;
isBattleOver = false;
initWorld(pokemonName, level, 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public PlayerFighter create(GamePlayer player);",
"public Battle() {\r\n\t\tfoesPokemon = new Pokemon[] {\r\n\t\t\t\tnew Totodile(12),\r\n\t\t\t\tnew Bulbasaur(15),\r\n\t\t\t\tnew Combusken(20),\r\n\t\t\t\tnew Raichu(25),\r\n\t\t\t\tnew Venausaur(50),\r\n\t\t\t\tnew Blaziken(50)\r\n\t\t};\r\n\t\tyourPokemon = ne... | [
"0.6195924",
"0.60455287",
"0.6037541",
"0.59652567",
"0.580055",
"0.575251",
"0.57318985",
"0.5688625",
"0.559698",
"0.55717295",
"0.55249065",
"0.55231625",
"0.5519389",
"0.5496968",
"0.54933393",
"0.5441131",
"0.54358244",
"0.54249626",
"0.54239184",
"0.5423751",
"0.542248... | 0.51226825 | 65 |
Initialises the new battle. | public void initWorld(String inName, int inLevel, int id)
{
setBackground(248);
addObject(playerPkmnInfoBox, 334, 229);
addObject(enemyPkmnInfoBox, 144, 49);
currentEnemyPokemon = id;
addNewPokemon("Player", currentPlayerPokemon, "", 0);
if(wildPokemon)
{
addNewPokemon("Enemy", currentEnemyPokemon, inName, inLevel);
}
else
{
addNewPokemon("Enemy", currentEnemyPokemon, "", 0);
}
this.textInfoBox = new TextInfoBox("BattleSelectBox", "BattleBar", currentPlayerPokemon);
addObject(textInfoBox, getWidth() / 2, getHeight() - 69); //Battle Text Box
newMusic("Battle");
Greenfoot.setSpeed(50);
setPaintOrder(Blackout.class, TextInfoBox.class, PkmnInfoBox.class, Pokemon.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Battle(){\r\n\t\t\r\n\t}",
"public Battle() {\r\n\t\tnbVals = 0;\r\n\t\tplayer1 = new Deck();\r\n\t\tplayer2 = new Deck();\r\n\t\ttrick = new Deck();\r\n\t}",
"public Battle() {\r\n\t\tfoesPokemon = new Pokemon[] {\r\n\t\t\t\tnew Totodile(12),\r\n\t\t\t\tnew Bulbasaur(15),\r\n\t\t\t\tnew Combusken(20),\... | [
"0.738602",
"0.7246132",
"0.6960692",
"0.651809",
"0.63326705",
"0.63113075",
"0.63102186",
"0.62714374",
"0.62570155",
"0.6248426",
"0.6239063",
"0.6230058",
"0.61710703",
"0.6168952",
"0.61657906",
"0.61410445",
"0.6140685",
"0.61261284",
"0.6119456",
"0.6114515",
"0.610094... | 0.0 | -1 |
Adds a new Pokemon to the world. | public void addNewPokemon(String type, int index, String tempName, int tempLevel)
{
if(type.equals("Player"))
{
if(getObjects(Pokemon.class).size() == 2)
{
savePokemonData(playerPokemon, currentPlayerPokemon);
removeObject(playerPokemon);
}
for(int i = 0; i < 6; i++)
{
if(Reader.readIntFromFile("playerPokemon", index, 3) > 0)
{
makePlayerPokemon(index);
break;
}
index++;
}
playerPokemonName = playerPokemon.getName();
addObject(playerPokemon, getWidth() / 4, getHeight() / 2 - 12);
if(getObjects(Pokemon.class).size() == 2)
{
playerPkmnInfoBox.drawAll();
}
}
else if(type.equals("Enemy"))
{
if(getObjects(Pokemon.class).size() == 2)
{
removeObject(enemyPokemon);
}
if(!wildPokemon)
{
String enemyPkmnName = Reader.readStringFromFile("pokeMonListBattle", index, 0);
int enemyPkmnLevel = Reader.readIntFromFile("pokeMonListBattle", index, 1);
boolean enemyPkmnGender = Reader.readBooleanFromFile("pokeMonListBattle", index, 2);
int enemyPkmnCurrentHealth = Reader.readIntFromFile("pokeMonListBattle", index, 3);
this.enemyPokemon = new Pokemon(currentEnemyPokemon, enemyPkmnName, enemyPkmnLevel, enemyPkmnGender, enemyPkmnCurrentHealth, 0, false);
enemyPokemonName = enemyPkmnName;
addObject(enemyPokemon, 372, 84);
}
else
{
this.enemyPokemon = new Pokemon(currentEnemyPokemon, tempName, tempLevel, getRandomBoolean(), 9999, 0, false);
enemyPokemonName = tempName;
addObject(enemyPokemon, 372, 84);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addNewPokemon(Pokemon pokemon) {\n try {\n PokemonSpecies pokemonSpecies = findSeenSpeciesData(pokemon.getSpecies());\n // then this Pokemon has been encountered before, just add to inventory\n pokemonSpecies.addNewPokemon(pokemon);\n } catch (PokedexException e) {\n // then t... | [
"0.74890906",
"0.7066181",
"0.6935309",
"0.6927881",
"0.6836731",
"0.6730086",
"0.6615398",
"0.6542769",
"0.6395855",
"0.6340557",
"0.63043094",
"0.6302678",
"0.6289809",
"0.62379676",
"0.6201173",
"0.6139551",
"0.60003024",
"0.5971128",
"0.5961929",
"0.590506",
"0.5901074",
... | 0.6660341 | 6 |
Creates a new player Pokemon. | public void makePlayerPokemon(int index)
{
String playerPkmnName = Reader.readStringFromFile("playerPokemon", index, 0);
int playerPkmnLevel = Reader.readIntFromFile("playerPokemon", index, 1);
boolean playerPkmnGender = Reader.readBooleanFromFile("playerPokemon", index, 2);
int playerPkmnCurrentHealth = Reader.readIntFromFile("playerPokemon", index, 3);
int playerPkmnExp = Reader.readIntFromFile("playerPokemon", index, 4);
this.playerPokemon = new Pokemon(currentPlayerPokemon, playerPkmnName, playerPkmnLevel, playerPkmnGender, playerPkmnCurrentHealth, playerPkmnExp, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public PokemonEntity create(PokemonEntity pokemon )\n {\n em.persist(pokemon);\n return pokemon;\n }",
"void createPlayer(Player player);",
"public Pokemon() {\n }",
"public void insertPokemon(Pokemon p) {\r\n\t\tEntityManager em = emfactory.createEntityManager();\r\n\t\tem.getTransactio... | [
"0.7159877",
"0.6816528",
"0.6616906",
"0.6564289",
"0.6521441",
"0.6470215",
"0.64411294",
"0.6426973",
"0.64045686",
"0.6372435",
"0.6320469",
"0.629934",
"0.6290465",
"0.6220222",
"0.61522853",
"0.61457044",
"0.61427087",
"0.6142596",
"0.6133154",
"0.6130402",
"0.61267084"... | 0.7070541 | 1 |
The act method of the world. Does the following: Shows intro text. Shows outro text. Goes back to GameWorld at the end of a battle. | public void act()
{
if(worldTimer == 1)
{
if(wildPokemon)
{
textInfoBox.displayText("Wild " + enemyPokemon.getName() + " appeared!", true, false);
}
else
{
textInfoBox.displayText("Enemy trainer sent out " + enemyPokemon.getName() + "!", true, false);
}
textInfoBox.displayText("Go " + playerPokemon.getName() + "!", true, false);
textInfoBox.updateImage();
worldTimer++;
}
else if(worldTimer == 0)
{
worldTimer++;
}
if(getObjects(Pokemon.class).size() < 2)
{
ArrayList<Pokemon> pokemon = (ArrayList<Pokemon>) getObjects(Pokemon.class);
for(Pokemon pkmn : pokemon)
{
if(pkmn.getIsPlayers() == true)
{
textInfoBox.displayText("Enemy " + enemyPokemonName.toUpperCase() + " fainted!", true, false);
int expGain = StatCalculator.experienceGainCalc(playerPokemon.getName(), playerPokemon.getLevel());
textInfoBox.displayText(playerPokemon.getName().toUpperCase() + " gained " + expGain + "\nEXP. Points!", true, false);
playerPokemon.addEXP(expGain);
if(playerPokemon.getCurrentExperience() >= StatCalculator.experienceToNextLevel(playerPokemon.getLevel()))
{
int newEXP = playerPokemon.getCurrentExperience() - StatCalculator.experienceToNextLevel(playerPokemon.getLevel());
playerPokemon.setEXP(newEXP);
playerPokemon.levelUp();
playerPokemon.newPokemonMoves();
textInfoBox.displayText(playerPokemonName.toUpperCase() + " grew to level " + playerPokemon.getLevel() + "!", true, false);
}
savePokemonData(playerPokemon, currentPlayerPokemon);
textInfoBox.updateImage();
isPlayersTurn = true;
battleOver();
}
else
{
textInfoBox.displayText(playerPokemonName.toUpperCase() + " fainted!", true, false);
String playerName = Reader.readStringFromFile("gameInformation", 0, 0);
textInfoBox.displayText(playerName + " blacked out!", true, false);
addObject(new Blackout("Fade"), getWidth() / 2, getHeight() / 2);
removeAllObjects();
String newWorld = Reader.readStringFromFile("gameInformation", 0, 4);
int newX = Reader.readIntFromFile("gameInformation", 0, 5);
int newY = Reader.readIntFromFile("gameInformation", 0, 6);
GameWorld gameWorld = new GameWorld(newWorld, newX, newY, "Down");
gameWorld.healPokemon();
Greenfoot.setWorld(gameWorld);
isPlayersTurn = true;
battleOver();
}
}
}
if(isBattleOver)
{
isPlayersTurn = true;
savePokemonData(playerPokemon, currentPlayerPokemon);
newGameWorld();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void act() \n {\n // Add your action code here.\n MyWorld world = (MyWorld) getWorld();\n jefe = world.comprobarJefe();\n \n \n explotar();\n \n if(jefe)\n {\n girarHaciaEnemigo();\n movimientoPegadoAJefe();\n }\n... | [
"0.76109844",
"0.76061183",
"0.75126266",
"0.74335563",
"0.73473614",
"0.7234561",
"0.71346796",
"0.7116039",
"0.7033136",
"0.7029543",
"0.69827324",
"0.6967522",
"0.6911516",
"0.6877378",
"0.6859318",
"0.68290424",
"0.6827736",
"0.68071663",
"0.6762324",
"0.6752092",
"0.6747... | 0.62229776 | 69 |
Sets the battle to be over. | public void battleOver()
{
isBattleOver = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final void turnOver() {\n this.currentMovementAllowance = this.details.getMaxMovementAllowance();\n this.onTurnOver();\n }",
"@Override\r\n\tpublic void gameOver() {\n\t\tover = true;\r\n\t\tupdate();\r\n\t}",
"public void setOver(boolean over) {\r\n isOver = over;\r\n }",
"... | [
"0.69008976",
"0.6893452",
"0.6763982",
"0.6637293",
"0.6616474",
"0.6597616",
"0.655179",
"0.65420866",
"0.6537785",
"0.64747965",
"0.6381829",
"0.6323245",
"0.6308149",
"0.62687993",
"0.61494815",
"0.61239046",
"0.6096752",
"0.60698336",
"0.60308653",
"0.60301036",
"0.60298... | 0.7957377 | 0 |
Changes the turn of the player's Pokemon. | public void changeTurn()
{
isPlayersTurn = !isPlayersTurn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void changePlayerTurn()\n {\n if (player_turn == RED)\n player_turn = BLACK;\n else\n player_turn = RED;\n }",
"public void changeTurn(){\n // this function is used to calculate the turn of a player after every move is played\n int turn = this.turn;\n ... | [
"0.7369993",
"0.7352865",
"0.7318808",
"0.72519493",
"0.7072087",
"0.70661813",
"0.6926491",
"0.68584406",
"0.67737585",
"0.67415196",
"0.66930854",
"0.6610932",
"0.6609573",
"0.65991527",
"0.65784574",
"0.6578192",
"0.6572467",
"0.65587556",
"0.6527713",
"0.6517228",
"0.6462... | 0.755541 | 0 |
Changes the world to GameWorld. | public void newGameWorld()
{
addObject(new Blackout("Fade"), getWidth() / 2, getHeight() / 2);
removeAllObjects();
GameWorld gameWorld = new GameWorld();
Greenfoot.setWorld(gameWorld);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setWorld(GameData world) {\r\n this.world = world;\r\n }",
"public void setWorld(World world) {\n this.world = world;\n }",
"protected void updateWorld(World world) {\r\n\t\tthis.world = world;\r\n\t\tsetup(); //Call setup again to re assign certain variables that depend\r\n\t\t\t\t /... | [
"0.7892208",
"0.7571313",
"0.75299495",
"0.72067255",
"0.6971724",
"0.6912633",
"0.68673843",
"0.6843358",
"0.6843194",
"0.67773575",
"0.6753272",
"0.674827",
"0.66813594",
"0.6596207",
"0.65782654",
"0.64825386",
"0.6421659",
"0.6408244",
"0.6406867",
"0.6400593",
"0.6290977... | 0.68452024 | 7 |
Removes the player info box. | public void removePlayerPkmnInfoBox()
{
removeObject(playerPkmnInfoBox);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void clearInfo() {\n helpFocal.setText(null);\n helpLens.setText(null);\n helpObject.setText(null);\n helpImage.setText(null);\n helpPrinciple.setText(null);\n info.setText(null);\n }",
"public void unload() {\n this.currentRooms.clear();\n // Zer... | [
"0.6448022",
"0.63067514",
"0.62557894",
"0.613896",
"0.6129657",
"0.611697",
"0.61140007",
"0.6049843",
"0.6029601",
"0.5971602",
"0.5904509",
"0.5864069",
"0.5852168",
"0.5844669",
"0.5818775",
"0.5805894",
"0.58030427",
"0.5786168",
"0.5782483",
"0.57813925",
"0.5770922",
... | 0.8855968 | 0 |
Saves the data of the current Pokemon. | public void savePokemonData()
{
try
{
int currentPokemon = playerPokemon.getCurrentPokemon();
FileWriter fw = new FileWriter("tempPlayerPokemon.txt");
List<String> list = Files.readAllLines(Paths.get("playerPokemon.txt"), StandardCharsets.UTF_8);
String[] pokemonList = list.toArray(new String[list.size()]);
String currentPokemonStr = pokemonList[currentPokemon];
String[] currentPokemonArray = currentPokemonStr.split("\\s*,\\s*");
currentPokemonArray[1] = Integer.toString(playerPokemon.getLevel());
currentPokemonArray[3] = Integer.toString(playerPokemon.getCurrentHealth());
currentPokemonArray[4] = Integer.toString(playerPokemon.getCurrentExperience());
for(int c = 0; c < 4; c++)
{
currentPokemonArray[5 + c] = playerPokemon.getMove(c);
}
String arrayAdd = currentPokemonArray[0];
for(int i = 1; i < currentPokemonArray.length; i++)
{
arrayAdd = arrayAdd.concat(", " + currentPokemonArray[i]);
}
pokemonList[currentPokemon] = arrayAdd;
for(int f = 0; f < pokemonList.length; f++)
{
fw.write(pokemonList[f]);
fw.write("\n");
}
fw.close();
Writer.overwriteFile("tempPlayerPokemon", "playerPokemon");
}
catch(Exception error)
{
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void save()\n\t{\n\t\tfor(PlayerData pd : dataMap.values())\n\t\t\tpd.save();\n\t}",
"void save() {\n gameModelPoDao.saveToFile(file.getAbsolutePath(), gameModelPo);\n }",
"public void save() {\n savePrefs();\n }",
"private void saveData() {\n }",
"public void save(){\r\n\t\ttry {\r... | [
"0.6837192",
"0.67360187",
"0.6535339",
"0.64985657",
"0.64647394",
"0.6408689",
"0.6378714",
"0.63058573",
"0.62612414",
"0.62499565",
"0.62124735",
"0.619285",
"0.61603343",
"0.61600643",
"0.6151947",
"0.6120496",
"0.60878915",
"0.606963",
"0.60693455",
"0.60670793",
"0.602... | 0.7545663 | 0 |
Sets the player Pokemon object to null. | public void setPlayerPkmnNull()
{
playerPokemon = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setEnemyPkmnNull()\r\n {\r\n enemyPokemon = null;\r\n }",
"public Builder clearPokemonDisplay() {\n if (pokemonDisplayBuilder_ == null) {\n pokemonDisplay_ = null;\n onChanged();\n } else {\n pokemonDisplay_ = null;\n pokemonDisplayBuilde... | [
"0.7774379",
"0.6242638",
"0.6241162",
"0.6217543",
"0.60307246",
"0.60048735",
"0.599411",
"0.59817547",
"0.597527",
"0.5961636",
"0.59574956",
"0.59513044",
"0.5929807",
"0.5899159",
"0.58976346",
"0.5881219",
"0.58232987",
"0.5800122",
"0.5778813",
"0.5764935",
"0.56908774... | 0.8478543 | 0 |
Sets the enemy Pokemon object to null. | public void setEnemyPkmnNull()
{
enemyPokemon = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void nullEnemy(){\n enemy = null;\n nullEntity();\n }",
"public void setPlayerPkmnNull()\r\n {\r\n playerPokemon = null;\r\n }",
"public void enemyoff(){\n getWorld().removeObject(this);\n }",
"private void nullify() {\n paint = null;\n bg1 = null;... | [
"0.7678603",
"0.75187707",
"0.65179867",
"0.630473",
"0.6258495",
"0.6220579",
"0.6011205",
"0.5886352",
"0.5831209",
"0.58140796",
"0.57850677",
"0.57827055",
"0.5777734",
"0.5742273",
"0.5734157",
"0.5729768",
"0.57282144",
"0.57045704",
"0.56849205",
"0.5678923",
"0.565655... | 0.86735046 | 0 |
Changes the current player Pokemon. | public void setCurrentPlayerPokemon(int newID)
{
currentPlayerPokemon = newID;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setCurrentPlayer(Player P){\n this.currentPlayer = P;\n }",
"public void Switch()\n {\n if(getCurrentPokemon().equals(Pokemon1))\n {\n // Change to pokemon2\n setCurrentPokemon(Pokemon2);\n }\n // if my current pokemon is the same as poke... | [
"0.68501824",
"0.67501545",
"0.6649691",
"0.65842867",
"0.6498279",
"0.6404883",
"0.63881904",
"0.63694626",
"0.6365992",
"0.6291207",
"0.6289429",
"0.62711847",
"0.62367195",
"0.62366027",
"0.6233333",
"0.62225276",
"0.6205992",
"0.6204316",
"0.619615",
"0.61846393",
"0.6164... | 0.7575174 | 0 |
Returns the current player Pokemon. | public int getCurrentPlayerPokemon()
{
return currentPlayerPokemon;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Pokemon getPlayerPokemon()\r\n {\r\n return playerPokemon;\r\n }",
"public Pokemon getAlivePokemon() {\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tif (p.getCurrentHP() > 0) {\r\n\t\t\t\treturn p;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public POGOProtos.Rpc.CombatProto.Combat... | [
"0.83478695",
"0.7712315",
"0.7381976",
"0.7380506",
"0.73567814",
"0.7353675",
"0.71875226",
"0.71514577",
"0.7140544",
"0.7136758",
"0.7033879",
"0.70203024",
"0.69703835",
"0.69142824",
"0.6897648",
"0.6850171",
"0.68390846",
"0.68390846",
"0.6835606",
"0.682411",
"0.68180... | 0.81058323 | 1 |
Returns reference to the player Pokemon. | public Pokemon getPlayerPokemon()
{
return playerPokemon;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Pokemon getAlivePokemon() {\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tif (p.getCurrentHP() > 0) {\r\n\t\t\t\treturn p;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"POGOProtos.Rpc.PokemonProto getPokemon();",
"public Pokemon getEnemyPokemon()\r\n {\r\n return enemyPokemon;\r\n }"... | [
"0.7636486",
"0.75805223",
"0.7429093",
"0.7395827",
"0.71194667",
"0.71093565",
"0.71026725",
"0.7016045",
"0.69585705",
"0.6916428",
"0.68542916",
"0.6790417",
"0.6769662",
"0.67660373",
"0.67477363",
"0.6702579",
"0.6604544",
"0.65723044",
"0.655377",
"0.65291756",
"0.6524... | 0.8465837 | 0 |
Returns reference to the enemy Pokemon. | public Pokemon getEnemyPokemon()
{
return enemyPokemon;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Pokemon getAlivePokemon() {\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tif (p.getCurrentHP() > 0) {\r\n\t\t\t\treturn p;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public Enemy getEnemy(){\n return enemy;\n }",
"public Pokemon getPlayerPokemon()\r\n {\r\n return playerPok... | [
"0.7246401",
"0.70771784",
"0.6975623",
"0.6886952",
"0.6749369",
"0.6271097",
"0.6242902",
"0.6233382",
"0.6180347",
"0.61481124",
"0.61170465",
"0.6106152",
"0.6105061",
"0.60549074",
"0.60458946",
"0.6028242",
"0.59965247",
"0.59964395",
"0.5968823",
"0.5960694",
"0.596028... | 0.8490559 | 0 |
Returns reference to the player Pokemon info box. | public PkmnInfoBox getPlayerInfoBox()
{
return playerPkmnInfoBox;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Pokemon getPlayerPokemon()\r\n {\r\n return playerPokemon;\r\n }",
"POGOProtos.Rpc.PokemonDisplayProto getPokemonDisplay();",
"POGOProtos.Rpc.PokemonDisplayProtoOrBuilder getPokemonDisplayOrBuilder();",
"POGOProtos.Rpc.PokemonProto getPokemon();",
"public String getPokemonName() {\n\t\t... | [
"0.69959426",
"0.6851237",
"0.6539949",
"0.64283234",
"0.63940316",
"0.6320603",
"0.626839",
"0.6265339",
"0.6242054",
"0.60523504",
"0.6045673",
"0.60437477",
"0.60279644",
"0.6016358",
"0.60088736",
"0.6003945",
"0.5991715",
"0.59766877",
"0.59264284",
"0.5907959",
"0.58502... | 0.773585 | 0 |
Returns reference to the enemy Pokemon info box. | public PkmnInfoBox getEnemyInfoBox()
{
return enemyPkmnInfoBox;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Pokemon getEnemyPokemon()\r\n {\r\n return enemyPokemon;\r\n }",
"public PkmnInfoBox getPlayerInfoBox()\r\n {\r\n return playerPkmnInfoBox;\r\n }",
"public Pokemon getPlayerPokemon()\r\n {\r\n return playerPokemon;\r\n }",
"public Pokemon getAlivePokemon() {\r\n\... | [
"0.73491",
"0.6482694",
"0.63135326",
"0.6271558",
"0.5936762",
"0.58750284",
"0.5798727",
"0.57820237",
"0.57670784",
"0.5720245",
"0.5693722",
"0.56745285",
"0.5667237",
"0.5600817",
"0.55807334",
"0.55567",
"0.55457205",
"0.55095464",
"0.55035627",
"0.55033404",
"0.5484569... | 0.7930504 | 0 |
Returns reference to the text info box. | public TextInfoBox getTextInfoBox()
{
return textInfoBox;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getInfoText();",
"public String getAboutBoxText();",
"public void setInfoText(String infoText);",
"private JTextField getTxtIdC() {\n\t\tif (txtIdC == null) {\n\t\t\ttxtIdC = new JTextField();\n\t\t\ttxtIdC.setBounds(new Rectangle(140, 10, 125, 16));\n\t\t}\n\t\treturn txtIdC;\n\t}",
"private... | [
"0.7151146",
"0.7039065",
"0.66019505",
"0.6470923",
"0.6381983",
"0.6328738",
"0.63278186",
"0.6322636",
"0.63096553",
"0.627386",
"0.62515557",
"0.62427235",
"0.62421626",
"0.62029153",
"0.6197726",
"0.6178101",
"0.6142377",
"0.61401975",
"0.61272126",
"0.61141616",
"0.6114... | 0.858787 | 0 |
Returns of the battle is over or not. | public boolean getIsBattleOver()
{
return isBattleOver;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isBattleOver() {\n\t\treturn battleOver;\n\t}",
"public boolean isOver() {\n \treturn status == GameStatus.victory || status == GameStatus.draw || status == GameStatus.quit;\n }",
"public boolean gameOver() \n {\n \treturn status() != GAME_NOT_OVER;\n }",
"public boolean isBattl... | [
"0.82399154",
"0.772624",
"0.7720861",
"0.7690286",
"0.7612658",
"0.7411291",
"0.7383918",
"0.7383918",
"0.7340194",
"0.73254883",
"0.73186576",
"0.7317525",
"0.729618",
"0.729618",
"0.72692055",
"0.72648865",
"0.72316694",
"0.7194031",
"0.7193211",
"0.71869236",
"0.71869236"... | 0.8184108 | 1 |
Returns if it is the player's turn or not. | public static boolean getIsPlayersTurn()
{
return isPlayersTurn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isPlayerTurn() {\n return playerTurn;\n }",
"boolean isPlayerTurn();",
"public boolean isTurn() {\n\t\treturn turn;\n\t}",
"public boolean hasTurn() {\n\t\treturn world.getCurrentPlayer() == this;\n\t}",
"public boolean isTurn()\n\t{\n\t\treturn isTurn;\n\t}",
"private boolean is... | [
"0.8689199",
"0.85333693",
"0.8314537",
"0.82655275",
"0.82483774",
"0.7946624",
"0.79086375",
"0.7897414",
"0.78099525",
"0.78011847",
"0.7607947",
"0.7566761",
"0.7263912",
"0.7183083",
"0.717374",
"0.7097463",
"0.7067914",
"0.7044047",
"0.6992375",
"0.6973166",
"0.6963454"... | 0.8198313 | 5 |
Returns a random boolean. | public boolean getRandomBoolean()
{
return Math.random() < 0.5;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean randomBoolean() {\n\t\treturn RANDOMIZER.nextBoolean();\n\t}",
"public static boolean estraiBoolean() {\n return rand.nextBoolean();\n }",
"public abstract boolean isRandom();",
"Boolean getRandomize();",
"public boolean isRandom(){\r\n\t\treturn isRandom;\r\n\t}",
"@Override\n ... | [
"0.90167767",
"0.8231669",
"0.797162",
"0.78927135",
"0.7673291",
"0.75488746",
"0.7539907",
"0.7455722",
"0.74554336",
"0.74121475",
"0.6998659",
"0.69526774",
"0.683458",
"0.6709639",
"0.6689553",
"0.66810143",
"0.6562109",
"0.6523621",
"0.64761615",
"0.6470238",
"0.6423266... | 0.8398797 | 1 |
Returns if the battle is against a wild pokemon or not. | public boolean getWildPokemon()
{
return wildPokemon;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasPokemon();",
"boolean hasActivePokemon();",
"boolean hasPokemonDisplay();",
"public final boolean isWild() {\n/* 165 */ return this.m_wild;\n/* */ }",
"boolean gameOver() {\n return piecesContiguous(BP) || piecesContiguous(WP);\n }",
"private void CheckFaintedPokemon() {\n ... | [
"0.70250565",
"0.6825224",
"0.6761164",
"0.66651946",
"0.66431636",
"0.6476944",
"0.6440224",
"0.63055974",
"0.62973297",
"0.6295853",
"0.6215223",
"0.61787635",
"0.6162953",
"0.6157176",
"0.60942334",
"0.60732126",
"0.60716575",
"0.6070843",
"0.60182023",
"0.59908754",
"0.59... | 0.7608242 | 0 |
Initializes a sliding window with the given size and range. For example a sliding window of 10ms every 2ms would mean: sizeMs=10, rangeMs=2 | public SlidingWindow(long sizeMs, long rangeMs){
this.sizeMs = sizeMs;
this.rangeMs = rangeMs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"WindowedStream<T> timeSlidingWindow(long millis, long slide);",
"public BaseWindowedBolt<T> ingestionTimeWindow(Time size, Time slide) {\n long s = size.toMilliseconds();\n long l = slide.toMilliseconds();\n ensurePositiveTime(s, l);\n ensureSizeGreaterThanSlide(s, l);\n\n setS... | [
"0.60397154",
"0.58784014",
"0.58001906",
"0.5799858",
"0.577485",
"0.55449593",
"0.5487144",
"0.5412166",
"0.53613603",
"0.5270392",
"0.5190278",
"0.51419544",
"0.5136287",
"0.5111383",
"0.50548756",
"0.50344855",
"0.5008437",
"0.4996668",
"0.49538442",
"0.49464798",
"0.4912... | 0.8382866 | 0 |
consider this is an infinite array and we do not know size and end index; | public static void main(String[] args) {
int[] arr = {1,4,5,6,7,8,100,200,300,400,500,1000,2000,3000,4000,5000,6000,7000,8000};
int target = 1;
System.out.println(helper(arr, target));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"IArray getArrayNext() throws InvalidRangeException;",
"IArray getArrayCurrent() throws InvalidRangeException;",
"public abstract void endArray();",
"int getEnd()\n {\n // check whether Deque is empty or not \n if(isEmpty() || end < 0)\n {\n System.out.println(\" Underflow\\... | [
"0.64676684",
"0.63095516",
"0.6300114",
"0.61843777",
"0.61102366",
"0.607261",
"0.600216",
"0.5868113",
"0.5812831",
"0.5802605",
"0.57733834",
"0.56943786",
"0.56172055",
"0.560084",
"0.5592508",
"0.5556008",
"0.55552614",
"0.55153096",
"0.5470141",
"0.54639876",
"0.545675... | 0.0 | -1 |
Returns the size of the shadow element. | @Override
public int getShadowSize() {
return Geometry.getW(shadow.getElement());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public float getSoftShadowLength();",
"public double getSize() {\n return getElement().getSize();\n }",
"public long getSize() {\n\t\treturn Math.abs(getXSize() * getYSize() * getZSize());\n\t}",
"public float getSize() {\n\t\treturn size;\n\t}",
"public float getSize() {\n return size;\n ... | [
"0.6629826",
"0.65550333",
"0.6369756",
"0.6269714",
"0.6254549",
"0.6219356",
"0.6184271",
"0.6164071",
"0.6156617",
"0.61478984",
"0.6139233",
"0.61312",
"0.6120292",
"0.6109509",
"0.6093284",
"0.6091651",
"0.60358423",
"0.60317814",
"0.6010445",
"0.6010445",
"0.6005617",
... | 0.86617774 | 0 |
Creates a new delete resource action. | public DeleteResourceAction() {
super("Delete Safi Resources");
setToolTipText("Deletes physical resources from the current workspace");
// PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
// IIDEHelpContextIds.DELETE_RESOURCE_ACTION);
setId(ID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DeleteResource() {\n }",
"private void deleteResource() {\n }",
"private ServiceAction createDeleteEnrichmentAction() {\n final MarcRecord deleteRecord = new MarcRecord(marcRecord);\n final MarcRecordReader reader = new MarcRecordReader(deleteRecord);\n final String recordId =... | [
"0.6327583",
"0.6211646",
"0.605749",
"0.5914821",
"0.57831925",
"0.57831925",
"0.57750964",
"0.5772737",
"0.57377696",
"0.5703079",
"0.5699302",
"0.5699302",
"0.56818265",
"0.56797284",
"0.5678023",
"0.5673539",
"0.5664177",
"0.56566155",
"0.5632771",
"0.56052893",
"0.559157... | 0.64461917 | 0 |
Returns whether delete can be performed on the current selection. | private boolean canDelete(IResource[] resources) {
// allow only projects or only non-projects to be selected;
// note that the selection may contain multiple types of resource
if (!(containsOnlyProjects(resources) || containsOnlyNonProjects(resources))) {
return false;
}
if (resources.length == 0) {
return false;
}
// Return true if everything in the selection exists.
for (IResource resource : resources) {
if (resource.isPhantom()) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isDeleteEnabled() {\n \t\tif (text == null || text.isDisposed())\n \t\t\treturn false;\n \t\treturn text.getSelectionCount() > 0\n \t\t\t|| text.getCaretPosition() < text.getCharCount();\n \t}",
"@Override\n \tpublic boolean canDelete() {\n \t\treturn false;\n \t}",
"public boolean isOkToDelete(... | [
"0.7388833",
"0.7368956",
"0.70642203",
"0.69907284",
"0.69907284",
"0.69782686",
"0.6954585",
"0.6785953",
"0.6785592",
"0.6728333",
"0.67179626",
"0.66536677",
"0.66504383",
"0.65482473",
"0.65482074",
"0.6497099",
"0.64585763",
"0.64148796",
"0.64140993",
"0.6408848",
"0.6... | 0.6716901 | 11 |
Returns whether the selection contains linked resources. | private boolean containsLinkedResource(IResource[] resources) {
for (IResource resource : resources) {
if (resource.isLinked()) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isHasResources();",
"public boolean hasLink() {\n return !links.isEmpty();\n }",
"public boolean isSetResources() {\n return this.resources != null;\n }",
"public boolean isSetResources() {\n return this.resources != null;\n }",
"boolean hasResource();",
"public boolean contains... | [
"0.65815264",
"0.6501193",
"0.6422693",
"0.6422693",
"0.6383934",
"0.63771355",
"0.62506145",
"0.6197532",
"0.617695",
"0.6026086",
"0.602483",
"0.59939414",
"0.5981271",
"0.5973625",
"0.59479576",
"0.5937494",
"0.59253186",
"0.59096855",
"0.5837651",
"0.58000094",
"0.5792472... | 0.72465336 | 0 |
Returns whether the selection contains only nonprojects. | private boolean containsOnlyNonProjects(IResource[] resources) {
int types = getSelectedResourceTypes(resources);
// check for empty selection
if (types == 0) {
return false;
}
// note that the selection may contain multiple types of resource
return (types & IResource.PROJECT) == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean containsOnlyProjects(IResource[] resources) {\r\n int types = getSelectedResourceTypes(resources);\r\n // note that the selection may contain multiple types of resource\r\n return types == IResource.PROJECT;\r\n }",
"public boolean isExcluded()\n {\n return project.isExcluded(this);... | [
"0.7137668",
"0.634442",
"0.6323033",
"0.6149113",
"0.6072694",
"0.5931473",
"0.59259045",
"0.57580954",
"0.57580954",
"0.5746849",
"0.5710398",
"0.56956136",
"0.56920147",
"0.56704277",
"0.56685054",
"0.5657592",
"0.5596958",
"0.559529",
"0.55871236",
"0.55695796",
"0.555370... | 0.79758734 | 0 |
Returns whether the selection contains only projects. | private boolean containsOnlyProjects(IResource[] resources) {
int types = getSelectedResourceTypes(resources);
// note that the selection may contain multiple types of resource
return types == IResource.PROJECT;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean containsOnlyNonProjects(IResource[] resources) {\r\n int types = getSelectedResourceTypes(resources);\r\n // check for empty selection\r\n if (types == 0) {\r\n return false;\r\n }\r\n // note that the selection may contain multiple types of resource\r\n return (types & IReso... | [
"0.8013185",
"0.72905236",
"0.68406206",
"0.6414832",
"0.63377404",
"0.63377404",
"0.6323828",
"0.6167218",
"0.608094",
"0.60763943",
"0.6031156",
"0.60179704",
"0.5924169",
"0.5855984",
"0.583859",
"0.578902",
"0.57303005",
"0.5694206",
"0.568122",
"0.5673877",
"0.5660552",
... | 0.8130198 | 0 |
Asks the user to confirm a delete operation, where the selection contains only projects. Also remembers whether project content should be deleted. | private IResource[] getSelectedResourcesArray() {
List selection = getSelectedResources();
IResource[] resources = new IResource[selection.size()];
selection.toArray(resources);
return resources;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeSelectedAction() {\n\t\tfinal List<Project> selectedItems = selectionList.getSelectionModel().getSelectedItems();\n\t\tif (!selectedItems.isEmpty()) {\n\t\t\tfinal Project[] items = selectedItems.toArray(new Project[selectedItems.size()]);\n\t\t\tfinal Alert alert = new Alert(Alert.AlertType.CONF... | [
"0.7443273",
"0.70665586",
"0.69377214",
"0.6698134",
"0.664316",
"0.66228086",
"0.64677984",
"0.63851446",
"0.6319353",
"0.6301522",
"0.62407106",
"0.6223951",
"0.6187936",
"0.6176771",
"0.6153872",
"0.61461514",
"0.6119932",
"0.6003282",
"0.59856504",
"0.59581655",
"0.59466... | 0.0 | -1 |
Returns a bitmask containing the types of resources in the selection. | private int getSelectedResourceTypes(IResource[] resources) {
int types = 0;
for (IResource resource : resources) {
types |= resource.getType();
}
return types;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final ArrayList<Class<? extends IResource>> getSelectableResourceTypes() {\n\treturn mSelectableResourceTypes;\n}",
"List<ResourceType> resourceTypes();",
"public List getResourceTypes(ResourceType resourceType);",
"public List<String> getResourceTypes(){\n\t\treturn jtemp.queryForList(\"SELECT resour... | [
"0.67719036",
"0.66974",
"0.61392486",
"0.6041471",
"0.58523107",
"0.57257855",
"0.55519086",
"0.5538311",
"0.54783946",
"0.5453613",
"0.54128",
"0.5391649",
"0.53020424",
"0.5298479",
"0.5276395",
"0.5246476",
"0.52027214",
"0.5120446",
"0.5106191",
"0.50938416",
"0.5072293"... | 0.6792566 | 0 |
/ (nonJavadoc) Method declared on IAction. | @Override
public void run() {
final IResource[] resources = getSelectedResourcesArray();
// WARNING: do not query the selected resources more than once
// since the selection may change during the run,
// e.g. due to window activation when the prompt dialog is dismissed.
// For more details, see Bug 60606 [Navigator] (data loss) Navigator
// deletes/moves the wrong file
Job deletionCheckJob = new Job(DELETE_SAFI_RESOURCES_JOB) {
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
if (resources.length == 0)
return Status.CANCEL_STATUS;
scheduleDeleteJob(resources);
return Status.OK_STATUS;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
*/
@Override
public boolean belongsTo(Object family) {
if (DELETE_SAFI_RESOURCES_JOB.equals(family)) {
return true;
}
return super.belongsTo(family);
}
};
deletionCheckJob.schedule();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"@Override\r\n\tpublic void action() {\n\t\t\r\n\t}",
"@Override\n\tpublic void action() {\n\n\t}",
"public abstra... | [
"0.81562597",
"0.81562597",
"0.81562597",
"0.80996215",
"0.8047148",
"0.7898596",
"0.76949763",
"0.7652237",
"0.7600415",
"0.75714034",
"0.75182235",
"0.74942404",
"0.74825466",
"0.74474895",
"0.7442278",
"0.7437897",
"0.7437006",
"0.74259895",
"0.7412704",
"0.7380249",
"0.73... | 0.0 | -1 |
Schedule a job to delete the resources to delete. | private void scheduleDeleteJob(final IResource[] resourcesToDelete) {
// use a non-workspace job with a runnable inside so we can avoid
// periodic updates
Job deleteJob = new Job(DELETE_SAFI_RESOURCES_JOB) {
@Override
public IStatus run(final IProgressMonitor monitor) {
try {
final DeleteResourcesOperation op = new DeleteResourcesOperation(resourcesToDelete,
"Delete Resources Operation", deleteContent);
// op.setModelProviderIds(getModelProviderIds());
// If we are deleting projects and their content, do not
// execute the operation in the undo history, since it cannot be
// properly restored. Just execute it directly so it won't be
// added to the undo history.
if (deleteContent && containsOnlyProjects(resourcesToDelete)) {
// We must compute the execution status first so that any user prompting
// or validation checking occurs. Do it in a syncExec because
// we are calling this from a Job.
WorkbenchJob statusJob = new WorkbenchJob("Status checking") { //$NON-NLS-1$
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.
* IProgressMonitor)
*/
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
return op.computeExecutionStatus(monitor);
}
};
statusJob.setSystem(true);
statusJob.schedule();
try {// block until the status is ready
statusJob.join();
} catch (InterruptedException e) {
// Do nothing as status will be a cancel
}
if (statusJob.getResult().isOK()) {
return op.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(null));
}
return statusJob.getResult();
}
return PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op,
monitor, WorkspaceUndoUtil.getUIInfoAdapter(null));
} catch (ExecutionException e) {
if (e.getCause() instanceof CoreException) {
return ((CoreException) e.getCause()).getStatus();
}
return new Status(IStatus.ERROR, AsteriskDiagramEditorPlugin.ID, e.getMessage(), e);
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
*/
@Override
public boolean belongsTo(Object family) {
if (DELETE_SAFI_RESOURCES_JOB.equals(family)) {
return true;
}
return super.belongsTo(family);
}
};
deleteJob.setUser(true);
deleteJob.schedule();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteJob(String jobId);",
"void deleteByJobId(Long jobId);",
"private void deletejob() {\n\t\tjob.delete(new UpdateListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void done(BmobException e) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (e==null) {\n\t\t\t\t\ttoast(\"删除成功\");\n\t\t\... | [
"0.68955934",
"0.65041316",
"0.6458005",
"0.6268821",
"0.6183391",
"0.5850381",
"0.58096224",
"0.5649567",
"0.5645095",
"0.5634832",
"0.562616",
"0.55953276",
"0.55944556",
"0.55384576",
"0.5516042",
"0.5512085",
"0.5500916",
"0.5481018",
"0.5408383",
"0.53938293",
"0.5359998... | 0.6757599 | 1 |
Returns the model provider ids that are known to the client that instantiated this operation. | public String[] getModelProviderIds() {
return modelProviderIds;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setModelProviderIds(String[] modelProviderIds) {\r\n this.modelProviderIds = modelProviderIds;\r\n }",
"modelProvidersI getProvider();",
"public Vector getServiceIds() throws ServiceException {\n return namingService.getServiceIds();\n }",
"public Collection<Provider> getProviders()... | [
"0.6274897",
"0.62235516",
"0.5872691",
"0.57898647",
"0.5770759",
"0.5770759",
"0.5756453",
"0.57441217",
"0.5740701",
"0.5718284",
"0.5708549",
"0.562429",
"0.5604596",
"0.5525873",
"0.550956",
"0.550956",
"0.5503951",
"0.549505",
"0.5482373",
"0.5472885",
"0.54447",
"0.5... | 0.8463934 | 0 |
Sets the model provider ids that are known to the client that instantiated this operation. Any potential side effects reported by these models during validation will be ignored. | public void setModelProviderIds(String[] modelProviderIds) {
this.modelProviderIds = modelProviderIds;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setProvider(modelProvidersI IDProvider);",
"public String[] getModelProviderIds() {\r\n return modelProviderIds;\r\n }",
"public void setProviderId(String value) { _providerId = value; }",
"void updateProviders(List<Provider> providers) {\n this.providers = providers;\n }",
"@Override\r\... | [
"0.6896758",
"0.6419171",
"0.570847",
"0.55558324",
"0.51997244",
"0.50123054",
"0.49468762",
"0.4897718",
"0.48870632",
"0.48816732",
"0.48682556",
"0.48598662",
"0.4822745",
"0.48090392",
"0.4808546",
"0.4803848",
"0.4799944",
"0.47675622",
"0.47540408",
"0.4721683",
"0.470... | 0.78979945 | 0 |
Gets the test bed name. | public String getTestBedName() {
return testBedName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getTestname() {\n return testname;\n }",
"protected String getName() {\n return testClass.getName();\n }",
"@Override\n\t\tpublic String getTestName() {\n\t\t\treturn null;\n\t\t}",
"public String getTestName() {\n return testURL;\n }",
"public void setTestBedNam... | [
"0.72242296",
"0.6688196",
"0.65236855",
"0.650075",
"0.64718777",
"0.64387864",
"0.64057857",
"0.62687296",
"0.62645286",
"0.6192612",
"0.61182517",
"0.60449505",
"0.60412234",
"0.597249",
"0.5970511",
"0.59138334",
"0.58945",
"0.5874779",
"0.5862504",
"0.58267444",
"0.58195... | 0.84114957 | 0 |
Sets the test bed name. | public void setTestBedName(String testBedName) {
this.testBedName = testBedName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void setTestName( String name ) {\n\t\ttestName = name;\n\t}",
"@Override\n\t\tpublic void setTestName(String name) {\n\t\t\t\n\t\t}",
"public void setTestname(String testname) {\n this.testname = testname;\n }",
"public static void setTestName(String rnTest)\n\t{\n\t\trnTestName = rnTest... | [
"0.73380744",
"0.7293722",
"0.70423144",
"0.6831214",
"0.6768243",
"0.6713411",
"0.6635295",
"0.6576948",
"0.65564865",
"0.65489537",
"0.65435094",
"0.6521177",
"0.6519317",
"0.65189433",
"0.6508629",
"0.65002745",
"0.6478668",
"0.6472921",
"0.6471191",
"0.64662015",
"0.64444... | 0.745167 | 0 |
Gets the testbed class name. | public String[] getTestbedClassName() {
return testbedClassName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected String getName() {\n return testClass.getName();\n }",
"public String getTestClassName()\r\n {\r\n return target.getClass().getName();\r\n }",
"public String getShortTestClassName()\r\n {\r\n return target.getClass().getSimpleName();\r\n }",
"public static String... | [
"0.7972072",
"0.7586323",
"0.7445094",
"0.7353646",
"0.70559776",
"0.7036231",
"0.7007955",
"0.69785565",
"0.6920921",
"0.6857336",
"0.6806468",
"0.67981356",
"0.6796104",
"0.6765221",
"0.67315817",
"0.67315817",
"0.67315817",
"0.66783136",
"0.66579145",
"0.66412973",
"0.6622... | 0.75991535 | 1 |
Sets the testbed class name. | public void setTestbedClassName(String[] testbedClassName) {
this.testbedClassName = testbedClassName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setName(String s) {\n\t\tclassName = s;\n\t}",
"@Override\n\t\tpublic void setTestName(String name) {\n\t\t\t\n\t\t}",
"protected void setTestName( String name ) {\n\t\ttestName = name;\n\t}",
"public static void setTestName(String rnTest)\n\t{\n\t\trnTestName = rnTest;\n\t\tlogger.info(\"set tes... | [
"0.69316024",
"0.6880945",
"0.6862441",
"0.6800897",
"0.6788997",
"0.6706271",
"0.6615386",
"0.64588165",
"0.6446639",
"0.6382791",
"0.637363",
"0.6308636",
"0.6297489",
"0.62692857",
"0.62484926",
"0.6212965",
"0.6188823",
"0.6117873",
"0.6113377",
"0.61079437",
"0.6082506",... | 0.7188525 | 0 |
TODO Handle item click | @Override public void onItemClick(View view, int position) {
UserDetails.chatWith = users.get(position).getUsername();
UserDetails.username = spu.getStringPreference(MainActivity.this,"Username");
UserDetails.password = spu.getStringPreference(MainActivity.this,"Password");
Intent i = new Intent(MainActivity.this,ChatActivity.class);
startActivity(i);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void itemClick(int pos) {\n }",
"@Override\n public void OnItemClick(int position) {\n }",
"@Override\n public void onItemClick(int pos) {\n }",
"void issuedClick(String item);",
"void clickItem(int uid);",
"abstract public void... | [
"0.8194031",
"0.8038467",
"0.78200257",
"0.7738836",
"0.7697011",
"0.76394415",
"0.7593405",
"0.75824976",
"0.7565778",
"0.7565778",
"0.7565778",
"0.7565778",
"0.7565778",
"0.7544339",
"0.7514702",
"0.7469693",
"0.7469693",
"0.7452618",
"0.7443529",
"0.7439108",
"0.7439108",
... | 0.0 | -1 |
Solo per testare l'applicazione senza i database | private void testDB(){
DB=new LinkedList<>();
DB.add(new Offer("ID1","AGV923","Nico","Leo","Salvo",""));
DB.add(new Offer("ID2","ADJ325","Tizio", "Caio", "Sempronio",""));
DB.add(new Offer("ID3","T56G2G","Antonella", "Daniele","",""));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testEsegui() throws MainException {\n System.out.println(\"esegui\");\n String SQLString = \"insert into infermieri (nome, cognome) values ('Luca', 'Massa')\";\n LinkingDb instance = new LinkingDb(new ConfigurazioneTO(\"jdbc:hsqldb:file:database/\",\n \"AD... | [
"0.6461398",
"0.64500326",
"0.62705606",
"0.62243813",
"0.6219471",
"0.6187594",
"0.61695576",
"0.6156621",
"0.6113121",
"0.6102615",
"0.60913694",
"0.6081486",
"0.60702395",
"0.6058651",
"0.60569066",
"0.60255736",
"0.6018997",
"0.6006594",
"0.6003805",
"0.600293",
"0.599759... | 0.0 | -1 |
do user registration using api call | private void userSignUp(final int id, String agentNm, String fName, String sta, String localG, String tow, String phoneNm, String fmMr, String cbRg, String memSiz, String cggNam, String cFarmZz, String fcRg, String inFarm, String riceVarr, String qttyHarr, String afRg,
String fertTldd, String noRzz, String qtyApll, String alRg, String szLoaa, String srcRicc, String qtyPdyRicc, String majByrss, String comSolcc, String qttyByy, String howMcc, String prcBb, String incDs,
String reasnn, String hwSpyy, String stRg, String ysSptrr, String fm1, String t11, String cstCs11, String fm2, String t22, String cstCs22, String fm3, String t33, String cstCs33, String infPrcc, String salesDmm,
String avgQtFcc, String whnCp, String whyCp, String whnEx, String whyExx, String mjCh, String adCh, String timSe, String othSe, String adInn) {
Call<ResponseBody> call = RetrofitClient2
.getInstance()
.getNaSurvey()
.submitResponse(agentNm, fName, sta, localG, tow, phoneNm, fmMr, cbRg, memSiz, cggNam, cFarmZz, fcRg, inFarm, riceVarr, qttyHarr, afRg, fertTldd, noRzz, qtyApll, alRg, szLoaa, srcRicc, qtyPdyRicc, majByrss, comSolcc, qttyByy, howMcc, prcBb, incDs, reasnn, hwSpyy, stRg, ysSptrr, fm1, t11, cstCs11,
fm2, t22, cstCs22, fm3, t33, cstCs33, infPrcc, salesDmm, avgQtFcc, whnCp, whyCp, whnEx, whyExx, mjCh, adCh, timSe, othSe, adInn);
call.enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
JSONObject obj = new JSONObject(String.valueOf(response));
if (!obj.getBoolean("error")) {
//updating the status in sqlite
db.updateNameStatus(id, SurveyActivity.SYNC_STATUS_OK);
//sending the broadcast to refresh the list
context.sendBroadcast(new Intent(SurveyActivity.DATA_SAVED_BROADCAST));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
Map<String, String> params = new HashMap<>();
params.put("agentNm", agentNm);
params.put("fname", fName);
params.put("state", sta);
params.put("lga", localG);
params.put("town", tow);
params.put("phoneNm", phoneNm);
params.put("farmer", fmMr);
params.put("cogp", cbRg);
params.put("memsz", memSiz);
params.put("cgnam", cggNam);
params.put("cofmsz", cFarmZz);
params.put("frmcol", fcRg);
params.put("invfz", inFarm);
params.put("ricev", riceVarr);
params.put("qtyhv", qttyHarr);
params.put("apfert", afRg);
params.put("ysyld", fertTldd);
params.put("norz", noRzz);
params.put("qtyap", qtyApll);
params.put("aploa", alRg);
params.put("szloa", szLoaa);
params.put("srcric", srcRicc);
params.put("qtypdrc", qtyPdyRicc);
params.put("majby", majByrss);
params.put("comso", comSolcc);
params.put("qtby", qttyByy);
params.put("hwmch", howMcc);
params.put("pricbf", prcBb);
params.put("indcr", incDs);
params.put("rsn", reasnn);
params.put("hwspl", hwSpyy);
params.put("chsp", stRg);
params.put("yssptr", ysSptrr);
params.put("frm1", fm1);
params.put("to1", t11);
params.put("costc1", cstCs11);
params.put("frm2", fm2);
params.put("to2", t22);
params.put("costcs2", cstCs22);
params.put("frm3", fm3);
params.put("to3", t33);
params.put("costcs3", cstCs33);
params.put("infpr", infPrcc);
params.put("salsdm", salesDmm);
params.put("avqtf", avgQtFcc);
params.put("wncp", whnCp);
params.put("wycp", whyCp);
params.put("wnex", whnEx);
params.put("wyex", whyExx);
params.put("majch", mjCh);
params.put("addch", adCh);
params.put("timsl",timSe);
params.put("othsl",othSe);
params.put("adin",adInn);
return;
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}",
"@GET(Config.REGISTER) Call<User> registerUser(@QueryMap Map<String, String> body);",
"public void Register() {\n Url url = new Url();\n User user = new User(fn... | [
"0.846383",
"0.7819855",
"0.7796031",
"0.75085175",
"0.73858374",
"0.73287296",
"0.73091656",
"0.72695947",
"0.71899587",
"0.71084964",
"0.7073496",
"0.70568603",
"0.7049231",
"0.7024614",
"0.7013409",
"0.69765437",
"0.696608",
"0.69591933",
"0.69569826",
"0.6915108",
"0.6906... | 0.6896403 | 22 |
Get connection from SQL DataSource | private Connection getConnection() throws SQLException{
return ds.getConnection();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private synchronized Connection getConnection() throws SQLException {\n return datasource.getConnection();\r\n }",
"public Connection getConnection() {\n try {\n return dataSource.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n retur... | [
"0.767723",
"0.7590657",
"0.7540497",
"0.74176264",
"0.73921204",
"0.7376173",
"0.73610425",
"0.72718537",
"0.72059816",
"0.7172834",
"0.7122725",
"0.71157277",
"0.70883644",
"0.7083429",
"0.70736045",
"0.7045057",
"0.70440245",
"0.7004399",
"0.6998577",
"0.6981277",
"0.69575... | 0.74185425 | 3 |
Initialize DataSource class Only use one connection for this application, prevent memory leaks | public static Connection createConnection() throws SQLException, NamingException {
DATA_SOURCE.init();
return DATA_SOURCE.getConnection();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private DataSource() {\n Connection tmpConn = null;\n while(tmpConn == null) {\n try {\n tmpConn = DriverManager.getConnection(CONNECTION_STRING);\n } catch(SQLException e) {\n print(\"Couldn't connect to \" + DB_NAME + \" database: \" + e.getMessag... | [
"0.77058804",
"0.7396967",
"0.7342783",
"0.7067675",
"0.702878",
"0.6998761",
"0.69788927",
"0.6977865",
"0.69003236",
"0.6827667",
"0.67940426",
"0.67579025",
"0.6702939",
"0.66567534",
"0.6652391",
"0.66512907",
"0.6632766",
"0.6629172",
"0.6621739",
"0.6592448",
"0.6592105... | 0.0 | -1 |
Created by Dan on 7/5/2017. | @Repository
@Transactional
public interface PointOfInterestDao extends CrudRepository<PointOfInterest, Integer> {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"public final void mo51373a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"@Overri... | [
"0.59149843",
"0.581384",
"0.5761767",
"0.5692374",
"0.5685024",
"0.5625592",
"0.56062794",
"0.55744267",
"0.55744267",
"0.55606234",
"0.55453545",
"0.55214417",
"0.5517024",
"0.55128443",
"0.5508119",
"0.5490769",
"0.5442314",
"0.54374576",
"0.5437257",
"0.54336375",
"0.5428... | 0.0 | -1 |
Creates an instance of the class StartUp. | public StartUp(){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void startUp() {\n }",
"public void initialize() {\n\n getStartUp();\n }",
"public void startup(){}",
"public LocalAppLauncher() {\n }",
"public ApplicationCreator() {\n }",
"public StartupHandler(){\r\n\t\tloadGameFiles();\r\n\t\tnew Engine();\r\n\t}",
"public Main... | [
"0.65579796",
"0.6395239",
"0.62089896",
"0.6130389",
"0.6077849",
"0.60562485",
"0.60515803",
"0.6042338",
"0.6033026",
"0.59444237",
"0.586897",
"0.5853767",
"0.58232343",
"0.58008474",
"0.5787633",
"0.57808965",
"0.577722",
"0.57736623",
"0.57445496",
"0.5725679",
"0.57163... | 0.77117145 | 0 |
Runs the startup procedure. | public View runStartUp() {
Controller contr = new Controller();
contr.addObserver(InspectionStatsView.getObserver());
Logger firstLogger = new FileLogger();
return new View(contr, firstLogger);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void startup() {\n\t\tstart();\n }",
"public void startup(){}",
"public abstract void startup();",
"void startup();",
"void startup();",
"@Override\n public void startup() {\n }",
"public void startup()\n\t{\n\t\t; // do nothing\n\t}",
"private void startUp () {\n NativeMethodBroke... | [
"0.83218676",
"0.781072",
"0.765929",
"0.7597331",
"0.7597331",
"0.73502445",
"0.72602504",
"0.6901464",
"0.6881629",
"0.6835028",
"0.67894316",
"0.6788075",
"0.6750065",
"0.6749255",
"0.6734439",
"0.6732111",
"0.6690465",
"0.66877127",
"0.6669537",
"0.6617671",
"0.661435",
... | 0.0 | -1 |
private static final Logger log = LoggerFactory.getLogger(AsyncService.class); | public AsyncService() {
super(2, 2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface AsyncLogger {\n\n public void logMessage(String message);\n}",
"public void logMessage(AsyncLoggerConfig asyncLoggerConfig, LogEvent event) {\n/* 65 */ asyncLoggerConfig.callAppendersInCurrentThread(event);\n/* */ }",
"public void logMessage(AsyncLoggerConfig asyncLoggerConfig,... | [
"0.65097904",
"0.6128837",
"0.6058971",
"0.6016643",
"0.59352934",
"0.5897541",
"0.581998",
"0.57373846",
"0.570946",
"0.57089245",
"0.56967187",
"0.5691596",
"0.56089056",
"0.5547226",
"0.5515382",
"0.54974765",
"0.54954696",
"0.54575324",
"0.5443115",
"0.5408842",
"0.540691... | 0.62183374 | 1 |
TODO Autogenerated method stub | public static void main(String[] args) {
HashMap<Integer,String> map = new HashMap<Integer,String>();
map.put(5,"Five");
map.put(6,"Six");
map.put(7,"Seven");
map.put(8,"Eight");
map.put(9,"Nine");
map.put(1,"One");
map.put(6,"ten");
String text= map.get(6);
System.out.println(text);
for(Map.Entry<Integer, String> entry:map.entrySet()) {
int key = entry.getKey();
String value = entry.getValue();
System.out.println(key + ":"+value);
}
} | {
"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 |
Returns the module (file) of the innermost enclosing Starlark function on the call stack, or null if none of the active calls are functions defined in Starlark. The name of this function is intentionally horrible to make you feel bad for using it. | @Nullable
public static Module ofInnermostEnclosingStarlarkFunction(StarlarkThread thread) {
for (Debug.Frame fr : thread.getDebugCallStack().reverse()) {
if (fr.getFunction() instanceof StarlarkFunction) {
return ((StarlarkFunction) fr.getFunction()).getModule();
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Closure findEnclosingFunction(){\n Closure currentClosure = this;\n while (currentClosure != null){\n if (currentClosure.isFunction){\n return currentClosure;\n }\n currentClosure = currentClosure.getParent();\n }\n return null;\n ... | [
"0.6600958",
"0.6336702",
"0.61776483",
"0.6049898",
"0.6046633",
"0.5988324",
"0.59564286",
"0.56154215",
"0.5582296",
"0.5577949",
"0.55256844",
"0.5498098",
"0.5440475",
"0.54060024",
"0.5383486",
"0.53468513",
"0.534457",
"0.53421056",
"0.5286504",
"0.524412",
"0.5222555"... | 0.7482099 | 0 |
Returns a map in which each semanticsenabled FlagGuardedValue has been replaced by the value it guards. Disabled FlagGuardedValues are left in place, and should be treated as unavailable. The iteration order is unchanged. | private static ImmutableMap<String, Object> filter(
Map<String, Object> predeclared, StarlarkSemantics semantics) {
ImmutableMap.Builder<String, Object> filtered = ImmutableMap.builder();
for (Map.Entry<String, Object> bind : predeclared.entrySet()) {
Object v = bind.getValue();
if (v instanceof FlagGuardedValue) {
FlagGuardedValue fv = (FlagGuardedValue) bind.getValue();
if (fv.isObjectAccessibleUsingSemantics(semantics)) {
v = fv.getObject();
}
}
filtered.put(bind.getKey(), v);
}
return filtered.build();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Map<String, Boolean> getIsAssignmentOptionValidMap() {\n if (assignmentOptionValidMap == null) {\n assignmentOptionValidMap = new HashMap<String, Boolean>() {\n @Override\n public Boolean get(Object key) {\n return !(key == null || \"\".equa... | [
"0.48825806",
"0.4824611",
"0.47945413",
"0.46981874",
"0.4695111",
"0.46062416",
"0.45886227",
"0.4583899",
"0.45818722",
"0.4483426",
"0.44737867",
"0.44727102",
"0.4439882",
"0.44254085",
"0.44185364",
"0.44166154",
"0.44116512",
"0.43896574",
"0.43773136",
"0.43539894",
"... | 0.58107287 | 0 |
Returns the value of a predeclared (or universal) binding in this module. | Object getPredeclared(String name) {
Object v = predeclared.get(name);
if (v != null) {
return v;
}
return Starlark.UNIVERSE.get(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract int getBindingVariable();",
"Binding getBinding();",
"public Binding getBinding() {\n\t\treturn binding;\n\t}",
"public Binding getBinding() {\n return binding;\n }",
"@Override\n public int getBindingVariable() {\n return BR.data;\n }",
"@Override\n public int g... | [
"0.6445214",
"0.6047401",
"0.57702905",
"0.57381517",
"0.56712633",
"0.56712633",
"0.564605",
"0.5330774",
"0.5310496",
"0.524067",
"0.5223768",
"0.51845765",
"0.5132593",
"0.51160383",
"0.51125294",
"0.51117086",
"0.508599",
"0.50574744",
"0.50521713",
"0.5051424",
"0.505006... | 0.45827425 | 73 |
Returns a readonly view of this module's global bindings. The bindings are returned in a deterministic order (for a given sequence of initial values and updates). | public Map<String, Object> getGlobals() {
return Collections.unmodifiableMap(globals);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Iterator getBindings() {\r\n\t\treturn bindings == null ? EmptyStructures.EMPTY_ITERATOR : new ReadOnlyIterator(bindings.values());\r\n\t}",
"@Nonnull\n SystemScriptBindings getBindings();",
"public static List<VariableDeclaration> getBindingManagementVars()\n {\n return FrameworkDefs.bindi... | [
"0.65662545",
"0.6373434",
"0.6277839",
"0.6008182",
"0.60000557",
"0.5626408",
"0.5600074",
"0.55929476",
"0.5450332",
"0.54446805",
"0.5429208",
"0.54170424",
"0.5403247",
"0.53969496",
"0.5317704",
"0.52797",
"0.5251534",
"0.52092",
"0.5180869",
"0.51276195",
"0.51119393",... | 0.5484934 | 8 |
Returns a map of bindings that are exported (i.e. symbols declared using `=` and `def`, but not `load`). TODO(adonovan): whether bindings are exported should be decided by the resolver; nonexported bindings should never be added to the module. Delete this. | public ImmutableMap<String, Object> getExportedGlobals() {
ImmutableMap.Builder<String, Object> result = new ImmutableMap.Builder<>();
for (Map.Entry<String, Object> entry : globals.entrySet()) {
if (exportedGlobals.contains(entry.getKey())) {
result.put(entry);
}
}
return result.build();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Map<String, FileModule> getSymbolMap() {\n Map<String, FileModule> out = new LinkedHashMap<>();\n for (FileModule module : fileToModule.values()) {\n for (String symbol : module.importedNamespacesToSymbols.keySet()) {\n out.put(symbol, module);\n }\n }\n return out;\n }",
"private M... | [
"0.61612",
"0.6067853",
"0.58225703",
"0.56969666",
"0.5670086",
"0.566255",
"0.55847424",
"0.55414766",
"0.5448002",
"0.5389605",
"0.53159654",
"0.5290154",
"0.5274019",
"0.52623904",
"0.5256594",
"0.5108667",
"0.5106463",
"0.50880206",
"0.50830823",
"0.50593597",
"0.5026775... | 0.68185264 | 0 |
Implements the resolver's module interface. | @Override
public Set<String> getNames() {
// TODO(adonovan): for now, the resolver treats all predeclared/universe
// and global names as one bucket (Scope.PREDECLARED). Fix that.
// TODO(adonovan): opt: change the resolver to request names on
// demand to avoid all this set copying.
HashSet<String> names = new HashSet<>();
for (Map.Entry<String, Object> bind : getTransitiveBindings().entrySet()) {
if (bind.getValue() instanceof FlagGuardedValue) {
continue; // disabled
}
names.add(bind.getKey());
}
return names;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected interface Resolver {\n\n /**\n * Adjusts a module graph if necessary.\n *\n * @param classLoader The class loader to adjust.\n * @param target The targeted class for which a proxy is created.\n */\n void accept(@MaybeN... | [
"0.70174503",
"0.66677076",
"0.6307434",
"0.6058096",
"0.6043398",
"0.6001448",
"0.5824893",
"0.5793242",
"0.5749425",
"0.5715988",
"0.5639798",
"0.5635092",
"0.55861336",
"0.5527013",
"0.5513363",
"0.5479189",
"0.5471069",
"0.5451799",
"0.54365814",
"0.5396383",
"0.5383227",... | 0.0 | -1 |
Returns a new map containing the predeclared (including universal) and global bindings of this module. TODO(adonovan): eliminate; clients should explicitly choose getPredeclared or getGlobals. | public Map<String, Object> getTransitiveBindings() {
// Can't use ImmutableMap.Builder because it doesn't allow duplicates.
LinkedHashMap<String, Object> env = new LinkedHashMap<>();
env.putAll(Starlark.UNIVERSE);
env.putAll(predeclared);
env.putAll(globals);
return env;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Map<String, Object> collectGlobals() {\n ImmutableMap.Builder<String, Object> envBuilder = ImmutableMap.builder();\n MethodLibrary.addBindingsToBuilder(envBuilder);\n Runtime.addConstantsToBuilder(envBuilder);\n return envBuilder.build();\n }",
"public Map<String, Object> getGlobals() {\n ... | [
"0.75185513",
"0.7381287",
"0.7087605",
"0.6964801",
"0.67389977",
"0.6351512",
"0.63010466",
"0.6222221",
"0.6168294",
"0.5953611",
"0.59169734",
"0.57709646",
"0.5590402",
"0.55886",
"0.5528551",
"0.54763806",
"0.54310757",
"0.53972125",
"0.5390892",
"0.53702384",
"0.534024... | 0.6796732 | 4 |
Returns the value of the specified global variable, or null if not bound. Does not look in the predeclared environment. | public Object getGlobal(String name) {
return globals.get(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.String getGlobalVariableValue() {\r\n return globalVariableValue;\r\n }",
"public Object getValue(String name) {\n Object value = localScope.get(name);\n if ( value!=null ) {\n return value;\n }\n // if not found\n B... | [
"0.63694865",
"0.60724753",
"0.5863205",
"0.5822656",
"0.5800912",
"0.5622417",
"0.55242985",
"0.5498693",
"0.5431673",
"0.54043764",
"0.53888255",
"0.5381924",
"0.5323151",
"0.52836716",
"0.5172998",
"0.51606923",
"0.51555187",
"0.5146857",
"0.5130776",
"0.5120425",
"0.51095... | 0.5869349 | 2 |
Updates a global binding in the module environment. | public void setGlobal(String name, Object value) {
Preconditions.checkNotNull(value, "Module.setGlobal(%s, null)", name);
globals.put(name, value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public BindState updateBinding(AccessPath ap, CFAEdge edge, List<AbstractState> otherStates) {\n if (ap.startFromGlobal()) {\n return addGlobalBinding(ap, edge, otherStates);\n } else {\n return addLocalBinding(ap, edge, otherStates);\n }\n }",
"private void changeBinding(InstanceBinding bind... | [
"0.60711336",
"0.6069187",
"0.60312706",
"0.55954975",
"0.5581824",
"0.5581824",
"0.55265486",
"0.55088395",
"0.54956996",
"0.54946744",
"0.5265173",
"0.5221691",
"0.5221691",
"0.5221691",
"0.52160573",
"0.5214468",
"0.5214468",
"0.52098054",
"0.5204908",
"0.5182339",
"0.5176... | 0.55721754 | 6 |
Test to ensure that http method type takes precedence over anything else. | @Test
public void testHttpMethodPriorityVsUnknown() {
this.requestDefinitions.get(0).setHttpMethod(HttpMethod.UNKNOWN);
this.requestDefinitions.get(1).setHttpMethod(HttpMethod.GET);
this.requestDefinitions.get(2).setHttpMethod(HttpMethod.UNKNOWN);
final List<RequestDefinition> expected = Arrays.asList(this.requestDefinitions.get(1),
this.requestDefinitions.get(0), this.requestDefinitions.get(2));
Collections.sort(this.requestDefinitions, this.comparator);
Assert.assertEquals(expected, this.requestDefinitions);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasHttpMethod();",
"String getHttpMethod();",
"String getHttpMethod();",
"public HTTPRequestMethod getMethod();",
"public void setMethod(HTTPMethod method);",
"public HttpMethod getMethod()\r\n/* 31: */ {\r\n/* 32:60 */ return HttpMethod.valueOf(this.httpRequest.getMethod());\r\n/* 33: ... | [
"0.70740944",
"0.6809038",
"0.6809038",
"0.67798126",
"0.67051345",
"0.6666607",
"0.6571061",
"0.64850014",
"0.64441115",
"0.6417054",
"0.6391798",
"0.63424903",
"0.63106936",
"0.63012534",
"0.6233475",
"0.6213034",
"0.61535615",
"0.6134703",
"0.60659873",
"0.6053533",
"0.604... | 0.64279234 | 9 |
Test to ensure that http method type takes precedence over anything else. | @Test
public void testHttpMethodPriorityVsOtherAttributes() {
this.requestDefinitions.get(0).setHttpMethod(HttpMethod.UNKNOWN);
this.requestDefinitions.get(0).setAccept(MediaType.HTML);
this.requestDefinitions.get(1).setHttpMethod(HttpMethod.GET);
this.requestDefinitions.get(1).setAccept(MediaType.UNKNOWN);
this.requestDefinitions.get(2).setHttpMethod(HttpMethod.UNKNOWN);
this.requestDefinitions.get(2).setAccept(MediaType.HTML);
final List<RequestDefinition> expected = Arrays.asList(this.requestDefinitions.get(1),
this.requestDefinitions.get(0), this.requestDefinitions.get(2));
Collections.sort(this.requestDefinitions, this.comparator);
Assert.assertEquals(expected, this.requestDefinitions);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasHttpMethod();",
"String getHttpMethod();",
"String getHttpMethod();",
"public HTTPRequestMethod getMethod();",
"public void setMethod(HTTPMethod method);",
"public HttpMethod getMethod()\r\n/* 31: */ {\r\n/* 32:60 */ return HttpMethod.valueOf(this.httpRequest.getMethod());\r\n/* 33: ... | [
"0.7073687",
"0.68086547",
"0.68086547",
"0.67779",
"0.67041826",
"0.66660285",
"0.6571647",
"0.6484811",
"0.64447343",
"0.6429679",
"0.6391727",
"0.6342672",
"0.6309639",
"0.6301402",
"0.6232114",
"0.6212533",
"0.61527824",
"0.613475",
"0.60651356",
"0.60537803",
"0.6044819"... | 0.6418232 | 10 |
Test to ensure that basic sorting uses HttpMethod first, followed by ContentType, and then Accept. | @Test
public void testDefinitionPriority() {
this.requestDefinitions.get(0).setHttpMethod(HttpMethod.UNKNOWN);
this.requestDefinitions.get(0).setContentType(MediaType.UNKNOWN);
this.requestDefinitions.get(0).setAccept(MediaType.HTML);
this.requestDefinitions.get(1).setHttpMethod(HttpMethod.UNKNOWN);
this.requestDefinitions.get(1).setContentType(MediaType.HTML);
this.requestDefinitions.get(1).setAccept(MediaType.UNKNOWN);
this.requestDefinitions.get(2).setHttpMethod(HttpMethod.GET);
this.requestDefinitions.get(2).setContentType(MediaType.UNKNOWN);
this.requestDefinitions.get(2).setAccept(MediaType.UNKNOWN);
final List<RequestDefinition> expected = Arrays.asList(this.requestDefinitions.get(2),
this.requestDefinitions.get(1), this.requestDefinitions.get(0));
Collections.sort(this.requestDefinitions, this.comparator);
Assert.assertEquals(expected, this.requestDefinitions);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testHttpMethodPriorityVsUnknown() {\n\n\t\tthis.requestDefinitions.get(0).setHttpMethod(HttpMethod.UNKNOWN);\n\t\tthis.requestDefinitions.get(1).setHttpMethod(HttpMethod.GET);\n\t\tthis.requestDefinitions.get(2).setHttpMethod(HttpMethod.UNKNOWN);\n\n\t\tfinal List<RequestDefinition> expected =... | [
"0.7056274",
"0.696163",
"0.618279",
"0.61484075",
"0.59153664",
"0.55932766",
"0.5485424",
"0.54789776",
"0.54012793",
"0.53729206",
"0.5313751",
"0.530539",
"0.5294373",
"0.52926373",
"0.52665174",
"0.5243798",
"0.5155168",
"0.5146277",
"0.51452374",
"0.5137532",
"0.5063839... | 0.6156388 | 3 |
Test to ensure that path sorting will give the longer path a greater priority | @Test
public void testPathPriorityByLength() {
this.requestDefinitions.get(0).setPathParts(new PathDefinition[1]);
this.requestDefinitions.get(1).setPathParts(new PathDefinition[3]);
this.requestDefinitions.get(2).setPathParts(new PathDefinition[2]);
final List<RequestDefinition> expected = Arrays.asList(this.requestDefinitions.get(1),
this.requestDefinitions.get(2), this.requestDefinitions.get(0));
Collections.sort(this.requestDefinitions, this.comparator);
Assert.assertEquals(expected, this.requestDefinitions);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testSortPath() {\n RestOperationMeta dynamicResLessStatic = UnitTestRestUtils.createRestOperationMeta(\"POST\", \"/a/{id}\");\n RestOperationMeta dynamicResMoreStatic = UnitTestRestUtils.createRestOperationMeta(\"POST\", \"/abc/{id}\");\n\n MicroservicePaths paths = new MicroservicePa... | [
"0.60854274",
"0.60773516",
"0.5758138",
"0.57074714",
"0.5706894",
"0.5643439",
"0.5618193",
"0.55733275",
"0.5569511",
"0.55519956",
"0.5545245",
"0.55237436",
"0.55237436",
"0.55010223",
"0.5490224",
"0.54326",
"0.5404865",
"0.5379184",
"0.5374931",
"0.5352709",
"0.5343967... | 0.60630333 | 2 |
Test to ensure that path sorting will give parts with wild cards lower priority. | @Test
public void testPathPriorityByWildCard() {
this.requestDefinitions.get(0).setPathParts(new PathDefinition[2]);
this.requestDefinitions.get(0).getPathParts()[0] = new PathDefinition();
this.requestDefinitions.get(0).getPathParts()[0].setValue("a");
this.requestDefinitions.get(0).getPathParts()[1] = new PathDefinition();
this.requestDefinitions.get(0).getPathParts()[1].setValue(null);
this.requestDefinitions.get(1).setPathParts(new PathDefinition[2]);
this.requestDefinitions.get(1).getPathParts()[0] = new PathDefinition();
this.requestDefinitions.get(1).getPathParts()[0].setValue("a");
this.requestDefinitions.get(1).getPathParts()[1] = new PathDefinition();
this.requestDefinitions.get(1).getPathParts()[1].setValue("a");
this.requestDefinitions.get(2).setPathParts(new PathDefinition[2]);
this.requestDefinitions.get(2).getPathParts()[0] = new PathDefinition();
this.requestDefinitions.get(2).getPathParts()[0].setValue(null);
this.requestDefinitions.get(2).getPathParts()[1] = new PathDefinition();
this.requestDefinitions.get(2).getPathParts()[1].setValue("a");
final List<RequestDefinition> expected = Arrays.asList(this.requestDefinitions.get(1),
this.requestDefinitions.get(0), this.requestDefinitions.get(2));
Collections.sort(this.requestDefinitions, this.comparator);
Assert.assertEquals(expected, this.requestDefinitions);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testSortPath() {\n RestOperationMeta dynamicResLessStatic = UnitTestRestUtils.createRestOperationMeta(\"POST\", \"/a/{id}\");\n RestOperationMeta dynamicResMoreStatic = UnitTestRestUtils.createRestOperationMeta(\"POST\", \"/abc/{id}\");\n\n MicroservicePaths paths = new MicroservicePa... | [
"0.62824863",
"0.6015238",
"0.5960595",
"0.57146513",
"0.5471172",
"0.54697883",
"0.5418352",
"0.51727045",
"0.5148038",
"0.5074766",
"0.50677794",
"0.5062157",
"0.49795875",
"0.4962613",
"0.4942323",
"0.49168313",
"0.4905748",
"0.48971912",
"0.48964572",
"0.488276",
"0.48795... | 0.6639164 | 0 |
TODO Autogenerated method stub | @Override
public void configure() throws Exception {
ProducerTemplate camelTemplate = getContext().createProducerTemplate();
CamelHelper.getInstance().setHttpCamelTemplate(camelTemplate);
//endpoint 설정
from("jetty:http://0.0.0.0:9999"+"/testApi")
.routeId("HTTP_TEST_API")
.process(testProcessor)
;
} | {
"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 |
Test of findUsuario method, of class UsuarioJpaController. | @Test
public void testFindUsuario_Integer() {
System.out.println("findUsuario");
Integer id = 1;
String user = "angelleonardovian@ufps.edu.co";
UsuarioJpaController instance = new UsuarioJpaController(emf);
Usuario expResult = instance.findUsuario(user);
Usuario result = instance.findUsuario(id);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
if (!result.equals(expResult)) {
fail("El test de busqueda por usuario ha fallado");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testFindUsuario_String() {\n System.out.println(\"findUsuario\");\n Integer user = 1;\n Usuario usuario = new Usuario(1, \"angelleonardovian@ufps.edu.co\", \"12345\", new Date(), true);\n UsuarioJpaController instance = new UsuarioJpaController(emf);\n Usua... | [
"0.7587799",
"0.72525066",
"0.72473514",
"0.7129614",
"0.7074805",
"0.70224684",
"0.69820523",
"0.6967543",
"0.686236",
"0.6858243",
"0.6812534",
"0.67546934",
"0.67413616",
"0.6698422",
"0.6583436",
"0.65754485",
"0.6572667",
"0.6565002",
"0.65492016",
"0.65482223",
"0.65427... | 0.75905055 | 0 |
Test of findUsuario method, of class UsuarioJpaController. | @Test
public void testFindUsuario_String() {
System.out.println("findUsuario");
Integer user = 1;
Usuario usuario = new Usuario(1, "angelleonardovian@ufps.edu.co", "12345", new Date(), true);
UsuarioJpaController instance = new UsuarioJpaController(emf);
Usuario expResult = instance.findUsuario(usuario.getIdUsuario());
Usuario result = instance.findUsuario(user);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
if (!result.equals(expResult)) {
fail("El test de busqueda por id ha fallado");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testFindUsuario_Integer() {\n System.out.println(\"findUsuario\");\n Integer id = 1;\n String user = \"angelleonardovian@ufps.edu.co\";\n UsuarioJpaController instance = new UsuarioJpaController(emf);\n Usuario expResult = instance.findUsuario(user);\n ... | [
"0.7590762",
"0.725385",
"0.7247701",
"0.7128966",
"0.7074386",
"0.7021726",
"0.6980966",
"0.69675165",
"0.68626845",
"0.6857804",
"0.68132377",
"0.67545664",
"0.67413133",
"0.6698098",
"0.65830237",
"0.6576439",
"0.65721285",
"0.65659773",
"0.65503407",
"0.6547661",
"0.65426... | 0.758761 | 1 |
Test of autenticacion method, of class UsuarioJpaController. | @Test
public void testAutenticacion() {
System.out.println("autenticacion");
Usuario usuario = new Usuario(1, "angelleonardovian@ufps.edu.co", "12345", new Date(), true);//parametro in
UsuarioJpaController instance = new UsuarioJpaController(emf);
Usuario expResult = instance.findUsuario(usuario.getIdUsuario());
Usuario result = instance.autenticacion(usuario);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
if (!result.equals(expResult)) {
fail("El test de autenticaccion ha fallado");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testAutenticacionGoogle() {\n System.out.println(\"autenticacionGoogle\");\n Usuario usuario = new Usuario(1, \"angelleonardovian@ufps.edu.co\", \"1\", new Date(), true);;\n UsuarioJpaController instance = new UsuarioJpaController(emf);\n Usuario expResult = insta... | [
"0.697209",
"0.66444504",
"0.65236133",
"0.64539665",
"0.6438664",
"0.6358757",
"0.63410455",
"0.62810194",
"0.62510264",
"0.621502",
"0.61623937",
"0.6118223",
"0.6106992",
"0.6102824",
"0.60832626",
"0.6032976",
"0.60307217",
"0.6029245",
"0.60169876",
"0.6014734",
"0.59842... | 0.80539453 | 0 |
Test of autenticacionGoogle method, of class UsuarioJpaController. | @Test
public void testAutenticacionGoogle() {
System.out.println("autenticacionGoogle");
Usuario usuario = new Usuario(1, "angelleonardovian@ufps.edu.co", "1", new Date(), true);;
UsuarioJpaController instance = new UsuarioJpaController(emf);
Usuario expResult = instance.findUsuario(usuario.getIdUsuario());
Usuario result = instance.autenticacionGoogle(usuario);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
if (!result.equals(expResult)) {
fail("The test case is a prototype.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testAutenticacion() {\n System.out.println(\"autenticacion\");\n Usuario usuario = new Usuario(1, \"angelleonardovian@ufps.edu.co\", \"12345\", new Date(), true);//parametro in\n UsuarioJpaController instance = new UsuarioJpaController(emf);\n Usuario expResult = ... | [
"0.69067657",
"0.61842865",
"0.59811205",
"0.590054",
"0.58423233",
"0.58364064",
"0.57571286",
"0.574605",
"0.57158613",
"0.5703752",
"0.56660134",
"0.5638214",
"0.5630151",
"0.56290954",
"0.5628625",
"0.5622821",
"0.561155",
"0.56107354",
"0.5596532",
"0.5577363",
"0.557627... | 0.819306 | 0 |
Add (+,+), (, +), (, ), (+, ) to quadrants | public void run() {
GCanvas gc = this.getGCanvas();
this.setSize(1000,1000);
GOval wheel = new GOval(100, 100, 800, 800);
this.add(wheel);
GLine horzline = new GLine(105,500, 895, 500);
this.add(horzline);
GLine vertline = new GLine(500,105, 500, 895);
this.add(vertline);
GLabel Quad1 = new GLabel("(+,+)", 700, 100);
Quad1.setFont("Arial-PLAIN-28");
this.add(Quad1);
GLabel Quad2 = new GLabel("(-,+)", 300, 100);
Quad2.setFont("Arial-PLAIN-28");
this.add(Quad2);
GLabel Quad3 = new GLabel("(-,-)", 300, 900);
Quad3.setFont("Arial-PLAIN-28");
this.add(Quad3);
GLabel Quad4 = new GLabel("(+,-)", 700, 900);
Quad4.setFont("Arial-PLAIN-28");
this.add(Quad4);
//TwoPi
GLabel TwoPiShow = new GLabel("2π");
GOval twopi = new GOval(890, 490, 20,20);
this.add(twopi);
twopi.setFilled(true);
twopi.setFillColor(Color.BLACK);
TwoPiShow.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(TwoPiShow, 915, 510);
GLabel TwoPiSin = new GLabel("(0)");
TwoPiSin.setFont("Arial-PLAIN-18");
TwoPiSin.setColor(Color.GREEN);
GLabel TwoPiCos = new GLabel("(1)");
TwoPiCos.setFont("Arial-PLAIN-18");
TwoPiCos.setColor(Color.BLUE);
GLabel TwoPiTan = new GLabel("(0)");
TwoPiTan.setFont("Arial-PLAIN-18");
TwoPiTan.setColor(Color.RED);
GLabel TwoPiSec = new GLabel("(1)");
TwoPiSec.setFont("Arial-PLAIN-18");
TwoPiSec.setColor(Color.CYAN);
GLabel TwoPiCsc = new GLabel("(undefined)");
TwoPiCsc.setFont("Arial-PLAIN-18");
TwoPiCsc.setColor(Color.ORANGE);
/*
Make Mouse Listener Thing for:
Sin(2pi) = 0
Cos(2pi) = 1
*/
//Zero
GLabel Zero = new GLabel("0");
Zero.setFont("Arial-PLAIN-18");
this.add(Zero, 915, 495);
/*
Make Mouse Listener Thing for:
Or I guess make a button to show these:
Sin(0) = 0
Cos(0) = 1
Tan(0)
Sec(0)
Csc(0)
Cot(0)
Mouse Scroll Over --> show that:
Tan = (sin)/(cos)
Sec = 1/(cos)
Cot = 1/(tan)
Csc = 1/(sin)
*/
// Quad 1
//Pi6
GLabel Pi6Show = new GLabel("(π/6)");
GOval Pi6 = new GOval(840, 300, 20,20);
this.add(Pi6);
Pi6.setFilled(true);
Pi6.setFillColor(Color.BLACK);
Pi6Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(Pi6Show, 860, 300);
GLabel Pi6Sin = new GLabel("(1/2)");
Pi6Sin.setFont("Arial-PLAIN-18");
Pi6Sin.setColor(Color.GREEN);
GLabel Pi6Cos = new GLabel("(√3/2)");
Pi6Cos.setFont("Arial-PLAIN-18");
Pi6Cos.setColor(Color.BLUE);
GLabel Pi6Tan = new GLabel("(√3/3)");
Pi6Tan.setFont("Arial-PLAIN-18");
Pi6Tan.setColor(Color.RED);
GLabel Pi6Cot = new GLabel("(√3)");
Pi6Cot.setFont("Arial-PLAIN-18");
Pi6Cot.setColor(Color.MAGENTA);
GLabel Pi6Csc = new GLabel("2");
Pi6Csc.setFont("Arial-PLAIN-18");
Pi6Csc.setColor(Color.CYAN);
GLabel Pi6Sec = new GLabel("(2√3/3)");
Pi6Sec.setFont("Arial-PLAIN-18");
Pi6Sec.setColor(Color.ORANGE);
/*
Make Mouse Listener Thing for:
Sin(pi/6) = 1/2
Cos(pi/6) = sqrt(3)/2
*/
//Pi4
GLabel Pi4Show = new GLabel("(π/4)");
GOval Pi4 = new GOval(770, 200, 20,20);
this.add(Pi4);
Pi4.setFilled(true);
Pi4.setFillColor(Color.BLACK);
Pi4Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(Pi4Show, 800, 200);
GLabel Pi4Sin = new GLabel("(√2/2)");
Pi4Sin.setFont("Arial-PLAIN-18");
Pi4Sin.setColor(Color.GREEN);
GLabel Pi4Cos = new GLabel("(√2/2)");
Pi4Cos.setFont("Arial-PLAIN-18");
Pi4Cos.setColor(Color.blue);
GLabel Pi4Tan = new GLabel("1");
Pi4Cos.setFont("Arial-PLAIN-18");
Pi4Cos.setColor(Color.RED);
GLabel Pi4Sec = new GLabel("(2√2/2)");
Pi4Cos.setFont("Arial-PLAIN-18");
Pi4Cos.setColor(Color.ORANGE);
GLabel Pi4Csc = new GLabel("(2√2/2)");
Pi4Cos.setFont("Arial-PLAIN-18");
Pi4Cos.setColor(Color.CYAN);
//Pi3
GLabel Pi3Show = new GLabel("(π/3)");
GOval Pi3 = new GOval(650, 120, 20,20);
this.add(Pi3);
Pi3.setFilled(true);
Pi3.setFillColor(Color.BLACK);
Pi3Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(Pi3Show, 670, 120);
GLabel Pi3Sin = new GLabel("(√3/2)");
Pi3Sin.setFont("Arial-PLAIN-18");
Pi3Sin.setColor(Color.GREEN);
GLabel Pi3Cos = new GLabel("(1/2)");
Pi3Cos.setFont("Arial-PLAIN-18");
Pi3Cos.setColor(Color.BLUE);
GLabel Pi3Tan = new GLabel("(√3)");
Pi3Tan.setFont("Arial-PLAIN-18");
Pi3Tan.setColor(Color.RED);
GLabel Pi3Sec = new GLabel("2");
Pi3Sec.setFont("Arial-PLAIN-18");
Pi3Sec.setColor(Color.ORANGE);
GLabel Pi3Csc = new GLabel("(2√3/3)");
Pi3Csc.setFont("Arial-PLAIN-18");
Pi3Csc.setColor(Color.CYAN);
//Pi2
GLabel Pi2Show = new GLabel("(π/2)");
GOval Pi2 = new GOval(490, 90, 20,20);
this.add(Pi2);
Pi2.setFilled(true);
Pi2.setFillColor(Color.BLACK);
Pi2Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(Pi2Show, 490, 90);
GLabel Pi2Sin = new GLabel("(1)");
Pi2Sin.setFont("Arial-PLAIN-18");
Pi2Sin.setColor(Color.GREEN);
GLabel Pi2Cos = new GLabel("(0)");
Pi2Cos.setFont("Arial-PLAIN-18");
Pi2Cos.setColor(Color.BLUE);
GLabel Pi2Tan = new GLabel("(undefined)");
Pi2Tan.setFont("Arial-PLAIN-18");
Pi2Tan.setColor(Color.RED);
GLabel Pi2Sec = new GLabel("(undefined)");
Pi2Sec.setFont("Arial-PLAIN-18");
Pi2Sec.setColor(Color.ORANGE);
GLabel Pi2Csc = new GLabel("(1)");
Pi2Csc.setFont("Arial-PLAIN-18");
Pi2Csc.setColor(Color.CYAN);
// Quad 2
//2Pi3
GLabel TwoPi3Show = new GLabel("(2π/3)");
GOval TwoPi3 = new GOval(340, 115, 20,20);
this.add(TwoPi3);
TwoPi3.setFilled(true);
TwoPi3.setFillColor(Color.BLACK);
TwoPi3Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(TwoPi3Show, 285, 125);
GLabel TwoPi3Sin = new GLabel("(√3/2)");
TwoPi3Sin.setFont("Arial-PLAIN-18");
TwoPi3Sin.setColor(Color.GREEN);
GLabel TwoPi3Cos = new GLabel("(-1/2)");
TwoPi3Cos.setFont("Arial-PLAIN-18");
TwoPi3Cos.setColor(Color.BLUE);
GLabel TwoPi3Tan = new GLabel("(-√3)");
TwoPi3Tan.setFont("Arial-PLAIN-18");
Pi2Tan.setColor(Color.RED);
GLabel TwoPi3Sec = new GLabel("(-2)");
TwoPi3Sec.setFont("Arial-PLAIN-18");
TwoPi3Sec.setColor(Color.ORANGE);
GLabel TwoPi3Csc = new GLabel("(2√3/3)");
TwoPi3Csc.setFont("Arial-PLAIN-18");
TwoPi3Csc.setColor(Color.CYAN);
//3Pi4
GLabel ThreePi4Show = new GLabel("(3π/4)");
GOval ThreePi4 = new GOval(225, 190, 20,20);
this.add(ThreePi4);
ThreePi4.setFilled(true);
ThreePi4.setFillColor(Color.BLACK);
ThreePi4Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(ThreePi4Show, 160, 205);
GLabel ThreePi4Sin = new GLabel("(√2/2)");
ThreePi4Sin.setFont("Arial-PLAIN-18");
ThreePi4Sin.setColor(Color.GREEN);
GLabel ThreePi4Cos = new GLabel("(-√2/2)");
ThreePi4Cos.setFont("Arial-PLAIN-18");
ThreePi4Cos.setColor(Color.BLUE);
GLabel ThreePi4Tan = new GLabel("(-1)");
ThreePi4Tan.setFont("Arial-PLAIN-18");
ThreePi4Tan.setColor(Color.RED);
GLabel ThreePi4Sec = new GLabel("(-2√2/2)");
ThreePi4Sec.setFont("Arial-PLAIN-18");
ThreePi4Sec.setColor(Color.ORANGE);
GLabel ThreePi4Csc = new GLabel("(2√3/3)");
ThreePi4Csc.setFont("Arial-PLAIN-18");
ThreePi4Csc.setColor(Color.CYAN);
//5Pi6
GLabel FivePi6Show = new GLabel("(5π/6)");
GOval FivePi6 = new GOval(135, 290, 20,20);
this.add(FivePi6);
FivePi6.setFilled(true);
FivePi6.setFillColor(Color.BLACK);
FivePi6Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(FivePi6Show, 80, 310);
GLabel FivePi6Sin = new GLabel("(1/2)");
FivePi6Sin.setFont("Arial-PLAIN-18");
FivePi6Sin.setColor(Color.GREEN);
GLabel FivePi6Cos = new GLabel("(-√3/2)");
FivePi6Cos.setFont("Arial-PLAIN-18");
FivePi6Cos.setColor(Color.BLUE);
GLabel FivePi6Tan = new GLabel("(-√3/3)");
FivePi6Tan.setFont("Arial-PLAIN-18");
FivePi6Tan.setColor(Color.RED);
GLabel FivePi6Sec = new GLabel("(-2√2/2)");
FivePi6Sec.setFont("Arial-PLAIN-18");
FivePi6Sec.setColor(Color.ORANGE);
GLabel FivePi6Csc = new GLabel("(2)");
FivePi6Csc.setFont("Arial-PLAIN-18");
FivePi6Csc.setColor(Color.CYAN);
//Pi
GLabel PiShow = new GLabel("π");
GOval pi = new GOval(90, 490, 20,20);
this.add(pi);
pi.setFilled(true);
pi.setFillColor(Color.BLACK);
PiShow.setFont("Arial-PLAIN-22");
//Make into Mouse Listener
this.add(PiShow, 75, 510);
GLabel PiSin = new GLabel("(0)");
PiSin.setFont("Arial-PLAIN-18");
PiSin.setColor(Color.GREEN);
GLabel PiCos = new GLabel("(-1)");
PiCos.setFont("Arial-PLAIN-18");
PiCos.setColor(Color.BLUE);
GLabel PiTan = new GLabel("(0)");
PiTan.setFont("Arial-PLAIN-18");
PiTan.setColor(Color.RED);
GLabel PiSec = new GLabel("(-1)");
PiSec.setFont("Arial-PLAIN-18");
PiSec.setColor(Color.ORANGE);
GLabel PiCsc = new GLabel("(undefined)");
PiCsc.setFont("Arial-PLAIN-18");
PiCsc.setColor(Color.CYAN);
//Quad 3
//7Pi6
GLabel SevenPi6Show = new GLabel("(7π/6)");
GOval SevenPi6 = new GOval(145, 680, 20,20);
this.add(SevenPi6);
SevenPi6.setFilled(true);
SevenPi6.setFillColor(Color.BLACK);
SevenPi6Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(SevenPi6Show, 90, 690);
GLabel SevenPi6Sin = new GLabel("(-1/2)");
SevenPi6Sin.setFont("Arial-PLAIN-18");
SevenPi6Sin.setColor(Color.GREEN);
GLabel SevenPi6Cos = new GLabel("(-√3/2)");
SevenPi6Cos.setFont("Arial-PLAIN-18");
SevenPi6Cos.setColor(Color.BLUE);
GLabel SevenPi6Tan = new GLabel("(√3/3)");
SevenPi6Tan.setFont("Arial-PLAIN-18");
SevenPi6Tan.setColor(Color.RED);
GLabel SevenPi6Sec = new GLabel("(-2√3/3)");
SevenPi6Sec.setFont("Arial-PLAIN-18");
SevenPi6Sec.setColor(Color.ORANGE);
GLabel SevenPi6Csc = new GLabel("(-2)");
SevenPi6Csc.setFont("Arial-PLAIN-18");
SevenPi6Csc.setColor(Color.CYAN);
//5Pi4
GLabel FivePi4Show = new GLabel("(5π/4)");
GOval FivePi4 = new GOval(205, 780, 20,20);
this.add(FivePi4);
FivePi4.setFilled(true);
FivePi4.setFillColor(Color.BLACK);
FivePi4Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(FivePi4Show, 150, 790);
GLabel FivePi4Sin = new GLabel("(-√2/2)");
FivePi4Sin.setFont("Arial-PLAIN-18");
FivePi4Sin.setColor(Color.GREEN);
GLabel FivePi4Cos = new GLabel("(-√2/2)");
FivePi4Cos.setFont("Arial-PLAIN-18");
FivePi4Cos.setColor(Color.BLUE);
GLabel FivePi4Tan = new GLabel("(1)");
FivePi4Tan.setFont("Arial-PLAIN-18");
FivePi4Tan.setColor(Color.RED);
GLabel FivePi4Csc = new GLabel("(-2√2/2)");
FivePi4Csc.setFont("Arial-PLAIN-18");
FivePi4Csc.setColor(Color.CYAN);
GLabel FivePi4Sec = new GLabel("(-2√2/2)");
FivePi4Sec.setFont("Arial-PLAIN-18");
FivePi4Sec.setColor(Color.ORANGE);
//4Pi3
GLabel FourPi3Show = new GLabel("(4π/3)");
GOval FourPi3 = new GOval(335, 860, 20,20);
this.add(FourPi3);
FourPi3.setFilled(true);
FourPi3.setFillColor(Color.BLACK);
FourPi3Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(FourPi3Show, 275, 870);
GLabel FourPi3Sin = new GLabel("(-√3/2)");
FourPi3Sin.setFont("Arial-PLAIN-18");
FourPi3Sin.setColor(Color.GREEN);
GLabel FourPi3Cos = new GLabel("(-1/2)");
FourPi3Cos.setFont("Arial-PLAIN-18");
FourPi3Cos.setColor(Color.blue);
GLabel FourPi3Tan = new GLabel("(√3)");
FourPi3Cos.setFont("Arial-PLAIN-18");
FourPi3Cos.setColor(Color.RED);
GLabel FourPi3Sec = new GLabel("(-2)");
FourPi3Cos.setFont("Arial-PLAIN-18");
FourPi3Cos.setColor(Color.ORANGE);
GLabel FourPi3Csc = new GLabel("(-2√3/3)");
FourPi3Cos.setFont("Arial-PLAIN-18");
FourPi3Cos.setColor(Color.CYAN);
/*
//TwoPi
GLabel TwoPiShow = new GLabel("2π");
GOval twopi = new GOval(890, 490, 20,20);
this.add(twopi);
twopi.setFilled(true);
twopi.setFillColor(Color.BLACK);
TwoPiShow.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(TwoPiShow, 915, 510);
*/
//3Pi2
GLabel ThreePi2Show = new GLabel("(3π/2)");
GOval ThreePi2 = new GOval(490, 890, 20,20);
this.add(ThreePi2);
ThreePi2.setFilled(true);
ThreePi2.setFillColor(Color.BLACK);
ThreePi2Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(ThreePi2Show, 480, 890);
GLabel ThreePi2Sin = new GLabel("(-1)");
ThreePi2Sin.setFont("Arial-PLAIN-18");
ThreePi2Sin.setColor(Color.GREEN);
GLabel ThreePi2Cos = new GLabel("(0)");
ThreePi2Cos.setFont("Arial-PLAIN-18");
ThreePi2Cos.setColor(Color.BLUE);
GLabel ThreePi2Tan = new GLabel("(undefined)");
ThreePi2Tan.setFont("Arial-PLAIN-18");
ThreePi2Tan.setColor(Color.RED);
GLabel ThreePi2Cot = new GLabel("(0)");
ThreePi2Cot.setFont("Arial-PLAIN-18");
ThreePi2Cot.setColor(Color.MAGENTA);
GLabel ThreePi2Csc = new GLabel("(-1)");
ThreePi2Csc.setFont("Arial-PLAIN-18");
ThreePi2Csc.setColor(Color.CYAN);
GLabel ThreePi2Sec = new GLabel("(undefined)");
ThreePi2Sec.setFont("Arial-PLAIN-18");
ThreePi2Sec.setColor(Color.ORANGE);
//FivePi3
GLabel FivePi3Show = new GLabel("(5π/3)");
GOval FivePi3 = new GOval(655, 855, 20,20);
this.add(FivePi3);
FivePi3.setFilled(true);
FivePi3.setFillColor(Color.BLACK);
FivePi3Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(FivePi3Show, 685, 865);
GLabel FivePi3Sin = new GLabel("(-√3/2)");
FivePi3Sin.setFont("Arial-PLAIN-18");
FivePi3Sin.setColor(Color.GREEN);
GLabel FivePi3Cos = new GLabel("(1/2)");
FivePi3Cos.setFont("Arial-PLAIN-18");
FivePi3Cos.setColor(Color.BLUE);
GLabel FivePi3Tan = new GLabel("(-√3)");
FivePi3Tan.setFont("Arial-PLAIN-18");
FivePi3Tan.setColor(Color.RED);
GLabel FivePi3Csc = new GLabel("(-2√3/3)");
FivePi3Csc.setFont("Arial-PLAIN-18");
FivePi3Csc.setColor(Color.CYAN);
GLabel FivePi3Sec = new GLabel("2");
FivePi3Sec.setFont("Arial-PLAIN-18");
FivePi3Sec.setColor(Color.ORANGE);
//SevenPi4
GLabel SevenPi4Show = new GLabel("(7π/4)");
GOval SevenPi4 = new GOval(785, 760, 20,20);
this.add(SevenPi4);
SevenPi4.setFilled(true);
SevenPi4.setFillColor(Color.BLACK);
SevenPi4Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(SevenPi4Show, 810, 770);
GLabel SevenPi4Sin = new GLabel("(-√2/2)");
SevenPi4Sin.setFont("Arial-PLAIN-18");
SevenPi4Sin.setColor(Color.GREEN);
GLabel SevenPi4Cos = new GLabel("(√2/2)");
SevenPi4Cos.setFont("Arial-PLAIN-18");
FivePi3Cos.setColor(Color.BLUE);
GLabel SevenPi4Tan = new GLabel("(-1)");
SevenPi4Tan.setFont("Arial-PLAIN-18");
SevenPi4Tan.setColor(Color.RED);
GLabel SevenPi4Csc = new GLabel("(-2√2/2)");
SevenPi4Csc.setFont("Arial-PLAIN-18");
SevenPi4Csc.setColor(Color.CYAN);
GLabel SevenPi4Sec = new GLabel("(2√2/2)");
SevenPi4Sec.setFont("Arial-PLAIN-18");
SevenPi4Sec.setColor(Color.ORANGE);
//ElevenPi6
GLabel ElevenPi6Show = new GLabel("(11π/4)");
GOval ElevenPi6 = new GOval(855, 660, 20,20);
this.add(ElevenPi6);
ElevenPi6.setFilled(true);
ElevenPi6.setFillColor(Color.BLACK);
SevenPi4Show.setFont("Arial-PLAIN-18");
//Make into Mouse Listener
this.add(ElevenPi6Show, 885, 670);
GLabel ElevenPi6Sin = new GLabel("(-1/2)");
ElevenPi6Sin.setFont("Arial-PLAIN-18");
ElevenPi6Sin.setColor(Color.GREEN);
GLabel ElevenPi6Cos = new GLabel("(√3/2)");
ElevenPi6Cos.setFont("Arial-PLAIN-18");
ElevenPi6Cos.setColor(Color.BLUE);
GLabel ElevenPi6Tan = new GLabel("(-√3/3)");
ElevenPi6Tan.setFont("Arial-PLAIN-18");
ElevenPi6Tan.setColor(Color.RED);
GLabel ElevenPi6Csc = new GLabel("(-2)");
ElevenPi6Csc.setFont("Arial-PLAIN-18");
ElevenPi6Csc.setColor(Color.CYAN);
GLabel ElevenPi6Sec = new GLabel("(2√3/3)");
ElevenPi6Sec.setFont("Arial-PLAIN-18");
ElevenPi6Sec.setColor(Color.ORANGE);
//Now add mouse listeners and lines
// Add buttons (action listeners) too with sin, cos, tan, sec, csc, cot
//And then a key listener for a quiz
/*
Pi6.addMouseMotionListener(
new MouseMotionListener() {
@Override
public void mouseDragged(MouseEvent e) { }
@Override
public void mouseMoved(MouseEvent e) {
GLine LinePi6 = new GLine(400, 400, 840, 300);
LinePi6.setColor(Color.GREEN);
canvas.add(LinePi6);
}
}
);
*/
JButton buttonSin = new JButton("Sin(x)");
this.add(buttonSin, SOUTH);
JButton buttonCos = new JButton("Cos(x)");
this.add(buttonCos, SOUTH);
JButton buttonTan = new JButton("Tan(x)");
this.add(buttonTan, SOUTH);
JButton buttonCot = new JButton("Cot(x)");
this.add(buttonCos, SOUTH);
JButton buttonCsc = new JButton("Csc(x)");
this.add(buttonCsc, SOUTH);
JButton buttonSec = new JButton("Sec(x)");
this.add(buttonSec, SOUTH);
buttonSin.getParent().revalidate();
buttonSin.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GCanvas canvas = TrigWheel.this.getGCanvas();
canvas.add(Pi6Sin, 900, 300);
canvas.add(Pi4Sin,840, 200);
canvas.add(Pi3Sin,710, 120);
canvas.add(Pi2Sin, 530, 90);
canvas.add(TwoPiSin,955, 510);
canvas.add(TwoPi3Sin, 235, 125);
canvas.add(ThreePi4Sin,100, 205);
canvas.add(FivePi6Sin,40, 300);
canvas.add(PiSin,35, 510);
canvas.add(FourPi3Sin, 215, 870);
canvas.add(FivePi4Sin,90, 790);
canvas.add(SevenPi6Sin,40, 690);
canvas.add(FivePi3Sin, 740, 865);
canvas.add(SevenPi4Sin,860, 770);
canvas.add(ElevenPi6Sin,935, 670);
}
}
);
buttonCos.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GCanvas canvas = TrigWheel.this.getGCanvas();
canvas.add(Pi6Cos, 900, 300);
canvas.add(Pi4Cos,840, 200);
canvas.add(Pi3Cos,710, 120);
canvas.add(Pi2Cos, 530, 90);
canvas.add(TwoPiCos,955, 510);
canvas.add(TwoPi3Cos, 235, 125);
canvas.add(ThreePi4Cos,100, 205);
canvas.add(FivePi6Cos,40, 300);
canvas.add(PiCos,35, 510);
canvas.add(FourPi3Cos, 215, 870);
canvas.add(FivePi4Cos,90, 790);
canvas.add(SevenPi6Cos,40, 690);
canvas.add(FivePi3Cos, 740, 865);
canvas.add(SevenPi4Cos,860, 770);
canvas.add(ElevenPi6Cos,935, 670);
}
}
);
buttonTan.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GCanvas canvas = TrigWheel.this.getGCanvas();
canvas.add(Pi6Tan, 900, 300);
canvas.add(Pi4Tan,840, 200);
canvas.add(Pi3Tan,710, 120);
canvas.add(Pi2Tan, 530, 90);
canvas.add(TwoPiTan,955, 510);
canvas.add(TwoPi3Tan, 235, 125);
canvas.add(ThreePi4Tan,100, 205);
canvas.add(FivePi6Tan,40, 300);
canvas.add(PiTan,35, 510);
canvas.add(FourPi3Tan, 215, 870);
canvas.add(FivePi4Tan,90, 790);
canvas.add(SevenPi6Tan,40, 690);
canvas.add(FivePi3Tan, 740, 865);
canvas.add(SevenPi4Tan,860, 770);
canvas.add(ElevenPi6Tan,935, 670);
}
}
);
buttonSec.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GCanvas canvas = TrigWheel.this.getGCanvas();
canvas.add(Pi6Sec, 900, 300);
canvas.add(Pi4Sec,840, 200);
canvas.add(Pi3Sec,720, 120);
canvas.add(Pi2Sec, 530, 90);
canvas.add(TwoPiSec,955, 510);
canvas.add(TwoPi3Sec, 235, 125);
canvas.add(ThreePi4Sec,90, 205);
canvas.add(FivePi6Sec,40, 290);
canvas.add(PiSec,35, 510);
canvas.add(FourPi3Sec, 215, 870);
canvas.add(FivePi4Sec,80, 790);
canvas.add(SevenPi6Sec,40, 670);
canvas.add(FivePi3Sec, 740, 865);
canvas.add(SevenPi4Sec,860, 770);
canvas.add(ElevenPi6Sec,935, 670);
}
}
);
buttonCsc.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GCanvas canvas = TrigWheel.this.getGCanvas();
canvas.add(Pi6Csc, 900, 300);
canvas.add(Pi4Csc,840, 200);
canvas.add(Pi3Csc,720, 120);
canvas.add(Pi2Csc, 530, 90);
canvas.add(TwoPiCsc,890, 480);
canvas.add(TwoPi3Csc, 215, 125);
canvas.add(ThreePi4Csc,90, 205);
canvas.add(FivePi6Csc,40, 300);
canvas.add(PiCsc,35, 490);
canvas.add(FourPi3Csc, 215, 870);
canvas.add(FivePi4Csc,80, 790);
canvas.add(SevenPi6Csc,40, 680);
canvas.add(FivePi3Csc, 740, 865);
canvas.add(SevenPi4Csc,860, 770);
canvas.add(ElevenPi6Csc,935, 670);
}
}
);
/*
Pi6.addMouseListener(
new MouseListener() {
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {}
@Override
public void mouseEntered(MouseEvent e) {}
@Override
public void mouseExited(MouseEvent e) {}
@Override
public void mouseClicked(MouseEvent e) {}
}
);
*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void AddQuad(Quadruple quad)\n {\n Quadruple.add(nextQuad, quad);\n nextQuad++;\n }",
"public Quadrat(Point a, Point b, Point c, Point d){\r\n\t\tsuper(a,b,c,d);\r\n\t}",
"void addTriangle(int vertexIndex1, int vertexIndex2, int vertexIndex3);",
"private QuadTree<Point> quadrant(Point p) ... | [
"0.62534416",
"0.552041",
"0.55142844",
"0.5513317",
"0.5349595",
"0.5330959",
"0.517171",
"0.5153969",
"0.51088",
"0.5074954",
"0.50685656",
"0.50004226",
"0.4981287",
"0.49499106",
"0.4936521",
"0.49318323",
"0.4917562",
"0.4870055",
"0.48469564",
"0.4844887",
"0.48443374",... | 0.0 | -1 |
delete any samples that exist in the database but have had their checkboxes unchecked by the user on the ASM Module Info screen. MR6976 | private Map deleteSamples(SecurityInfo securityInfo, String module) throws Exception {
Map returnValue = new HashMap();
//get the existing sample ids for the ASM module
AsmData asmInfo = new AsmData();
asmInfo.setAsm_id(module);
IcpOperationHome home = (IcpOperationHome) EjbHomes.getHome(IcpOperationHome.class);
IcpOperation icp = home.create();
asmInfo = (AsmData) icp.getAsmData(asmInfo, securityInfo, true, false);
Iterator frozenIterator = ApiFunctions.safeList(asmInfo.getFrozen_samples()).iterator();
Iterator paraffinIterator = ApiFunctions.safeList(asmInfo.getParaffin_samples()).iterator();
List existingSampleIds = new ArrayList();
SampleData sample;
while (frozenIterator.hasNext()) {
sample = (SampleData)frozenIterator.next();
existingSampleIds.add(sample.getSample_id());
}
while (paraffinIterator.hasNext()) {
sample = (SampleData)paraffinIterator.next();
existingSampleIds.add(sample.getSample_id());
}
//for each existing sample, if it has not been checked off on the front end it is a candidate
//for deletion. Build a list of candidate ids and if it's not empty pass the list off to
//BtxPerformerSampleOperation for deletion. That class will enforce any business rules that
//ensure the samples can truly be deleted. We simply need to check for errors and if any
//ocurred pass them back to the user.
List samplesToDelete = new ArrayList();
Iterator existingIterator = existingSampleIds.iterator();
while (existingIterator.hasNext()) {
String sampleId = (String)existingIterator.next();
//if the state is disabled, this is a sample that wasn't allowed to be unchecked
//so it is not a candidate for deletion. We cannot check the "present"<sample_id>
//parameter because disabled controls do not have their values passed in the request
String state = ApiFunctions.safeString(request.getParameter("present" + sampleId + "state"));
if (state.indexOf("disabled") < 0) {
//otherwise, see if there is a parameter indicating the sample is checked. If not,
//this sample is a candidate for deletion. Frozen and paraffin samples have
//slightly different parameter names, so get them both
String frozenCheck = ApiFunctions.safeString(request.getParameter("present" + sampleId));
String paraffinCheck = ApiFunctions.safeString(request.getParameter("pfin_present" + sampleId));
if (ApiFunctions.isEmpty(frozenCheck) && ApiFunctions.isEmpty(paraffinCheck)) {
samplesToDelete.add(sampleId);
}
}
}
if (samplesToDelete.size() > 0) {
Timestamp now = new Timestamp(System.currentTimeMillis());
BtxDetailsDeleteSamples btxDetails = new BtxDetailsDeleteSamples();
btxDetails.setBeginTimestamp(now);
btxDetails.setLoggedInUserSecurityInfo(securityInfo);
List sampleList = new ArrayList();
Iterator sampleIterator = samplesToDelete.iterator();
while (sampleIterator.hasNext()) {
com.ardais.bigr.javabeans.SampleData sampleData = new com.ardais.bigr.javabeans.SampleData();
sampleData.setSampleId((String)sampleIterator.next());
sampleData.setConsentId(asmInfo.getCase_id());
sampleList.add(sampleData);
}
btxDetails.setSampleDatas(sampleList);
//note - I spoke with Gail about providing a default reason for deleting the samples,
//and she requested that we leave the reason blank. Most of the time it's because the
//samples were created in error, but there are occasionally other reasons (i.e. the
//sample was broken).
btxDetails = (BtxDetailsDeleteSamples)Btx.perform(btxDetails, "iltds_sample_deleteSamples");
//if any errors were returned, add them to the errors list
BtxActionErrors actionErrors = btxDetails.getActionErrors();
if (actionErrors != null && actionErrors.size() > 0) {
Iterator errorIterator = actionErrors.get();
MessageResources messages = (MessageResources)servletCtx.getAttribute(Globals.MESSAGES_KEY);
while (errorIterator.hasNext()) {
BtxActionError error = (BtxActionError)errorIterator.next();
String message = messages.getMessage(error.getKey(), error.getValues());
//because these messages are shown in plain text, strip off the <li> and </li> tags
message = StringUtils.replace(message,"<li>"," ");
message = StringUtils.replace(message,"</li>"," ");
errors.add(message.trim());
}
}
else {
//no errors occurred, so return a map of deleted sample ids
Iterator iterator = samplesToDelete.iterator();
String sampleId;
while (iterator.hasNext()) {
sampleId = (String)iterator.next();
returnValue.put(sampleId, sampleId);
}
}
}
return returnValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteAllRealTestCode() {\n\n\t myDataBase.delete(\"tbl_TestCode\", \"TestCode\" + \" != ?\",\n\t new String[] { \"1\" });\n\t }",
"public void clear_data() {\n\n for(Map.Entry<Integer,ArrayList<Integer>> entry : to_refer_each_item.entrySet()) {\n\n ArrayList... | [
"0.5985693",
"0.59621835",
"0.5930949",
"0.5764042",
"0.5750801",
"0.57187283",
"0.5637931",
"0.5612583",
"0.560667",
"0.5605228",
"0.556948",
"0.5541938",
"0.5522307",
"0.5498883",
"0.5482166",
"0.54809326",
"0.54491407",
"0.54272825",
"0.5418361",
"0.54154885",
"0.5391113",... | 0.67876744 | 0 |
create the fixative dropdown changed to use ARTS for MR 4435 | private void retry(AsmData asmData) throws IOException, ServletException {
LegalValueSet fixatives = BigrGbossData.getValueSetAsLegalValueSet(ArtsConstants.VALUE_SET_TYPE_OF_FIXATIVE);
request.setAttribute("fixatives", fixatives);
// new fields that pass in ARTS codes for MR 4435
LegalValueSet sampleFormatDetail = BigrGbossData.getValueSetAsLegalValueSet(ArtsConstants.VALUE_SET_SAMPLE_FORMAT_DETAIL);
request.setAttribute("sampleFormat", sampleFormatDetail);
LegalValueSet minThickness = BigrGbossData.getValueSetAsLegalValueSet(ArtsConstants.VALUE_SET_PARAFFIN_DIMENSIONS);
request.setAttribute("minThickness", minThickness);
LegalValueSet maxThickness = BigrGbossData.getValueSetAsLegalValueSet(ArtsConstants.VALUE_SET_PARAFFIN_DIMENSIONS);
request.setAttribute("maxThickness", maxThickness);
LegalValueSet widthAcross = BigrGbossData.getValueSetAsLegalValueSet(ArtsConstants.VALUE_SET_PARAFFIN_DIMENSIONS);
request.setAttribute("widthAcross", widthAcross);
LegalValueSet paraffinFeatureSet = BigrGbossData.getValueSetAsLegalValueSet(ArtsConstants.VALUE_SET_PARAFFIN_FEATURE);
request.setAttribute("paraffinFeatureSet", paraffinFeatureSet);
//set the changed sample vectors
request.setAttribute("hours", FormLogic.getHourIntVector());
request.setAttribute("minutes", FormLogic.getMinuteIntVector());
request.setAttribute("organ", asmData.getTissue_type());
request.setAttribute("otherTissue", asmData.getOther_tissue());
request.setAttribute("moduleLetter", asmData.getModule_letter());
request.setAttribute("asmInfo", asmData);
request.setAttribute("myRetry", errors);
//MR6976 - for every sample on the ASM, populate it's statuses. If this isn't done,
//the jsp will incorrectly allow the user to uncheck samples that have progressed
//beyond the ASMPRESENT stage.
SampleData sampleData;
Iterator frozenIterator = asmData.getFrozen_samples().iterator();
while (frozenIterator.hasNext()) {
sampleData = (SampleData)frozenIterator.next();
if (sampleData.isExists()) {
sampleData.setStatuses(FormLogic.getStatusValuesForSample(sampleData.getSample_id()));
}
}
Iterator paraffinIterator = asmData.getParaffin_samples().iterator();
while (paraffinIterator.hasNext()) {
sampleData = (SampleData)paraffinIterator.next();
if (sampleData.isExists()) {
sampleData.setStatuses(FormLogic.getStatusValuesForSample(sampleData.getSample_id()));
}
}
servletCtx.getRequestDispatcher("/hiddenJsps/iltds/asm/asmModuleInfo.jsp").forward(
request,
response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void add(){\r\n ArrayAdapter<String> adp3 = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, list);\r\n adp3.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\r\n txtAuto3.setThreshold(1);\r\n txtAuto3.setAdapter(adp3);\r\n }",
... | [
"0.5510179",
"0.55050325",
"0.5385734",
"0.536664",
"0.5218124",
"0.51876324",
"0.5170106",
"0.5129404",
"0.5122177",
"0.51162404",
"0.51134527",
"0.507466",
"0.5069854",
"0.5067576",
"0.5049968",
"0.5029629",
"0.5029524",
"0.50155133",
"0.50096875",
"0.5008094",
"0.50056064"... | 0.0 | -1 |
Heart Rate Service (Service UUID: 0x180D) callback | public interface HeartRateServiceCallback {
/**
* Read Heart Rate Measurement's Client Characteristic Configuration success callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param clientCharacteristicConfigurationAndroid {@link ClientCharacteristicConfigurationAndroid}
* @param argument callback argument
*/
void onHeartRateMeasurementClientCharacteristicConfigurationReadSuccess(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @NonNull Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @NonNull Integer characteristicInstanceId
, @NonNull Integer descriptorInstanceId
, @NonNull ClientCharacteristicConfigurationAndroid clientCharacteristicConfigurationAndroid
, @Nullable Bundle argument);
/**
* Read Heart Rate Measurement's Client Characteristic Configuration error callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param status one of {@link BLEConnection#onDescriptorRead(BluetoothGatt, BluetoothGattDescriptor, int)} 3rd parameter, {@link org.im97mori.ble.constants.ErrorCodeAndroid#UNKNOWN}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#CANCEL}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#BUSY}
* @param argument callback argument
*/
void onHeartRateMeasurementClientCharacteristicConfigurationReadFailed(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, @Nullable Integer descriptorInstanceId
, int status
, @Nullable Bundle argument);
/**
* Read Heart Rate Measurement's Client Characteristic Configuration timeout callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param timeout timeout(millis)
* @param argument callback argument
*/
void onHeartRateMeasurementClientCharacteristicConfigurationReadTimeout(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, @Nullable Integer descriptorInstanceId
, long timeout
, @Nullable Bundle argument);
/**
* Start Heart Rate Measurement notificate success callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param argument callback argument
*/
void onHeartRateMeasurementNotificateStartSuccess(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, @NonNull Integer descriptorInstanceId
, @Nullable Bundle argument);
/**
* Start Heart Rate Measurement notificate error callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param status one of {@link BLEConnection#onDescriptorWrite(BluetoothGatt, BluetoothGattDescriptor, int)} 3rd parameter, {@link org.im97mori.ble.constants.ErrorCodeAndroid#UNKNOWN}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#CANCEL}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#BUSY}
* @param argument callback argument
*/
void onHeartRateMeasurementNotificateStartFailed(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, @Nullable Integer descriptorInstanceId
, int status
, @Nullable Bundle argument);
/**
* Start Heart Rate Measurement notificate timeout callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param timeout timeout(millis)
* @param argument callback argument
*/
void onHeartRateMeasurementNotificateStartTimeout(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, @Nullable Integer descriptorInstanceId
, long timeout
, @Nullable Bundle argument);
/**
* Stop Heart Rate Measurement notificate success callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param argument callback argument
*/
void onHeartRateMeasurementNotificateStopSuccess(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, @NonNull Integer descriptorInstanceId
, @Nullable Bundle argument);
/**
* Stop Heart Rate Measurement notificate error callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param status one of {@link BLEConnection#onDescriptorWrite(BluetoothGatt, BluetoothGattDescriptor, int)} 3rd parameter, {@link org.im97mori.ble.constants.ErrorCodeAndroid#UNKNOWN}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#CANCEL}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#BUSY}
* @param argument callback argument
*/
void onHeartRateMeasurementNotificateStopFailed(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, @Nullable Integer descriptorInstanceId
, int status
, @Nullable Bundle argument);
/**
* Stop Heart Rate Measurement notificate timeout callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param descriptorInstanceId task target descriptor incetanceId
* @param timeout timeout(millis)
* @param argument callback argument
*/
void onHeartRateMeasurementNotificateStopTimeout(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, @Nullable Integer descriptorInstanceId
, long timeout
, @Nullable Bundle argument);
/**
* Heart Rate Measurement notified callback
*
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param heartRateMeasurementAndroid {@link org.im97mori.ble.characteristic.u2a37.HeartRateMeasurementAndroid}
*/
void onHeartRateMeasurementNotified(@NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @NonNull Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @NonNull Integer characteristicInstanceId
, @NonNull HeartRateMeasurementAndroid heartRateMeasurementAndroid);
/**
* Read Body Sensor Location success callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param bodySensorLocationAndroid {@link BodySensorLocationAndroid}
* @param argument callback argument
*/
void onBodySensorLocationReadSuccess(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @NonNull Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @NonNull Integer characteristicInstanceId
, @NonNull BodySensorLocationAndroid bodySensorLocationAndroid
, @Nullable Bundle argument);
/**
* Read Body Sensor Location error callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param status one of {@link BLEConnection#onCharacteristicRead(BluetoothGatt, BluetoothGattCharacteristic, int)} 3rd parameter, {@link org.im97mori.ble.constants.ErrorCodeAndroid#UNKNOWN}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#CANCEL}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#BUSY}
* @param argument callback argument
*/
void onBodySensorLocationReadFailed(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, int status
, @Nullable Bundle argument);
/**
* Read Body Sensor Location timeout callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param timeout timeout(millis)
* @param argument callback argument
*/
void onBodySensorLocationReadTimeout(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, long timeout
, @Nullable Bundle argument);
/**
* Write Heart Rate Control Point success callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param heartRateControlPointAndroid {@link HeartRateControlPointAndroid}
* @param argument callback argument
*/
void onHeartRateControlPointWriteSuccess(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @NonNull Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @NonNull Integer characteristicInstanceId
, @NonNull HeartRateControlPointAndroid heartRateControlPointAndroid
, @Nullable Bundle argument);
/**
* Write Heart Rate Control Point error callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param status one of {@link BLEConnection#onCharacteristicRead(BluetoothGatt, BluetoothGattCharacteristic, int)} 3rd parameter, {@link org.im97mori.ble.constants.ErrorCodeAndroid#UNKNOWN}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#CANCEL}, {@link org.im97mori.ble.constants.ErrorCodeAndroid#BUSY}
* @param argument callback argument
*/
void onHeartRateControlPointWriteFailed(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, int status
, @Nullable Bundle argument);
/**
* Write Heart Rate Control Point timeout callback
*
* @param taskId task id
* @param bluetoothDevice BLE device
* @param serviceUUID service {@link UUID}
* @param serviceInstanceId task target service incetanceId {@link BluetoothGattService#getInstanceId()}
* @param characteristicUUID characteristic {@link UUID}
* @param characteristicInstanceId task target characteristic incetanceId {@link BluetoothGattCharacteristic#getInstanceId()}
* @param timeout timeout(millis)
* @param argument callback argument
*/
void onHeartRateControlPointWriteTimeout(@NonNull Integer taskId
, @NonNull BluetoothDevice bluetoothDevice
, @NonNull UUID serviceUUID
, @Nullable Integer serviceInstanceId
, @NonNull UUID characteristicUUID
, @Nullable Integer characteristicInstanceId
, long timeout
, @Nullable Bundle argument);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getHeartRate();",
"@Override\n public void heartRate(int valueHr, int timestamp) {\n }",
"public void heartBeat();",
"@Override\n public void onReceive(Context context, Intent intent) {\n Log.d(\"ALARMA\", \"alarma\");\n AlarmUtils.scheduleAlarmHeartRate();\n BleDevice devic... | [
"0.7582189",
"0.6946416",
"0.6768623",
"0.657519",
"0.65630805",
"0.65460855",
"0.64089763",
"0.635418",
"0.6287055",
"0.627599",
"0.6234617",
"0.6138246",
"0.6130381",
"0.60721713",
"0.6056683",
"0.6049911",
"0.5957314",
"0.5892161",
"0.58697253",
"0.58389413",
"0.57971835",... | 0.6637766 | 3 |
called after camera intent finished | @Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
//photo taken from cam
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
if (_mImageUri != null) {
showTakenPhoto();
}
}
//photo chosen
if (requestCode == REQUEST_IMAGE_PICK && resultCode == RESULT_OK) {
_mImageUri = intent.getData();
try {
_bitmap = MediaStore.Images.Media.getBitmap(
getContentResolver(), _mImageUri);
ImageView imageView = (ImageView) findViewById(R.id.uploadedImage);
assert _bitmap != null;
String[] filePathColumn = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(
_mImageUri, filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String filePath = cursor.getString(columnIndex);
cursor.close();
rotateImage(filePath);
imageView.setImageBitmap(scaleBitmap(_bitmap, 350));
_uploadButton.setEnabled(true);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void cameraIntent() {\n startActivityForResult(new Intent(\"android.media.action.IMAGE_CAPTURE\"), 1);\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent intent)\n {\n if(requestCode==REQUEST_IMAGE_CAPTURE && resultCode==RESULT_OK)\n {\n ... | [
"0.7136372",
"0.6943413",
"0.69216263",
"0.69183713",
"0.6916481",
"0.69127744",
"0.68979347",
"0.6891996",
"0.68654144",
"0.6810539",
"0.674436",
"0.66809404",
"0.66675735",
"0.66637343",
"0.6593785",
"0.6576912",
"0.6566068",
"0.65596217",
"0.6532391",
"0.65264785",
"0.6525... | 0.6474181 | 27 |
Called when the activity is first created. | @Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.side);
Button t=(Button)findViewById(R.id.text2);
t.setText("Events");
t.setTypeface(null, 0);
setListAdapter(new ArrayAdapter(this, R.layout.simplelistitem, Eventtypes));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}",
"@Override\n\tpublic void onActivit... | [
"0.791686",
"0.77270156",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7637394",
"0.7637394",
"0.7629958",
"0.76189965",
"0.76189965",
"0.7543775",
"0.7540053",
"0.7540053",
"0.7539505",
"0.75269467",
"0.75147736",
"0.7509639",
"0.7500879",... | 0.0 | -1 |
type : sms and google | private void authSuccess(String str, Utilis.AuthType type) {
Utilis.setSharePreference(AppConstant.PREF_PARENT_LOGIN_INFO, str);
Utilis.setSharePreference(AppConstant.PREF_AUTH_TYPE, type.name());
startActivity(new Intent(LoginActivity.this, ChildActivity.class));
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface ReceiveAdvertisementType\n {\n /**\n * sms\n */\n String BY_SMS = \"0\";\n\n /**\n * email\n */\n String BY_EMAIL = \"1\";\n }",
"com.polytech.spik.protocol.SpikMessages.Sms getSms();",
"void requestSendSMSCode(Context context,S... | [
"0.6473819",
"0.6075977",
"0.59833705",
"0.59771395",
"0.58849496",
"0.5844369",
"0.58116984",
"0.57923436",
"0.57876366",
"0.5725328",
"0.56432444",
"0.56296635",
"0.56160414",
"0.5552749",
"0.5536868",
"0.5532978",
"0.5520222",
"0.54975516",
"0.54918903",
"0.54392296",
"0.5... | 0.0 | -1 |
TODO when login failed | private void authFailed() {
Toast.makeText(LoginActivity.this, "Authentication failed.",
Toast.LENGTH_SHORT).show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void login() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void login() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void login() {\n\r\n\t}",
"@Override\n\tprotected void login() {\n\t\tsuper.login();\n\t}",
"protected synchronized void login() {\n\t\tauthenticate();\n\t}",
"public static void Login() \r... | [
"0.75553226",
"0.72537136",
"0.6972939",
"0.69100744",
"0.6618622",
"0.65778613",
"0.6564271",
"0.65429044",
"0.6477974",
"0.646926",
"0.64646256",
"0.6437402",
"0.6432921",
"0.64166474",
"0.6410102",
"0.6401605",
"0.63813233",
"0.63813233",
"0.63590467",
"0.6354203",
"0.6337... | 0.0 | -1 |
The method initializing the research of the periods. Finds the beginning and the ending of the area where the first period is to be searched. Filters the data into the dataFiltered list. | public void initPeriodsSearch() {
//init fundamentalFreq
calculatefundamentalFreq();
//set the first search area
final double confidenceLevel = 5 / 100.;
nextPeriodSearchingAreaEnd = (int) Math.floor( hzToPeriod( fundamentalFreq ) * ( 1 + confidenceLevel ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setup_search_region (RJGUIController.XferCatalogMod xfer) {\n\n\t\t// Time range for aftershock search\n\t\t\n\t\tdouble minDays = xfer.x_dataStartTimeParam;\n\t\tdouble maxDays = xfer.x_dataEndTimeParam;\n\t\t\n\t\tlong startTime = fcmain.mainshock_time + Math.round(minDays*ComcatOAFAccessor.day_mill... | [
"0.54129046",
"0.5371604",
"0.53536373",
"0.5247338",
"0.52364343",
"0.5168858",
"0.51540154",
"0.5140184",
"0.51114774",
"0.5089092",
"0.5068379",
"0.50575066",
"0.50197953",
"0.4981684",
"0.49606165",
"0.49287885",
"0.490862",
"0.49083543",
"0.48690322",
"0.48671392",
"0.48... | 0.72765267 | 0 |
The method calculating the periods in the data and searching the pitches positions. Fills the pitchPositions and the periods lists. | public void searchPitchPositions() {
for(float pitch : pitches)
periods.add((int) hzToPeriod(pitch));
int periodMaxPitch;
int periodMaxPitchIndex = 0;
int periodBeginning = 0;
//search each periods maxima
for ( int period = 0; period < periods.size() - 1; period++ ) {
periodMaxPitch = 0;
//search a maximum
for ( int i = periodBeginning; i < periodBeginning + periods.get( period ); i++ ) {
if(i < data.size()){
if ( periodMaxPitch < data.get( i ) ) {
periodMaxPitch = data.get( i );
periodMaxPitchIndex = i;
}
}
}
periodBeginning += periods.get( period );
pitchPositions.add( periodMaxPitchIndex );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Float> calculatePitches(){\n\t\tList<Integer> res = new ArrayList<Integer>();\n\t\tint size = data.size();\n\t\tint maxAmp = 0;\n\t\tint startPos = 0;\n\t\t// get the first pitch in the basic period\n\t\tfor (int i = 0; i < BASE_FRAGMENT; i ++){\n\t\t\tif (maxAmp < data.get(i)){\n\t\t\t\tmaxAmp = data.... | [
"0.7478235",
"0.571415",
"0.55877614",
"0.54471564",
"0.5338539",
"0.5337807",
"0.51631767",
"0.516181",
"0.5132112",
"0.49860132",
"0.47935972",
"0.4734798",
"0.46600536",
"0.46349758",
"0.4600435",
"0.45994997",
"0.45807022",
"0.4572236",
"0.45678738",
"0.45539087",
"0.4546... | 0.76817393 | 0 |
Returns the period length of the given value in Hz considering the sample rate (44.1kHz). | private float hzToPeriod(float hz ) {
int sampling = 44100;
return sampling / hz;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int freq()\n\t{\n\t\treturn _lsPeriod.get (0).freq();\n\t}",
"private float calculateSensorFrequency() {\n if (startTime == 0) {\n startTime = System.nanoTime();\n }\n\n long timestamp = System.nanoTime();\n\n // Find the sample period (between updates) and convert f... | [
"0.6353981",
"0.61254674",
"0.6044024",
"0.6026354",
"0.5896274",
"0.5881207",
"0.58719015",
"0.585478",
"0.58294463",
"0.5821131",
"0.579739",
"0.5714488",
"0.5690322",
"0.56768906",
"0.56266063",
"0.5617016",
"0.5591459",
"0.5569813",
"0.5555429",
"0.55397946",
"0.55318034"... | 0.67106175 | 0 |
FEATURE NUMBER 1 : SHIMMER The method calculating the Shimmer | public double getShimmer() {
int minAmp = 0; // figures the minium of the amplitude.
int maxAmp; // figures the maxium of the amplitude.
double amplitude = 0;
List<Double> amplitudes = new ArrayList<Double>();
double sum = 0;
for ( int i = 0; i < pitchPositions.size() - 1; i++ ) {
// get each pitch
maxAmp = data.get( pitchPositions.get( i ) );
for ( int j = pitchPositions.get( i ); j < pitchPositions.get( i + 1 ); j++ ) {
if ( minAmp > data.get( j ) ) {
minAmp = data.get( j );
}
}
amplitude = maxAmp - minAmp;
amplitudes.add(amplitude);
minAmp = 9999;
}
///Math.log(10)
for(int j = 0; j < amplitudes.size() - 1; j++){
double element = Math.abs(20*(Math.log(amplitudes.get(j+1)/amplitudes.get(j))));
sum = sum + element;
}
double result1 = sum/(amplitudes.size() - 1);
return result1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo1501h();",
"void mo1506m();",
"private void m23260f() {\n Shimmer aVar;\n Shader shader;\n Rect bounds = getBounds();\n int width = bounds.width();\n int height = bounds.height();\n if (width != 0 && height != 0 && (aVar = this.f19138f) != null) {\n i... | [
"0.598375",
"0.5694126",
"0.5677906",
"0.56584483",
"0.5612316",
"0.56121355",
"0.55517566",
"0.5526309",
"0.55260456",
"0.5522696",
"0.55183977",
"0.5506434",
"0.5469367",
"0.546614",
"0.54600924",
"0.5454606",
"0.54539686",
"0.54522514",
"0.54321796",
"0.5431705",
"0.541290... | 0.58365786 | 1 |
FEATURE NUMBER 2 : JITTER The method calculating the Jitter (corresponds to ddp in Praat) | public double getJitter() {
double sumOfDifferenceOfPeriods = 0.0; // sum of difference between every two periods
double sumOfPeriods = 0.0; // sum of all periods
double numberOfPeriods = periods.size(); //set as double for double division
// JITTER FORMULA (RELATIVE)
for ( int i = 0; i < periods.size() - 1; i++ ) {
sumOfDifferenceOfPeriods += Math.abs( periods.get( i ) - periods.get( i + 1 ) );
sumOfPeriods += periods.get( i );
}
// add the last period into sum
if ( !periods.isEmpty() ) {
sumOfPeriods += periods.get( periods.size() - 1 );
}
double meanPeriod = sumOfPeriods / numberOfPeriods;
// calculate jitter (relative)
return ( sumOfDifferenceOfPeriods / ( numberOfPeriods - 1 ) ) / meanPeriod;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static int benchmarkedMethod() {\n return 3;\n }",
"@Benchmark\n public void testJMH(@SuppressWarnings(\"unused\") GraalState s) {\n }",
"public void jitter() {\n // jitter +- 20% of the value\n double amount = 0.20;\n double change = 1.0 - amount + (Evolve.getRand... | [
"0.5845645",
"0.5828103",
"0.56780505",
"0.55514437",
"0.54290026",
"0.5354926",
"0.5280327",
"0.5273568",
"0.5258621",
"0.5215285",
"0.518387",
"0.5179955",
"0.51639634",
"0.516297",
"0.51578224",
"0.51504856",
"0.51392084",
"0.5138033",
"0.51307344",
"0.5119668",
"0.5107436... | 0.6472895 | 0 |
FEATURE NUMBER 3 : FUNDAMENTAL FREQUENCY Getter for the fundamental frequency | public double getfundamentalFreq() {
if ( fundamentalFreq == 0f )
calculatefundamentalFreq();
return fundamentalFreq;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void calculatefundamentalFreq() {\n\t\tint count;\n\t\tfloat f0 = 0;\n\t\tSystem.out.println(\"pitches\");\n\t\tSystem.out.println(pitches);\n\t\tfor(count = 0; count < pitches.size(); count++)\n\t\t{\n\t\t\tf0 += pitches.get(count);\n\t\t}\n\t\tif(count != 0)\n\t\t\tfundamentalFreq = f0 / count;\n\t\tels... | [
"0.75091124",
"0.7401085",
"0.72766006",
"0.71297395",
"0.7061961",
"0.698877",
"0.6978794",
"0.68601114",
"0.6855581",
"0.6853673",
"0.6841052",
"0.6832012",
"0.6831977",
"0.68158823",
"0.6686236",
"0.66839576",
"0.664574",
"0.6642657",
"0.66399676",
"0.6607014",
"0.65855724... | 0.81998175 | 0 |
The method finding the fundamental frequency of the data. To increase efficiency, this method only test the frequencies between 40Hz to 400Hz. | private void calculatefundamentalFreq() {
int count;
float f0 = 0;
System.out.println("pitches");
System.out.println(pitches);
for(count = 0; count < pitches.size(); count++)
{
f0 += pitches.get(count);
}
if(count != 0)
fundamentalFreq = f0 / count;
else
fundamentalFreq = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getfundamentalFreq() {\n\t\tif ( fundamentalFreq == 0f )\n\t\t\tcalculatefundamentalFreq();\n\n\t\treturn fundamentalFreq;\n\t}",
"@Test\n public void testDFTOneFreq() {\n for (int freq = 0; freq < 1000; freq += 200) {\n SoundWave wave = new SoundWave(freq, 5, 0.5, 0.1);\n ... | [
"0.7413342",
"0.74126804",
"0.72742265",
"0.6881332",
"0.68776643",
"0.6829389",
"0.6795932",
"0.6787255",
"0.67229366",
"0.6671921",
"0.6604716",
"0.6564024",
"0.6516471",
"0.64079785",
"0.6392684",
"0.63315606",
"0.62483597",
"0.6133605",
"0.61246926",
"0.611679",
"0.610159... | 0.8117217 | 0 |
The method calculating the pitch periods | public List<Float> calculatePitches(){
List<Integer> res = new ArrayList<Integer>();
int size = data.size();
int maxAmp = 0;
int startPos = 0;
// get the first pitch in the basic period
for (int i = 0; i < BASE_FRAGMENT; i ++){
if (maxAmp < data.get(i)){
maxAmp = data.get(i);
// set this position as the start position
startPos = i;
}
}
Log.v("startPos", String.valueOf(startPos));
// find every pitch in all the fragments
int pos = startPos + OFFSET; // set current position
int posAmpMax;
while(startPos < 1000){
if(data.get(pos) > 0) { // only read the positive data
posAmpMax = 0;
maxAmp = 0;
// access to all the data in this fragment
while (pos < startPos + BASE_FRAGMENT) {
// find the pitch and mark this position
if (maxAmp < data.get(pos)) {
maxAmp = data.get(pos);
posAmpMax = pos;
}
pos++;
}
// add pitch position into the list
pitchPositions.add(posAmpMax);
res.add(posAmpMax);
// update the start position and the current position
startPos = posAmpMax;
pos = startPos + OFFSET;
}else{
pos ++;
}
}
// calculate all periods and add them into list
for(int i = 0; i < pitchPositions.size() - 1; i++){
float period = (float)(pitchPositions.get(i+1) - pitchPositions.get(i));
T.add(period);
pitches.add(PeriodToPitch(period));
}
pitchPositions.clear();
return pitches;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void analyzePitch(java.util.List<Double> samples) {\n \r\n if(samples.isEmpty()) return;\r\n if(samples.size()<=SAMPLE_RATE*MIN_SAMPLE_LENGTH_MS/1000) {\r\n //System.err.println(\"samples too short: \"+samples.size());\r\n return;\r\n }\r\n final Sound pitchSound=So... | [
"0.6791497",
"0.6618286",
"0.65856117",
"0.6577069",
"0.6572845",
"0.6472334",
"0.6419275",
"0.64133567",
"0.6404893",
"0.6404893",
"0.61804414",
"0.61093044",
"0.60604525",
"0.6005036",
"0.5980107",
"0.5886116",
"0.5863939",
"0.58499086",
"0.58473796",
"0.5844087",
"0.584244... | 0.71643764 | 0 |
Increases the value of the given Property by the amount specified in setParams. If the agent does not have the specified property, then it is left unaffected. | @Override
public void execute(Agent agent, double deltaTime) throws PropertyDoesNotExistException {
try{
double current_value = (double) agent.getProperty(propertyName);
current_value += amount;
agent.setProperty(propertyName, current_value);
}
catch(PropertyDoesNotExistException e) {
// DO NOTHING, if doesn't exist, don't overwrite
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void enablePropertyBalance()\n {\n iPropertyBalance = new PropertyInt(new ParameterInt(\"Balance\"));\n addProperty(iPropertyBalance);\n }",
"void addPropertyCB(int property) {\n properties_[property].logNum++;\n properties_[property].logTotal++;\n }",
"void setExtremeSpikeInc... | [
"0.5786808",
"0.5522966",
"0.5501484",
"0.5492236",
"0.5473706",
"0.5456186",
"0.54047376",
"0.5399565",
"0.5394293",
"0.5363562",
"0.53176165",
"0.530514",
"0.53038096",
"0.53006107",
"0.5277652",
"0.5251092",
"0.52483284",
"0.5234484",
"0.5220175",
"0.52154684",
"0.52084655... | 0.6445769 | 0 |
Title: MotgaCltalCtrctBsSgmt.java Description: TODO | public MotgaCltalCtrctBsSgmt() {
super();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void cajas() {\n\t\t\n\t}",
"public void mo1403c() {\n }",
"@Override\n\tpublic void coba() {\n\t\t\n\t}",
"@Override\n\tpublic void ccc() {\n\t\t\n\t}",
"private static void statACricri() {\n \tSession session = new Session();\n \tNSTimestamp dateRef = session.debutAnnee();\n \tNSArra... | [
"0.6175511",
"0.589491",
"0.5887771",
"0.5783924",
"0.5730793",
"0.57200295",
"0.57200295",
"0.5697986",
"0.5695501",
"0.5673555",
"0.5670875",
"0.5666339",
"0.5656729",
"0.56466687",
"0.56249",
"0.5617913",
"0.5614103",
"0.5606851",
"0.56047803",
"0.5603133",
"0.56024015",
... | 0.84012896 | 0 |
Created by sudh on 3/28/2015. | @Component
public interface ModeratorRepository extends MongoRepository<Moderator, Integer> {
Moderator save(Moderator saved);
//Moderator findOne(int id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r... | [
"0.6104785",
"0.60510546",
"0.60356945",
"0.60161084",
"0.59092486",
"0.59092486",
"0.58910424",
"0.5880325",
"0.5865359",
"0.5831054",
"0.58290905",
"0.58188593",
"0.5803197",
"0.57861394",
"0.57861394",
"0.57861394",
"0.57861394",
"0.57861394",
"0.5780238",
"0.5776798",
"0.... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void save(List<PayRollLock> payRollLock) {
payRollLockRepository.save(payRollLock);
} | {
"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 PayRollLock findpayRollLock(String processMonth, Long departmentId) {
return payRollLockRepository.findpayRollLock(processMonth, departmentId);
} | {
"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 List<PayRollLock> findpayRollLock(String processMonth) {
return payRollLockRepository.findpayRollLock(processMonth);
} | {
"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 |
deli podla pravidla sql prikaz a vracia list jeho vykonatelnych alt casti | @Override
public List<String> applyRule(final String sqlSelectQuery) {
//pre istotu cistim, v testoch mam viac stringov po sebe
sqlBlocks.clear();
joinTypeBlocks.clear();
List<String> parts = new ArrayList<String>();
//vycistenie od riadkov, trim, a 1+medizer za jednu medzeru
String workingSQL = RuleUtils.clearSqlStatement(sqlSelectQuery);
//check ci obsahuje JOIN
while (workingSQL.toUpperCase().contains(RULE_KEY)) {
int indexOfJoin = workingSQL.indexOf(RULE_KEY);
//najdem index JOIN a poslem do metody na najdenie jeho celeho tvaru
String foundJOIN = whatFormOfJoin(workingSQL, indexOfJoin);
//najdeny cely tvar odseknem a pridam part
String part = workingSQL.substring(0, workingSQL.indexOf(foundJOIN));
//skratim working string pre cyklus while
workingSQL = workingSQL.substring(indexOfJoin + 4);
//pridam part
sqlBlocks.add(part);
}
lastPart = workingSQL;
//mam stavebne bloky a zapnam magicku funkciu
List<String> variations = makeVariations(sqlBlocks, joinTypeBlocks, lastPart);
//nabucham variacie ak su do vysledku
for (String s : variations) {
parts.add(s);
}
return parts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic List<?> getListSQLDinamic(String sql) throws Exception {\n\t\treturn null;\n\t}",
"List<T> getSQLList(String sql);",
"@Override\n\tpublic List queryForList(String sql) {\n\t\treturn this.baseDaoSupport.queryForList(sql);\n\t}",
"List<ParqueaderoEntidad> listar();",
"public List select(S... | [
"0.7117383",
"0.69910824",
"0.6473962",
"0.63790554",
"0.6369473",
"0.6311562",
"0.6216357",
"0.6180231",
"0.61715806",
"0.6145559",
"0.61127394",
"0.61066234",
"0.6092409",
"0.6072771",
"0.6060921",
"0.6058655",
"0.60444313",
"0.60021454",
"0.6000008",
"0.59974957",
"0.59883... | 0.0 | -1 |
Vrati mi info o aky pravidlo sa jedna, je to pre DebuggerService | @Override
public DebuggerRuleInfo getDebuggerRuleInfo() {
return new DebuggerRuleInfo("JOIN", "Generate variations for every type of JOIN (INNER JOIN | LEFT JOIN | IGHT JOIN).");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void debug() {\n\n\t\t// Establecemos el estado\n\t\tsetEstado(Estado.DEBUG);\n\n\t\t// Obtenemos la proxima tarea\n\t\ttarea = planificador.obtenerProximaTarea();\n\t}",
"public void getInfo(){\n System.out.println(\"Name: \" + name + \"\\n\" + \"Address: \" + address);\n }",
"@Override\n\tpu... | [
"0.65288335",
"0.595146",
"0.58399975",
"0.58116955",
"0.5721499",
"0.5714775",
"0.562737",
"0.55849636",
"0.5560775",
"0.554795",
"0.55266285",
"0.5514145",
"0.54413414",
"0.5428243",
"0.54011303",
"0.5398571",
"0.5375061",
"0.53607583",
"0.5340914",
"0.53396106",
"0.5316242... | 0.0 | -1 |
Vratim co som nasiel aby som to neskor osekal z stringu, spoliham sa ze metoda plny pole typov | private String whatFormOfJoin(final String sqlTrash, final int indexOfJoin) {
// 21 pred potrebujem max
String preSQLTrash = sqlTrash.substring(
indexOfJoin - 21 < 0 ? 0 : indexOfJoin - 21,
indexOfJoin).toUpperCase();
if (preSQLTrash.endsWith("_")) {
joinTypeBlocks.add(0);
return "STRAIGHT_JOIN";
} else if (preSQLTrash.contains("INNER")) {
joinTypeBlocks.add(0);
return "INNER JOIN";
} else if (preSQLTrash.contains("CROSS")) {
joinTypeBlocks.add(0);
return "CROSS JOIN";
} else if (preSQLTrash.contains("LEFT")) {
joinTypeBlocks.add(1);
String returnString = "LEFT";
if (preSQLTrash.contains("OUTER")) {
returnString = returnString + " OUTER JOIN";
} else {
returnString = returnString + " JOIN";
}
if (preSQLTrash.contains("NATURAL")) {
returnString = "NATURAL " + returnString;
}
return returnString;
} else if (preSQLTrash.contains("RIGHT")) {
joinTypeBlocks.add(2);
String returnString = "RIGHT";
if (preSQLTrash.contains("OUTER")) {
returnString = returnString + " OUTER JOIN";
} else {
returnString = returnString + " JOIN";
}
if (preSQLTrash.contains("NATURAL")) {
returnString = "NATURAL " + returnString;
}
return returnString;
}
//ak nenajdem nic exte
joinTypeBlocks.add(0);
return "JOIN";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }",
"@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho in... | [
"0.6325703",
"0.6154967",
"0.6085097",
"0.60602826",
"0.60346043",
"0.59358567",
"0.59239024",
"0.5912317",
"0.5909954",
"0.5909954",
"0.5909954",
"0.5898303",
"0.5891671",
"0.5884876",
"0.58699125",
"0.5842954",
"0.5839423",
"0.5826263",
"0.5819014",
"0.5817454",
"0.5787096"... | 0.0 | -1 |
Na sqlBlock vrati variacie s pripojeny jointype | private List<String> recursionByType(final String sqlBlock, final int joinType) {
List<String> result = new ArrayList<String>(4);
for (int i = 0; i < JOIN_VARIATIONS.length; i++) {
//ak by som chcel len onstatne variacie JOINOV
// if (joinType == i) continue;
result.add(sqlBlock + JOIN_VARIATIONS[i]);
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract String toSQL();",
"public int getSqlType() { return _type; }",
"@Override\n\tpublic String toSql() {\n\t\treturn null;\n\t}",
"String toSql();",
"private void setSql() {\n sql = sqlData.getSql();\n }",
"@Override\n public long insertJQLRaw(String password, Date birthDay, Contac... | [
"0.59024227",
"0.56425756",
"0.5587839",
"0.55690384",
"0.54119676",
"0.5403898",
"0.53984666",
"0.5390624",
"0.53692174",
"0.5368403",
"0.5353919",
"0.53521305",
"0.5340286",
"0.5332985",
"0.53304064",
"0.53244203",
"0.5321668",
"0.5314815",
"0.5311148",
"0.5309369",
"0.5282... | 0.5541406 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.