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 |
|---|---|---|---|---|---|---|
TODO Autogenerated method stub | @Override
public boolean seLanceSurServiteurProprietaire() {
return false;
} | {
"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<Role> findAll() {
return this.roleMapper.findQueryAll();
} | {
"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<Role> findByName(String name) {
return this.roleMapper.findQueryByName(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void saveRole(Role role) {
this.roleMapper.insert(role);
} | {
"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 Role findById(int id) {
return this.roleMapper.selectByPrimaryKey(id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void updateRole(Role role) {
this.roleMapper.updateByPrimaryKey(role);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void deleteRole(int id) {
this.roleMapper.deleteByPrimaryKey(id);
} | {
"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 |
Starting a new Intent | public void onClick(View arg0) {
Intent nextScreen = new Intent(getApplicationContext(), ActivityTwo.class);
//Sending data to another Activity
nextScreen.putExtra("name_input", inputName.getText().toString());
nextScreen.putExtra("email_input", inputEmail.getText().toString());
Log.e("n", inputName.getText() + "." + inputEmail.getText());
startActivity(nextScreen);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void startNewActivity(Intent intent);",
"private void startNewAcitivity(Intent intent, ActivityOptionsCompat options) {\n ActivityCompat.startActivity(this, intent, options.toBundle());\n }",
"@Override\n public void startActivity(Intent intent) {\n startActivity(intent, null);\n }",
"... | [
"0.8284751",
"0.75490785",
"0.7505843",
"0.7477715",
"0.7227833",
"0.7227295",
"0.7190018",
"0.71341217",
"0.70691866",
"0.70667887",
"0.70667887",
"0.70445263",
"0.7011311",
"0.7004684",
"0.69984794",
"0.6995166",
"0.6955471",
"0.69399333",
"0.6939175",
"0.69113314",
"0.6901... | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_one, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {... | [
"0.7246102",
"0.7201358",
"0.7194834",
"0.7176498",
"0.71066517",
"0.7039537",
"0.7037961",
"0.70112145",
"0.70094734",
"0.69807225",
"0.6944953",
"0.69389373",
"0.6933199",
"0.6916928",
"0.6916928",
"0.6891486",
"0.68831646",
"0.68754137",
"0.68745375",
"0.68621665",
"0.6862... | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ... | [
"0.7904975",
"0.78056985",
"0.77671826",
"0.77275974",
"0.7632173",
"0.7622138",
"0.75856143",
"0.7531176",
"0.7488386",
"0.74576557",
"0.74576557",
"0.74391466",
"0.7422802",
"0.7403698",
"0.7392229",
"0.73873955",
"0.73796785",
"0.737091",
"0.73627585",
"0.7356357",
"0.7346... | 0.0 | -1 |
Create a new empty XMLDocument. | public static XMLDocument create()
{
return new XMLDocument();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public XMLDocument ()\r\n\t{\r\n\t\tthis (DEFAULT_XML_VERSION, true);\r\n\t}",
"public static Document newDocument() throws XMLException{\n\t\ttry{\n\t\t\tfinal DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\t\t\t\n\t\t\tfinal DocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\... | [
"0.7686627",
"0.74794424",
"0.7392169",
"0.7233471",
"0.7224613",
"0.7203745",
"0.70458335",
"0.6759438",
"0.6756132",
"0.6728604",
"0.6728463",
"0.6695243",
"0.6694668",
"0.66597337",
"0.6633381",
"0.661932",
"0.6591662",
"0.6456157",
"0.64000875",
"0.64000875",
"0.64000875"... | 0.8059295 | 0 |
TODO Autogenerated method stub | public String echo(String str) {
return str;
} | {
"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 | public String no(String str) {
return str;
} | {
"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 | public String echo(String str) {
return str;
} | {
"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 | public String no(String str) {
return str;
} | {
"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: replace ASCII for "You Won" | public static void win(){
System.out.println("\n" + getAnsiGreen() +
"██╗░░░██╗░█████╗░██╗░░░██╗░░░░██╗░░░░░░░██╗░█████╗░███╗░░██╗░░░\n" +
"╚██╗░██╔╝██╔══██╗██║░░░██║░░░░██║░░██╗░░██║██╔══██╗████╗░██║░░░\n" +
"░╚████╔╝░██║░░██║██║░░░██║░░░░╚██╗████╗██╔╝██║░░██║██╔██╗██║░░░\n" +
"░░╚██╔╝░░██║░░██║██║░░░██║░░░░░████╔═████║░██║░░██║██║╚████║░░░\n" +
"░░░██║░░░╚█████╔╝╚██████╔╝░░░░░╚██╔╝░╚██╔╝░╚█████╔╝██║░╚███║██╗\n" +
"░░░╚═╝░░░░╚════╝░░╚═════╝░░░░░░░╚═╝░░░╚═╝░░░╚════╝░╚═╝░░╚══╝╚═╝\n" +
"\n" +
"░█████╗░░█████╗░███╗░░██╗░██████╗░██████╗░░█████╗░████████╗░██████╗██╗██╗\n" +
"██╔══██╗██╔══██╗████╗░██║██╔════╝░██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██║██║\n" +
"██║░░╚═╝██║░░██║██╔██╗██║██║░░██╗░██████╔╝███████║░░░██║░░░╚█████╗░██║██║\n" +
"██║░░██╗██║░░██║██║╚████║██║░░╚██╗██╔══██╗██╔══██║░░░██║░░░░╚═══██╗╚═╝╚═╝\n" +
"╚█████╔╝╚█████╔╝██║░╚███║╚██████╔╝██║░░██║██║░░██║░░░██║░░░██████╔╝██╗██╗\n" +
"░╚════╝░░╚════╝░╚═╝░░╚══╝░╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░╚═════╝░╚═╝╚═╝" + getAnsiReset());
try {
TimeUnit.SECONDS.sleep(1);
System.out.println("You feel movement in your belly...");
startNewOrQuitGame();
} catch (InterruptedException e) {
System.out.println("Something wrong with the Game!!!");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String playerWon() {\n\t\tString message = \"Congratulations \"+name+ \"! \";\n\t\tRandom rand = new Random();\n\t\tswitch(rand.nextInt(3)) {\n\t\t\tcase 0:\n\t\t\t\tmessage+=\"Can you stop now? You're too good at this!\";\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tmessage+=\"You OBLITERATED the opponent!\";\n... | [
"0.7256649",
"0.6793429",
"0.6605679",
"0.6416092",
"0.63626665",
"0.6357015",
"0.6340972",
"0.62792706",
"0.62739533",
"0.62239724",
"0.6209301",
"0.61754894",
"0.6170276",
"0.6162046",
"0.6160853",
"0.6107212",
"0.6090106",
"0.60861033",
"0.608148",
"0.6078412",
"0.60078436... | 0.0 | -1 |
Interactivly reports the progress of a projectload operation. | public interface LoaderProgressMonitor {
/**
* Called by the <code>ProjectManager</code> when a project-load operation is about to begin.
*
* @param libraryCount the number of libraries expected to load
*/
public void beginLoad(int libraryCount);
/**
* Called when a library is about to be loaded by the <code>ProjectManager</code>.
*
* @param libraryFilename the filename of the library about to be loaded
*/
public void loadingLibrary(String libraryFilename);
/**
* Called immediately following a library load.
*/
public void libraryLoaded();
/**
* Called when the project-load operation is complete.
*/
public void done();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void showQueuingBuildProgress();",
"void showProgress();",
"void startProgress();",
"public void progressMade();",
"void progress(int pUnitsCompleted);",
"private void updateTaskActivityLabel()\r\n {\r\n setLabelValue(\"Tile Downloads \" + myActiveQueryCounter.intValue());\r\n setProgres... | [
"0.65772694",
"0.646532",
"0.64047873",
"0.62746656",
"0.6225883",
"0.620174",
"0.6180402",
"0.604914",
"0.6046313",
"0.6037346",
"0.6015516",
"0.59811157",
"0.59541655",
"0.593004",
"0.5916275",
"0.5914423",
"0.58950716",
"0.58864033",
"0.5860315",
"0.5855475",
"0.5848848",
... | 0.618207 | 6 |
Called by the ProjectManager when a projectload operation is about to begin. | public void beginLoad(int libraryCount); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadTheProject() {\n\t\tProjectHandler.openProject(mFilePath);\n }",
"public void load() {\r\n try {\r\n project = ProjectAccessor.findFromTitle(title, conn);\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"void projectFound( S... | [
"0.67270297",
"0.6287888",
"0.62465835",
"0.61984974",
"0.61036336",
"0.60905993",
"0.6089438",
"0.6068156",
"0.6065765",
"0.59947425",
"0.59811836",
"0.59754294",
"0.59506017",
"0.5865112",
"0.5855218",
"0.5852592",
"0.5836091",
"0.58278924",
"0.58183044",
"0.57848614",
"0.5... | 0.5878942 | 13 |
Called when a library is about to be loaded by the ProjectManager. | public void loadingLibrary(String libraryFilename); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void libraryLoaded();",
"public void onLoad() {\n // store jar path for plugin loader\n thisJar = this.getFile();\n }",
"public void beginLoad(int libraryCount);",
"public static void load()\n {\n\n try {\n System.loadLibrary(\"gnustl_shared\");\n ... | [
"0.8155331",
"0.6763771",
"0.67326945",
"0.62439704",
"0.6200241",
"0.6143318",
"0.6014281",
"0.60075504",
"0.5999982",
"0.59465396",
"0.59185505",
"0.5799465",
"0.57960004",
"0.5785939",
"0.57784104",
"0.57233703",
"0.5705768",
"0.5694737",
"0.56735873",
"0.56735873",
"0.567... | 0.74890476 | 1 |
Called immediately following a library load. | public void libraryLoaded(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void beginLoad(int libraryCount);",
"public void loadingLibrary(String libraryFilename);",
"public static void SelfCallForLoading() {\n\t}",
"public void onLoad()\n\t{\n\t\tJLog.info(\" --- INIT --- \");\n\t\t\n\t}",
"@Override\r\n\tprotected void initLoad() {\n\r\n\t}",
"public void onLoad() {\n ... | [
"0.76486266",
"0.6889358",
"0.686541",
"0.682418",
"0.66646034",
"0.6603834",
"0.6588665",
"0.64688104",
"0.64384717",
"0.64344096",
"0.6398261",
"0.6395468",
"0.6383349",
"0.6354639",
"0.62920606",
"0.6278027",
"0.62599564",
"0.62599564",
"0.62530893",
"0.6239779",
"0.621629... | 0.78916186 | 0 |
Called when the projectload operation is complete. | public void done(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadTheProject() {\n\t\tProjectHandler.openProject(mFilePath);\n }",
"public void load() {\r\n try {\r\n project = ProjectAccessor.findFromTitle(title, conn);\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"void projectComplete... | [
"0.6687317",
"0.6361321",
"0.6301702",
"0.6297967",
"0.62805784",
"0.62766665",
"0.62481064",
"0.619739",
"0.6190389",
"0.61541075",
"0.61519533",
"0.6011193",
"0.5993665",
"0.5925484",
"0.5922448",
"0.5906359",
"0.58966726",
"0.58874995",
"0.5803968",
"0.57893187",
"0.575911... | 0.0 | -1 |
Sets the container activity to the activity passed as a parameter. | public void setContainerActivity(Activity containerActivity) {
this.containerActivity = containerActivity;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setActivity(AppCompatActivity activity) {\n this.activity = activity;\n }",
"@Override\n\tpublic void setActivity(Activity pAcitivity) {\n\n\t}",
"public void setActivity(Activity activity) {\n if (activity != null) {\n service = (BleTrackerService) activity.getApplicati... | [
"0.7257742",
"0.6995419",
"0.69088614",
"0.64524114",
"0.62611556",
"0.62273026",
"0.62111926",
"0.619809",
"0.61946374",
"0.61434835",
"0.6112844",
"0.60303",
"0.6016124",
"0.6002177",
"0.59999347",
"0.5982458",
"0.5951747",
"0.5947598",
"0.593311",
"0.5910106",
"0.59077054"... | 0.82270736 | 0 |
This method is used to set the view for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_share_flickr, container, false);
WebView myWebView = v.findViewById(R.id.flickrWebView);
myWebView.setWebViewClient(new WebViewClient());
myWebView.loadUrl(flickrUrl);
return v;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void setView(View view) {\n\n\t}",
"public void setView(View view);",
"void setView(View v);",
"public void setView(View view) {\n\t\tthis.view = view;\n\t}",
"@Override\n\tprotected void setUpView() {\n\t\tsuper.setUpView();\n\t\tsetChatFragmentListener(this);\n\t}",
"@Override prote... | [
"0.739553",
"0.7232601",
"0.6988817",
"0.69428277",
"0.6936557",
"0.6895232",
"0.687074",
"0.687074",
"0.68545496",
"0.683112",
"0.68256176",
"0.6789276",
"0.6776948",
"0.6774826",
"0.67737204",
"0.67708963",
"0.6762644",
"0.6762644",
"0.6750703",
"0.6737912",
"0.67282367",
... | 0.0 | -1 |
Setter for the url | public void setFlickrUrl(String url) {
this.flickrUrl = url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setUrl(String url);",
"public void setUrl(String url);",
"public void setURL(String url);",
"public void setUrl(URL url)\n {\n this.url = url;\n }",
"public void setUrl(String url) {\n if(url != null && !url.endsWith(\"/\")){\n url += \"/\";\n }\n this.url =... | [
"0.7862011",
"0.7862011",
"0.7834139",
"0.77817094",
"0.77564514",
"0.77242255",
"0.7707359",
"0.7699195",
"0.7427088",
"0.7427088",
"0.7424005",
"0.74227196",
"0.7416929",
"0.7401524",
"0.73729646",
"0.73233163",
"0.73233163",
"0.73233163",
"0.72976625",
"0.729692",
"0.72969... | 0.0 | -1 |
Setter for the new title | public void setTitle(String title) {
this.title = title;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void SetTitle(String newTitle){ title = newTitle; }",
"public void setTitle(String title) { this.title = title; }",
"public void setTitle(String newTitle)\r\n {\r\n title = newTitle;\r\n }",
"public void setTitle(String title){\n \tthis.title = title;\n }",
"@Override\r\n\tpubl... | [
"0.8746112",
"0.86697155",
"0.8621771",
"0.86126024",
"0.86024845",
"0.8598794",
"0.8598794",
"0.8593509",
"0.859107",
"0.8588293",
"0.85796636",
"0.85678804",
"0.85666186",
"0.85664374",
"0.8561814",
"0.8561814",
"0.85523605",
"0.85435283",
"0.8540112",
"0.85330874",
"0.8533... | 0.8487794 | 51 |
Setter for the image to populate | public void setImage(Bitmap image) {
this.image = image;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void setPic() {\n }",
"public void setImage(Image img) {\r\n this.img = img;\r\n }",
"public void setImage(Image itemImg) \n {\n img = itemImg;\n }",
"void setImage(String image);",
"public void setImg(){\n if(PicSingleton.getInstance().getPicToShape() != null){\n... | [
"0.7712312",
"0.7569654",
"0.75192314",
"0.74638706",
"0.73976064",
"0.730385",
"0.7297783",
"0.7251356",
"0.71551645",
"0.71329117",
"0.7122619",
"0.7021542",
"0.69893944",
"0.6984418",
"0.6976462",
"0.69722456",
"0.6959346",
"0.69414157",
"0.6916975",
"0.6916975",
"0.691253... | 0.6778941 | 35 |
GEtter for the url | public String getFlickrUrl() {
return flickrUrl;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"protected abstract String getUrl();",
"@Override\n\tpublic String getUrl()\n\t{\n\t\treturn url;\n\t}",
"private String... | [
"0.75031734",
"0.75031734",
"0.75031734",
"0.75031734",
"0.75031734",
"0.75031734",
"0.74427575",
"0.7370809",
"0.7346101",
"0.72795665",
"0.7272304",
"0.72666186",
"0.725702",
"0.725702",
"0.725702",
"0.725702",
"0.725702",
"0.71838194",
"0.71281457",
"0.7120552",
"0.7111002... | 0.0 | -1 |
getter for the current title of this item | public String getTitle() {
return title;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getTitle()\n {\n return (this.title);\n }",
"public String getItemTitle() {\n\t return this.itemTitle;\n\t}",
"public String getTitle() {\n\t\treturn this.title;\n\t}",
"public String getTitle() {\n\t\treturn this.title;\n\t}",
"public String getTitle() {\n\t\treturn this.titl... | [
"0.81728727",
"0.8089713",
"0.80501825",
"0.80501825",
"0.80501825",
"0.8037147",
"0.8026247",
"0.801344",
"0.80097586",
"0.800453",
"0.80027694",
"0.80027694",
"0.80027694",
"0.80027694",
"0.80027694",
"0.7988582",
"0.7978284",
"0.79782236",
"0.79654497",
"0.79627746",
"0.79... | 0.0 | -1 |
Getter for the current bitmap attached tothis item | public Bitmap getImage() {
return image;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Bitmap getBitmap() {\n\t\treturn mBitmap;\n\t}",
"public Bitmap getBitmap() {\n\t\treturn this.initialBitmap;\r\n\t}",
"public Bitmap getBitmap(){\n return bitmap;\n }",
"public Bitmap getBitmapIn() {\r\n\t\treturn bitmapIn;\r\n\t}",
"public BitmapField getBitmapField() {\n\t\treturn bitma... | [
"0.79816943",
"0.77339816",
"0.73809534",
"0.7274738",
"0.70133793",
"0.69696504",
"0.68799126",
"0.659283",
"0.6582918",
"0.65115714",
"0.6462053",
"0.6445036",
"0.6416703",
"0.6407196",
"0.6406306",
"0.6377476",
"0.63489795",
"0.63069946",
"0.6303447",
"0.6243934",
"0.62364... | 0.70030284 | 5 |
Constructor para objetos de la clase EmbarcacionAMotor. | public EmbarcacionAMotor(String matricula, double eslora, int anoFabricacion, Persona persona, int potenciaCV)
{
super(matricula, eslora, anoFabricacion, persona);
this.potenciaCV = potenciaCV;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DarAyudaAcceso() {\r\n }",
"public Alojamiento() {\r\n\t}",
"public Odontologo() {\n }",
"private MApi() {}",
"private CameraExecutors() {\n }",
"public Corso() {\n\n }",
"public AfiliadoVista() {\r\n }",
"public CorreoElectronico() {\n }",
"public FiltroMicrorregiao() {\r\n ... | [
"0.62939006",
"0.6028434",
"0.5860561",
"0.57544756",
"0.57390743",
"0.573505",
"0.5711594",
"0.5607863",
"0.56045705",
"0.5590637",
"0.55672497",
"0.55618906",
"0.55582327",
"0.5541402",
"0.5532722",
"0.5532313",
"0.5521923",
"0.55213183",
"0.5499306",
"0.5473174",
"0.545603... | 0.6114165 | 1 |
Devuelve el Coeficiente Bernua. | public int getCoeficienteBernua()
{
return potenciaCV;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n ... | [
"0.6969201",
"0.67273194",
"0.6518776",
"0.6513558",
"0.64950204",
"0.64885753",
"0.64531636",
"0.6417601",
"0.63390356",
"0.6321697",
"0.6231333",
"0.6209136",
"0.6204379",
"0.6201271",
"0.6200333",
"0.6185585",
"0.61711985",
"0.61358666",
"0.6130241",
"0.61235064",
"0.61096... | 0.7482796 | 0 |
Devuelve la informacion de la entrada. | @Override
public String toString()
{
String aDevolver= "";
aDevolver += super.toString();
aDevolver += "potenciaCV: " + potenciaCV + "\n";
return aDevolver;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void carregaInformacoes() {\n Pessoa pessoa = (Pessoa) getIntent().getExtras().getSerializable(\"pessoa\");\n edtNome.setText(pessoa.getNome());\n edtEmail.setText(pessoa.getEmail());\n edtTelefone.setText(pessoa.getTelefone());\n edtIdade.setText(pessoa.getIdade());\n ... | [
"0.7329119",
"0.72088814",
"0.70796794",
"0.7013138",
"0.6878093",
"0.6826161",
"0.6819203",
"0.68036073",
"0.67254364",
"0.6712577",
"0.668846",
"0.6558647",
"0.65095943",
"0.64897686",
"0.64707273",
"0.6469215",
"0.64449483",
"0.644492",
"0.6426964",
"0.6421699",
"0.6417180... | 0.0 | -1 |
If key is a String, we can use it as it is, otherwise, serialize to byte[] and encode in base64 | private String serializeKey(String topic, K key) {
if (key instanceof String) {
return (String) key;
}
if (keySchema instanceof PulsarKafkaSchema) {
((PulsarKafkaSchema<K>) keySchema).setTopic(topic);
}
byte[] keyBytes = keySchema.encode(key);
return Base64.getEncoder().encodeToString(keyBytes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String base64Encode(final byte[] key) {\n return Base64.encode(key);\n }",
"@SuppressWarnings(\"unused\")\n private static String getKeyString(Key key)\n {\n return Base64.encode(key.getEncoded());\n }",
"public String base64Encode(String str) throws StoreFactoryExceptio... | [
"0.7374658",
"0.72808266",
"0.6584598",
"0.6433538",
"0.6287129",
"0.6222778",
"0.6215567",
"0.6214279",
"0.6193711",
"0.6179385",
"0.6163838",
"0.6125658",
"0.61130756",
"0.6091788",
"0.6065",
"0.6021291",
"0.5992438",
"0.598568",
"0.5984483",
"0.5981032",
"0.5967611",
"0.... | 0.64776504 | 3 |
return info about short var declarations | public HashMap<Node, List<Node>> getShortDeclInfo() {
return shortDeclInfo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getVarDeclare();",
"public short readVarShort() throws IOException {\n return readVarShort(7);\n }",
"public java.lang.CharSequence getVar17() {\n return var17;\n }",
"String getDeclare();",
"public java.lang.CharSequence getVar17() {\n return var17;\n }",
"public java.lang.CharSeq... | [
"0.7094033",
"0.6066823",
"0.59848887",
"0.5983754",
"0.5963295",
"0.59140366",
"0.58881307",
"0.58871806",
"0.5859164",
"0.5789366",
"0.5670779",
"0.56656724",
"0.5664548",
"0.5661256",
"0.5625599",
"0.5616446",
"0.56033593",
"0.55947506",
"0.5587537",
"0.5580795",
"0.555401... | 0.630588 | 1 |
return list of names used in program | public List<String> getNames() {
return names;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic StringList getNames() {\n\t\tStringList ss = new StringList();\n\t\tss.add(\"java\");\n\t\treturn ss;\n\t}",
"public String[] getNames() {\n\t\tString[] names = new String[functions.size()];\n\t\tint index = 0;\n\t\tfor (Enumeration en = functions.keys(); en.hasMoreElements(); index++) {\n\t\... | [
"0.65261567",
"0.6453516",
"0.6451515",
"0.643032",
"0.64107484",
"0.6407416",
"0.63258296",
"0.63247633",
"0.63230056",
"0.6312923",
"0.6311217",
"0.6290219",
"0.626065",
"0.62326926",
"0.61797535",
"0.617907",
"0.6152725",
"0.6133006",
"0.6128734",
"0.6112028",
"0.6092378",... | 0.0 | -1 |
Symbol Table related methods | public void newScope() {
Map<String, Type> scope = new HashMap<String, Type>();
scopes.push(scope);
Map<String, Type> typeScope = new HashMap<String, Type>();
typeScopes.push(typeScope);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(\"unused\")\n private void initSymbolTable() {\n MethodType I_V = new MethodType(Type.Int, Type.Void);\n MethodType I_R = new MethodType(Type.Int, Type.Real);\n MethodType I_S = new MethodType(Type.Int, Type.String);\n MethodType I_D = new MethodType(Type.Int, T... | [
"0.7818436",
"0.7664437",
"0.7605204",
"0.7589264",
"0.745587",
"0.73832047",
"0.7373048",
"0.7272642",
"0.7131122",
"0.7075995",
"0.6996624",
"0.6988119",
"0.6986946",
"0.6982295",
"0.6971095",
"0.6831453",
"0.68199474",
"0.68127024",
"0.6769686",
"0.672819",
"0.6723037",
... | 0.0 | -1 |
check for flag before dumping symbol table | public void unScope() {
if (dump) {
dumpSymTable();
}
scopes.pop();
typeScopes.pop();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void buildSymbolTables() {\n new SymbolsTableBuilder(data).read(this);//.dump();\n }",
"public boolean isSmapDumped();",
"public void dump()\r\n {\r\n dump(true);\r\n }",
"public void dumpTable() {\n Enumeration elements = table.elements();\n while (elements.hasMoreElem... | [
"0.59500796",
"0.58723265",
"0.5820843",
"0.57278764",
"0.5656895",
"0.5656895",
"0.5616391",
"0.5607751",
"0.5569996",
"0.54136723",
"0.53736764",
"0.5371946",
"0.53597623",
"0.53525966",
"0.5310941",
"0.5301758",
"0.52486384",
"0.52377266",
"0.51519763",
"0.5149736",
"0.514... | 0.0 | -1 |
gets id from AIdExp | public String getId(Node node) {
String id = "";
if (node instanceof AIdExp) {
AIdExp idNode = (AIdExp) node;
id = idNode.getId().getText();
}
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getAoisId();",
"int getAId();",
"java.lang.String getID();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.Str... | [
"0.8005345",
"0.7598331",
"0.7383261",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"0.7230529",
"... | 0.7200679 | 22 |
/ / var declaration blank identifiers are not added to symbol table | public void caseAVarDecStmt(AVarDecStmt node)
{
inAVarDecStmt(node);
outAVarDecStmt(node);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void initFunDecl() {\n\t\t_localVarID = 0;\r\n\t\t_labelID = 0;\r\n\t\t_tempVarID = 32;\r\n\t\t_lsymtable.clear();\r\n\t}",
"@SuppressWarnings(\"unused\")\n private void initSymbolTable() {\n MethodType I_V = new MethodType(Type.Int, Type.Void);\n MethodType I_R = new MethodType(Type.Int, Type... | [
"0.6745909",
"0.66019887",
"0.6498203",
"0.6394332",
"0.6218612",
"0.6178978",
"0.61615485",
"0.61615485",
"0.6150682",
"0.60024214",
"0.5954159",
"0.59478027",
"0.58889073",
"0.5884506",
"0.58284235",
"0.58226806",
"0.580553",
"0.58032495",
"0.57858366",
"0.5777892",
"0.5773... | 0.0 | -1 |
var decl where type is not explicitly stated | public void outAVarDecStmt(AVarDecStmt node)
{
List<PExp> ids = node.getId();
List<PExp> values = node.getVal();
PType typeNode = node.getType();
if (typeNode == null) {
for (int i=0; i<ids.size(); i++) {
Node idNode = ids.get(i);
if (idNode instanceof AIdExp) {
String id = getId(idNode);
Node valueNode = values.get(i);
Type t = typemap.get(valueNode);
if (t==null) {
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Attempted to assign void value to variable.");
}
if (t instanceof FunctionType) {
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Attempted to assign function as value.");
}
//System.out.println(id + t.toString());
declInScope(id, t);
typemap.put(idNode,t);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ResolvedReferenceTypeDeclaration declaringType();",
"public TYPE SemantMe() {\n\t\tSYM_TABLE sym_table = SYM_TABLE.getInstance();\n\t\t\n\t\t// Lookup the name\n\t\tTYPE t = sym_table.find(this.type);\n\t\t// Check it\n\t\tif (t == null || !t.isTypeName())\n\t\t {\n\t\t\t// Code bug -- type given does not exi... | [
"0.6101641",
"0.6082024",
"0.57735926",
"0.5767387",
"0.57594633",
"0.5743018",
"0.5714231",
"0.56713253",
"0.5564044",
"0.5505601",
"0.5498392",
"0.54652923",
"0.5444801",
"0.5427154",
"0.5353571",
"0.5353133",
"0.5348026",
"0.53349954",
"0.5334529",
"0.5318606",
"0.5291241"... | 0.4897462 | 81 |
/ / type declaration | public void caseATypeDecStmt(ATypeDecStmt node)
{
// ignore declarations with blank identifier
if (node.getExp() instanceof AIdExp) {
String id = getId(node.getExp());
if (! (node.getType() instanceof AStructType)) {
Type type = getAliasType(id, node.getType());
declInTypeScope(id, type);
}
else {
structName = id;
Type type = getType(node.getType());
declInTypeScope(id, type);
structName = "";
}
// TODO: deal with alias of alias
//update fixed. Check AliasType's boolean field for info.
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public Type type();",
"Type() {\n }",
"public static $type () {\n }",
"public ReocType() \r\n {\r\n super();\r\n }",
"type getType();",
"@Override\r\n\tpublic void visit(TypedefDefinition typedefDefinition) {\n\r\n\t}",
"private Type type()\r\n {\r\n Type t = new T... | [
"0.65862596",
"0.65815187",
"0.64175516",
"0.6374658",
"0.6333711",
"0.62961024",
"0.6271565",
"0.61827",
"0.6129517",
"0.6124955",
"0.6124955",
"0.6124955",
"0.6124955",
"0.6124955",
"0.6124955",
"0.6124955",
"0.6124955",
"0.61154133",
"0.61091727",
"0.6079623",
"0.6070441",... | 0.0 | -1 |
/ HELPER FUNCTIONS / returns true if two types are boolean, false otherwise | public boolean areBoolean(Type typeone, Type typetwo){
if (areSameType(typeone, typetwo)) {
typeone = removeAlias(typeone);
typetwo = removeAlias(typetwo);
}
if(typeone instanceof BooleanType && typetwo instanceof BooleanType) return true;
else return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isBoolean();",
"boolean hasBool();",
"boolean booleanOf();",
"public Boolean asBoolean();",
"boolean hasBoolValue();",
"boolean isEBoolean();",
"@Override\n public Node typeCheck() {\n if (!(FOOLlib.isSubtype(left.typeCheck(), new BoolTypeNode()) &&\n FOOLlib.isS... | [
"0.7285062",
"0.7004743",
"0.69397",
"0.68943554",
"0.6851016",
"0.67508316",
"0.66582024",
"0.6653383",
"0.64624995",
"0.64436764",
"0.64433193",
"0.64317393",
"0.64054465",
"0.6391214",
"0.6391214",
"0.6391214",
"0.6391214",
"0.6381519",
"0.6289485",
"0.6284794",
"0.6255366... | 0.75904363 | 0 |
/ returns true if two types are comparable, false otherwise | public boolean areComparable(Type typeone, Type typetwo){
/* first check the basic types */
if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof Float64Type && typetwo instanceof Float64Type) || (typeone instanceof BooleanType && typetwo instanceof BooleanType) ||(typeone instanceof RuneType && typetwo instanceof RuneType) || (typeone instanceof StringType && typetwo instanceof StringType)) return true;
/* structs are comparable if they correspond to the same type declaration and the fields are comparable */
else if(typeone instanceof StructType && typetwo instanceof StructType){
String name1 = ((StructType)typeone).getStructName();
String name2 = ((StructType)typetwo).getStructName();
if (name1==name2 || (name1.equals(name2) && name1.equals(""))) {
StructType lefts = (StructType) typeone;
StructType rights = (StructType) typetwo;
List<Map.Entry<List<String>,Type>> leftlist = lefts.getFields();
List<Map.Entry<List<String>,Type>> rightlist = rights.getFields();
if (leftlist.size()!=rightlist.size()) {
return false;
}
for(int i=0; i<leftlist.size(); i++){
Type typel = leftlist.get(i).getValue();
Type typer = rightlist.get(i).getValue();
if(!areComparable(typel,typer)) {
return false;
}
}
return true;
}
else {
return false;
}
}
/* finally, if they are arrays, check that the underlying type is comparable */
else if(typeone instanceof ArrayType && typetwo instanceof ArrayType){
Type typel,typer;
ArrayType lefta = (ArrayType) typeone;
ArrayType righta = (ArrayType) typetwo;
typel = lefta.getType();
typer = righta.getType();
if(!areComparable(typel,typer) || !(lefta.getSize().equals(righta.getSize()))) return false;
else return true;
}
else if (typeone instanceof AliasType && typetwo instanceof AliasType) {
AliasType left = (AliasType) typeone;
AliasType right = (AliasType) typetwo;
if (left.getAliasName()==right.getAliasName()) {
return true;
}
else {
return false;
}
}
else return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isComparable();",
"private Boolean areCompatible(Class a, Class b) {\n return (a.isAssignableFrom(b) || b.isAssignableFrom(a));\n }",
"private boolean compare(ValueType first, ValueType second) {\r\n // TODO\r\n return false;\r\n }",
"public boolean cmp(Type other){\n ... | [
"0.79483765",
"0.69917625",
"0.6731263",
"0.6636794",
"0.65950185",
"0.65766835",
"0.64507395",
"0.6373992",
"0.63520306",
"0.6349435",
"0.63450783",
"0.63400376",
"0.62203187",
"0.6185249",
"0.61627275",
"0.613902",
"0.60480624",
"0.6012301",
"0.59678227",
"0.59653807",
"0.5... | 0.7645306 | 1 |
/ returns true if two types are ordered, false otherise | public boolean areOrdered(Type typeone, Type typetwo){
/* if they are both the same alias type, get the underlying type */
if(areBinaryAlias(typeone,typetwo)){
typeone = removeAlias(typeone);
typetwo = removeAlias(typetwo);
}//if exactly one is an alias, get it's underlying type
// else if (typeone instanceof AliasType && !(typetwo instanceof AliasType)
// || !(typeone instanceof AliasType) && typetwo instanceof AliasType ) {
// typeone = removeAlias(typeone);
// typetwo = removeAlias(typetwo);
// }
if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof Float64Type && typetwo instanceof Float64Type) || (typeone instanceof RuneType && typetwo instanceof RuneType) || (typeone instanceof StringType && typetwo instanceof StringType)) return true;
else return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isOrdered();",
"boolean isOrdered();",
"boolean isIsOrdered();",
"boolean isOrderable();",
"protected boolean isOrdered(Class type) {\n return List.class.isAssignableFrom(type)\n || \"java.util.LinkedHashSet\".equals(type.getName());\n }",
"@objid (\"fcf73d01-d406-41e9-9490-0... | [
"0.7498105",
"0.7498105",
"0.7322665",
"0.71453923",
"0.7106108",
"0.7007547",
"0.6805451",
"0.64931566",
"0.6450074",
"0.64094734",
"0.63165945",
"0.6207528",
"0.61136705",
"0.6062747",
"0.6060735",
"0.60593915",
"0.6004733",
"0.59187037",
"0.5887292",
"0.58745116",
"0.58588... | 0.7529769 | 0 |
/ returns true if two types are numeric, false otherwise | public boolean areNumeric(Type typeone, Type typetwo){
/* if they are both the same alias type, get the underlying type */
if(areBinaryAlias(typeone,typetwo)){
typeone = removeAlias(typeone);
typetwo = removeAlias(typetwo);
}//if exactly one is an alias, get it's underlying type
// else if (typeone instanceof AliasType && !(typetwo instanceof AliasType)
// || !(typeone instanceof AliasType) && typetwo instanceof AliasType ) {
// typeone = removeAlias(typeone);
// typetwo = removeAlias(typetwo);
//}
if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof Float64Type && typetwo instanceof Float64Type) || (typeone instanceof RuneType && typetwo instanceof RuneType)) return true;
else return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract boolean isNumeric();",
"public boolean isNumeric() {\n return this.isInteger() || this.isDecimal() || this.isDouble();\n }",
"public static boolean numeric(Type p) {\n\t\tif (p == Type.Char || p == Type.Int || p == Type.Float) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"... | [
"0.7807263",
"0.7497534",
"0.7133108",
"0.69479674",
"0.69386786",
"0.69364303",
"0.69131327",
"0.6845127",
"0.67326725",
"0.6684591",
"0.6678283",
"0.6600142",
"0.6595435",
"0.65432054",
"0.6541718",
"0.6538465",
"0.65196514",
"0.65174747",
"0.65143543",
"0.6487125",
"0.6469... | 0.7502118 | 1 |
/ returns true if two types are integral, false otherwise | public boolean areIntegral(Type typeone, Type typetwo){
/* if they are both the same alias type, get the underlying type */
if(areBinaryAlias(typeone,typetwo)){
typeone = removeAlias(typeone);
typetwo = removeAlias(typetwo);
}
if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof RuneType && typetwo instanceof RuneType)) return true;
else return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final boolean isIntegral() {\n return this.equals(BYTE)\n || this.equals(CODE)\n || this.equals(SHORT)\n || this.equals(INT)\n || this.equals(LONG)\n || this.equals(UBYTE)\n || this.equals(UINT)\n || this.equals(ULONG)\n || this.equals(USHORT);\n }... | [
"0.74770796",
"0.7186571",
"0.6540409",
"0.64458275",
"0.6340505",
"0.6339662",
"0.63363034",
"0.62614226",
"0.6125856",
"0.6096058",
"0.6061567",
"0.5957259",
"0.59371674",
"0.5890819",
"0.58877313",
"0.5873356",
"0.58208865",
"0.58208865",
"0.58208865",
"0.57829136",
"0.576... | 0.74602705 | 1 |
/ returns true if the two types are the same, false otherwise | public boolean areSameType(Type typeone, Type typetwo){
if(areBinaryAlias(typeone,typetwo)) return true;
else if (typeone instanceof ArrayType && typetwo instanceof ArrayType){
Type typel;
Type typer;
ArrayType lefta = (ArrayType) typeone;
ArrayType righta = (ArrayType) typetwo;
typel = lefta.getType();
typer = righta.getType();
if(!areComparable(typel,typer)) return false;
else return true;
}
/* areComparable takes care of the basic types except boolean*/
else if(areComparable(typeone,typetwo)) return true;
else if (typeone instanceof BooleanType && typetwo instanceof BooleanType) return true;
/* compare every field in the two structs */
/* if slices, compare their underlying types */
else if (typeone instanceof SliceType && typetwo instanceof SliceType){
Type typel,typer;
SliceType lefta = (SliceType) typeone;
SliceType righta = (SliceType) typetwo;
typel = lefta.getType();
typer = righta.getType();
if(areSameType(typel,typer)) return true;
else return false;
}
/* function return type might be null */
else if (typeone==null && typetwo==null) {
return true;
}
/* otherwise, return false */
else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean areSameType(String s1, String s2) {\n\t\treturn((isMatrix(s1) && isMatrix(s2)) || (isOperator(s1) && isOperator(s2)) || (isNumber(s1) && isNumber(s2)));\n\t}",
"private boolean compatibleNodeTypes(AxiomTreeNode t1, AxiomTreeNode t2) {\n if (!t1.getNodeType().equals(t2.getNodeType())) {\n ... | [
"0.76051337",
"0.7388881",
"0.7350811",
"0.71771157",
"0.7070146",
"0.6841972",
"0.6785268",
"0.6756964",
"0.66334254",
"0.65871966",
"0.6585567",
"0.65846986",
"0.6582939",
"0.65164745",
"0.65052027",
"0.64993423",
"0.6490041",
"0.64759755",
"0.64687294",
"0.64520395",
"0.64... | 0.7448163 | 1 |
/ returns true if the two types are the same alias, false otherwise | public boolean areBinaryAlias(Type tone, Type ttwo){
if(tone instanceof AliasType && ttwo instanceof AliasType){
AliasType aliasone = (AliasType) tone;
AliasType aliastwo = (AliasType) ttwo;
if (aliasone.getAliasName().equals(aliastwo.getAliasName())) return true;
else return false;
}
else return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean type_alias(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"type_alias\")) return false;\n if (!nextTokenIs(b, KEYWORD_TYPE)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, TYPE_ALIAS, null);\n r = consumeToken(b, KEYWORD_TYPE);\n p = r; // pin... | [
"0.6716481",
"0.6716034",
"0.66839325",
"0.66458905",
"0.64975774",
"0.6484966",
"0.64166194",
"0.6361646",
"0.6262348",
"0.62400264",
"0.6237537",
"0.6213056",
"0.6069168",
"0.6003582",
"0.59944195",
"0.5986199",
"0.59732187",
"0.59628296",
"0.5880139",
"0.5874731",
"0.58416... | 0.6166873 | 12 |
/ returns the underlying type of a type | public Type removeAlias(Type t){
while(t instanceof AliasType){
AliasType aliast = (AliasType) t;
t = aliast.getType();
}
return t;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"public Type getType();",
"Type type();",
"Type type();",
"type getType();",
... | [
"0.8071676",
"0.8071676",
"0.8071676",
"0.8071676",
"0.8071676",
"0.8071676",
"0.8071676",
"0.8071676",
"0.8071676",
"0.8071676",
"0.8071676",
"0.7977564",
"0.78574747",
"0.78574747",
"0.7801359",
"0.77417505",
"0.7679445",
"0.7678796",
"0.7674538",
"0.7640365",
"0.7542747",
... | 0.0 | -1 |
/ STATEMENT TYPING / 2.4 Return Statements | public void outAReturnStmt(AReturnStmt node) throws TypeException{
PExp exp = node.getExp();
if(exp==null){
if (!(funcReturnType == null)) throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Empty return statement in a non-void function.");
}
else {
Type exptype = typemap.get(exp);
if (!areSameType(exptype,funcReturnType)) throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Return type and enclosing function type do not match.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private ReturnStmt returnStmt() {\n Expr myExpr = null;\n \n lexer.nextToken();\n \n if (isFunction) myExpr = expr();\n \n return new ReturnStmt(myExpr); \n }",
"private void return_(ReturnStmt stmt) {\n Value op = immediate(stmt, (Immediate) stmt.g... | [
"0.67595667",
"0.64426696",
"0.64371943",
"0.6357254",
"0.6355253",
"0.62446356",
"0.6178148",
"0.6112761",
"0.6062034",
"0.59931546",
"0.59628344",
"0.594863",
"0.592644",
"0.5925886",
"0.5923401",
"0.5902201",
"0.5897562",
"0.58820415",
"0.58773834",
"0.5872696",
"0.5853053... | 0.56091064 | 39 |
/ 2.5 Short Declaration Statements | public void caseAShortDeclStmt(AShortDeclStmt node)
{
inAShortDeclStmt(node);
{
List<PExp> copy = new ArrayList<PExp>(node.getR());
for(PExp e : copy)
{
e.apply(this);
}
}
outAShortDeclStmt(node);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void masterDeclaration();",
"void declaration() {\n\t\tString theToken = currentToken();\r\n\r\n\t\tif (theToken.equals(\"int\") || theToken.equals(\"void\")) {\r\n\t\t\ttypeSpeci();\r\n\t\t\taccept(\"ID\");\r\n\t\t\ttheToken = currentToken();\r\n\t\t\tif (theToken.equals(\";\") || theToken.equals(\"[\"))... | [
"0.62743837",
"0.597415",
"0.5967448",
"0.59028095",
"0.58996105",
"0.5894643",
"0.58438754",
"0.5834794",
"0.5830677",
"0.5807933",
"0.5784055",
"0.57600904",
"0.57573646",
"0.57558525",
"0.57530016",
"0.574201",
"0.5726908",
"0.5723443",
"0.5719146",
"0.57152253",
"0.571307... | 0.0 | -1 |
check init statements separately | public void outAShortDeclStmt(AShortDeclStmt node) throws TypeException{
// keep track of new variables
List<Node> newVars = new ArrayList<Node>();
List<String> leftVars = new ArrayList<String>();
int newVarCount = 0;
LinkedList<PExp> leftlist = node.getL();
LinkedList<PExp> rightlist = node.getR();
ListIterator<PExp> iterl = leftlist.listIterator(0);
ListIterator<PExp> iterr = rightlist.listIterator(0);
while(iterl.hasNext() && iterr.hasNext()){
PExp leftexp = iterl.next();
PExp rightexp = iterr.next();
Type exptype;
java.lang.String idname;
// MODIFIED
if(leftexp instanceof AIdExp){
AIdExp idexp = (AIdExp) leftexp;
TId id = idexp.getId();
idname = id.getText();
if (leftVars.contains(idname)) {
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Repeated variable " + idname + " on left.");
}
leftVars.add(idname);
Map<String, Type> scope = getScope();
Map<String, Type> typeScope = getScope();
if (!scope.containsKey(idname) && !typeScope.containsKey(idname)) {
newVars.add(leftexp);
newVarCount++;
Type t = typemap.get(rightexp);
if (t==null) {
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Attempted to assign void value to variable " + idname + ".");
}
if (t instanceof FunctionType) {
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Attempted to assign function as value " + idname + ".");
}
declInScope(idname, t);
}
else {
exptype = lookUpVarType(idname, golite.weeder.LineNumber.getLineNumber(node));
if(!(exptype == null)){
Type righttype = typemap.get(rightexp);
if(! (areSameType(exptype,righttype))){
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Types on left and right don't match for short declaration statment at: " + idname + ".");
}
}
}
}
}
if (newVarCount==0) {
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] No new variables on left.");
}
shortDeclInfo.put(node, newVars);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract boolean init();",
"public boolean init() {\n\t\treturn true;\n\t}",
"abstract public boolean init();",
"public abstract boolean init();",
"public boolean init() {\n\r\n return true;\r\n }",
"private void checkInitialization()\r\n\t{\r\n\t\tif ( !initialized )\r\n\t\t{\r\n\t\t... | [
"0.7191491",
"0.7130437",
"0.7125388",
"0.70419335",
"0.6883576",
"0.6872347",
"0.6836142",
"0.6836142",
"0.6836142",
"0.6836142",
"0.6821059",
"0.6812856",
"0.68078715",
"0.6776118",
"0.6754382",
"0.67461187",
"0.67436624",
"0.674146",
"0.6733211",
"0.67073977",
"0.67073977"... | 0.0 | -1 |
/ 2.7 Assignment Statements | public void outAAssignEqStmt(AAssignEqStmt node) throws TypeException{
LinkedList<PExp> leftlist = node.getL();
LinkedList<PExp> rightlist = node.getR();
Iterator<PExp> iteratorone = leftlist.iterator();
Iterator<PExp> iteratortwo = rightlist.iterator();
while(iteratorone.hasNext() && iteratortwo.hasNext()){
PExp expone = iteratorone.next();
PExp exptwo = iteratortwo.next();
Type typeone = typemap.get(expone);
Type typetwo = typemap.get(exptwo);
if (!(expone instanceof ABlankExp) && !areSameType(typeone,typetwo)) {
dumpSymTable();
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Types on left and right don't match for assignment statement.");
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void assignment() {\n\n\t\t\t}",
"@Test\n\tpublic void testAssignment(){\n\t\tVariable x = new Variable(\"x\");\n\t\tOperator plus = new Operator(\"+\");\n\t\tExpression one = f.createNumNode(1);\n\t\tExpression two = f.createNumNode(2);\n\t\tExpression exp = f.createInfixNode(plus, one, two);\n\t\tState... | [
"0.7534801",
"0.6672506",
"0.6610759",
"0.64522094",
"0.63870823",
"0.6326239",
"0.62973696",
"0.62903196",
"0.6261572",
"0.6261572",
"0.6249823",
"0.62346137",
"0.62268746",
"0.6218402",
"0.6212996",
"0.61845076",
"0.618397",
"0.6183423",
"0.6173839",
"0.6158609",
"0.6157914... | 0.0 | -1 |
/ 2.8 OpAssignment Statements | public void outAAmpCaretEqStmt(AAmpCaretEqStmt node) throws TypeException{
PExp l = node.getL();
PExp r = node.getR();
Type typel = typemap.get(l);
Type typer = typemap.get(r);
if(areIntegral(typel,typer)) typemap.put(node,typel);
else throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Attempt to use bit clear statement on two incompatible types.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"assign_op getAssign_op();",
"private void assignment() {\n\n\t\t\t}",
"@Test\n\tpublic void testAssignment(){\n\t\tVariable x = new Variable(\"x\");\n\t\tOperator plus = new Operator(\"+\");\n\t\tExpression one = f.createNumNode(1);\n\t\tExpression two = f.createNumNode(2);\n\t\tExpression exp = f.createInfixN... | [
"0.7210354",
"0.69945985",
"0.67361134",
"0.66470355",
"0.6579454",
"0.64852005",
"0.64803755",
"0.6459971",
"0.6437303",
"0.6419684",
"0.63994354",
"0.63533723",
"0.63489443",
"0.63414764",
"0.6323411",
"0.6287235",
"0.62545973",
"0.6195921",
"0.6162595",
"0.6137918",
"0.613... | 0.0 | -1 |
/ 2.10 Print Statements | public void outAPrintStmt(APrintStmt node) throws TypeException{
LinkedList<PExp> explist = node.getExp();
for(PExp exp : explist){
Type exptype = typemap.get(exp);
exptype = removeAlias(exptype);
if(!(exptype instanceof IntType || exptype instanceof BooleanType || exptype instanceof Float64Type || exptype instanceof StringType || exptype instanceof RuneType)) throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Print of non-basic type.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void printStatement() {\n\t\t\n\t}",
"public void print();",
"public void print();",
"public void print();",
"public void print();",
"@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}",
"void print();",
"void print();",
"void print();",
"void print();",
"void print();",
"@Overr... | [
"0.7777016",
"0.73582697",
"0.73582697",
"0.73582697",
"0.73582697",
"0.73500055",
"0.7347755",
"0.7347755",
"0.7347755",
"0.7347755",
"0.7347755",
"0.72647226",
"0.7253973",
"0.7248601",
"0.72325075",
"0.72193277",
"0.7215881",
"0.72000116",
"0.7126024",
"0.7098148",
"0.7075... | 0.0 | -1 |
/ 2.11 Loop Statements | public void outAWhileStmt(AWhileStmt node) throws TypeException{
if(node.getExp() != null)
{
Node e = node.getExp();
Type t = typemap.get(e);
t = removeAlias(t);
if(!(t instanceof BooleanType)) throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] While loop with non-boolean condition.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static void loop() {\r\n\r\n\t\tfor (int i =1; i<=10; i++) { \r\n\t\t\tSystem.out.println(i);\r\n\t\t}\r\n\t}",
"public void loop(){\n\t\t\n\t}",
"public static LoopExpression loop(Expression body) { throw Extensions.todo(); }",
"private static void iterator() {\n\t\t\r\n\t}",
"void iterationStatements() \... | [
"0.674043",
"0.6716339",
"0.67030346",
"0.65349543",
"0.65326136",
"0.64731026",
"0.64279914",
"0.63834494",
"0.62975234",
"0.62772405",
"0.62632966",
"0.6221833",
"0.621076",
"0.6182158",
"0.61800057",
"0.61678606",
"0.6149969",
"0.6149706",
"0.6146243",
"0.6117858",
"0.6117... | 0.0 | -1 |
/ 2.12 If Statements | public void caseAIfStmt(AIfStmt node)
{
int initCount = 0;
//inAIfStmt(node);
if(node.getStmt() != null)
{
newScope();
initCount++;
}
if(node.getIf() != null)
{
node.getIf().apply(this);
}
if(node.getStmt() != null)
{
node.getStmt().apply(this);
}
if(node.getExp() != null)
{
node.getExp().apply(this);
}
{
List<PStmt> copy = new ArrayList<PStmt>(node.getTrue());
for(PStmt e : copy)
{
e.apply(this);
}
}
{
List<PElseIf> copy = new ArrayList<PElseIf>(node.getElseIf());
Iterator<PElseIf> itr = copy.iterator();
while (itr.hasNext()) {
PElseIf e = itr.next();
AElseIf elseIf = (AElseIf) e;
if(elseIf.getStmt() != null)
{
newScope();
initCount++;
}
e.apply(this);
if(elseIf.getExp() != null)
{
Type t = typemap.get(elseIf.getExp());
t = removeAlias(t);
if(!(t instanceof BooleanType)) throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(elseIf) + "] If-else statement with non-boolean condition.");
}
}
}
{
List<PStmt> copy = new ArrayList<PStmt>(node.getFalse());
for(PStmt e : copy)
{
e.apply(this);
}
}
//outAIfStmt(node);
if(node.getExp() != null)
{
Node e = node.getExp();
Type t = typemap.get(e);
t = removeAlias(t);
if(!(t instanceof BooleanType)) throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] If statement with non-boolean condition.");
}
if (initCount>0) {
if (dump) {
List<PStmt> copy = new ArrayList<PStmt>(node.getTrue());
if (copy.size()>0 && golite.weeder.LineNumber.getLineNumber(copy.get(copy.size()-1))>0)
{
Node n = copy.get(copy.size()-1);
System.out.println("[line " + golite.weeder.LineNumber.getLineNumber(n) + "]");
}
}
while (initCount>0) {
unScope();
initCount--;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void page013() {\n int x = 3;\n if (x == 3) {\n System.out.println(\"x must be 3\");\n }\n System.out.println(\"this line runs no matter what\");\n\n // Test 2\n int y = 2;\n if (y == 3) {\n System.out.println(\"y must be 3\");\n... | [
"0.6368582",
"0.63619995",
"0.6320737",
"0.63027334",
"0.6229119",
"0.6201773",
"0.6175869",
"0.61675155",
"0.6148928",
"0.6136577",
"0.6111954",
"0.61100745",
"0.607932",
"0.607825",
"0.60669863",
"0.60295564",
"0.6014431",
"0.59860474",
"0.59800214",
"0.59312624",
"0.590757... | 0.57146555 | 49 |
/ 2.13 Switch Statements | public void inASwitchStmt(ASwitchStmt node) throws TypeException {
if(node.getStmt() != null)
{
newScope();
initCount++;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void do_switch() {\n {\n bind(OPC.CONST_0); iparmNone();\n pre(FLOW_NEXT); do_const(0); post();\n bind(OPC.CONST_1); iparmNone();\n pre(FLOW... | [
"0.7136465",
"0.6750636",
"0.6714599",
"0.6654219",
"0.6630186",
"0.6611044",
"0.6590689",
"0.65280634",
"0.6518078",
"0.6463553",
"0.6422781",
"0.6413006",
"0.6400715",
"0.6341495",
"0.6326898",
"0.63194525",
"0.63194215",
"0.631502",
"0.62626666",
"0.62205267",
"0.6207936",... | 0.0 | -1 |
/ EXPRESSION TYPING / 3.1 Literals / just save the type of the node into the typemap | public void outAIntExp(AIntExp node) throws TypeException{
typemap.put(node,new IntType());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"TypeLiteralExp createTypeLiteralExp();",
"public abstract TypeLiteral<?> toTypeLiteral(Type type);",
"public TypeLiteralElements getTypeLiteralAccess() {\r\n\t\treturn pTypeLiteral;\r\n\t}",
"public void visit(Literal literal) {}",
"private Value generateLiteralTermType(TermMap termMap, String value)\n \t\... | [
"0.7041185",
"0.67215353",
"0.6505328",
"0.6505119",
"0.63811916",
"0.6165438",
"0.6114909",
"0.6114909",
"0.5953242",
"0.5914287",
"0.58802676",
"0.58802676",
"0.5828938",
"0.5818133",
"0.58018833",
"0.5788221",
"0.57612807",
"0.5760536",
"0.57594573",
"0.57139415",
"0.57139... | 0.0 | -1 |
/ 3.2 Identifiers / grab the type out of the symboltable, check that it's not null, and then put it into the typemap with the node | public void outAIdExp(AIdExp node) throws TypeException{
TId id = node.getId();
java.lang.String name = id.getText();
Type t = lookUpVarType(name, golite.weeder.LineNumber.getLineNumber(node));
typemap.put(node,t);
/*
if(t==null) throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Identifier " + name + " used that cannot be found in symbol table.");
else typemap.put(node,t);
*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\tpublic void inAListExpr(AListExpr node) {\n\t\t\ttry {\t\n\t\t\t\t if(node.getExpr().toString().contains(\"String\")){\n\t\t\t\t\t symbolTable.put(node.getExpr().toString(), klasses.get(\"String\"));\n\t\t\t\t }\n\t\t\t\t if(node.getExpr().toString().contains(\"Bool\")){\n\t\t\t\t\t symbolTable.put(... | [
"0.56954634",
"0.56719595",
"0.56606406",
"0.5537295",
"0.54903746",
"0.54859746",
"0.5448054",
"0.54459804",
"0.5429492",
"0.5416236",
"0.53964674",
"0.53727067",
"0.53453875",
"0.5345212",
"0.533453",
"0.5331895",
"0.53207386",
"0.5311058",
"0.53050375",
"0.5302331",
"0.529... | 0.58568335 | 0 |
/ 3.3 Unary Expressions / get the type out of the typemap, dealias it if necessary, and check that it's the correct type | public void outAUPlusExp(AUPlusExp node) throws TypeException{
Node e = node.getExp();
Type t = typemap.get(e);
Type t_dealiased = removeAlias(t);
if(t_dealiased instanceof IntType || t_dealiased instanceof RuneType || t_dealiased instanceof Float64Type) typemap.put(node,t);
else throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Unary plus used in non-numeric context.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static UnaryExpression typeAs(Expression expression, Class type) { throw Extensions.todo(); }",
"@Test\n public void untypedLambda1() {\n DependentLink A = param(\"A\", Universe(0));\n Expression type = Pi(params(A, param(\"a\", Reference(A))), Nat());\n List<Binding> context = new ArrayList<>()... | [
"0.59831893",
"0.5514498",
"0.54045326",
"0.5379895",
"0.53616494",
"0.5285031",
"0.521427",
"0.51843",
"0.5146669",
"0.51183265",
"0.5072869",
"0.50481707",
"0.50377035",
"0.49533558",
"0.49507764",
"0.49295908",
"0.4917147",
"0.49073225",
"0.48897278",
"0.48650643",
"0.4842... | 0.5146787 | 8 |
/ 3.4 Binary Expressions / same idea for all of these: grab the types out of the typemap, use the appropriate helper function to verify that they are of the correct type (or aliases of the correct type, then store the result | public void outABinAndExp(ABinAndExp node) throws TypeException{
PExp l = node.getL();
PExp r = node.getR();
Type typel = typemap.get(l);
Type typer = typemap.get(r);
if(areBoolean(typel,typer)) typemap.put(node, typel);
else throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Binary and used without two Booleans.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Exp\nadjustTypesOfBinaryOperands( Exp pExp1, Exp pExp2 );",
"private final TypeSAT GetTypeSAT(String expression, String leftExpression, String rightExpression) {\r\n // remove extra brackets\r\n expression = this.RemoveExtraBrackets(expression);\r\n // look for binary implies\r\n ... | [
"0.61330754",
"0.5549555",
"0.53037554",
"0.52811927",
"0.5265839",
"0.526162",
"0.5246011",
"0.52367866",
"0.5209061",
"0.52077246",
"0.5200058",
"0.5181924",
"0.51711565",
"0.5152395",
"0.5130425",
"0.5126627",
"0.51264167",
"0.51186365",
"0.5107805",
"0.50841266",
"0.50667... | 0.49192485 | 34 |
/ 3.5 FunctionType Calls / first, check that we can get the function's type out of the symboltable. then compare the types of all the arguments from the node with the declared parameter types from the symbol table | public void caseAFuncCallExp(AFuncCallExp node)
{
inAFuncCallExp(node);
{
// don't typecheck name
List<PExp> copy = new ArrayList<PExp>(node.getParam());
for(PExp e : copy)
{
e.apply(this);
}
}
outAFuncCallExp(node);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Type typeCheck(){\n\tType fnType = myId.sym().getType();\n\tboolean result = true;\n\tif(!(fnType instanceof FnType)){\n\t myId.typeCheckError(\"Attempt to call a non-function\");\n\t result = false;\n\t}else{ // it is a function call\n\t FnSym fs = (FnSym)myId.sym();\n\t List<Type> declFormal =... | [
"0.67417955",
"0.6623236",
"0.6465391",
"0.62275004",
"0.61272514",
"0.60930747",
"0.59230524",
"0.5905928",
"0.5752492",
"0.5652184",
"0.558645",
"0.5573453",
"0.5571903",
"0.5541631",
"0.5537053",
"0.5520944",
"0.54706997",
"0.5467897",
"0.54351133",
"0.541665",
"0.5396576"... | 0.0 | -1 |
/ 3.6 Indexing / verify that the index expression has type int or alias of int, and that the expression has type slice or array or corresponding alias | public void outAIndexingExp(AIndexingExp node) throws TypeException{
PExp exp = node.getArray();
PExp index = node.getIndex();
Type exptype = typemap.get(exp);
Type indextype = typemap.get(index);
indextype = removeAlias(indextype);
exptype = removeAlias(exptype);
if(!(indextype instanceof IntType)){
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Non-integer index.");
}
if(exptype instanceof SliceType){
SliceType expslice = (SliceType) exptype;
typemap.put(node,expslice.getType());
}
else if(exptype instanceof ArrayType){
ArrayType exparray = (ArrayType) exptype;
typemap.put(node,exparray.getType());
}
else{
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Indexing expression on a non-array/slice type.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Expression getIndexExpr();",
"public Object visitIndexNode(GoIRIndexNode node){\n\t\tString type = (String) node.getIndex().accept(this);\n\t\tif(!(type.equalsIgnoreCase(\"int\"))) {\n\t\t\tthrow new GoException(\"non-integer slice index \\\"\"+type +\"\\\"\" );\n\t\t}\n\t\treturn type;\n\t}",
"boolean isIndex... | [
"0.60701853",
"0.59289706",
"0.58927083",
"0.58848184",
"0.5840622",
"0.5828104",
"0.568006",
"0.5569214",
"0.5557826",
"0.5518875",
"0.5513712",
"0.54984814",
"0.54984814",
"0.54615766",
"0.54615766",
"0.54615766",
"0.54615766",
"0.54615766",
"0.54615766",
"0.545821",
"0.542... | 0.5881157 | 4 |
/ confirm the node has type struct or alias of struct, then check that struct for the relevant fieldname / 3.7 Field Expressions | public void outASelectorExp(ASelectorExp node) throws TypeException{
PExp exp = node.getExp();
Type exptype = typemap.get(exp);
exptype = removeAlias(exptype);
TId id = node.getId();
java.lang.String idname = id.getText();
if(!(exptype instanceof StructType)){
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Selector on non-struct type.");
}
else{
StructType tempstruct = (StructType) exptype;
List<Map.Entry<List<String>,Type>> fields = tempstruct.getFields();
for(Map.Entry<List<String>,Type> entry : fields){
List<String> fieldname = entry.getKey();
Type fieldtype = entry.getValue();
if (fieldname.contains(idname)) {
typemap.put(node,fieldtype);
return;
}
}
throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Selector on nonexistent field.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasFieldNested();",
"boolean hasNestedField();",
"boolean hasNestedOuterField();",
"public Type TypeCheck(StructTable structTable, SymbolTableList symbolTables)\n {\n Type leftType = left.TypeCheck(structTable, symbolTables);\n\n // check that left is a struct\n if (!(leftType instan... | [
"0.64010954",
"0.607764",
"0.6000133",
"0.5888713",
"0.58234775",
"0.5778645",
"0.57737803",
"0.56176573",
"0.5549295",
"0.55397904",
"0.553044",
"0.55296135",
"0.5522324",
"0.54939294",
"0.54931515",
"0.54645294",
"0.54383665",
"0.5423305",
"0.53928256",
"0.5390679",
"0.5380... | 0.0 | -1 |
/ 3.9 Type Cast (can assume the cast is not an alias, this will be handled by function calls in 3.5) | public void outATypeCastExp(ATypeCastExp node){
PExp exp = node.getExp();
Type exptype = removeAlias(typemap.get(exp));
PType castedtype = node.getType();
Type finaltype;
if(castedtype instanceof AIntType){
finaltype = new IntType();
}
else if(castedtype instanceof ABoolType){
finaltype = new BooleanType();
}
else if(castedtype instanceof AFloatType){
finaltype = new Float64Type();
}
else if(castedtype instanceof ARuneType){
finaltype = new RuneType();
}
else throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Type cast to a disallowed type.");
if((exptype instanceof IntType) ||(exptype instanceof Float64Type) ||(exptype instanceof BooleanType) ||(exptype instanceof RuneType)) typemap.put(node,finaltype);
else throw new TypeException("[line " + golite.weeder.LineNumber.getLineNumber(node) + "] Type cast from a disallowed type.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public <T> T cast();",
"@Override\n\tpublic void visit(CastExpression arg0) {\n\t\t\n\t}",
"@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void cast() {\n\r\n\t}",
"OpFunct... | [
"0.7230195",
"0.7024402",
"0.69817835",
"0.69817835",
"0.69817835",
"0.6827841",
"0.67042476",
"0.653113",
"0.64385664",
"0.63999635",
"0.63130736",
"0.62466365",
"0.6237506",
"0.62134737",
"0.61141354",
"0.60444653",
"0.60234034",
"0.60190547",
"0.59894264",
"0.5977071",
"0.... | 0.6227154 | 13 |
constructor implicit al clasei | public Node() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Constructor(){\n\t\t\n\t}",
"public Clade() {}",
"Constructor() {\r\n\t\t \r\n\t }",
"private Instantiation(){}",
"public Pasien() {\r\n }",
"defaultConstructor(){}",
"public AntrianPasien() {\r\n\r\n }",
"public TCubico(){}",
"public Alojamiento() {\r\n\t}",
"public Carrera(){\n }"... | [
"0.7528051",
"0.7480505",
"0.7444623",
"0.7318006",
"0.72875756",
"0.7265447",
"0.72092724",
"0.71850336",
"0.71187973",
"0.7077822",
"0.703716",
"0.70338714",
"0.7025012",
"0.7017506",
"0.70092475",
"0.69949937",
"0.69490683",
"0.69389236",
"0.691288",
"0.69125944",
"0.69045... | 0.0 | -1 |
constructor explicit al clasei | public Node(T val) {
this.val = val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Constructor(){\n\t\t\n\t}",
"public Clade() {}",
"public Pasien() {\r\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"public AntrianPasien() {\r\n\r\n }",
"defaultConstructor(){}",
"private Instantiation(){}",
"public TCubico(){}",
"public TTau() {}",
"public CyanSus() {\n\n }",
"publi... | [
"0.75062203",
"0.7504877",
"0.74139553",
"0.740266",
"0.7387049",
"0.73662645",
"0.7354048",
"0.71720296",
"0.70971394",
"0.70955455",
"0.7088633",
"0.70839953",
"0.7082582",
"0.7081893",
"0.7057618",
"0.7030636",
"0.70107144",
"0.70036834",
"0.6968602",
"0.69646096",
"0.6948... | 0.0 | -1 |
setter pentru valoarea din nod | public void setData(T val) {
this.val = val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setValue(IveObject val){\r\n\tvalue = val;\r\n\tnotifyFromAttr();\r\n }",
"@Override\n public void setValue(Node value) throws ValueFormatException,\n VersionException, LockException, ConstraintViolationException,\n RepositoryException {\n \n }",
"public void setV... | [
"0.6935777",
"0.6629095",
"0.657469",
"0.65328217",
"0.6490541",
"0.6412215",
"0.63949543",
"0.638739",
"0.6363146",
"0.63440657",
"0.63335407",
"0.63185084",
"0.6314103",
"0.6310521",
"0.6307594",
"0.6307263",
"0.6262282",
"0.62579584",
"0.6256788",
"0.6201522",
"0.61657387"... | 0.63050354 | 16 |
functie pentru stergerea parintelui | public void removeParent() {
if (getParent() == null)
return;
if (p.getLeft() == this)
p.setLeft(null);
else if (p.getRight() == this)
p.setRight(null);
this.p = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void pausaParaComer() {\n\n\t}",
"void pasarALista();",
"void aprovarAnalise();",
"private void limpiarDatos() {\n\t\t\n\t}",
"@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}",
"private static void cajas() {\n\... | [
"0.6958765",
"0.65817446",
"0.627151",
"0.62390095",
"0.6209073",
"0.6190817",
"0.61877894",
"0.61608",
"0.6059982",
"0.6056565",
"0.6040463",
"0.60309106",
"0.60192525",
"0.60080147",
"0.60074157",
"0.59968096",
"0.59825015",
"0.5980813",
"0.5977505",
"0.59643304",
"0.596168... | 0.0 | -1 |
setter pentru parintele stang | public void setLeft(Node<T> val) {
if (getLeft() != null)
getLeft().setParent(null);
if (val != null) {
val.removeParent();
val.setParent(this);
}
this.left = val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setValor(String valor)\n/* 22: */ {\n/* 23:34 */ this.valor = valor;\n/* 24: */ }",
"public void setOrigen(java.lang.String param){\n \n this.localOrigen=param;\n \n\n ... | [
"0.6997818",
"0.67378175",
"0.65746444",
"0.653207",
"0.6522051",
"0.64487535",
"0.6441313",
"0.64356065",
"0.6433336",
"0.63750505",
"0.6347217",
"0.6307605",
"0.6286292",
"0.6283221",
"0.6276662",
"0.6276135",
"0.6255419",
"0.62257314",
"0.6208348",
"0.6198121",
"0.6171858"... | 0.0 | -1 |
setter pentru parintele drept | public void setRight(Node<T> val) {
if (getRight() != null) {
getRight().setParent(null);
}
if (val != null) {
val.removeParent();
val.setParent(this);
}
this.right = val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setdat()\n {\n }",
"public void setPuntoDeVenta(PuntoDeVenta puntoDeVenta)\r\n/* 145: */ {\r\n/* 146:166 */ this.puntoDeVenta = puntoDeVenta;\r\n/* 147: */ }",
"public void setValor(String valor)\n/* 22: */ {\n/* 23:34 */ this.valor = valor;\n/* 24: */ }",
"public ... | [
"0.713135",
"0.705396",
"0.6874852",
"0.6834596",
"0.6688703",
"0.65487975",
"0.6528073",
"0.6493044",
"0.6448482",
"0.64343834",
"0.64091957",
"0.6374953",
"0.6370456",
"0.6370452",
"0.63619703",
"0.63475764",
"0.6344555",
"0.6337974",
"0.6335462",
"0.631353",
"0.62833804",
... | 0.0 | -1 |
getter pentru nodul stang | public Node<T> getLeft() {
return left;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getNume();",
"java.lang.String getNume();",
"public java.lang.String getOrigen(){\n return localOrigen;\n }",
"public String getNom();",
"public String getNombre()\r\n/* 60: */ {\r\n/* 61: 67 */ return this.nombre;\r\n... | [
"0.63035727",
"0.63035727",
"0.6297542",
"0.6280963",
"0.62641096",
"0.62496394",
"0.6215023",
"0.6199692",
"0.6184171",
"0.61141604",
"0.60728896",
"0.6070941",
"0.60651964",
"0.60425216",
"0.6033747",
"0.60329175",
"0.6013454",
"0.6007366",
"0.60019153",
"0.5997789",
"0.599... | 0.0 | -1 |
getter pentru nodul drept | public Node<T> getRight() {
return right;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Nodo getNodoDerecho(){\n return der;\n }",
"public String getDPTitel(){\n\t\treturn this.m_sDPTitel;\n\t}",
"@Override\n\tpublic int getDikte() {\n\t\treturn this.dikttte;\n\t}",
"public Nodo getPadre() {\n return this.padre;\n }",
"public Nodo<T> getDerecho() {\n\t\treturn derecho;\n\... | [
"0.7325169",
"0.66847867",
"0.6639575",
"0.65245074",
"0.65210193",
"0.6507496",
"0.64707226",
"0.64635944",
"0.64596444",
"0.63568515",
"0.63330877",
"0.6312859",
"0.6298902",
"0.6292115",
"0.62786394",
"0.6228889",
"0.6228097",
"0.6224729",
"0.6224241",
"0.62165505",
"0.620... | 0.0 | -1 |
functie care verifica daca exista nod in partea stanga | public boolean hasLeft() {
return left != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean existsRec(Node<T> nodo, T key) {\r\n\t\tif (nodo.getData().equals(key)) {// Si existe el nodo en el arbol\r\n\t\t\treturn true;\r\n\t\t} else if (nodo.getChildren() != null) {// Si tiene hijos\r\n\t\t\tList<Node<T>> lista = nodo.getChildren();// Los hijos\r\n\t\t\tboolean comprobacion = false;\r\n\... | [
"0.66810364",
"0.64723104",
"0.6306981",
"0.6294829",
"0.6281177",
"0.62751323",
"0.6230709",
"0.6230709",
"0.62158775",
"0.62020415",
"0.6147555",
"0.6140544",
"0.6085534",
"0.60221815",
"0.6008799",
"0.60052544",
"0.5980103",
"0.5961049",
"0.5918998",
"0.589966",
"0.5885665... | 0.0 | -1 |
functie care verifica daca exista nod in partea dreapta | public boolean hasRight() {
return right != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean existsRec(Node<T> nodo, T key) {\r\n\t\tif (nodo.getData().equals(key)) {// Si existe el nodo en el arbol\r\n\t\t\treturn true;\r\n\t\t} else if (nodo.getChildren() != null) {// Si tiene hijos\r\n\t\t\tList<Node<T>> lista = nodo.getChildren();// Los hijos\r\n\t\t\tboolean comprobacion = false;\r\n\... | [
"0.6943788",
"0.6478015",
"0.6329001",
"0.6199127",
"0.6157959",
"0.6123857",
"0.6112238",
"0.60915214",
"0.60836965",
"0.6083548",
"0.6082837",
"0.60596657",
"0.6023666",
"0.60026866",
"0.60026866",
"0.599061",
"0.59743065",
"0.5963594",
"0.59306544",
"0.5913373",
"0.5910267... | 0.0 | -1 |
suprasctrierea functiei de afisare | @Override
public String toString() {
return val.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void berechneFlaeche() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"public abstract void afvuren();",
"public void asetaTeksti(){\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n protected void adicionar(... | [
"0.7291108",
"0.70359206",
"0.6991138",
"0.68851966",
"0.6767705",
"0.6751518",
"0.6733344",
"0.6731996",
"0.66916424",
"0.66822666",
"0.66728175",
"0.66005737",
"0.65657926",
"0.65478534",
"0.65440875",
"0.6535713",
"0.6504812",
"0.6485548",
"0.64763397",
"0.64733267",
"0.64... | 0.0 | -1 |
functie care verifica daca un nod este rosu | public boolean isRed() {
return getColor() == RED;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean existsRec(Node<T> nodo, T key) {\r\n\t\tif (nodo.getData().equals(key)) {// Si existe el nodo en el arbol\r\n\t\t\treturn true;\r\n\t\t} else if (nodo.getChildren() != null) {// Si tiene hijos\r\n\t\t\tList<Node<T>> lista = nodo.getChildren();// Los hijos\r\n\t\t\tboolean comprobacion = false;\r\n\... | [
"0.60357976",
"0.5992636",
"0.59656864",
"0.5952597",
"0.5941836",
"0.59248465",
"0.5900762",
"0.58957255",
"0.58890206",
"0.584963",
"0.58368206",
"0.5767227",
"0.57309526",
"0.5708773",
"0.570733",
"0.5682331",
"0.56771415",
"0.5665834",
"0.56481564",
"0.5621566",
"0.561401... | 0.0 | -1 |
functie care verifica daca un nod este negru | public boolean isBlack() {
return !isRed();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean inneholder(N n) {\n\n if(n == null) {\n return false;\n }\n\n Node node = listehode.neste;\n\n if (listehode.neste == null) {\n return false;\n }\n while (node != null) {\n if (node.nkl.compareTo(n) == 0) {\n r... | [
"0.6404752",
"0.63575685",
"0.6195872",
"0.6128888",
"0.60572034",
"0.60485727",
"0.60252506",
"0.602014",
"0.59632957",
"0.59437215",
"0.5889633",
"0.5877876",
"0.58727264",
"0.58174956",
"0.5788014",
"0.5779814",
"0.57688314",
"0.5755797",
"0.57362396",
"0.57362396",
"0.572... | 0.0 | -1 |
functie care verifica daca un nod este rosu | public static boolean isRed(Node<?> node) {
return getColor(node) == RED;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean existsRec(Node<T> nodo, T key) {\r\n\t\tif (nodo.getData().equals(key)) {// Si existe el nodo en el arbol\r\n\t\t\treturn true;\r\n\t\t} else if (nodo.getChildren() != null) {// Si tiene hijos\r\n\t\t\tList<Node<T>> lista = nodo.getChildren();// Los hijos\r\n\t\t\tboolean comprobacion = false;\r\n\... | [
"0.60357976",
"0.5992636",
"0.59656864",
"0.5952597",
"0.5941836",
"0.59248465",
"0.5900762",
"0.58957255",
"0.58890206",
"0.584963",
"0.58368206",
"0.5767227",
"0.57309526",
"0.5708773",
"0.570733",
"0.5682331",
"0.56771415",
"0.5665834",
"0.56481564",
"0.5621566",
"0.561401... | 0.0 | -1 |
functie care verifica daca un nod este negru | public static boolean isBlack(Node<?> node) {
return !isRed(node);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean inneholder(N n) {\n\n if(n == null) {\n return false;\n }\n\n Node node = listehode.neste;\n\n if (listehode.neste == null) {\n return false;\n }\n while (node != null) {\n if (node.nkl.compareTo(n) == 0) {\n r... | [
"0.6404752",
"0.63575685",
"0.6195872",
"0.6128888",
"0.60572034",
"0.60485727",
"0.60252506",
"0.602014",
"0.59632957",
"0.59437215",
"0.5889633",
"0.5877876",
"0.58727264",
"0.58174956",
"0.5788014",
"0.5779814",
"0.57688314",
"0.5755797",
"0.57362396",
"0.57362396",
"0.572... | 0.0 | -1 |
setter pentru culoarea nodului | public void setColor(boolean color) {
this.color = color;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setNodo(Long nodo);",
"public void Nodo(){\r\n this.valor = \"\";\r\n this.siguiente = null;\r\n }",
"public abstract void setNodes();",
"public void setNode_1(String node_1);",
"public void resetNodo()\r\n {\r\n this.nodo = null;\r\n }",
"public void settInn(T e... | [
"0.65590537",
"0.6557485",
"0.65567267",
"0.65539205",
"0.6346322",
"0.6308594",
"0.6280346",
"0.62203354",
"0.6197016",
"0.6155116",
"0.615068",
"0.6125404",
"0.6101396",
"0.6091275",
"0.5995001",
"0.5991147",
"0.598336",
"0.5983164",
"0.59827876",
"0.5971482",
"0.5968139",
... | 0.0 | -1 |
getter pentru culoarea nodului | public boolean getColor() {
return color;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getNodeValue ();",
"public int getNode() {\r\n\t\t\treturn data;\r\n\t\t}",
"public Nodo obtener_Nodo() {\n\t\treturn this.elem;\n\t}",
"public int getNodeLabel ();",
"Node getNode();",
"@AutoEscape\n\tpublic String getNode_1();",
"Nodo_B getPrimero(){\n return this.primero;\n }... | [
"0.6648355",
"0.6565873",
"0.64945865",
"0.64830303",
"0.64540064",
"0.64418066",
"0.64379865",
"0.6429158",
"0.64223",
"0.64205533",
"0.63945645",
"0.63725895",
"0.6363832",
"0.6308399",
"0.6291572",
"0.62713945",
"0.6255395",
"0.6229395",
"0.6227233",
"0.62052464",
"0.61918... | 0.0 | -1 |
getter pentru culoarea curenta a nodului | public Color getRedBlack() {
if (isRed())
return Color.RED;
else
return Color.BLACK;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getNode() {\r\n\t\t\treturn data;\r\n\t\t}",
"public int Node() { return this.Node; }",
"public int getNodeA(){\n return this.nodeA;\n }",
"public int eleminardelInicio(){\n int elemento=inicio.dato;\n if(inicio==fin){\n inicio=fin=null;\n }else{\n inicio=inic... | [
"0.6568067",
"0.65624815",
"0.6425897",
"0.6307117",
"0.61972296",
"0.6183512",
"0.60586995",
"0.60125804",
"0.6006473",
"0.5899686",
"0.5883991",
"0.5831912",
"0.5822932",
"0.5821395",
"0.5817265",
"0.5811621",
"0.5794168",
"0.5790427",
"0.5790427",
"0.57879764",
"0.5777908"... | 0.0 | -1 |
functie pentru schimbarea culorii unui nod | public void switchColor() {
color = !color;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tpublic void coba() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"public Nodo espaciosJustos(Nodo nodo){\n System.out.println(\"----------------inicio heuristica espaciosJustos--------------\");\n Operadores operadores... | [
"0.68327796",
"0.6299517",
"0.60572994",
"0.6052698",
"0.6035453",
"0.6022364",
"0.6005507",
"0.59312695",
"0.5913299",
"0.58842224",
"0.5865463",
"0.5854815",
"0.58171463",
"0.58129615",
"0.5801393",
"0.5797646",
"0.57943165",
"0.5757024",
"0.57480043",
"0.57347834",
"0.5716... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
int arr[]= {2, 5, 4, 2, 7, 4, 2};
int n=arr.length;
occurence(arr,n);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onStart() {
super.onStart();
// 不能在onCreate函数中获取控件,因为fragment还没有start,可以在onStart函数中获取:
mFlowLayoutMarks = (FlowLayoutMarks) getActivity().findViewById(
R.id.flowLayoutMarks);
initData();
mScrollView=(ScrollView) getActivity().findViewById(R.id.mark_scrollView);
initEvent();
} | {
"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 | private void initEvent() {
mScrollView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
switch (event.getAction()) {
/*case MotionEvent.ACTION_UP:
break;
case MotionEvent.ACTION_DOWN:
break;*/
case MotionEvent.ACTION_MOVE:
//判断是否滑动到底部
if(mScrollView.getChildAt(0).getMeasuredHeight()<=mScrollView.getHeight()+mScrollView.getScrollY()){
Toast.makeText(getActivity(), "已经到底部了,去留下你的足迹吧", Toast.LENGTH_SHORT).show();
}
break;
default:
break;
}
return false;
}
});
} | {
"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 boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
/*case MotionEvent.ACTION_UP:
break;
case MotionEvent.ACTION_DOWN:
break;*/
case MotionEvent.ACTION_MOVE:
//判断是否滑动到底部
if(mScrollView.getChildAt(0).getMeasuredHeight()<=mScrollView.getHeight()+mScrollView.getScrollY()){
Toast.makeText(getActivity(), "已经到底部了,去留下你的足迹吧", Toast.LENGTH_SHORT).show();
}
break;
default:
break;
}
return false;
} | {
"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 |
double open = Math.sin(System.currentTimeMillis() % 1000 / 1000.0Math.PI2)0.5+0.5; | public void render(Screen screen) {
double open = openness * 0.47;
List<Sprite> doorSprites = ((Door) sprites).doorSprites;
if (level.getTile(x, y - 1).isWall() && level.getTile(x, y + 1).isWall()) {
sprites.rotate(0, true);
for (int i = 0; i < doorSprites.size(); i++) {
Sprite sprite = doorSprites.get(i);
if (sprite.z < 0.45) {
sprite.z -= open;
} else {
sprite.z += open;
}
}
} else {
sprites.rotate(Math.PI * 2 * 0.25, true);
for (int i = 0; i < doorSprites.size(); i++) {
Sprite sprite = doorSprites.get(i);
if (sprite.x < 0.45) {
sprite.x -= open;
} else {
sprite.x += open;
}
}
}
super.render(screen);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double sin(double number);",
"static double f(double x){\n \treturn Math.sin(x);\r\n }",
"private static double getSinSquare(Double value){\r\n\t\treturn Math.pow(Math.sin(value/2), 2);\r\n\r\n }",
"static double sineWave(double timeInSeconds, double frequency) {\r\n\t\tdouble result= Math.... | [
"0.6658647",
"0.66318065",
"0.64981055",
"0.63555104",
"0.62326634",
"0.6171626",
"0.61665875",
"0.6006949",
"0.595521",
"0.59446055",
"0.59184456",
"0.59068376",
"0.5876957",
"0.58766854",
"0.58751404",
"0.58733827",
"0.58578736",
"0.58313864",
"0.5821144",
"0.58158576",
"0.... | 0.0 | -1 |
Use this method to run the main logic | public int[] solve() {
setupAnts();
clearTrails();
IntStream.range(0, maxIterations)
.forEach(i -> {
moveAnts();
updateTrails();
updateBest();
});
System.out.println("Best tour length: " + (bestTourLength));
System.out.println("Best tour order: " + Arrays.toString(bestTourOrder));
IntStream.range(1, bestTourOrder.length)
.forEach(i -> {
if (graph[bestTourOrder[i]][bestTourOrder[i - 1]] == 0.01)
System.out.println("Не подходит по пути");
});
IntStream.range(1, bestTourOrder.length)
.forEach(i -> {
if (emcMatrix[bestTourOrder[i]][bestTourOrder[i - 1]] == 0)
System.out.println("Не подходит по ЭМС");
});
List<Element> sortedElements = new ArrayList<>();
for (int i = 0; i < bestTourOrder.length; i++) {
sortedElements.add(elements.get(bestTourOrder[i]));
}
return bestTourOrder.clone();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void run() {\n // The run method should be overridden by the subordinate class. Please\n // see the example applications provided for more details.\n }",
"public static void main(String... args) {\n doMain().run();\n }",
"public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\... | [
"0.75556535",
"0.7147439",
"0.7142204",
"0.71381354",
"0.69919276",
"0.696898",
"0.69672686",
"0.69273025",
"0.6896459",
"0.68917984",
"0.6865261",
"0.68596375",
"0.6827679",
"0.68169236",
"0.68115574",
"0.67977566",
"0.67916584",
"0.6780606",
"0.6764843",
"0.67630535",
"0.67... | 0.0 | -1 |
Prepare ants for the simulation | private void setupAnts() {
IntStream.range(0, numberOfAnts)
.forEach(i -> {
ants.forEach(ant -> {
ant.clear();
ant.visitCity(-1, random.nextInt(numberOfCities));
});
});
currentIndex = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void prepare() {\n this.shifts = new ArrayList<>();\n this.rates = new ArrayList<>();\n // bootstrap shifts and rates\n this.prepareShifts();\n this.prepareRates();\n }",
"public void prepare() {\n\t\twhile (lastEventEndTime<=curSimulation.time) {\n\t\t\t\n\t\t\t// ge... | [
"0.6035649",
"0.6025622",
"0.59247226",
"0.59079695",
"0.58852315",
"0.5761255",
"0.57338834",
"0.57232624",
"0.57180697",
"0.5688748",
"0.56858015",
"0.5683521",
"0.56647044",
"0.5654096",
"0.56530017",
"0.56445384",
"0.562185",
"0.5601681",
"0.55657136",
"0.55501384",
"0.55... | 0.6485658 | 0 |
At each iteration, move ants | private void moveAnts() {
IntStream.range(currentIndex, numberOfCities - 1)
.forEach(i -> {
ants.forEach(ant -> ant.visitCity(currentIndex, selectNextCity(ant)));
currentIndex++;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void move() {\n for (int i = 0; i < Vampiro.getNumVamp(); i++) {\n\n lista[i].move();\n }\n }",
"public void moveAll()\n\t{\n\t\tmoveOutput = \"\";\n\t\tfor (int i = 0; i < 20; i++)\n\t\t{\n\t\t\tif (river[i] != null)\n\t\t\t{\n\t\t\t\triver[i].move(i);\n\t\t\t}\n\t\t}\n\t}",
... | [
"0.6963462",
"0.69575757",
"0.6542088",
"0.6484962",
"0.643417",
"0.64141047",
"0.63875",
"0.6365441",
"0.63567215",
"0.6339961",
"0.63350105",
"0.6325154",
"0.6306566",
"0.6301644",
"0.6278653",
"0.6277502",
"0.62713367",
"0.62661314",
"0.6246666",
"0.6228271",
"0.62251",
... | 0.7238576 | 0 |
Select next city for each ant | private int selectNextCity(Ant ant) {
int t = random.nextInt(numberOfCities - currentIndex);
if (random.nextDouble() < randomFactor) {
OptionalInt cityIndex = IntStream.range(0, numberOfCities)
.filter(i -> i == t && !ant.visited(i))
.findFirst();
if (cityIndex.isPresent()) {
return cityIndex.getAsInt();
}
}
calculateProbabilities(ant);
double r = random.nextDouble();
double total = 0;
for (int i = 0; i < numberOfCities; i++) {
total += probabilities[i];
if (total >= r) {
return i;
}
}
throw new RuntimeException("There are no other cities");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int selectNextCity(Ant ant) {\r\n\t\tint from, to;\r\n\t\t\r\n\t\tdouble denom = 0.0;\r\n\r\n\t\tfrom = ant.curCity;\r\n\r\n\t\t// compute denom\r\n\t\tfor (to = 0; to < cities.length; to++) {\r\n\t\t\tif (ant.tabu[to] == 0) {\r\n\t\t\t\tdenom += antProduct(from, to);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tassert denom !=... | [
"0.76886487",
"0.6462185",
"0.5920698",
"0.5815037",
"0.5780682",
"0.5656972",
"0.5638411",
"0.5633101",
"0.5571936",
"0.554771",
"0.5486019",
"0.54748005",
"0.5419385",
"0.5405555",
"0.5374795",
"0.5370647",
"0.5351341",
"0.5333642",
"0.52943254",
"0.5292896",
"0.5287506",
... | 0.6834802 | 1 |
Calculate the next city picks probabilites | public void calculateProbabilities(Ant ant) {
int i = ant.trail[currentIndex];
double pheromone = 0.0;
for (int l = 0; l < numberOfCities; l++) {
if (!ant.visited(l)) {
pheromone += (Math.pow(trails[i][l], alpha) + 1) * (Math.pow(graph[i][l], beta) + 1) *
(Math.pow(emcMatrix[i][l], ccc) + 1) * (Math.pow(functionalAttachmentMatrix[i][l], ddd) + 1);
}
}
for (int j = 0; j < numberOfCities; j++) {
if (ant.visited(j)) {
probabilities[j] = 0.0;
} else {
double numerator = (Math.pow(trails[i][j], alpha) + 1) * (Math.pow(graph[i][j], beta) + 1) *
(Math.pow(emcMatrix[i][j], ccc) + 1) * (Math.pow(functionalAttachmentMatrix[i][j], ddd) + 1);
probabilities[j] = numerator / pheromone;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int selectNextCity(Ant ant) {\n int t = random.nextInt(numberOfCities - currentIndex);\n if (random.nextDouble() < randomFactor) {\n OptionalInt cityIndex = IntStream.range(0, numberOfCities)\n .filter(i -> i == t && !ant.visited(i))\n .findFir... | [
"0.6220319",
"0.61459464",
"0.6018024",
"0.59801394",
"0.59778583",
"0.5807977",
"0.57746905",
"0.5739642",
"0.57107764",
"0.56983995",
"0.5697717",
"0.5652001",
"0.5626996",
"0.56187606",
"0.5571646",
"0.5528845",
"0.5487778",
"0.5486321",
"0.54826844",
"0.54756767",
"0.5434... | 0.0 | -1 |
Update trails that ants used | private void updateTrails() {
for (int i = 0; i < numberOfCities; i++) {
for (int j = 0; j < numberOfCities; j++) {
trails[i][j] *= evaporation;
}
}
for (Ant a : ants) {
double contribution = Q / a.trailLength(graph);
for (int i = 0; i < numberOfCities - 1; i++) {
trails[a.trail[i]][a.trail[i + 1]] += contribution;
}
trails[a.trail[numberOfCities - 1]][a.trail[0]] += contribution;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void updateTrails() {\r\n\t\tint from, to;\r\n\t\t\r\n\t\t// Pheromone evaporation\r\n\t\tfor(from = 0; from < cities.length; from++) {\r\n\t\t\tfor(to = 0; to < cities.length; to++) {\r\n\t\t\t\tif(from != to) {\r\n\t\t\t\t\tpheromone[from][to] *= (1.0 - RHO);\r\n\t\t\t\t\tif(pheromone[from][to] < 0.0) pheromone[... | [
"0.7343087",
"0.60551363",
"0.605474",
"0.5808541",
"0.5758928",
"0.55369925",
"0.55280745",
"0.5471085",
"0.5450001",
"0.54365003",
"0.542321",
"0.535438",
"0.5339294",
"0.52883404",
"0.5280307",
"0.5265977",
"0.5249764",
"0.5237862",
"0.52011967",
"0.5198184",
"0.5186501",
... | 0.76607466 | 0 |
Update the best solution | private void updateBest() {
if (bestTourOrder == null) {
bestTourOrder = ants.get(0).trail;
bestTourLength = ants.get(0)
.trailLength(graph);
}
for (Ant a : ants) {
if (a.trailLength(graph) > bestTourLength) {
bestTourLength = a.trailLength(graph);
bestTourOrder = a.trail.clone();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void update() {\n\t\tif (max == null || max.length < info.size())\r\n\t\t\tmax = info.stream().mapToInt(i -> Math.max(1, i[1])).toArray();\r\n\r\n\t\tfull = improve(max);\r\n\t}",
"private void checkIsBetterSolution() {\n if (solution == null) {\n solution = generateSolution();\n ... | [
"0.6630295",
"0.6541378",
"0.64852405",
"0.6457265",
"0.6415674",
"0.61930686",
"0.6184937",
"0.6171311",
"0.61341566",
"0.6127016",
"0.6124579",
"0.6085213",
"0.60790735",
"0.6045168",
"0.59812987",
"0.59494936",
"0.59486204",
"0.5944893",
"0.59333956",
"0.5928246",
"0.59171... | 0.64923966 | 2 |
Clear trails after simulation | private void clearTrails() {
IntStream.range(0, numberOfCities)
.forEach(i -> {
IntStream.range(0, numberOfCities)
.forEach(j -> trails[i][j] = c);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void resetTesting() {\r\n\t\tcompanyCars.clear();\r\n\t\trentDetails.clear();\r\n\t}",
"public void reset() \n {\n cumulativeTrials = 0;\n\t numTwoHeads = 0;\n\t numTwoTails = 0;\n\t numHeadTails = 0;\n }",
"public void removeTurtles()\n {\n // Stop observing every turtle\n for... | [
"0.6815085",
"0.66289",
"0.659707",
"0.6582119",
"0.65733516",
"0.6536",
"0.65186226",
"0.64956415",
"0.6451933",
"0.6443428",
"0.6436835",
"0.64366233",
"0.6393146",
"0.638888",
"0.6379623",
"0.63632196",
"0.6341647",
"0.633829",
"0.6330496",
"0.6322127",
"0.6321607",
"0.6... | 0.6974034 | 0 |
Creates new form Venda | public Venda() {
initComponents();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public frmVenda() {\n initComponents();\n }",
"@Command\n\tpublic void nuevoAnalista(){\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\n\n\t\t//parametros.put(\"recordMode\", \"NEW\");\n\t\tllamarFormulario(\"formularioAnalistas.zul\", null);\n\t}",
"FORM createFORM();",
"publ... | [
"0.6643666",
"0.6617271",
"0.6599882",
"0.6521472",
"0.64106643",
"0.63889396",
"0.6386409",
"0.6331269",
"0.6308499",
"0.6306714",
"0.6256647",
"0.6231167",
"0.62144065",
"0.62083745",
"0.61847734",
"0.61645615",
"0.6136669",
"0.6117701",
"0.610413",
"0.6096156",
"0.6089788"... | 0.61947715 | 15 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
txtPesquisa = new javax.swing.JTextField();
btnBusca = new javax.swing.JButton();
txtQunatidade = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
txtValorItem = new javax.swing.JTextField();
txtValorTotal = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
tabelaPesquisa = new javax.swing.JTable();
jLabel7 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
tabelaItemVenda = new javax.swing.JTable();
btnFinalizar = new javax.swing.JButton();
btnAdicionar = new javax.swing.JButton();
txtCodProduto = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
btnAbirVenda = new javax.swing.JButton();
txtCodFuncionario = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
txtCodVenda = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Formulario de Venda");
jLabel2.setFont(new java.awt.Font("Tahoma", 0, 30)); // NOI18N
jLabel2.setText("VENDAS");
jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel1.setText("Produto:");
txtPesquisa.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtPesquisaActionPerformed(evt);
}
});
btnBusca.setText("Busca");
btnBusca.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnBuscaActionPerformed(evt);
}
});
txtQunatidade.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
txtQunatidadeFocusGained(evt);
}
});
txtQunatidade.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtQunatidadeKeyReleased(evt);
}
});
jLabel3.setText("Qtd:");
jLabel4.setText("Valor por item:");
txtValorItem.setEnabled(false);
txtValorTotal.setEnabled(false);
jLabel5.setText("Valor total:");
tabelaPesquisa.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{},
{},
{},
{}
},
new String [] {
}
));
tabelaPesquisa.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tabelaPesquisaMouseClicked(evt);
}
});
jScrollPane1.setViewportView(tabelaPesquisa);
jLabel7.setText("Itens da venda:");
tabelaItemVenda.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{},
{},
{},
{}
},
new String [] {
}
));
jScrollPane2.setViewportView(tabelaItemVenda);
btnFinalizar.setText("FINALIZAR VENDA");
btnFinalizar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnFinalizarActionPerformed(evt);
}
});
btnAdicionar.setText("ADD");
btnAdicionar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAdicionarActionPerformed(evt);
}
});
jLabel8.setText("Cod Produto:");
btnAbirVenda.setText("Abrir Venda");
btnAbirVenda.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAbirVendaActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(39, 39, 39)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel7)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 660, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(txtPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnAbirVenda)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel8)
.addComponent(txtCodProduto, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnBusca))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
.addGap(312, 312, 312)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(txtQunatidade, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(41, 41, 41)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(txtValorItem, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnAdicionar)))))
.addComponent(jLabel1)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnFinalizar)
.addGap(112, 112, 112)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5)
.addComponent(txtValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(53, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel8))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtQunatidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtValorItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnAdicionar)
.addComponent(txtCodProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(btnAbirVenda, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnBusca))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(79, 79, 79))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(btnFinalizar, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(21, 21, 21))))
);
txtCodFuncionario.setEnabled(false);
jLabel6.setText("Cod Func");
txtCodVenda.setEnabled(false);
jLabel9.setText("Cod Venda");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(38, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(144, 144, 144)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtCodVenda, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9))
.addGap(39, 39, 39)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6)
.addComponent(txtCodFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(34, 34, 34))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(24, 24, 24)
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtCodVenda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtCodFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(20, 20, 20)))
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(76, 76, 76))
);
setSize(new java.awt.Dimension(846, 714));
setLocationRelativeTo(null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n ... | [
"0.73197734",
"0.72908777",
"0.72908777",
"0.72908777",
"0.72870827",
"0.7248368",
"0.7213462",
"0.7208004",
"0.7195763",
"0.7189973",
"0.7184436",
"0.7159332",
"0.71478266",
"0.709268",
"0.7080727",
"0.7057287",
"0.6986775",
"0.6977119",
"0.69554067",
"0.69548035",
"0.694574... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.