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 |
|---|---|---|---|---|---|---|
Gets the filetype value for this SelectRequest. | public java.lang.String getFiletype() {
return filetype;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFileType()\n {\n if (m_fileOptions.m_type == null ||\n m_fileOptions.m_type.length() <= 0)\n {\n return getTypeFromExtension();\n }\n\n return m_fileOptions.m_type;\n }",
"public String getFileType(){\n\t\treturn type;\n\t}",
"public stat... | [
"0.7607488",
"0.753419",
"0.74863875",
"0.74792546",
"0.7386676",
"0.73258567",
"0.73205113",
"0.7317119",
"0.71724457",
"0.7166957",
"0.6604021",
"0.6458126",
"0.6456938",
"0.63478786",
"0.62626284",
"0.62229466",
"0.62229466",
"0.61755747",
"0.6145571",
"0.6086844",
"0.6082... | 0.73726654 | 5 |
Sets the filetype value for this SelectRequest. | public void setFiletype(java.lang.String filetype) {
this.filetype = filetype;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setFileType(FileType typ) {\n fileType = typ;\n }",
"public void setFileType(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), FILETYPE, value);\r\n\t}",
"public void setFileType(String fileType) {\r\n\t\tthis.fileType = fileType;\r\n\t}",
"public void setFileTyp... | [
"0.74858254",
"0.74326473",
"0.7375923",
"0.72767425",
"0.7033242",
"0.69802177",
"0.6974492",
"0.6797945",
"0.6725919",
"0.6639931",
"0.662854",
"0.6547121",
"0.6465893",
"0.64099795",
"0.6380199",
"0.62667245",
"0.61505973",
"0.61162883",
"0.60657483",
"0.6058412",
"0.60518... | 0.6985334 | 5 |
Gets the columns value for this SelectRequest. | public java.lang.String[] getColumns() {
return columns;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getValue() {\n return this.column;\n }",
"public String getValue() {\n return this.column;\n }",
"public String getValue() {\n return this.column;\n }",
"public String getValue() {\n return this.column;\n }",
"public Stri... | [
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.661015",
"0.64960325",
"0.64960325",
"0.64960325",
"0.64960325",
"0.64960325",
"0.64960325",
"0.64960325",
"0.64960325",
"0.649... | 0.5864409 | 27 |
Sets the columns value for this SelectRequest. | public void setColumns(java.lang.String[] columns) {
this.columns = columns;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setColumns(List<String> columns);",
"public void cols(String...columns) {\n\t\tthis.columnList = columns;\n\t}",
"public Criteria setColumns(String[] columns) {\r\n this.projections.clear();\r\n for (int i = 0; i < columns.length; i++) {\r\n this.projections.add(columns[i]);\r\n ... | [
"0.59771675",
"0.5918432",
"0.58097726",
"0.58067876",
"0.578394",
"0.57758236",
"0.57725286",
"0.573062",
"0.57176936",
"0.56933266",
"0.5663921",
"0.5621385",
"0.5554722",
"0.5509322",
"0.54796505",
"0.5368993",
"0.5352729",
"0.53517926",
"0.53430337",
"0.52464694",
"0.5230... | 0.57403433 | 7 |
Gets the simpleWhere value for this SelectRequest. | public java.lang.Object[] getSimpleWhere() {
return simpleWhere;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Nullable\n public TupleExpr getWhereExpr() {\n return this.whereExpr;\n }",
"public String getWhereClause() {\n Object ref = whereClause_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n S... | [
"0.62949663",
"0.62818044",
"0.6276626",
"0.627138",
"0.62452155",
"0.61063737",
"0.60053957",
"0.59533066",
"0.5930028",
"0.59216446",
"0.5886617",
"0.57323897",
"0.5410701",
"0.53996366",
"0.52679527",
"0.5220208",
"0.50921494",
"0.50124407",
"0.5009428",
"0.49911234",
"0.4... | 0.69176024 | 0 |
Sets the simpleWhere value for this SelectRequest. | public void setSimpleWhere(java.lang.Object[] simpleWhere) {
this.simpleWhere = simpleWhere;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setWhere(String where) {\r\n\t\tthis._where = where;\r\n\t}",
"public StatementBuilder setWhere(SqlPart where) {\n this.where = where;\n return this;\n }",
"public java.lang.Object[] getSimpleWhere() {\n return simpleWhere;\n }",
"public void setWhere(ZExpression whereE... | [
"0.6399303",
"0.6221861",
"0.6047995",
"0.59709114",
"0.5909986",
"0.57240057",
"0.5561547",
"0.5540428",
"0.5250479",
"0.52034557",
"0.51106155",
"0.5110277",
"0.51099235",
"0.5103522",
"0.5049004",
"0.4993125",
"0.49905178",
"0.49671388",
"0.4964515",
"0.4932362",
"0.486341... | 0.76506555 | 0 |
Gets the whereExprs value for this SelectRequest. | public com.triniforce.pk.soap.WhereExpr[] getWhereExprs() {
return whereExprs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setWhereExprs(com.triniforce.pk.soap.WhereExpr[] whereExprs) {\n this.whereExprs = whereExprs;\n }",
"@Nullable\n public TupleExpr getWhereExpr() {\n return this.whereExpr;\n }",
"com.google.protobuf.ByteString\n getWhereClauseBytes();",
"public Set<StatementPattern>... | [
"0.6404175",
"0.63208956",
"0.5753202",
"0.5728511",
"0.56635994",
"0.53289425",
"0.52051383",
"0.5157324",
"0.5116274",
"0.5092699",
"0.50748163",
"0.50168574",
"0.49489537",
"0.48539716",
"0.47914478",
"0.47908407",
"0.47805208",
"0.47557366",
"0.4666728",
"0.45102695",
"0.... | 0.7484844 | 0 |
Sets the whereExprs value for this SelectRequest. | public void setWhereExprs(com.triniforce.pk.soap.WhereExpr[] whereExprs) {
this.whereExprs = whereExprs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public com.triniforce.pk.soap.WhereExpr[] getWhereExprs() {\n return whereExprs;\n }",
"public void setRestrictingColumns(List<String> whereNames) {\r\n\t\tMap<String, Operator> columns = new HashMap<String, Operator>();\r\n\t\tfor (String columnName : whereNames) {\r\n\t\t columns.put(columnName, O... | [
"0.6083958",
"0.5591452",
"0.54249275",
"0.5144453",
"0.4903929",
"0.49022138",
"0.49008566",
"0.47458303",
"0.4723416",
"0.46947178",
"0.46911013",
"0.46255404",
"0.4624224",
"0.46109152",
"0.45973352",
"0.4560602",
"0.45111895",
"0.45006263",
"0.44337237",
"0.4412241",
"0.4... | 0.7897425 | 0 |
Gets the orderBy value for this SelectRequest. | public java.lang.Object[] getOrderBy() {
return orderBy;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getOrderBy() {\n\t\treturn orderBy;\n\t}",
"public String getOrderByClause() {\r\n return orderByClause;\r\n }",
"public String getOrderByClause() {\r\n return orderByClause;\r\n }",
"public String getOrderByClause() {\r\n return orderByClause;\r\n }",
"public St... | [
"0.7364094",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"0.6930342",
"... | 0.0 | -1 |
Sets the orderBy value for this SelectRequest. | public void setOrderBy(java.lang.Object[] orderBy) {
this.orderBy = orderBy;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setOrderBy(DriveRequest<?> request, String orderBy);",
"public final native void setOrderBy(String orderBy) /*-{\n this.setOrderBy(orderBy);\n }-*/;",
"public void setOrderBy(String orderBy) {\n\t\tthis.orderBy = orderBy;\n\t}",
"public void setOrderBy(boolean value) {\n this.orderBy = value;... | [
"0.7412608",
"0.70505905",
"0.6921921",
"0.67287856",
"0.64942354",
"0.63239306",
"0.6308995",
"0.6269867",
"0.6052273",
"0.59352493",
"0.58686054",
"0.57943785",
"0.57943785",
"0.57943785",
"0.57943785",
"0.57943785",
"0.57943785",
"0.57943785",
"0.57943785",
"0.57943785",
"... | 0.6950143 | 2 |
Return type metadata object | public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MetadataType getType();",
"public MetadataType getType() {\n return type;\n }",
"public MilanoTypeMetadata.TypeMetadata getMetadata()\n {\n if (typeMetadata == null) {\n return null;\n }\n\n return typeMetadata;\n }",
"private Metadata getMetadata(RubyModule type)... | [
"0.7969707",
"0.7373198",
"0.7358018",
"0.7090138",
"0.67353225",
"0.67259765",
"0.66725683",
"0.65644145",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",
"0.6543223",... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onNothingSelected(AdapterView<?> arg0) {
} | {
"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 |
Reads tessdata/configs/tess_configvars and setVariable on Tesseract engine. This only works for | void controlParameters(Tesseract instance) throws Exception {
File configvarsFilePath = new File(datapath, CONFIG_PATH + CONFIGVARS_FILE);
if (!configvarsFilePath.exists()) {
return;
}
String str = Utils.readTextFile(configvarsFilePath);
for (String line : str.split("\n")) {
if (!line.trim().startsWith("#")) {
try {
String[] keyValuePair = line.trim().split("\\s+");
instance.setVariable(keyValuePair[0], keyValuePair[1]);
} catch (Exception e) {
//ignore and continue on
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initConfigVar() {\n\t\tConfigUtils configUtils = new ConfigUtils();\n\t\tmenuColor = configUtils.readConfig(\"MENU_COLOR\");\n\t\taboutTitle = configUtils.readConfig(\"ABOUT_TITLE\");\n\t\taboutHeader = configUtils.readConfig(\"ABOUT_HEADER\");\n\t\taboutDetails = configUtils.readConfig(\"ABOUT_DETAIL... | [
"0.59215206",
"0.56402177",
"0.55526894",
"0.55234617",
"0.53561205",
"0.5344217",
"0.53224695",
"0.5315581",
"0.53012335",
"0.5273696",
"0.513429",
"0.5129285",
"0.5109849",
"0.5098359",
"0.5016443",
"0.49895725",
"0.49890688",
"0.49850655",
"0.49831814",
"0.49759543",
"0.49... | 0.6916301 | 0 |
Processes OCR for input file with specified output format. | @Override
public void processPages(File imageFile, File outputFile) throws Exception {
instance.setDatapath(datapath);
instance.setLanguage(language);
instance.setPageSegMode(Integer.parseInt(pageSegMode));
instance.setOcrEngineMode(Integer.parseInt(ocrEngineMode));
List<RenderedFormat> renderedFormats = new ArrayList<RenderedFormat>();
for (String format : outputFormats.toUpperCase().split(",")) {
renderedFormats.add(RenderedFormat.valueOf(format));
}
instance.createDocuments(imageFile.getPath(), outputFile.getPath(), renderedFormats);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void convert(File inputFile, File outputFile) throws IOException {\n\n setType(inputFile);\n\n BufferedReader reader = null;\n PrintWriter writer = null;\n\n try {\n reader = new BufferedReader(new FileReader(inputFile));\n writer = new PrintWriter(new Buffe... | [
"0.61344343",
"0.5934901",
"0.5683847",
"0.53564155",
"0.53081125",
"0.529444",
"0.52869546",
"0.5236896",
"0.52124226",
"0.5212127",
"0.51913244",
"0.517049",
"0.5169254",
"0.5135136",
"0.51227266",
"0.51107055",
"0.5036262",
"0.50239396",
"0.5009486",
"0.4989901",
"0.497946... | 0.58155614 | 2 |
Returns the name of this attribute | public String getName()
{
return name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic String getName() {\n\t\treturn (String) attributes.get(\"name\");\n\t}",
"public String getName()\n {\n return (String)getAttributeInternal(NAME);\n }",
"public final String getNameAttribute() {\n return getAttributeValue(\"name\");\n }",
"public String getAttrName() {\n ... | [
"0.81073004",
"0.8019885",
"0.7703932",
"0.762615",
"0.7574586",
"0.7559642",
"0.7492779",
"0.74495465",
"0.736478",
"0.73490095",
"0.73406845",
"0.73406845",
"0.73406845",
"0.73378426",
"0.7315855",
"0.72921234",
"0.72738004",
"0.7270296",
"0.7269113",
"0.72553384",
"0.72527... | 0.0 | -1 |
Returns the type of this attribute | public DataBufferType getType()
{
return type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final String getTypeAttribute() {\n return getAttributeValue(\"type\");\n }",
"public Class getAttributeType();",
"public short getAttributeType() {\n return attributeType;\n }",
"final DynamoDBAttributeType attributeType() {\n return this.attributeType;\n }",
"public S... | [
"0.8109744",
"0.7976843",
"0.7937906",
"0.76789045",
"0.7614902",
"0.7533536",
"0.7385146",
"0.73315495",
"0.7242653",
"0.7231791",
"0.72178227",
"0.72178227",
"0.72178227",
"0.72178227",
"0.72178227",
"0.72178227",
"0.72178227",
"0.72178227",
"0.72153246",
"0.72022295",
"0.7... | 0.0 | -1 |
Returns the size (number of components) of the attribute | public int getSize()
{
return size;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getSize() {\n\t\tif (type == Attribute.Type.Int) {\r\n\t\t\treturn INT_SIZE;\r\n\t\t} else if (type == Attribute.Type.Char) {\r\n\t\t\treturn CHAR_SIZE * length;\r\n\t\t} else if (type == Attribute.Type.Long) {\r\n\t\t\treturn LONG_SIZE;\r\n\t\t} else if (type == Attribute.Type.Float) {\r\n\t\t\treturn ... | [
"0.81920207",
"0.81518555",
"0.7637871",
"0.7574035",
"0.7516092",
"0.74391544",
"0.7428219",
"0.73970795",
"0.7392708",
"0.7377601",
"0.7234118",
"0.7234118",
"0.7185508",
"0.71565515",
"0.7144108",
"0.7140663",
"0.71120286",
"0.70552295",
"0.7048082",
"0.7015179",
"0.701009... | 0.0 | -1 |
Initialize and destroy video hardware emulation | static int videoram_alloc(int size)
{
/* create video ram */
if ( (omegaf_bg0_videoram = new UBytePtr(size)) == null )
{
return 1;
}
memset( omegaf_bg0_videoram, 0x00, size );
if ( (omegaf_bg1_videoram = new UBytePtr(size)) == null )
{
omegaf_bg0_videoram = null;
return 1;
}
memset( omegaf_bg1_videoram, 0x00, size );
if ( (omegaf_bg2_videoram = new UBytePtr(size)) == null )
{
omegaf_bg0_videoram = null;
omegaf_bg1_videoram = null;
return 1;
}
memset( omegaf_bg2_videoram, 0x00, size );
if ( (bitmap_sp =
bitmap_alloc (Machine . drv . screen_width, Machine . drv . screen_height
) ) == null )
{
omegaf_bg0_videoram = null;
omegaf_bg1_videoram = null;
omegaf_bg2_videoram = null;
return 1;
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void disabledInit()\n {\n //cam.stopCapture();\n m_USBVCommand.start();\n }",
"public void reloadVideoDevices();",
"private void initHardware(){\n }",
"@Override\n public void releaseVideoFrames() {\n\n }",
"private void setUpMediaPlayer(){\n //Ini... | [
"0.6203794",
"0.60995716",
"0.60984284",
"0.6059363",
"0.5945065",
"0.5911659",
"0.58553606",
"0.5855103",
"0.5827889",
"0.58149326",
"0.580211",
"0.5757563",
"0.5745378",
"0.5699935",
"0.56715596",
"0.56641275",
"0.56514436",
"0.5630791",
"0.56302553",
"0.5626891",
"0.562688... | 0.0 | -1 |
/TODO logerror( "sprite overdraw flag : %02x\n", data ); | public void handler(int offset, int data)
{
if (sprite_overdraw_enabled != (data & 1))
{
sprite_overdraw_enabled = data & 1;
fillbitmap(bitmap_sp, 15, Machine . visible_area);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void drawSprite(int var1, int var2, int var3) {\n if(this.field_742[var3]) {\n var1 += this.field_738[var3];\n var2 += this.field_739[var3];\n }\n\n int var4 = var1 + var2 * this.field_723;\n int var5 = 0;\n int var6 = this.field_737[var3];\n int var7 = this.fie... | [
"0.6356331",
"0.6308166",
"0.5992258",
"0.58745944",
"0.58410466",
"0.58163065",
"0.5783251",
"0.5750851",
"0.57252187",
"0.57249504",
"0.5719276",
"0.5705342",
"0.5693917",
"0.5689733",
"0.56837183",
"0.56719524",
"0.5644075",
"0.56177765",
"0.56171066",
"0.5590515",
"0.5545... | 0.7242303 | 0 |
sizeOfRepo.setText(""); forksSize.setText(""); languageName.setText(""); sortFilter.setSelection(0); orderBy.setSelection(0); | private void clearAllFilter() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@FXML\n private void updateNameOrder(ActionEvent event) {\n\n if (sortOrder == Order.NAME_ASC) {\n\n sortOrder = Order.NAME_DESC;\n\n } else if (sortOrder == Order.NAME_DESC) {\n\n sortOrder = Order.DEFAULT;\n\n } else {\n\n sortOrder = Order.NAME_ASC;\n\n }\n\n updateOrderButtons();... | [
"0.5742832",
"0.5692827",
"0.5685681",
"0.5657578",
"0.562198",
"0.5619692",
"0.5590452",
"0.5514448",
"0.54730755",
"0.5448261",
"0.5416141",
"0.5346851",
"0.5336955",
"0.53334916",
"0.5325667",
"0.53073555",
"0.5285969",
"0.5263181",
"0.52623624",
"0.52603143",
"0.52381754"... | 0.0 | -1 |
If empty list, return empty list | public static List<DFSTreeNode> sortDFS(final List<DFSTreeNode> nodes) {
if(nodes == null || nodes.size() <= 0)
return new ArrayList<>();
List<DFSTreeNode> sorted = new ArrayList<>(nodes);
List<DFSTreeNode> visited = new ArrayList<>();
Stack<DFSTreeNode> parents = new Stack<>();
// Find the root node and push it in parents
sorted.sort(new Comparator<DFSTreeNode>(){
@Override
public int compare(DFSTreeNode o1, DFSTreeNode o2) {
return o1.compareTo(o2);
}
});
DFSTreeNode root = sorted.get(0);
parents.push(root);
while(!parents.isEmpty()) {
DFSTreeNode currNode = parents.pop();
if(!visited.contains(currNode)) visited.add(currNode);
// Find all children
List<DFSTreeNode> children = sorted.stream().filter(n -> n.isChildOf(currNode))
.collect(Collectors.toList());
for(DFSTreeNode child : children){
// If child was already visited, skip it
if(visited.contains(child)) continue;
// If not visited, push it to parents stack together with currNode
parents.push(currNode);
parents.push(child);
// Break as we don't want to visit any siblings until we've completed the current line of descendants
break;
}
}
return visited;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static <T> List<T> getOrEmptyList(List<T> list) {\n return list == null ? Collections.emptyList() : list;\n }",
"List<Wine> emptyMethodReturnList(){\n return List.of();\n }",
"public boolean supportsEmptyInList() {\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean isEmpty() {\n\t\t... | [
"0.72862095",
"0.69713235",
"0.6597742",
"0.65709186",
"0.65709186",
"0.65489787",
"0.6539637",
"0.6530885",
"0.65197635",
"0.65025896",
"0.6448875",
"0.64198804",
"0.63932675",
"0.63653183",
"0.6309785",
"0.6203831",
"0.6202681",
"0.6202055",
"0.61948854",
"0.61825883",
"0.6... | 0.0 | -1 |
If empty list, return empty list | public static String printDFS(final List<DFSTreeNode> nodes) {
if(nodes == null || nodes.size() <= 0)
return "";
String print = "";
List<DFSTreeNode> sorted = new ArrayList<>(nodes);
List<DFSTreeNode> visited = new ArrayList<>();
Stack<DFSTreeNode> parents = new Stack<>();
// Find the root node and push it in parents
sorted.sort(new Comparator<DFSTreeNode>(){
@Override
public int compare(DFSTreeNode o1, DFSTreeNode o2) {
return o1.compareTo(o2);
}
});
DFSTreeNode root = sorted.get(0);
parents.push(root);
while(!parents.isEmpty()) {
DFSTreeNode currNode = parents.pop();
if(!visited.contains(currNode)) {
visited.add(currNode);
print += currNode.printStart(nodes,visited);
print += currNode.printBeforeChildren(nodes,visited);
}
// Find all children
List<DFSTreeNode> children = sorted.stream().filter(n -> n.isChildOf(currNode))
.collect(Collectors.toList());
// To indicate if we have already visited all children of the current node
boolean noMoreChildren = true;
for(DFSTreeNode child : children){
// If child was already visited, skip it
if(visited.contains(child)) continue;
// If not visited, push it to parents stack together with currNode
parents.push(currNode);
parents.push(child);
// Set noMoreChildren to false if we are going deeper
noMoreChildren = false;
// Break as we don't want to visit any siblings until we've completed the current line of descendants
break;
}
// If no more children for the current node, close the node
if(noMoreChildren) {
print += currNode.printAfterChildren(nodes,visited);
print += currNode.printEnd(nodes,visited);
}
}
return print;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static <T> List<T> getOrEmptyList(List<T> list) {\n return list == null ? Collections.emptyList() : list;\n }",
"List<Wine> emptyMethodReturnList(){\n return List.of();\n }",
"public boolean supportsEmptyInList() {\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean isEmpty() {\n\t\t... | [
"0.72862095",
"0.69713235",
"0.6597742",
"0.65709186",
"0.65709186",
"0.65489787",
"0.6539637",
"0.6530885",
"0.65197635",
"0.65025896",
"0.6448875",
"0.64198804",
"0.63932675",
"0.63653183",
"0.6309785",
"0.6203831",
"0.6202681",
"0.6202055",
"0.61948854",
"0.61825883",
"0.6... | 0.0 | -1 |
se declara la funcion que sera carga en el objeto | public boolean reducir_log(){
//se carga la consulta a una varible tipo string
String query = "exec sp_reducir_log_de_transacciones";
//variable distancia a la clase connection
Connection con = new Connexion().conexion();
//se declara la variable que prepara el query primero nula
PreparedStatement pstmt = null;
//intenta o carga el error
try {
//se inicializa ala transaccion en falto hasta el commit
con.setAutoCommit(false);
//prepara la coneccion con el query
pstmt = con.prepareStatement(query);
//ejecuta el query
pstmt.execute();
//si se ejecuta la transaccion la marcara como verdadero
con.commit();
//cacha el error
} catch (Exception e) {
System.out.println("SQLException: " + e.getMessage());
if (con != null){
try {
System.out.println("La transacción ha sido abortada");
con.rollback();
} catch(SQLException ex) {
System.out.println(ex.getMessage());
}
}
return false;
}finally{
try {
pstmt.close();
con.close();
} catch(SQLException e){
e.printStackTrace();
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void adicionar(Funcionario funcionario) {\n\n }",
"Funcionario(){\n }",
"@Override\n public void eventoCargarData() {\n }",
"public void datos_elegidos(){\n\n\n }",
"private void limpiarDatos() {\n\t\t\n\t}",
"@Override\n public void alRechazarOperac... | [
"0.6825642",
"0.638213",
"0.61847377",
"0.6139372",
"0.60404027",
"0.59406227",
"0.5934401",
"0.59320194",
"0.5921147",
"0.59056526",
"0.5859674",
"0.58479476",
"0.58067274",
"0.57940954",
"0.57940954",
"0.57750237",
"0.57718086",
"0.57661366",
"0.57319456",
"0.57304084",
"0.... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
int MAX = 20;
int MIN = 1;
Scanner number = new Scanner(System.in);
System.out.println("Guess a number between 1 and 20 ");
int input = number.nextInt();
int random = MIN + (int)(Math.random() * MAX);
if(input == random)
System.out.println("You were correct! The number was :" + random);
else
System.out.println("You were incorrect! The number was :" + random);
if(input >= 21 )
System.out.println("The range is 1 to 20. Please try again.");
} | {
"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 |
Creates a log entry with the specified speed, occurring right now. | public SpeedLogEntry(double aSpeed, int aLogGroup){
this(new Date(System.currentTimeMillis()), aSpeed, aLogGroup);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SpeedLogEntry(Date aTime, double aSpeed, int aLogGroup){\n\t\tmTime = aTime;\n\t\tmSpeed = aSpeed;\n mLogGroup = aLogGroup;\n\t}",
"public SpeedLogEntry(int aLogGroup, String aSpeed, String aTime) throws ParseException{\n mLogGroup = aLogGroup;\n mTime = sDateTimeFormat.parse(aTime);\... | [
"0.70332134",
"0.6275528",
"0.59378904",
"0.5631601",
"0.56180847",
"0.55600744",
"0.5548967",
"0.5516228",
"0.5450629",
"0.5450629",
"0.5427137",
"0.5418116",
"0.5418116",
"0.5367411",
"0.5349027",
"0.5304396",
"0.5284133",
"0.52696687",
"0.5225165",
"0.5212318",
"0.51672703... | 0.7396709 | 0 |
Creates a log entry with the specified speed, occurring at the specified time. | public SpeedLogEntry(Date aTime, double aSpeed, int aLogGroup){
mTime = aTime;
mSpeed = aSpeed;
mLogGroup = aLogGroup;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SpeedLogEntry(double aSpeed, int aLogGroup){\n\t\tthis(new Date(System.currentTimeMillis()), aSpeed, aLogGroup);\n\t}",
"public SpeedLogEntry(int aLogGroup, String aSpeed, String aTime) throws ParseException{\n mLogGroup = aLogGroup;\n mTime = sDateTimeFormat.parse(aTime);\n\t\tmSpeed = Doub... | [
"0.7215894",
"0.6569393",
"0.55466586",
"0.5444255",
"0.5362571",
"0.53495485",
"0.5346705",
"0.5312591",
"0.5291551",
"0.5278628",
"0.5238787",
"0.5194949",
"0.5188068",
"0.5185831",
"0.5185082",
"0.51589316",
"0.5154745",
"0.5115453",
"0.511021",
"0.5107021",
"0.5061637",
... | 0.7327 | 0 |
Creates a log entry from a stringformatted time value. | public SpeedLogEntry(int aLogGroup, String aSpeed, String aTime) throws ParseException{
mLogGroup = aLogGroup;
mTime = sDateTimeFormat.parse(aTime);
mSpeed = Double.parseDouble(aSpeed);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public TimeField(String time_field) {\n\t\tsuper('t', time_field);\n\t}",
"public void log(String message){\n Date date = new Date();\n String pattern = \"hh:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n String dateText = simpleDateFormat.format(date)... | [
"0.5685039",
"0.5646429",
"0.5645224",
"0.5638178",
"0.5616681",
"0.55912024",
"0.55892766",
"0.5577998",
"0.55490524",
"0.54824716",
"0.5449453",
"0.54211164",
"0.5408977",
"0.5351359",
"0.53079313",
"0.52737033",
"0.52709866",
"0.5253235",
"0.5233511",
"0.5189173",
"0.51842... | 0.49739915 | 37 |
Returns the time this object is storing as a Date object. | public Date getTime() {
return mTime;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long getTime() {\n\t\treturn date.getTime();\n }",
"public long getTime() {\n return instance.getTime();\n }",
"public long getTime() {\n return instance.getTime();\n }",
"public long getTime() {\n return instance.getTime();\n }",
"publi... | [
"0.7798983",
"0.7628993",
"0.7628993",
"0.7628993",
"0.7625685",
"0.7625685",
"0.7625685",
"0.7625685",
"0.7612477",
"0.7389533",
"0.7380508",
"0.7378403",
"0.7366949",
"0.73590195",
"0.73493755",
"0.7324926",
"0.73197645",
"0.7304881",
"0.7304881",
"0.7304881",
"0.7300955",
... | 0.71459866 | 37 |
Get the time when the speed detection occurred. | public String getNiceTime(){
return sTimeFormat.format(mTime);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic long getTime() {\n\t\treturn System.nanoTime() - startTime;\n\t}",
"public Double getTime() {\n\t\treturn new Double((double) length * 36) / ((((double) speed) * 100));\n\t}",
"public double readClock()\n {\n return (System.currentTimeMillis() - startingTime) / 1000.0;\n }",
... | [
"0.7157757",
"0.70754695",
"0.69533426",
"0.6930539",
"0.6874135",
"0.683142",
"0.6819381",
"0.6813004",
"0.6778073",
"0.67618",
"0.6758292",
"0.67562664",
"0.67562664",
"0.6742844",
"0.67397225",
"0.67080534",
"0.6705245",
"0.6679228",
"0.66676426",
"0.6656578",
"0.66520816"... | 0.0 | -1 |
Get the date when the speed detection occurred. | public String getNiceDate(){
return sDateFormat.format(mTime);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Timestamp getMovementDate() {\n\t\treturn (Timestamp) get_Value(\"MovementDate\");\n\t}",
"public String getPerformanceDate()\r\n {\r\n return performanceDate;\r\n }",
"public Timestamp getMovementDate();",
"public String getDate() {\n\t\treturn logInfoSplit[0] + \"_\" + logInfoSplit[1];\... | [
"0.63673204",
"0.63439214",
"0.6338884",
"0.61518687",
"0.6082798",
"0.6061388",
"0.60596013",
"0.6050912",
"0.5990148",
"0.59841186",
"0.59742945",
"0.5964251",
"0.5958529",
"0.59475344",
"0.59475344",
"0.5925871",
"0.59240067",
"0.5907772",
"0.5887375",
"0.58871394",
"0.587... | 0.0 | -1 |
Gets the speed, formatted in the locally specified units. | public String getNiceSpeed(){
return UnitManager.getInstance().getDisplaySpeed(mSpeed);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String getCurrentSpeed() {\r\n\t\treturn currentSpeed;\r\n\t}",
"public String toStringSpeed(){\r\n String strout = \"\";\r\n strout = String.format(\"%.2f\", this.getSpeed());\r\n return strout;\r\n }",
"public static String formatSpeed(float value, String unit)\n\t{\n\n\... | [
"0.67635506",
"0.67230535",
"0.6701401",
"0.6549022",
"0.65428585",
"0.6495717",
"0.6495717",
"0.6495717",
"0.6475791",
"0.64729434",
"0.6446696",
"0.63929874",
"0.63812536",
"0.6380558",
"0.63565403",
"0.6344259",
"0.63313174",
"0.63307524",
"0.6324684",
"0.6324684",
"0.6316... | 0.6595901 | 3 |
Set the group that this entry belongs to. | public void setLogGroup(int aNewGroup) {
mLogGroup = aNewGroup;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setGroup(final Group group) {\n this.group = group;\n }",
"public void setGroup(entity.Group value);",
"public void setGroup(String group) throws InvalidIDException {\r\n\t\tif (group == null) { return; }\r\n\r\n\t\tif (Arrays.binarySearch(Projects.GROUPS, group) < 0) {\r\n\t\t\tthrow new... | [
"0.7867586",
"0.7539814",
"0.7297568",
"0.72883266",
"0.72511184",
"0.686862",
"0.68204117",
"0.68151",
"0.6600316",
"0.65725124",
"0.65275055",
"0.6524514",
"0.64898705",
"0.64898705",
"0.6454269",
"0.6452192",
"0.6407365",
"0.64071596",
"0.6396293",
"0.6396293",
"0.6371195"... | 0.6277281 | 25 |
TODO Autogenerated method stub | @Override
public void mouseReleased(MouseEvent e) {
} | {
"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 mousePressed(MouseEvent e) {
} | {
"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 mouseExited(MouseEvent e) {
} | {
"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 mouseEntered(MouseEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Test for get enum value. | public void testGetEnumValue() {
TestEnum result = ReflectionUtils.getEnumValue(TestEnum.class, "VALUE1");
assertSame(TestEnum.VALUE1, result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testGetEnumValue_differentCase() {\r\n\r\n TestEnum result = ReflectionUtils.getEnumValue(TestEnum.class, \"Value1\");\r\n assertSame(TestEnum.VALUE1, result);\r\n }",
"com.yahoo.xpathproto.TransformTestProtos.MessageEnum getEnumValue();",
"boolean hasEnumValue();",
"gov.nih.nlm.... | [
"0.72541714",
"0.724706",
"0.6952806",
"0.67587477",
"0.66245085",
"0.65291405",
"0.64599687",
"0.6433935",
"0.6422011",
"0.6140604",
"0.61290866",
"0.6084892",
"0.6084892",
"0.6084892",
"0.603327",
"0.6032373",
"0.6021741",
"0.60138077",
"0.6009311",
"0.59397036",
"0.5927227... | 0.75992906 | 0 |
Test for get enum value with different case. | public void testGetEnumValue_differentCase() {
TestEnum result = ReflectionUtils.getEnumValue(TestEnum.class, "Value1");
assertSame(TestEnum.VALUE1, result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testGetEnumValue() {\r\n\r\n TestEnum result = ReflectionUtils.getEnumValue(TestEnum.class, \"VALUE1\");\r\n assertSame(TestEnum.VALUE1, result);\r\n }",
"com.yahoo.xpathproto.TransformTestProtos.MessageEnum getEnumValue();",
"@org.junit.jupiter.api.Test\n public void testEnums(... | [
"0.7451464",
"0.7114525",
"0.65587574",
"0.64878726",
"0.6485703",
"0.64822227",
"0.646988",
"0.6289444",
"0.6155494",
"0.61137444",
"0.60839564",
"0.598094",
"0.5968611",
"0.5968611",
"0.5968611",
"0.5946828",
"0.5939988",
"0.593407",
"0.5910765",
"0.58877486",
"0.58872217",... | 0.80057687 | 0 |
Test for get enum value, but an unknown value name. Should fail with a runtime exception. | public void testGetEnumValue_unexisting() {
try {
ReflectionUtils.getEnumValue(TestEnum.class, "xxxxxxxxx");
fail("Expected UnitilsException");
} catch (UnitilsException e) {
//expected
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testInvalidEnum () {\n\t\tString example = \"uSer_ExiT\";\n\t\ttry {\n\t\t AppInterfaceUnregisteredReason temp = AppInterfaceUnregisteredReason.valueForString(example);\n assertNull(\"Result of valueForString should be null.\", temp);\n\t\t}\n\t\tcatch (IllegalArgumentException exception)... | [
"0.72820306",
"0.7135941",
"0.7088062",
"0.7077566",
"0.70649356",
"0.6984104",
"0.67693",
"0.6573543",
"0.6513561",
"0.64944065",
"0.6386292",
"0.63675445",
"0.6348812",
"0.6318282",
"0.6209869",
"0.619328",
"0.6177452",
"0.6132895",
"0.61002314",
"0.6076395",
"0.60494214",
... | 0.7833038 | 0 |
Exception to be thrown when more than one game board is added | public OnlyOneFieldException() {
this.message = ONLY_ONE_FIELD_ALLOWED_MESSAGE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setDefaultBoard() throws TooManyPlayersException, InvalidColourException{\r\n\t\tif(getPlayers().size() != 2) {\r\n\t\t\tthrow new TooManyPlayersException(\"There are too many players, must only be 2\");\r\n\t\t}else {\r\n\t\t\tArrayList<Coordinate> pawnRankCoords, backRankCoords; //indexes for row nu... | [
"0.63969433",
"0.6351615",
"0.6249925",
"0.60705084",
"0.60326886",
"0.6030343",
"0.6005647",
"0.5875452",
"0.5864455",
"0.58563817",
"0.5843571",
"0.58129585",
"0.5807776",
"0.5766618",
"0.5751349",
"0.5749685",
"0.57495105",
"0.5742929",
"0.57415795",
"0.5737873",
"0.573540... | 0.0 | -1 |
Updates this user's password and salt | public void updatePassword(String password)
{
try
{
Random rand = new Random();
byte[] salt = new byte[16];
rand.nextBytes(salt);
MessageDigest digest = MessageDigest.getInstance("SHA-256");
digest.reset();
digest.update(salt);
byte[] out = digest.digest(password.getBytes());
this.salt = Base64.getEncoder().encodeToString(salt);
this.password = Base64.getEncoder().encodeToString(out);
}
catch (NoSuchAlgorithmException e)
{
throw new RuntimeException(e.getMessage(), e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void updateUserPassword(User user);",
"public void update() {\n user.setNewPassword(newPassword.getText().toString());\n user.setPassword(password.getText().toString());\n reauthenticate();\n }",
"public void updatePassword(String account, String password);",
"@Override\n\tpublic void... | [
"0.7325778",
"0.7251538",
"0.68743783",
"0.6754113",
"0.6634095",
"0.66019803",
"0.65945506",
"0.6526694",
"0.65266377",
"0.64909786",
"0.64680487",
"0.6433078",
"0.64162815",
"0.6375902",
"0.6330312",
"0.6329442",
"0.63146377",
"0.6313076",
"0.62703305",
"0.62587625",
"0.625... | 0.66319895 | 5 |
Check this user's password against a password | public static boolean check(User user, String password)
{
try
{
MessageDigest digest = MessageDigest.getInstance("SHA-256");
digest.reset();
digest.update(Base64.getDecoder().decode(user.salt));
byte[] out = digest.digest(password.getBytes());
byte[] check = Base64.getDecoder().decode(user.password);
if (out.length != check.length)
return false;
for (int i = 0; i < out.length; i++)
{
if (out[i] != check[i])
return false;
}
return true;
}
catch (NoSuchAlgorithmException e)
{
throw new RuntimeException(e.getMessage(), e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isMatchPassword(Password toCheck) throws NoUserSelectedException;",
"Boolean isValidUserPassword(String username, String password);",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"... | [
"0.79319435",
"0.78988063",
"0.77903944",
"0.77903944",
"0.77903944",
"0.77903944",
"0.77903944",
"0.77903944",
"0.77903944",
"0.77903944",
"0.7737662",
"0.7725534",
"0.7704576",
"0.7643214",
"0.76420367",
"0.7607474",
"0.75519913",
"0.74882466",
"0.7465502",
"0.74643123",
"0... | 0.71640694 | 36 |
To convert timestamp to Date | private String getDate(long timeStamp) {
try {
DateFormat sdf = new SimpleDateFormat("MMM d, yyyy", getResources().getConfiguration().locale);
Date netDate = (new Date(timeStamp * 1000));
return sdf.format(netDate);
} catch (Exception ex) {
return "xx";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static final Function<Timestamp,Date> timestampToDate() {\r\n return TIMESTAMP_TO_DATE;\r\n }",
"public static Date formaterStampTilDato(Timestamp timestamp) {\r\n\t\tDate date = new Date(timestamp.getTime());\r\n\t\treturn date;\r\n\t}",
"Date getTimestamp();",
"public static java.sql.Date ... | [
"0.77724004",
"0.75050956",
"0.7030163",
"0.70019305",
"0.67344373",
"0.6391525",
"0.6389893",
"0.63533103",
"0.6343206",
"0.6333882",
"0.6320948",
"0.6249184",
"0.62292415",
"0.6180446",
"0.61442393",
"0.6110047",
"0.60702163",
"0.60702163",
"0.60702163",
"0.60702163",
"0.60... | 0.0 | -1 |
This method is called when the user selects the homepage from the topbar menu. | public void transitionToHome() throws RemoteException{
removeAll();
mainPanel = new MainPanel(contr);
add(mainPanel, "span 1");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void selectedHomeScreen(Activity context) {\n\n // Get tracker\n Tracker tracker = ((GlobalEntity) context.getApplicationContext())\n .getTracker(TrackerName.APP_TRACKER);\n if (tracker == null) {\n return;\n }\n\n // Build and send an Even... | [
"0.72670376",
"0.70472187",
"0.6964944",
"0.6957087",
"0.69516146",
"0.6842337",
"0.677178",
"0.67642313",
"0.6711705",
"0.6708148",
"0.67035717",
"0.65916795",
"0.6570936",
"0.65648466",
"0.6557101",
"0.65440834",
"0.6534462",
"0.65025336",
"0.64784086",
"0.6444974",
"0.6426... | 0.61193144 | 45 |
This method is called when the user selects the statisticspage from the topbar menu. | public void transitionToStatsPage() throws RemoteException{
removeAll();
statsPanel = new StatsPanel(contr);
add(statsPanel, "span 1");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void statisticButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statisticButtonActionPerformed\n // TODO add your handling code here:\n this.setVisible(false);\n this.parentNavigationController.getStatisticController();\n }",
"private void actionStatisticalD... | [
"0.65812546",
"0.647801",
"0.6033824",
"0.599097",
"0.5849758",
"0.57614696",
"0.5748922",
"0.57070374",
"0.5699291",
"0.56932974",
"0.56929684",
"0.5681428",
"0.5681428",
"0.5655401",
"0.5630897",
"0.56238526",
"0.5612904",
"0.5563171",
"0.5551862",
"0.55496955",
"0.55481327... | 0.65844446 | 0 |
This method is called when the user selects the newparticipantpage from the topbar menu. | public void transitionToNewParticipantPage(){
removeAll();
newParticipantPanel = new NewParticipantPanel(contr);
add(newParticipantPanel, "span 1");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onPageSelected(int position) {\n setAddButtonVisibility(getCurrentlyVisibleEditorTab().requestsAddButton());\n }",
"public void clickedPresentationNew() {\n\t\t\n\t}",
"public void newClubEvent() {\n \n // Capture current category selection, if a... | [
"0.6361457",
"0.6256702",
"0.62383133",
"0.6018739",
"0.59716547",
"0.5931145",
"0.5821382",
"0.57987565",
"0.57793665",
"0.56802684",
"0.56730956",
"0.56573725",
"0.561689",
"0.56018305",
"0.5599268",
"0.5586417",
"0.5562736",
"0.5554972",
"0.55531687",
"0.5549978",
"0.55387... | 0.6658046 | 0 |
Method to update the participantdata in the mainPanel. | public void updateParticipants(ArrayList<Participant> participants) throws RemoteException{
if(mainPanel != null)
mainPanel.updateParticipants(participants);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void update() {\n\t\t//Indicate that data is fetched\n\t\tactivity.showProgressBar();\n\t\n\t\tPlayer currentPlayer = dc.getCurrentPlayer();\n\t\tactivity.updatePlayerInformation(\n\t\t\t\tcurrentPlayer.getName(),\n\t\t\t\tgetGlobalRanking(),\n\t\t\t\tcurrentPlayer.getGlobalScore(),\n\t\t\t\tcurrentPlayer.g... | [
"0.65055585",
"0.618037",
"0.6126233",
"0.61047596",
"0.6090131",
"0.6056712",
"0.60451096",
"0.59546006",
"0.5923254",
"0.5918787",
"0.587455",
"0.58531076",
"0.58394045",
"0.58259237",
"0.5770079",
"0.5756129",
"0.5724428",
"0.57035035",
"0.5693625",
"0.5678766",
"0.5675068... | 0.5677044 | 20 |
Method to update the participantdata in the statisticsPanel. | public void updateStatistics(ArrayList<Participant> participants) throws RemoteException{
if(statsPanel != null)
statsPanel.updateStatistics(participants);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateStatisticsData() {\r\n\t\tif (this.statisticsTabItem != null && !this.statisticsTabItem.isDisposed()) {\r\n\t\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\t\tthis.statisticsTabItem.updateStatisticsData(true);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tGDE.... | [
"0.6561207",
"0.6447962",
"0.6374996",
"0.6267347",
"0.6157797",
"0.6105206",
"0.6098868",
"0.600252",
"0.6000429",
"0.5932739",
"0.5901623",
"0.58494395",
"0.58436143",
"0.58128816",
"0.5794704",
"0.57638836",
"0.57638836",
"0.5727785",
"0.57201433",
"0.57006794",
"0.5696798... | 0.6914243 | 0 |
Konstruktor koji postavlja vrednosti atributa za objekat tipa Desert | public Desert(String naziv, String opis, String putanjaDoSlike, double cena) {
this.naziv = naziv;
this.opis = opis;
this.putanjaDoSlike = putanjaDoSlike;
this.cena = cena;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DDetRetContrArtEscenicsAttTO() { }",
"public DDetRetContrArtEscenicsAttTO(java.lang.Integer ideFormato, java.lang.Byte numVersionFormato, java.lang.String numEvento, java.lang.String nomEspectaculo, java.lang.Integer codMunicipioEspectaculo, java.lang.Integer codDepartamentoEspectaculo, Integer fecRealiza... | [
"0.62421894",
"0.5395577",
"0.5367961",
"0.52547765",
"0.5135099",
"0.50890917",
"0.5062612",
"0.5023971",
"0.5020693",
"0.49996918",
"0.49935782",
"0.494981",
"0.4920331",
"0.49166968",
"0.49126557",
"0.49063912",
"0.4884776",
"0.48747885",
"0.48747647",
"0.48505104",
"0.484... | 0.5145693 | 4 |
Vraca naziv odrednjenog deserta | public String getNaziv() {
return naziv;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void dodavanjePutnickogVozila() {\n\t\tString vrstaVozila = \"Putnicko Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja100 = UtillMethod.u... | [
"0.73219806",
"0.7028159",
"0.6597003",
"0.6524973",
"0.6437976",
"0.6357885",
"0.6352738",
"0.6352616",
"0.6318152",
"0.6317693",
"0.6241279",
"0.62308544",
"0.62219244",
"0.6169167",
"0.6151087",
"0.61171806",
"0.61117667",
"0.6096979",
"0.60505104",
"0.60358864",
"0.602939... | 0.0 | -1 |
Postavlja naziv za desert | public void setNaziv(String naziv) {
this.naziv = naziv;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int updateByPrimaryKeySelective(Dress record);",
"@Override\n public boolean delete(Revue objet) {\n return false;\n }",
"@Override\n\tpublic void delete(Integer deptno) {\n\t\t\n\t}",
"public DataPair delete(DataPair key) {\n throw new NotImplementedException();\n }",
"void actualiz... | [
"0.57356864",
"0.5630151",
"0.5505008",
"0.54655415",
"0.54586846",
"0.5429982",
"0.5420822",
"0.53858584",
"0.5374731",
"0.5373063",
"0.53378916",
"0.5329405",
"0.53153896",
"0.52882624",
"0.52864605",
"0.5283568",
"0.5273783",
"0.5271615",
"0.5269672",
"0.52524054",
"0.5235... | 0.0 | -1 |
Vraca opis deserta koji predstavlja kolicinu | public String getOpis() {
return opis;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void dodavanjePutnickogVozila() {\n\t\tString vrstaVozila = \"Putnicko Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja100 = UtillMethod.u... | [
"0.6872903",
"0.679615",
"0.6592327",
"0.61989677",
"0.61955345",
"0.61380535",
"0.61300284",
"0.611729",
"0.61021227",
"0.61016613",
"0.6084863",
"0.6065418",
"0.6055785",
"0.60437346",
"0.60406584",
"0.6014635",
"0.6007759",
"0.6006687",
"0.6003712",
"0.5996086",
"0.5983705... | 0.0 | -1 |
Vraca putanju do slike deserta u vidu Stringa | public String getPutanjaDoSlike() {
return putanjaDoSlike;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String elaboraAvvisoScrittura() {\n String testo = VUOTA;\n\n if (usaHeadNonScrivere) {\n testo += TAG_NON_SCRIVERE;\n testo += A_CAPO;\n }// end of if cycle\n\n return testo;\n }",
"public Fund hentArtikel(String u) {\n\t\tp(\"hentArtikel(\"+u+\")\");... | [
"0.644365",
"0.6144058",
"0.5971704",
"0.592339",
"0.5921835",
"0.58538014",
"0.58384526",
"0.58021826",
"0.57861894",
"0.5782518",
"0.57506484",
"0.57441115",
"0.5701428",
"0.5685821",
"0.56526035",
"0.5646627",
"0.55882406",
"0.55558026",
"0.55518883",
"0.55318993",
"0.5521... | 0.0 | -1 |
Postavlja vrednost Stringa koji predstavlja putanju do slike | public void setPutanjaDoSlike(String putanjaDoSlike) {
this.putanjaDoSlike = putanjaDoSlike;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String replaceInString(String s) {\n\t\tString newS = s.replaceAll(\"[a-zA-Z]+\", \"WORT\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}",
"protected String getContentLikeString(String l) {\n\t\treturn \"%\"+l+\"%\";\n\t}",
"private String createLikeSQLValue(Strin... | [
"0.59038246",
"0.5550516",
"0.5540818",
"0.5443319",
"0.53721607",
"0.5324399",
"0.5320171",
"0.5311548",
"0.52892214",
"0.52630156",
"0.52539104",
"0.5247173",
"0.5241807",
"0.523087",
"0.5225358",
"0.5208197",
"0.5208107",
"0.5204948",
"0.5199707",
"0.51891416",
"0.51815236... | 0.5077222 | 34 |
Vraca cenu odredjenog deserta | public double getCena() {
return cena;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void dodavanjePutnickogVozila() {\n\t\tString vrstaVozila = \"Putnicko Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja100 = UtillMethod.u... | [
"0.6719339",
"0.6676708",
"0.6640288",
"0.6602198",
"0.65459424",
"0.65245813",
"0.6485908",
"0.6471678",
"0.6449387",
"0.6384523",
"0.63621217",
"0.63157445",
"0.62639034",
"0.6255062",
"0.6242362",
"0.6220658",
"0.6206996",
"0.6177625",
"0.61635023",
"0.61558557",
"0.614831... | 0.0 | -1 |
Postavlja vrednost za cenu deserta | public void setCena(double cena) {
this.cena = cena;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteArticle(DetailDevisClient selected)\n\t{\n\t\tlistedetaildevis.remove(selected);\n\t\t\n\t\tdevis=getDevisActuel();\n\t\tif(devis.getMtTotalVente()==null) devis.setMtTotalVente(BigDecimal.ZERO);\n\t\tdevis.setMtTotalVente(devis.getMtTotalVente().subtract(selected.getMtTotalPrixVente()));\n\t\tif(... | [
"0.6327831",
"0.62984824",
"0.6255235",
"0.6149276",
"0.61181116",
"0.608268",
"0.60733575",
"0.60618347",
"0.6039726",
"0.6035662",
"0.6034342",
"0.60092545",
"0.59814274",
"0.5976931",
"0.5975316",
"0.59510326",
"0.59244555",
"0.59242135",
"0.59237975",
"0.5922091",
"0.5894... | 0.0 | -1 |
Create an instance of SCSoundControl, using the default properties file. | public SCSoundControl(SCSoundControlNotifiable listener) {
//this defines the default properties filename:
this(listener, "depends/SCSoundControl.properties");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SCSoundControl(SCSoundControlNotifiable listener, String propertiesFilename) {\n\t\t_propertiesFilename = propertiesFilename;\n\t\tshowDebugOutput(false);\n\n\t\t//load properties from a file\n\t\tloadPropertiesFile(_propertiesFilename);\n\t\t\n\t\t//setup synth launcher so that scsynth properties are handl... | [
"0.64956725",
"0.5825633",
"0.57950217",
"0.54347944",
"0.5374127",
"0.53681314",
"0.53539604",
"0.5300594",
"0.52560335",
"0.5208657",
"0.51678985",
"0.51643234",
"0.51375544",
"0.51210856",
"0.5074436",
"0.5040226",
"0.49614394",
"0.49511692",
"0.4930641",
"0.49227828",
"0.... | 0.6867265 | 0 |
Create an instance of SCSoundControl | public SCSoundControl(SCSoundControlNotifiable listener, String propertiesFilename) {
_propertiesFilename = propertiesFilename;
showDebugOutput(false);
//load properties from a file
loadPropertiesFile(_propertiesFilename);
//setup synth launcher so that scsynth properties are handled and defaults are setup as needed.
_scsynthLauncher = new ScsynthLauncher(this, _props);
_maxPolyphony = _scsynthLauncher.getMaxPolyphony();
//TODO: use maxPolyphony to check before new soundNode creation...
_scsclogger = new SCSCConnectionLogger();
// find the minimum id of a private audio bus.
// if certain properties are unset, use the scsynth defaults
_inChannels = Integer.valueOf(_props.getProperty("SuperCollider_NumberOfInputChannels", "8"));
_outChannels = Integer.valueOf(_props.getProperty("SuperCollider_NumberOfOutputChannels", "8"));
_minAudioBus = _inChannels + _outChannels;
_minNodeID = 2; //We're following the scsynth convention of allocating 0 as the
//root node and 1 as the default group. The rest are up for grabs.
// initialize id data structures
_bufferMap = new ConcurrentHashMap<Integer, String>();
_busList = new Vector<Integer>();
_nodeIdList = new Vector<Integer>();
_soundNodes = new ConcurrentHashMap<Integer, SoundNode>();
//grab the scsynth udp port for the socket:
int udpport = Integer.valueOf(_props.getProperty("SuperCollider_UDPportNumber", "57110"));
// open the port for sending
try { _sender = new OSCPortOut(InetAddress.getLocalHost(), udpport); }
catch (Exception e) { e.printStackTrace();}
// begin by listening for messages:
try {
_receiver = new OSCPortIn(_sender.getSocket());
_receiver.addListener(".*", this); // receive all notify info
_receiver.startListening();
} catch (Exception e1) { e1.printStackTrace(); }
//state variables
_prevPingResponseTime = _prevPingRequestTime = new Date();
_notifyListener = listener;
_serverLive = false;
_serverBooted = false;
//create the GUI: the control panel
_controlPanel = new SCSoundControlPanel();
_controlPanel.setOpaque(true); //content panes must be opaque
//TODO: maybe we don't want to create a frame, but rather hand off the panel.
//setup a window to display the control panel
JFrame frame = new JFrame("SuperColliderSoundControl");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(_controlPanel);
frame.pack();
frame.setSize(400, 300);
frame.setVisible(true);
//start the server.
bootScsynth();
//start the thread that will ping scsynth
_serverPingThread = new Thread(this);
_serverPingThread.setPriority(Thread.MIN_PRIORITY);
_serverPingThread.start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SCSoundControl(SCSoundControlNotifiable listener) {\n\t\t//this defines the default properties filename:\n\t\tthis(listener, \"depends/SCSoundControl.properties\");\n\t}",
"private ACARSSoundingTools() {\n\n }",
"SourceControl create();",
"public Sounds() {\n this.setDefaultCloseOperation(JF... | [
"0.5972854",
"0.571319",
"0.5635405",
"0.5630918",
"0.5584099",
"0.5455055",
"0.54371285",
"0.5431195",
"0.5329916",
"0.5312786",
"0.52479905",
"0.5238917",
"0.5203186",
"0.5173972",
"0.5170468",
"0.5124355",
"0.5097137",
"0.5083585",
"0.5083585",
"0.50770134",
"0.5071397",
... | 0.578427 | 1 |
Load properties from a file. | private void loadPropertiesFile(String propertiesFile) {
//open the properties file.
_props = new Properties();
//sanity check the properties file
File f = new File(propertiesFile);
if (!f.canRead()) {
//print an error - can't read the props file.
System.err.println("Properties file " + propertiesFile + " cannot be read.");
}
try {
_props.load(new FileInputStream(f));
} catch (Exception e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadPropertyFile(String filename) {\n try (InputStream is = new FileInputStream(filename)) {\n properties.load(is);\n } catch (IOException x) {\n throw new IllegalArgumentException(x);\n }\n }",
"private static void loadPropertiesFile() {\n checkNo... | [
"0.77755815",
"0.7709816",
"0.7692632",
"0.75138474",
"0.74937636",
"0.74389136",
"0.74269557",
"0.74216545",
"0.74027663",
"0.73976237",
"0.7353767",
"0.73260874",
"0.72129965",
"0.7205459",
"0.71909744",
"0.71655244",
"0.7159357",
"0.7124179",
"0.7075171",
"0.7065419",
"0.7... | 0.76250774 | 3 |
Output the current state of SCSoundControl properties to a file. | private void savePropertiesFile(String propertiesFile) {
if (_props == null) return; //or maybe save a default file?
File f = new File(propertiesFile);
//does it exist yet?
if (!f.exists()) {
//touch the file and close it.
try {f.createNewFile();}
catch (Exception e) {
System.err.println("Properties file " + propertiesFile + " does not exist and cannot be created.");
}
}
//write the file.
try {
_props.store(new FileOutputStream(f), "SCSoundControl Properties File");
} catch (Exception e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeSettings(double sound, double music) {\n try {\n settingsData = new File(wnwData, \"settings.dat\");\n settingsData.createNewFile();\n BufferedWriter bufferedWriter = new BufferedWriter(\n new FileWriter(settingsData));\n buffer... | [
"0.53016096",
"0.52730405",
"0.52425677",
"0.5237852",
"0.5234305",
"0.5229921",
"0.52151555",
"0.5147115",
"0.5052043",
"0.5051404",
"0.50504905",
"0.5010706",
"0.500401",
"0.49792007",
"0.49403906",
"0.49252966",
"0.4918237",
"0.49137023",
"0.4843307",
"0.4838356",
"0.48363... | 0.53630465 | 0 |
cleanup if we're getting gc'ed. | protected void finalize() throws Throwable {
cleanup();
//kill the scsynth
_scsynthLauncher.killScsynth();
// free the UDP port from JavaOSC
if (_receiver != null)
_receiver.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void cleanup() {\r\n }",
"public void cleanup() {\n }",
"public void cleanup() {\n\t}",
"@Override\r\n\tpublic void cleanup() {\n\t\t\r\n\t}",
"public void cleanup();",
"@Override\n public void cleanup() {\n }",
"@Override\r\n public void cleanup() {\n }",
"public final void cl... | [
"0.8017369",
"0.7923797",
"0.7914437",
"0.7726093",
"0.7717503",
"0.76847464",
"0.76657504",
"0.7643511",
"0.76176596",
"0.76176596",
"0.76176596",
"0.7605842",
"0.7605842",
"0.75749326",
"0.75447375",
"0.7508285",
"0.7508285",
"0.7458518",
"0.732596",
"0.7313777",
"0.7308256... | 0.67049533 | 82 |
establish group to contain all SCSoundControl nodes in SuperCollider | public void init() {
debugPrintln("Doing init.");
// can sanity check some things by requesting notification when nodes
// are created/deleted/etc.
// It does not notify when playBufs reach the end of a buffer, though.
// Too bad, that. Would have to poll.
sendMessage("/notify", new Object[] { 1 });
//start by cleaning up any detritus from previous runs on the same server:
cleanup();
//sclang creates the default group, not supercollider, so let's follow that convention.
createGroup(1, 0);
// create a mother group, under the default group (1),
// which will contain all of the SCSoundControl objects.
//this is where we would query if another node == _motherGroupID already exists.
//if so, would need to choose an alternate groupID (e.g. += 10000)
createGroup(_motherGroupID, 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void sendGroupInit() {\n \t\ttry {\n \t\t\tmyEndpt=new Endpt(serverName+\"@\"+vsAddress.toString());\n \n \t\t\tEndpt[] view=null;\n \t\t\tInetSocketAddress[] addrs=null;\n \n \t\t\taddrs=new InetSocketAddress[1];\n \t\t\taddrs[0]=vsAddress;\n \t\t\tview=new Endpt[1];\n \t\t\tview[0]=myEndpt;\n \n \t\t\tGr... | [
"0.5468821",
"0.5394951",
"0.5373866",
"0.529387",
"0.5279637",
"0.5192511",
"0.5166569",
"0.513012",
"0.5126715",
"0.509951",
"0.50011545",
"0.4998344",
"0.49756145",
"0.49728927",
"0.49723417",
"0.4951759",
"0.49344364",
"0.4932979",
"0.49287182",
"0.49239293",
"0.4900674",... | 0.6093738 | 0 |
cleanup all SCSoundControl nodes in SuperCollider | public synchronized void cleanup() {
// by freeing the mother group we clean up all the nodes we've created
// on the SC server
sendMessage("/g_freeAll", new Object[] { _motherGroupID });
freeNode(_motherGroupID);
freeAllBuffers();
//reset the lists of sound nodes, nodeIds, busses, etc
SoundNode sn;
Enumeration<SoundNode> e = _soundNodes.elements();
while (e.hasMoreElements()) {
sn = e.nextElement();
sn.setAlive(false);
}
_soundNodes.clear();
_nodeIdList.clear();
_busList.clear();
_bufferMap.clear();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void clearSounds() {\r\n\t\tMain.soundBags = \"\";\r\n\t\tMain.soundSet = \"\";\r\n\t\tMain.soundWin = \"\";\r\n\t\tMain.soundLose = \"\";\r\n\t\tMain.soundGameStart= \"\";\r\n\t}",
"public void cleanUp() {\n\t\tfor (int i = 0; i < 24; i++) {\r\n\t\t\tPlayerAssistant.itemOnInterface(c, 26099, i, -1... | [
"0.59526503",
"0.5715327",
"0.5658658",
"0.55800974",
"0.5559569",
"0.554956",
"0.55492",
"0.5534907",
"0.5516794",
"0.5516667",
"0.55121684",
"0.5509208",
"0.546285",
"0.54355437",
"0.5431487",
"0.5405798",
"0.5405595",
"0.5405328",
"0.540398",
"0.53898776",
"0.5380458",
"... | 0.64226216 | 0 |
Buffer Management It is up to the user to be sure that the filename exists on the machine running SuperCollider. by default, SuperCollider provides 1024 buffers. | public synchronized int readBuf(String filename) {
// find a buffer id that hasn't been used yet.
int bufNum = 0;
while (_bufferMap.containsKey(bufNum))
bufNum++;
// add this buffer number to the map
_bufferMap.put(bufNum, filename);
// create and load the buffer
sendMessage("/b_allocRead", new Object[] { bufNum, filename });
sendMessage("/sync", new Object[]{bufNum + _bufferReadIdOffset});
return bufNum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public BufferPool(String fileName, int numBuffers)\n throws IOException\n {\n BLOCK_SIZE = 4096;\n // create linked list of buffers, open file, create pointer tempArray\n this.pool = new LinkedList<Buffer>();\n this.buffArr = new Buffer[numBuffers];\n this.file = new Ra... | [
"0.6262231",
"0.61563915",
"0.60893816",
"0.59888273",
"0.5987633",
"0.5847055",
"0.5745475",
"0.5741045",
"0.57361656",
"0.5734786",
"0.56862205",
"0.56834793",
"0.5605507",
"0.5563301",
"0.5555111",
"0.5538061",
"0.5522326",
"0.5520287",
"0.5519211",
"0.5493378",
"0.5490429... | 0.6229957 | 1 |
free a given buffer from the SC server. | public synchronized void freeBuf(int bufNum) {
// if it's a valid remove request:
if (_bufferMap.containsKey(bufNum)) {
// remove it from the buffer map
_bufferMap.remove(bufNum);
// free it on the server
sendMessage("/b_free", new Object[] { bufNum });
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static native void free(long buffer);",
"public void freeBuffer() {\n if(allocatedBufferSource.get() != null) {\n allocatedBufferSource.getAndSet(null).freeVideo(this);\n }\n }",
"public void free();",
"@DISPID(1) //= 0x1. The runtime will prefer the VTID if present\r\n @VTID(7)\... | [
"0.70683366",
"0.68354154",
"0.63667446",
"0.63343537",
"0.6206057",
"0.6204103",
"0.61701053",
"0.6122742",
"0.6093039",
"0.6042132",
"0.6033218",
"0.6004332",
"0.5992414",
"0.5987453",
"0.59806514",
"0.59575224",
"0.59486616",
"0.5938923",
"0.59351",
"0.5920325",
"0.5905387... | 0.73376745 | 0 |
free all the buffers we've allocated on the SC server. | public synchronized void freeAllBuffers() {
Iterator<Integer> iter = _bufferMap.keySet().iterator();
while (iter.hasNext()) {
int bufNum = iter.next();
sendMessage("/b_free", new Object[] { bufNum });
iter.remove();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final void freeBuffers()\n {\n if (_ioContext != null) {\n byte[] buf = _inputBuffer;\n if (buf != null) {\n _inputBuffer = null;\n _ioContext.releaseReadIOBuffer(buf);\n }\n }\n }",
"public void cleanup() {\n sendBu... | [
"0.7140296",
"0.69726175",
"0.6961021",
"0.6921034",
"0.69010484",
"0.67932576",
"0.6788127",
"0.64976543",
"0.6493222",
"0.64668393",
"0.6419926",
"0.6393779",
"0.6362172",
"0.63353145",
"0.63279206",
"0.6323351",
"0.63114727",
"0.6299973",
"0.62835413",
"0.62828684",
"0.625... | 0.7992056 | 0 |
Internal Bus ID Management by default, SuperCollider allocates 128 audio rate busses. The way SCSoundControl has been designed, this should allow for 128 voice polyphony. If more are needed, see super collider help on how to do this from either command line arguments or by changing defaults via sclang code. | protected synchronized int allocateBus() {
int newBusID = _minAudioBus;
while (_busList.contains(newBusID))
newBusID++;
_busList.add(newBusID);
return newBusID;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initBus() {\n\n sbus = new Bus(16);\n dbus = new Bus(16);\n\n sbus.addPoint(new Point(51, 101));\n sbus.addPoint(new Point(563, 101));\n sbus.addPoint(new Point(74, 101));\n sbus.addPoint(new Point(74, 290));\n sbus.addPoint(new Point(74, 290));\n ... | [
"0.60389954",
"0.55911624",
"0.5415344",
"0.540582",
"0.5402259",
"0.5330015",
"0.52562296",
"0.5228929",
"0.5226978",
"0.52264965",
"0.5183058",
"0.5167047",
"0.5147529",
"0.5139789",
"0.51132333",
"0.4982658",
"0.49768278",
"0.49740312",
"0.4957185",
"0.49470943",
"0.493559... | 0.5682971 | 1 |
find consecutive busses, return lowest id. | protected synchronized int allocateConsecutiveBusses(int howManyBusses) {
int newBusID = _minAudioBus;
while (!testConsecutiveBusses_recursive(newBusID, howManyBusses)) {
newBusID++;
}
for (int i=0; i<howManyBusses; i++) {
_busList.add(newBusID + i);
}
return newBusID;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void findHighestConsecutive(){\r\n\r\n int maxSame = 1;\r\n int tempSame = 1;\r\n\r\n int testArr[] = getIntArr();\r\n\r\n for(int i = 0; i < testArr.length; i++){\r\n\r\n for(int j = i + 1; j < testArr.length; j++){\r\n if(testArr[i] == testArr[j]){\r\n... | [
"0.57252735",
"0.55973315",
"0.55797166",
"0.54861575",
"0.54418576",
"0.5363917",
"0.5361053",
"0.5346368",
"0.5301795",
"0.5291509",
"0.5228047",
"0.5216031",
"0.5206402",
"0.52010524",
"0.5194534",
"0.5122512",
"0.50413376",
"0.5040652",
"0.5030831",
"0.5018964",
"0.501437... | 0.5669166 | 1 |
recursively look for consecutive bus ID's to be free. | private boolean testConsecutiveBusses_recursive(int startID, int howMany) {
if (howMany == 0) return true;
if (_busList.contains(startID)) return false;
else return testConsecutiveBusses_recursive(startID+1, howMany-1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected synchronized int allocateConsecutiveBusses(int howManyBusses) {\n\t\tint newBusID = _minAudioBus;\n\t\twhile (!testConsecutiveBusses_recursive(newBusID, howManyBusses)) {\n\t\t\tnewBusID++;\n\t\t}\n\t\tfor (int i=0; i<howManyBusses; i++) {\n\t\t\t_busList.add(newBusID + i);\n\t\t}\n\t\treturn newBusID;\n... | [
"0.5508052",
"0.53098404",
"0.5113418",
"0.49355093",
"0.48833805",
"0.48797452",
"0.486523",
"0.48548406",
"0.47847995",
"0.47503603",
"0.4737842",
"0.47051296",
"0.47004184",
"0.46721458",
"0.4671569",
"0.46639404",
"0.46610716",
"0.46397832",
"0.45810154",
"0.4579662",
"0.... | 0.60103124 | 0 |
free up a no longer used bus id | protected synchronized void freeBus(int busNum) {
_busList.remove(new Integer(busNum));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void freeId( long id )\n {\n }",
"private native static void free(long instance);",
"public void free() {\n byteBase.free();\n byteBase = null;\n }",
"@Override\n\tpublic void removeInUse() {\n\t\theldObj.removeInUse();\n\t}",
"@Override\n public ... | [
"0.7206284",
"0.6075442",
"0.6068342",
"0.60536236",
"0.6005508",
"0.60034984",
"0.5931522",
"0.592645",
"0.5912446",
"0.5868595",
"0.5841036",
"0.5801105",
"0.5772453",
"0.57141703",
"0.5707853",
"0.5701072",
"0.56917775",
"0.5685159",
"0.5667047",
"0.56628263",
"0.56446844"... | 0.7232563 | 0 |
Node ID Management get an unallocated node id. | public int getNewNodeID() {
int newID = _minNodeID;
while (_nodeIdList.contains(newID)) newID++;
return newID;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String myNodeId() {\n\t\tif (nodeId == null) {\n\t\t\tnodeId = UUID.randomUUID();\n\t\t\tLOG.debug(\"My node id=\" + nodeId.toString());\n\t\t}\n\n\t\treturn nodeId.toString();\n\t}",
"NodeId getNodeId();",
"public String getNode_id() {\r\n\t\treturn node_id;\r\n\t}",
"public int getNodeID() {\r\n \t\... | [
"0.7266414",
"0.7168927",
"0.7135835",
"0.69388884",
"0.69016844",
"0.6896797",
"0.68298197",
"0.68254447",
"0.68023556",
"0.67787445",
"0.67757386",
"0.6651435",
"0.6650627",
"0.6572384",
"0.65434873",
"0.65378577",
"0.6532895",
"0.64698815",
"0.6469651",
"0.64564764",
"0.64... | 0.6733752 | 11 |
Messaging to Super Collider free a node we've allocated on the server. | protected void freeNode(int nodeNum) {
sendMessage("/n_free", new Object[] { nodeNum });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deallocateNode(){\n this.processId = NO_PROCESS;\n this.full = false;\n }",
"public void doSendOff(final int node) {\n\t\tcheckAddress();\n\n\t\t// send an OSC message to free the node 1000\n\t\tfinal List<Object> args = new ArrayList<Object>(1);\n\t\targs.add(node);\n\t\tfinal OSCMe... | [
"0.69808024",
"0.6967972",
"0.6346148",
"0.61868",
"0.61704427",
"0.5871633",
"0.57437843",
"0.57321763",
"0.5620102",
"0.5599134",
"0.5581224",
"0.55522555",
"0.5550426",
"0.55469227",
"0.5534226",
"0.55242854",
"0.5491968",
"0.54871684",
"0.547991",
"0.5452164",
"0.54366773... | 0.727853 | 0 |
autogenerate a new group and return the group ID. groups all have ids higher than the SoundControl "mothergroup" | protected int createGroup() {
int id = _motherGroupID + 1;
while (_soundNodes.containsKey(id)) { id++; }
createGroup(id);
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void allocateGroupId(){\n\t\trecords.add(new pair(this.groupname,currentId));\n\t\tthis.groupid = currentId;\n\t\tcurrentId++;\n\t\tConnection c = null;\n\t\tStatement stmt = null;\n\t\ttry{\n\t\t\tSystem.out.println(\"group setup\");\n\t\t\tSystem.out.println(this.groupid);\n\t\t\tClass.forName(\"org.postg... | [
"0.6936835",
"0.67857194",
"0.66143316",
"0.6591936",
"0.65523994",
"0.6523332",
"0.64895004",
"0.6472863",
"0.6451798",
"0.6451798",
"0.6451798",
"0.6451798",
"0.6451798",
"0.6451798",
"0.64229906",
"0.6373012",
"0.6373012",
"0.63272035",
"0.6291646",
"0.6289632",
"0.6265605... | 0.797254 | 0 |
create a group under the SCSoundControl mothergroup | protected void createGroup(int id) {
createGroup(id, _motherGroupID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected int createGroup() {\n\t\tint id = _motherGroupID + 1;\n\t\twhile (_soundNodes.containsKey(id)) { id++; }\n\t\tcreateGroup(id);\n\t\treturn id;\n\t}",
"protected void createBrowseFilterGroup(Composite parent) {\n\t\tcheckButtonGroup = new Group(parent,SWT.SHADOW_ETCHED_IN);\r\n\t\tcheckButtonGroup.setTe... | [
"0.6218041",
"0.59906834",
"0.59348226",
"0.58415693",
"0.5792539",
"0.5700495",
"0.56799567",
"0.5670072",
"0.5634404",
"0.5623381",
"0.56182575",
"0.554572",
"0.5538808",
"0.5516925",
"0.5360731",
"0.5352365",
"0.53168046",
"0.5299212",
"0.5296813",
"0.52832556",
"0.5282683... | 0.5324853 | 16 |
create a group on the server. | protected void createGroup(int id, int parentGroupID) {
sendMessage("/g_new", new Object[] { id, 0, parentGroupID });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"UserGroup createGroup(String companyId, String name);",
"UserGroup createGroup(String companyId, String name, String groupLead);",
"public boolean createGroup(GroupsGen group) {\n \n super.create(group);\n return true;\n }",
"public ServiceGroup create(String shortName, String ... | [
"0.7499238",
"0.74537337",
"0.73842084",
"0.7298937",
"0.72753996",
"0.72036475",
"0.7037899",
"0.7008326",
"0.70040685",
"0.69497937",
"0.69386995",
"0.6912973",
"0.6895941",
"0.68876743",
"0.68206954",
"0.6727111",
"0.67240584",
"0.67104274",
"0.6705611",
"0.66617453",
"0.6... | 0.7163275 | 6 |
create an ELplaybuf node. Note this is a custom synthdef which must be loaded on the server. | protected void createPlayBuf(int id, int group, int bufNum, int outBus,
float amp, float rate, boolean loop) {
Object args[] = new Object[16];
args[0] = new String("ELplaybuf");
args[1] = new Integer(id); // need a unique ID
args[2] = new Integer(1); // add to tail of node list in group
args[3] = new Integer(group); // target group
args[4] = new String("outBus");
args[5] = new Integer(outBus); // need a unique bus # here
args[6] = new String("bufNum");
args[7] = new Integer(bufNum);
args[8] = new String("doLoop");
args[9] = loop ? new Integer(1) : new Integer(0);
args[10] = new String("ampScale");
args[11] = new Float(amp);
args[12] = new String("playbackRate");
args[13] = new Float(rate);
args[14] = new String("groupToFreeWhenDone");
args[15] = new Integer(group);
sendMessage("/s_new", args);
_nodeIdList.add(id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public Buffer createBuffer();",
"RS3PacketBuilder buildPacket(T node);",
"public Voice(int brr_buf_size)\r\n\t{\r\n\t\tbuffer = new ModuloArray(brr_buf_size);\r\n\t}",
"public void createChain(){\r\n Oscillator wt = new Oscillator(this, Oscillator.SAWTOOTH_WAVE, this.sampleRate, this.channe... | [
"0.5481062",
"0.5378631",
"0.5175903",
"0.50960565",
"0.50960183",
"0.5072709",
"0.5053823",
"0.5027095",
"0.5025491",
"0.50086856",
"0.49848807",
"0.49815515",
"0.49800438",
"0.4931513",
"0.49265465",
"0.49164388",
"0.49070218",
"0.4905378",
"0.49028274",
"0.4894522",
"0.488... | 0.56230736 | 0 |
create an ELplaybuf node. Note this is a custom synthdef which must be loaded on the server. | protected void createStereoPlayBuf(int id, int group, int bufNum, int outBus,
float amp, float rate, boolean loop) {
Object args[] = new Object[16];
args[0] = new String("ELStereoPlaybuf");
args[1] = new Integer(id); // need a unique ID
args[2] = new Integer(1); // add to tail of node list in group
args[3] = new Integer(group); // target group
args[4] = new String("outBus");
args[5] = new Integer(outBus); // need a unique bus # here
args[6] = new String("bufNum");
args[7] = new Integer(bufNum);
args[8] = new String("doLoop");
args[9] = loop ? new Integer(1) : new Integer(0);
args[10] = new String("ampScale");
args[11] = new Float(amp);
args[12] = new String("playbackRate");
args[13] = new Float(rate);
args[14] = new String("groupToFreeWhenDone");
args[15] = new Integer(group);
sendMessage("/s_new", args);
_nodeIdList.add(id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void createPlayBuf(int id, int group, int bufNum, int outBus,\n\t\t\tfloat amp, float rate, boolean loop) {\n\n\t\tObject args[] = new Object[16];\n\t\targs[0] = new String(\"ELplaybuf\");\n\t\targs[1] = new Integer(id); // need a unique ID\n\t\targs[2] = new Integer(1); // add to tail of node list in gr... | [
"0.5624872",
"0.54838043",
"0.5377504",
"0.51770246",
"0.5096541",
"0.50948167",
"0.5073823",
"0.5053353",
"0.5029201",
"0.5028507",
"0.5007781",
"0.49869272",
"0.49806455",
"0.49318948",
"0.49261168",
"0.49174",
"0.49065807",
"0.49047413",
"0.49043718",
"0.4893049",
"0.48834... | 0.4980455 | 13 |
create an ELenv node. Note this is a custom synthdef which must be loaded on the server. | protected void createEnvelope(int id, int group, int inBus, int outBus,
float amp) {
Object args[] = new Object[12];
args[0] = new String("ELenv");
args[1] = new Integer(id); // need a unique ID
args[2] = new Integer(1); // add to tail of group
args[3] = new Integer(group);
args[4] = new String("inBus");
args[5] = new Integer(inBus); // need a unique bus # here
args[6] = new String("outChannel");
args[7] = new Integer(outBus);
args[8] = new String("ampScale");
args[9] = new Float(amp);
sendMessage("/s_new", args);
_nodeIdList.add(id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"EnvEntry createEnvEntry();",
"Environment createEnvironment();",
"Environment createEnvironment();",
"public void create(Environment environment);",
"public static EvalEnv genExampleEnv2()\n {\n EvalEnv result = new EvalEnv();\n result.createVariable(Boolean.class, true);\n result.c... | [
"0.63345265",
"0.60535365",
"0.60535365",
"0.59715146",
"0.56157935",
"0.52123517",
"0.52004164",
"0.5185488",
"0.51436573",
"0.51245433",
"0.49501884",
"0.4946243",
"0.49452522",
"0.49293578",
"0.48323593",
"0.48124015",
"0.47910747",
"0.475453",
"0.47527292",
"0.47403127",
... | 0.48090225 | 16 |
set the amplitude of an ELplaybuf or an ELenv. | public void setProperty(int id, String paramName, float amp) {
sendMessage("/n_set", new Object[] { id, paramName, amp });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setAmplitude(float amplitude) {\n/* 79 */ this.amplitude = amplitude;\n/* */ }",
"public void setAmplitude(float amplitude)\n\t{\n\t\tif (this.modulePlayer != null) {\n\t\t\tthis.modulePlayer.setAmplitude(amplitude);\n\t\t}\n\t}",
"public void amplitudeUpdate(AudioHandler handler, float ... | [
"0.7295008",
"0.654487",
"0.59168243",
"0.5877659",
"0.5818246",
"0.57689416",
"0.5669412",
"0.5656223",
"0.56022453",
"0.5562935",
"0.5505884",
"0.54739743",
"0.5340731",
"0.53216714",
"0.5189912",
"0.5168228",
"0.5045834",
"0.49997875",
"0.4966363",
"0.4966191",
"0.49621987... | 0.48702267 | 31 |
helper function, we use this all over the place. | protected void sendMessage(String addr, Object[] args) {
try {
_sender.send(args == null ? new OSCMessage(addr) : new OSCMessage(
addr, args));
} catch (IOException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected boolean func_70814_o() { return true; }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"private void strin() {\n\n\t}",
"private void poetries() {\n\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n public void perish() {\n \n ... | [
"0.54120374",
"0.54060477",
"0.53961575",
"0.52764267",
"0.5241453",
"0.52195024",
"0.5198224",
"0.5090837",
"0.508902",
"0.50457466",
"0.5036513",
"0.5031363",
"0.49767947",
"0.49318963",
"0.49060255",
"0.48775348",
"0.4871642",
"0.4866251",
"0.48651257",
"0.48378852",
"0.48... | 0.0 | -1 |
reset the SC server same as pressing "CMD." in sclang just for development. Shouldn't need to call this typically. it would kill nodes created by something else controlling the server. | public void resetScsynth() {
sendMessage("/g_freeAll", new Object[] { 0 });
sendMessage("/clearSched");
sendMessage("/g_new", new Object[] { 1 });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void cmdReset() throws NoSystemException {\n fSession.reset();\n }",
"public void reset() {\n serverReset(game.generateUIDs(data.getObjectCount()));\n }",
"private void resetClient()\n\t{\n\t\tSystem.out.println(\"\\n---Resetting client...\");\n\t\tSystem.out.println(\"\\n\");\n\t\t... | [
"0.68308103",
"0.66241705",
"0.64601356",
"0.6458735",
"0.6052072",
"0.6024381",
"0.6003637",
"0.599806",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
"0.5986839",
... | 0.6599588 | 2 |
for debugging: tell scsynth to dump a tree of its nodes to the post windows | public void dumpTree() {
sendMessage("/g_dumpTree", new Object[] { 0, 0 });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void printPostorder() { \n\t\tprintPostorder(root);\n\t}",
"public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.... | [
"0.67149293",
"0.6697956",
"0.6519676",
"0.6285393",
"0.61916333",
"0.6183256",
"0.61689246",
"0.6098831",
"0.6060937",
"0.6042118",
"0.600744",
"0.6007102",
"0.6005745",
"0.60038525",
"0.5988699",
"0.5968442",
"0.5965267",
"0.5956337",
"0.5941184",
"0.5928101",
"0.58999485",... | 0.7298886 | 0 |
for debugging: tell scsynth to trace a given node in the post window | public void trace(int node) {
sendMessage("/n_trace", new Object[] { node });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void debug(String post) {\n if (GameLauncher.isDebugging()) {\n System.out.println(post);\n }\n }",
"public void trace(Object message)\n/* */ {\n/* 95 */ debug(message);\n/* */ }",
"protected void trace(String msg)\r\n\t{\r\n\t\tm_stream.println(msg);\r\n\t}",
"@Override\... | [
"0.57549876",
"0.5561031",
"0.5518324",
"0.54514194",
"0.54465747",
"0.5348779",
"0.53321886",
"0.5295546",
"0.52904075",
"0.52540755",
"0.5247073",
"0.52378947",
"0.5236",
"0.52333415",
"0.5215117",
"0.5203299",
"0.5172546",
"0.5171285",
"0.51606494",
"0.5130058",
"0.5116588... | 0.6709908 | 0 |
Handle Incoming messages from Super Collider handle incoming messages | public void acceptMessage(java.util.Date time, OSCMessage message) {
// FOR DEBUGGING: to print the full message:
if (debugging) {
System.out.print(message.getAddress());
for(int i = 0; i < message.getArguments().length; i++) {
System.out.print(", " + message.getArguments()[i].toString());
}
System.out.println("");
}
if (message.getAddress().matches("/done")) {
if (message.getArguments()[0].toString().matches("/b_allocRead")) {
//debugPrintln("A buffer was created.");
}
}
//TODO: this /synced watch will work as long as the buffers load correctly.
//but there's not yet any way to know if they fail.
else if (message.getAddress().matches("/synced")) {
int id = (Integer)(message.getArguments()[0]) - _bufferReadIdOffset;
synchronized (this) {
if (_bufferMap.containsKey(id)) {
debugPrintln("Buffer " + id + " was loaded.");
if (_notifyListener != null) { _notifyListener.receiveNotification_BufferLoaded(id, _bufferMap.get(id)); }
if (_controlPanel != null && _controlPanel._statsDisplay != null) {
_controlPanel._statsDisplay.receiveNotification_BufferLoaded(id, _bufferMap.get(id));
}
}
}
}
else if (message.getAddress().matches("/n_go") ||
message.getAddress().matches("/n_info")) {
//if it was node 1, then we can get going.
if ((Integer)(message.getArguments()[0]) == _motherGroupID &&
(Integer)(message.getArguments()[1]) == 1 ) {
if (!_serverBooted) {
_serverBooted = true;
handleServerBooted();
}
}
}
// handle notices of freed nodes
else if (message.getAddress().matches("/n_end")) {
// take message.getArguments()[0] (the node id that was freed)
// and free up any resources associated with it.
//debugPrintln("node " + message.getArguments()[0].toString() + " was freed.");
Integer id = (Integer) (message.getArguments()[0]);
if (id > _motherGroupID) {
// it's a group node. a SoundNode has died.
synchronized (this) {
SoundNode sn = _soundNodes.get(id);
if (sn != null) {
sn.setAlive(false);
freeBus(sn.get_busID());
}
_soundNodes.remove(id);
}
} else {
// free up that node from the node id list.
synchronized (this) {
_nodeIdList.remove(message.getArguments()[0]);
}
}
}
//handle /status responses (status.reply)
else if (message.getAddress().matches("/status.*")) {
//TODO update control panel display with status data
Integer numUgens = (Integer)(message.getArguments()[1]);
Integer numSynths = (Integer)(message.getArguments()[2]);
Integer numGroups = (Integer)(message.getArguments()[3]);
Integer numSynthdefs = (Integer)(message.getArguments()[4]);
Float avgCPU = (Float)(message.getArguments()[5]);
Float peakCPU = (Float)(message.getArguments()[6]);
handleServerStatusUpdate(numUgens, numSynths, numGroups, numSynthdefs, avgCPU, peakCPU);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void handleMessage(Message msg){\n switch (msg.what) {\n case PSensor.MESSAGE_STATE_CHANGE:\n break;\n case PSensor.MESSAGE_WRITE:\n break;\n case PSensor.MESSAGE_READ... | [
"0.71550566",
"0.6873832",
"0.68385077",
"0.667801",
"0.6622101",
"0.6454149",
"0.6429602",
"0.6417432",
"0.6406435",
"0.63961536",
"0.638666",
"0.6378621",
"0.6373366",
"0.6366569",
"0.6364689",
"0.6362033",
"0.63152945",
"0.62989545",
"0.62599796",
"0.6243212",
"0.6240046",... | 0.0 | -1 |
Sound Node Factory Methods Convenience function to create a new soundNode to playback a mono buffer to a single output channel (can be used to play the left channel of a stereo buffer). Calls createMonoSoundNode(). | public SoundNode createSoundNodeOnSingleChannel(int bufferNumber, boolean doLoop, int channel, float amplitude, float playbackRate) {
int[] channels = new int[1];
channels[0] = channel;
float[] amps = new float[1];
amps[0] = amplitude;
return createMonoSoundNode(bufferNumber, doLoop, channels, amps, playbackRate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SoundNode createMonoSoundNode(int bufferNumber, boolean doLoop,\n\t\t\tint[] outputChannels, float[] channelAmplitudes, float playbackRate) {\n\t\t\n\t\t//sanity check the buffer that's been requested.\n\t\tif (!_bufferMap.containsKey(bufferNumber)) return null;\n\t\t\n\t\t//wrap up 1D input arrays into 2D ... | [
"0.7434794",
"0.5857648",
"0.5431046",
"0.5082167",
"0.50493586",
"0.4975861",
"0.49692187",
"0.49330232",
"0.48978227",
"0.4895",
"0.4895",
"0.48399043",
"0.4835864",
"0.4812475",
"0.47821137",
"0.47243804",
"0.47191975",
"0.47191975",
"0.47086707",
"0.46446317",
"0.46309495... | 0.6828047 | 1 |
create a new soundNode to playback a mono buffer (can be used to play the left channel of a stereo buffer) | public SoundNode createMonoSoundNode(int bufferNumber, boolean doLoop,
int[] outputChannels, float[] channelAmplitudes, float playbackRate) {
//sanity check the buffer that's been requested.
if (!_bufferMap.containsKey(bufferNumber)) return null;
//wrap up 1D input arrays into 2D arrays
float[][] amps = new float[1][];
amps[0] = channelAmplitudes; //this is ok, since the the amps array gets copied inside of SoundNode constructor.
int[][] outChannels = new int[1][];
outChannels[0] = outputChannels;
// instantiate a new SoundNode and remember it by its group ID.
// when that group ID is freed on the server we'll know this SoundNode
// is dead.
SoundNode sn;
synchronized (this) {
sn = new SoundNode(this, bufferNumber, 1, doLoop,
outChannels, amps, playbackRate);
_soundNodes.put(sn.getGroup(), sn);
}
return sn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SoundNode createSoundNodeOnSingleChannel(int bufferNumber, boolean doLoop, int channel, float amplitude, float playbackRate) {\n\t\tint[] channels = new int[1];\n\t\tchannels[0] = channel;\n\t\t\n\t\tfloat[] amps = new float[1];\n\t\tamps[0] = amplitude;\n\t\t\n\t\treturn createMonoSoundNode(bufferNumber, d... | [
"0.6546704",
"0.58625627",
"0.57030755",
"0.54019284",
"0.5387413",
"0.53429145",
"0.5331738",
"0.52788144",
"0.523062",
"0.52154076",
"0.5188084",
"0.51210195",
"0.51104254",
"0.50988877",
"0.5088272",
"0.5064874",
"0.5056908",
"0.5044868",
"0.504328",
"0.50395465",
"0.50383... | 0.694463 | 0 |
The use of this function is deprecated, as its functionality is made redundant by updates to createStereoSoundNode(). | @Deprecated public SoundNode createStereoSoundNodeWithLRMap(int bufferNumber, boolean doLoop,
int[] leftChannelMap, int[] rightChannelMap, float playbackRate) {
float[] lChannelAmplitudes = new float[leftChannelMap.length];
float[] rChannelAmplitudes = new float[rightChannelMap.length];
for (int i=0; i<leftChannelMap.length; i++) {
lChannelAmplitudes[leftChannelMap[i]] = 1f;
}
for (int i=0; i<rightChannelMap.length; i++) {
rChannelAmplitudes[rightChannelMap[i]] = 1f;
}
return createStereoSoundNode(bufferNumber, doLoop, leftChannelMap, lChannelAmplitudes, rightChannelMap, rChannelAmplitudes, playbackRate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SoundNode createStereoSoundNode(int bufferNumber, boolean doLoop,\n\t\t\tint[] lChannelOutputChannels, float[] lChannelAmplitudes, int[] rChannelOutputChannels, float[] rChannelAmplitudes, float playbackRate) {\n\t\t\n\t\t//sanity check the buffer that's been requested.\n\t\tif (!_bufferMap.containsKey(buff... | [
"0.57790333",
"0.5641132",
"0.53276306",
"0.53276306",
"0.5289104",
"0.5289104",
"0.51556134",
"0.5152936",
"0.51495343",
"0.51110613",
"0.5080444",
"0.50394917",
"0.50190693",
"0.49694285",
"0.4948522",
"0.4932888",
"0.49264932",
"0.48846442",
"0.48710465",
"0.48709643",
"0.... | 0.57519376 | 1 |
create a new soundNode to playback a stereo buffer | public SoundNode createStereoSoundNode(int bufferNumber, boolean doLoop,
int[] lChannelOutputChannels, float[] lChannelAmplitudes, int[] rChannelOutputChannels, float[] rChannelAmplitudes, float playbackRate) {
//sanity check the buffer that's been requested.
if (!_bufferMap.containsKey(bufferNumber)) return null;
float[][] amps = new float[2][];
amps[0] = lChannelAmplitudes;
amps[1] = rChannelAmplitudes;
int[][] outChannels = new int[2][];
outChannels[0] = lChannelOutputChannels;
outChannels[1] = rChannelOutputChannels;
// instantiate a new SoundNode and remember it by its group ID.
// when that group ID is freed on the server we'll know this SoundNode
// is dead.
SoundNode sn;
synchronized (this) {
sn = new SoundNode(this, bufferNumber, 2, doLoop,
outChannels, amps, playbackRate);
_soundNodes.put(sn.getGroup(), sn);
}
return sn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void createStereoPlayBuf(int id, int group, int bufNum, int outBus,\n\t\t\tfloat amp, float rate, boolean loop) {\n\n\t\tObject args[] = new Object[16];\n\t\targs[0] = new String(\"ELStereoPlaybuf\");\n\t\targs[1] = new Integer(id); // need a unique ID\n\t\targs[2] = new Integer(1); // add to tail of nod... | [
"0.64647436",
"0.5840847",
"0.5816908",
"0.57070047",
"0.54585856",
"0.51593643",
"0.50904477",
"0.49564695",
"0.49458867",
"0.49239102",
"0.48643538",
"0.48594868",
"0.48455223",
"0.4844437",
"0.48239034",
"0.47893387",
"0.47846445",
"0.47755685",
"0.47656083",
"0.47400948",
... | 0.7176001 | 0 |
SCSoundControl starts up a thread to make sure the server is running. | public void run() {
Date curTime;
while(true) {
curTime = new Date();
//System.out.println("currentTime: "+ curTime.getTime() +" prevTime: "+ _prevPingRequestTime.getTime() +" diff: " + (curTime.getTime() - _prevPingRequestTime.getTime()) +" interval: "+ _scsynthPingInterval);
//if the previous status request is still pending...
if (_serverLive && (_prevPingRequestTime.getTime() > _prevPingResponseTime.getTime())) {
//We've not yet heard back from the previous status request.
//Have we timed out?
if (curTime.getTime() - _prevPingRequestTime.getTime() > _serverResponseTimeout) {
//We've timed out on the previous status request.
System.out.println("Timed out on previous status request.");
if (_notifyListener != null) {
_notifyListener.receiveNotification_ServerStopped();
}
if (_controlPanel != null && _controlPanel._statsDisplay != null) {
_controlPanel._statsDisplay.receiveNotification_ServerStopped();
_scsclogger.receiveNotification_ServerStopped();
}
_serverLive = false;
_serverBooted = false;
}
//else we just keep waiting for a response or a timeout
}
//the previous status request is NOT still pending. Is it time to send another?
else if (curTime.getTime() - _prevPingRequestTime.getTime() > _scsynthPingInterval) {
//It's time to send another status request.
//generally, ping with a /status message.
//but, if we're live but not booted, query node 1 (the sign that init completed)
if (_serverLive && !_serverBooted) {
sendMessage("/notify", new Object[] { 1 });
sendMessage("/n_query", new Object[]{_motherGroupID});
//System.out.println("Querying SCSC mother node");
//debugPrintln("Querying SCSC mother node");
}
else {
//if the server's booted, request a status update.
sendMessage("/status");
}
_prevPingRequestTime = new Date();
}
//it's not time to send, and we're not watching
//for a reply, so go to sleep until it's time to ping again
else {
long sleeptime = Math.max(_scsynthPingInterval - (curTime.getTime() - _prevPingRequestTime.getTime()), 0);
//System.out.println("sleep " + sleeptime);
try {
Thread.sleep(sleeptime);
} catch (InterruptedException e) {
//NOTE this thread shouldn't get interrupted.
e.printStackTrace();
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public synchronized void start() {\n if(!running) {\n this.soundThread = new Thread(this, \"TankGameSound\");\n this.soundThread.start();\n this.running = true;\n }\n }",
"public static void playInternal( LayeredSound.SoundClip s )\r\n\t{\r\n\t\tif ( Settings.isS... | [
"0.7030875",
"0.6993667",
"0.65627235",
"0.64983124",
"0.6412815",
"0.62052333",
"0.61951166",
"0.6180158",
"0.6179722",
"0.6131927",
"0.61191446",
"0.609494",
"0.6086948",
"0.6073114",
"0.6071585",
"0.60363877",
"0.6000577",
"0.5998181",
"0.5986673",
"0.598615",
"0.59759396"... | 0.5585506 | 66 |
modify server ping settings: | public int get_serverResponseTimeout() {
return _serverResponseTimeout;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPing(boolean ping)\n {\n _isPing = ping;\n }",
"public void setPingInterval(Period interval)\n {\n _pingInterval = interval.getPeriod();\n \n if (_pingInterval < 0)\n _pingInterval = Long.MAX_VALUE / 2;\n else if (_pingInterval < 1000)\n _pingInterval = 1000;\n ... | [
"0.6708677",
"0.61471933",
"0.59080356",
"0.5886649",
"0.5869726",
"0.58027893",
"0.5722954",
"0.5707204",
"0.57054794",
"0.5679348",
"0.56787467",
"0.558995",
"0.558995",
"0.5563877",
"0.55491894",
"0.5531895",
"0.5451579",
"0.54297185",
"0.5411718",
"0.54044163",
"0.5384557... | 0.0 | -1 |
This method calculates the total games played by the player | public int totalGames() {
return wins + losses + draws;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getTotalOfGames() {\n return statistics.get(TypeOfGames.SIMGAME).getNumberOfGames()\n + statistics.get(TypeOfGames.EASYCOMPUTERGAME).getNumberOfGames()\n + statistics.get(TypeOfGames.HARDCOMPUTERGAME).getNumberOfGames();\n }",
"public int getTotalOftimePlayed() ... | [
"0.7492348",
"0.69302416",
"0.6860135",
"0.6830963",
"0.680855",
"0.67243123",
"0.6690914",
"0.66814005",
"0.66419303",
"0.6629106",
"0.66093963",
"0.6588549",
"0.65392536",
"0.6538848",
"0.6536201",
"0.6534244",
"0.6518529",
"0.6506383",
"0.6499187",
"0.6483343",
"0.6473165"... | 0.79431367 | 0 |
This method calculates the trumps that a player has in average on each game | public float trumpsPerGame() {
if (totalGames() == 0) return 0;
float res = (float) trumps / (float) (totalGames());
return Math.round(res * 10) / 10f;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void calculateAverage() {\n\n if (turn == 1) {\n p1.setTotalScore(p1.getTotalScore() + turnScore);\n\n p1.setTotalDarts(p1.getTotalDarts() + 1);\n\n float p1Average = p1.getTotalScore() / p1.getTotalDarts();\n p1.setAverage(p1Average);\n\n } else if ... | [
"0.70929843",
"0.68065584",
"0.6752485",
"0.6614555",
"0.6304229",
"0.63002354",
"0.62750304",
"0.6266882",
"0.6223624",
"0.61913586",
"0.61302733",
"0.6101035",
"0.6093619",
"0.6084555",
"0.6071293",
"0.6067851",
"0.6030266",
"0.6011895",
"0.59925985",
"0.59850085",
"0.59800... | 0.8021322 | 0 |
This method calculates the average number of loads obtained by a player at the end of a match | public float loadsPerGame() {
if (totalGames() == 0) return 0;
float res = (float) loads / (float) (totalGames());
return Math.round(res * 10) / 10f;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void calculateAverage() {\n\n if (turn == 1) {\n p1.setTotalScore(p1.getTotalScore() + turnScore);\n\n p1.setTotalDarts(p1.getTotalDarts() + 1);\n\n float p1Average = p1.getTotalScore() / p1.getTotalDarts();\n p1.setAverage(p1Average);\n\n } else if ... | [
"0.68156916",
"0.6766299",
"0.6735951",
"0.66846204",
"0.64867866",
"0.6481954",
"0.6475277",
"0.6454485",
"0.64487255",
"0.6354594",
"0.6277274",
"0.62396705",
"0.6199244",
"0.6186317",
"0.6172801",
"0.61565673",
"0.6111246",
"0.6084336",
"0.60566586",
"0.60298264",
"0.59891... | 0.68765205 | 0 |
This method calculates the average points obtained by a player at the end of a match | public float pointsPerGame() {
if (totalGames() == 0) return 0;
float res = (float) totalPoints / (float) totalGames();
return Math.round(res * 10) / 10f;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void calculateAverage() {\n\n if (turn == 1) {\n p1.setTotalScore(p1.getTotalScore() + turnScore);\n\n p1.setTotalDarts(p1.getTotalDarts() + 1);\n\n float p1Average = p1.getTotalScore() / p1.getTotalDarts();\n p1.setAverage(p1Average);\n\n } else if ... | [
"0.69398415",
"0.6405018",
"0.62827724",
"0.62364674",
"0.62038094",
"0.6190819",
"0.61791503",
"0.61534697",
"0.6116654",
"0.6077301",
"0.6071939",
"0.60275894",
"0.60234195",
"0.60195506",
"0.6001148",
"0.59941995",
"0.59182",
"0.59025663",
"0.58921665",
"0.5884187",
"0.585... | 0.5489333 | 53 |
This method saves the statistics of the player in memory | public void saveStats(int winnerId, GameActivity gameActivity) {
Player player0;
CardSuit trumpSuit;
ArrayList<Card> playerPile;
if (gameActivity.modality == 0) {
player0 = GameMaster.getInstance().getPlayers().get(0);
if (player0 instanceof PlayerAI){return;}
trumpSuit = GameTable.getInstance().getTrump();
} else {
RemoteGameMaster remoteGameMaster = RemoteGameMaster.getInstance();
trumpSuit = remoteGameMaster.getTrump().getSuit();
player0 = remoteGameMaster.getLocalPlayer();
}
//update stats only if match is played by a real player
if(player0 instanceof PlayerAI){return;}
totalPoints += player0.calculatePoints();
playerPile = player0.getPile();
if (winnerId == 0) {
wins++;
} else if (winnerId == 1) {
losses++;
} else {
draws++;
}
analyzePile(playerPile, trumpSuit);
SharedPreferencePersistence persistance = SharedPreferencePersistence.getInstance(context);
persistance.saveStatistic(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveStats() {\n this.saveStats(null);\n }",
"public void save()\n\t{\n\t\tfor(PlayerData pd : dataMap.values())\n\t\t\tpd.save();\n\t}",
"@Override\r\n\tpublic void SavePlayerData() {\r\n\r\n Player player = (Player)Player.getPlayerInstance();\r\n\t\t\r\n\t\tString file = \"PlayerI... | [
"0.7026127",
"0.6843498",
"0.6818793",
"0.67215747",
"0.66694474",
"0.6640287",
"0.6602645",
"0.6595677",
"0.6395932",
"0.63953274",
"0.6325954",
"0.6287836",
"0.6233558",
"0.6143301",
"0.61426306",
"0.603621",
"0.6028774",
"0.60130364",
"0.6007372",
"0.5972375",
"0.5967692",... | 0.6358711 | 10 |
This method calculates the loads and the trumps obtained by a player during the match by analyzing the player's pile at the end of the match | private void analyzePile(ArrayList<Card> pile, CardSuit trump) {
for (int i = 0; i < pile.size(); i++) {
CardValue value = pile.get(i).getValue();
CardSuit suit = pile.get(i).getSuit();
if (value == CardValue.ACE || value == CardValue.THREE)
this.loads++;
if (suit == trump)
this.trumps++;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void calculateResult() {\n\t\tfor (GameEngineCallback callback : callbacks) {\n\t\t\t// Roll for house\n\t\t\tthis.rollHouse(INITIAL_DELAY, FINAL_DELAY, DELAY_INCREMENT);\n\t\t\t\n\t\t\tfor (Player player : this.players.values()) {\n\t\t\t\t// Players who are playing must have a bet and a score\n\t\t\t\t// ... | [
"0.6229833",
"0.6044503",
"0.5859041",
"0.58495593",
"0.58475626",
"0.5790228",
"0.57890075",
"0.57730937",
"0.57687217",
"0.57276565",
"0.56915504",
"0.5650169",
"0.5615332",
"0.56122917",
"0.5601117",
"0.55950695",
"0.5587824",
"0.55692464",
"0.5554803",
"0.5525265",
"0.552... | 0.59421194 | 2 |
Put methods for controlling this subsystem here. Call these from Commands. | public void initDefaultCommand() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n /**\n * Set the default command for a subsystem here\n */\n public void initDefaultCommand() \n {\n // Set the default command for a subsystem here.\n // setDefaultCommand(new MySpecialCommand());\n }",
"@Override\n public void initDefaultCommand() {\n // Set the default command for... | [
"0.62314224",
"0.60199684",
"0.600779",
"0.5994197",
"0.5839986",
"0.58263487",
"0.58018154",
"0.5800751",
"0.5774303",
"0.5765803",
"0.57310116",
"0.5712051",
"0.56989545",
"0.5667754",
"0.56403124",
"0.562944",
"0.5619841",
"0.5619841",
"0.5599367",
"0.5586371",
"0.55790746... | 0.52273196 | 88 |
/ renamed from: a | public C0283b mo941a(String str, C0278a c0278a, int i, int i2, Map<C0293c, ?> map) {
if (c0278a == C0278a.ITF) {
return super.mo941a(str, c0278a, i, i2, map);
}
StringBuilder stringBuilder = new StringBuilder("Can only encode ITF, but got ");
stringBuilder.append(c0278a);
throw new IllegalArgumentException(stringBuilder.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed fr... | [
"0.62497115",
"0.6242887",
"0.61394435",
"0.61176854",
"0.6114027",
"0.60893",
"0.6046901",
"0.6024682",
"0.60201293",
"0.5975212",
"0.59482527",
"0.59121317",
"0.5883635",
"0.587841",
"0.58703005",
"0.5868436",
"0.5864884",
"0.5857492",
"0.58306104",
"0.5827752",
"0.58272064... | 0.0 | -1 |
/ renamed from: a | public boolean[] mo1603a(String str) {
int length = str.length();
if (length % 2 != 0) {
throw new IllegalArgumentException("The length of the input should be even");
} else if (length <= 80) {
boolean[] zArr = new boolean[((length * 9) + 9)];
int a = C0809o.m2096a(zArr, 0, f1950a, true);
for (int i = 0; i < length; i += 2) {
int digit = Character.digit(str.charAt(i), 10);
int digit2 = Character.digit(str.charAt(i + 1), 10);
int[] iArr = new int[18];
for (int i2 = 0; i2 < 5; i2++) {
int i3 = i2 * 2;
int[][] iArr2 = C0912l.f1949d;
iArr[i3] = iArr2[digit][i2];
iArr[i3 + 1] = iArr2[digit2][i2];
}
a += C0809o.m2096a(zArr, a, iArr, true);
}
C0809o.m2096a(zArr, a, f1951b, true);
return zArr;
} else {
StringBuilder stringBuilder = new StringBuilder("Requested contents should be less than 80 digits long, but got ");
stringBuilder.append(length);
throw new IllegalArgumentException(stringBuilder.toString());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed fr... | [
"0.62497115",
"0.6242887",
"0.61394435",
"0.61176854",
"0.6114027",
"0.60893",
"0.6046901",
"0.6024682",
"0.60201293",
"0.5975212",
"0.59482527",
"0.59121317",
"0.5883635",
"0.587841",
"0.58703005",
"0.5868436",
"0.5864884",
"0.5857492",
"0.58306104",
"0.5827752",
"0.58272064... | 0.0 | -1 |
Render the mover on the scene | public void PRCRender() {
if(rollOver) {
object.getStyle().setFillColorFloat(20);
} else if(dragging) {
object.getStyle().setFillColorFloat(5);
} else {
object.style.setFillColorFloat(100);
}
object.render();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void render() {\n \r\n stage.act();\r\n stage.draw();\r\n }",
"public void render(){\n\t\tstage.act();\n\t\tstage.draw();\n\t}",
"public void render () {\n\t\tcam.update();\n\t\tbatch.setProjectionMatrix(cam.combined);\n\t\trenderBackground();\n\t\t/*shapeRender.... | [
"0.6648004",
"0.65181404",
"0.64710516",
"0.63355094",
"0.6292628",
"0.6256292",
"0.6140423",
"0.6126414",
"0.6082967",
"0.60754025",
"0.60708946",
"0.59899294",
"0.59758085",
"0.5963705",
"0.5954916",
"0.5938828",
"0.59362614",
"0.59310675",
"0.59296685",
"0.5901127",
"0.588... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.