query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
this function analyse input merged vcut children and children's level and pick out all the matrixs and multiexpressions the output params are listMergeMatrixMExprs and listMergeMMLevel. They must be empty list when input. | public static void lookForMatrixMExprs(LinkedList<StructExprRecog> listMergeVCutChildren, LinkedList<Integer> listCharLevel,
LinkedList<StructExprRecog> listMergeMatrixMExprs, LinkedList<Integer> listMergeMMLevel) {
// 0 is normal mode
// 1 is round bracket mode
// 2 is square bracket mode
// 3 is brace mode
// 4 is vertical line mode
// 5 is double vertical line mode (not supported)
int nExprGoThroughMode = 0;
int nGoThroughModeStartIdx = -1;
int nMMLeft = Integer.MAX_VALUE, nMMRightP1 = Integer.MIN_VALUE;
int nMMTop = Integer.MAX_VALUE, nMMBottomP1 = Integer.MIN_VALUE;
boolean bGetMM = false;
for (int idx = 0; idx < listMergeVCutChildren.size(); idx ++) {
StructExprRecog ser = listMergeVCutChildren.get(idx);
if (nExprGoThroughMode == 0) { // we are in normal mode
if (idx != (listMergeVCutChildren.size() - 1) && !ser.isChildListType() && listCharLevel.get(idx) == 0) {
if (ser.mType == UnitProtoType.Type.TYPE_ROUND_BRACKET) {
nExprGoThroughMode = 1;
nGoThroughModeStartIdx = idx;
} else if (ser.mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET) {
nExprGoThroughMode = 2;
nGoThroughModeStartIdx = idx;
} else if (ser.mType == UnitProtoType.Type.TYPE_BRACE) {
nExprGoThroughMode = 3;
nGoThroughModeStartIdx = idx;
} else if (ser.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE) {
nExprGoThroughMode = 4;
nGoThroughModeStartIdx = idx;
} else if (ser.mnHeight / ser.mnWidth > ConstantsMgr.msdExtendableCharWOverHThresh * ConstantsMgr.msdCharWOverHGuaranteedExtRatio) {
// any other character that can be start of a matrix
nExprGoThroughMode = 5;
nGoThroughModeStartIdx = idx;
}
}
if (nExprGoThroughMode == 0) { //we are in normal mode
listMergeMatrixMExprs.add(ser);
listMergeMMLevel.add(listCharLevel.get(idx)); // listCharLevel.get(idx) should be 0
} else { // we start Matrix or M-expr mode
nMMLeft = Integer.MAX_VALUE;
nMMRightP1 = Integer.MIN_VALUE;
nMMTop = Integer.MAX_VALUE;
nMMBottomP1 = Integer.MIN_VALUE;
}
} else if ((!ser.isChildListType()) && listCharLevel.get(idx) == 0 // must be a base character
&& idx != (listMergeVCutChildren.size() - 1) // should not be in the last character
&& (ser.mType == UnitProtoType.Type.TYPE_ROUND_BRACKET
|| ser.mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET
|| ser.mType == UnitProtoType.Type.TYPE_BRACE
|| ser.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE
|| (ser.mType != UnitProtoType.Type.TYPE_CLOSE_ROUND_BRACKET
&& ser.mType != UnitProtoType.Type.TYPE_CLOSE_SQUARE_BRACKET
&& ser.mType != UnitProtoType.Type.TYPE_CLOSE_BRACE
&& ser.mType != UnitProtoType.Type.TYPE_VERTICAL_LINE
&& ser.mnHeight / ser.mnWidth > ConstantsMgr.msdExtendableCharWOverHThresh * ConstantsMgr.msdCharWOverHGuaranteedExtRatio)) // seems to be the beginning of a matrix
&& ser.mnTop <= listMergeVCutChildren.get(nGoThroughModeStartIdx).mnTop
&& ser.getBottomPlus1() >= listMergeVCutChildren.get(nGoThroughModeStartIdx).getBottomPlus1()) {
// we are not in normal mode, but old beginning of the matrix is not a real beginning of a matrix. Beginning of a matrix should start from here.
for (int idx1 = nGoThroughModeStartIdx; idx1 < idx; idx1 ++) {
//serFromGTS cannot be vertically cut. it must either be horizontally cut or a character.
StructExprRecog serFromGTS = listMergeVCutChildren.get(idx1);
listMergeMatrixMExprs.add(serFromGTS);
listMergeMMLevel.add(listCharLevel.get(idx1));
}
if (ser.mType == UnitProtoType.Type.TYPE_ROUND_BRACKET) {
nExprGoThroughMode = 1;
nGoThroughModeStartIdx = idx;
} else if (ser.mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET) {
nExprGoThroughMode = 2;
nGoThroughModeStartIdx = idx;
} else if (ser.mType == UnitProtoType.Type.TYPE_BRACE) {
nExprGoThroughMode = 3;
nGoThroughModeStartIdx = idx;
} else if (ser.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE) {
nExprGoThroughMode = 4;
nGoThroughModeStartIdx = idx;
} else if (ser.mnHeight / ser.mnWidth > ConstantsMgr.msdExtendableCharWOverHThresh * ConstantsMgr.msdCharWOverHGuaranteedExtRatio) {
nExprGoThroughMode = 5;
nGoThroughModeStartIdx = idx;
}
nMMLeft = Integer.MAX_VALUE;
nMMRightP1 = Integer.MIN_VALUE;
nMMTop = Integer.MAX_VALUE;
nMMBottomP1 = Integer.MIN_VALUE;
} else if (ser.isChildListType() == false && listCharLevel.get(idx) == 0 // must be a base character
&& (ser.getBottomPlus1() - listMergeVCutChildren.get(nGoThroughModeStartIdx).mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * ser.mnHeight
&& (listMergeVCutChildren.get(nGoThroughModeStartIdx).getBottomPlus1() - ser.mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * ser.mnHeight
&& ser.mnHeight > ConstantsMgr.msdOpenCloseBracketHeightRatio * listMergeVCutChildren.get(nGoThroughModeStartIdx).mnHeight // must have similar height as the start character
&& ser.mnHeight < 1/ConstantsMgr.msdOpenCloseBracketHeightRatio * listMergeVCutChildren.get(nGoThroughModeStartIdx).mnHeight
&& (ser.mType == UnitProtoType.Type.TYPE_CLOSE_ROUND_BRACKET
|| ser.mType == UnitProtoType.Type.TYPE_CLOSE_SQUARE_BRACKET
|| ser.mType == UnitProtoType.Type.TYPE_CLOSE_BRACE
|| ser.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE
|| (ser.mType != UnitProtoType.Type.TYPE_ROUND_BRACKET
&& ser.mType != UnitProtoType.Type.TYPE_SQUARE_BRACKET
&& ser.mType != UnitProtoType.Type.TYPE_BRACE
&& ser.mType != UnitProtoType.Type.TYPE_VERTICAL_LINE
&& ser.mnHeight / ser.mnWidth > ConstantsMgr.msdExtendableCharWOverHThresh * ConstantsMgr.msdCharWOverHGuaranteedExtRatio))) {
bGetMM = false;
boolean bHasBaseBlankDiv = false;
for (int idx1 = nGoThroughModeStartIdx + 1; idx1 < idx; idx1 ++) {
// should have at least one base level ser with type HBlankCut, otherwise, it cannot be a matrix.
if (listCharLevel.get(idx1) == 0 && listMergeVCutChildren.get(idx1).mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
bHasBaseBlankDiv = true;
break;
}
}
if (bHasBaseBlankDiv && (ser.getBottomPlus1() - nMMTop) > ConstantsMgr.msdMatrixBracketHeightRatio * ser.mnHeight
&& (nMMBottomP1 - ser.mnTop) > ConstantsMgr.msdMatrixBracketHeightRatio * ser.mnHeight
&& ser.mnHeight > ConstantsMgr.msdMatrixBracketHeightRatio * (nMMBottomP1 - nMMTop) // must have similar height as the start character
&& ser.mnHeight < 1/ConstantsMgr.msdMatrixBracketHeightRatio * (nMMBottomP1 - nMMTop)) { // we do have at least one H-blank cut between two brackets/vlines
// ok, this might be a matrix
// step a. first calculate average char width and average char height.
double dAvgCharWidth = 0, dAvgCharHeight = 0, dSumWeight = 0;
for (int idx2 = nGoThroughModeStartIdx + 1; idx2 < idx; idx2 ++) {
double[] darrayMetrics = listMergeVCutChildren.get(idx2).calcAvgCharMetrics();
dAvgCharWidth += darrayMetrics[AVG_CHAR_WIDTH_IDX] * darrayMetrics[CHAR_CNT_IDX];
dAvgCharHeight += darrayMetrics[AVG_CHAR_HEIGHT_IDX] * darrayMetrics[CHAR_CNT_IDX];
dSumWeight += darrayMetrics[CHAR_CNT_IDX];
}
if (dSumWeight > 0) {
dAvgCharWidth /= dSumWeight;
dAvgCharHeight /= dSumWeight;
} else {
dAvgCharWidth = ConstantsMgr.msnMinCharWidthInUnit;
dAvgCharHeight = ConstantsMgr.msnMinCharHeightInUnit;
}
// step b. find h divs.
LinkedList<Integer[]> listMMHDivs = new LinkedList<Integer[]>();
boolean bIsLastHDivLine = false, bIsHDivLine = true;
int nStartMMHDivIdx = -1, nEndMMHDivIdx = -1;
for (int idx1 = nMMTop; idx1 < nMMBottomP1; idx1 ++) {
bIsHDivLine = true;
for (int idx2 = nGoThroughModeStartIdx + 1; idx2 < idx; idx2 ++) {
StructExprRecog serMMChild = listMergeVCutChildren.get(idx2);
if (serMMChild.mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
for (int idx3 = 0; idx3 < serMMChild.mlistChildren.size(); idx3 ++) {
if (serMMChild.mlistChildren.get(idx3).mnTop <= idx1
&& idx1 < serMMChild.mlistChildren.get(idx3).getBottomPlus1()) {
// cut through one element.
bIsHDivLine = false;
break;
}
}
if (!bIsHDivLine) {
break;
}
} else { // serMMChild is a single element.
if (serMMChild.mnTop <= idx1
&& idx1 < serMMChild.getBottomPlus1()) {
// cut through one element.
bIsHDivLine = false;
break;
}
}
}
if (!bIsLastHDivLine && bIsHDivLine) { //start of hdiv
nStartMMHDivIdx = idx1;
} else if (bIsLastHDivLine && !bIsHDivLine) { // end of hdiv.
nEndMMHDivIdx = idx1 - 1;
if (nEndMMHDivIdx + 1 - nStartMMHDivIdx >= ConstantsMgr.msdMatrixMExprsHDivRelaxRatio * dAvgCharHeight) {
Integer[] narrayHDivTopBottom = new Integer[2];
narrayHDivTopBottom[0] = nStartMMHDivIdx;
narrayHDivTopBottom[1] = nEndMMHDivIdx;
listMMHDivs.add(narrayHDivTopBottom);
}
}
bIsLastHDivLine = bIsHDivLine;
}
for (int idx1 = 0; idx1 < listMMHDivs.size(); idx1 ++) {
int nStartIdx = listMMHDivs.get(idx1)[0];
int nEndIdx = listMMHDivs.get(idx1)[1];
if (nEndIdx + 1 - nStartIdx < ConstantsMgr.msdMatrixMExprsHDivRatio * dAvgCharHeight) {
// the h-div gap is not wide enough, need to double-check
int nLastHCutTop = (idx1 == 0)?nMMTop:(listMMHDivs.get(idx1 - 1)[1] + 1);
int nLastHCutBtmP1 = nStartIdx;
int nNextHCutTop = nEndIdx + 1;
int nNextHCutBtmP1 = (idx1 == listMMHDivs.size() - 1)?nMMBottomP1:listMMHDivs.get(idx1 + 1)[0];
int nSumGapTimesWidth = 0, nSumWidth = 0;
for (int idx2 = nGoThroughModeStartIdx + 1; idx2 < idx; idx2 ++) {
StructExprRecog serMMChild = listMergeVCutChildren.get(idx2);
if (serMMChild.mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
int nLastChildInLastHCut = -1, nFirstChildInNextHCut = -1;
for (int idx3 = 0; idx3 < serMMChild.mlistChildren.size(); idx3 ++) {
if (serMMChild.mlistChildren.get(idx3).mnTop > nLastHCutTop) {
continue; // haven't been in last hcut, continue;
}
if (serMMChild.mlistChildren.get(idx3).mnTop >= nLastHCutTop
&& nLastHCutBtmP1 >= serMMChild.mlistChildren.get(idx3).getBottomPlus1()) {
// cut through one element.
nLastChildInLastHCut = idx3;
} else if (serMMChild.mlistChildren.get(idx3).mnTop >= nNextHCutTop
&& nNextHCutBtmP1 >= serMMChild.mlistChildren.get(idx3).getBottomPlus1()
/*&& nFirstChildInNextHCut == -1*/) { // no need to check if nFirstChildInNextHCut == -1 coz it will break anyway.
nFirstChildInNextHCut = idx3;
break;
}
if (serMMChild.mlistChildren.get(idx3).mnTop >= nNextHCutBtmP1) { // have been beyond next hcut, so exit.
break;
}
}
if (nLastChildInLastHCut != -1 && nFirstChildInNextHCut != -1) {
int nGap = serMMChild.mlistChildren.get(nFirstChildInNextHCut).mnTop
- serMMChild.mlistChildren.get(nLastChildInLastHCut).getBottomPlus1();
int nWidth = serMMChild.mnWidth;
nSumGapTimesWidth += nGap * nWidth;
nSumWidth += nWidth;
}
}
}
double dExtHDivHeight = nEndIdx + 1 - nStartIdx;
if (nSumWidth > 0) {
dExtHDivHeight = (double)nSumGapTimesWidth/(double)nSumWidth;
}
if (dExtHDivHeight < ConstantsMgr.msdMatrixMExprsExtHDivRatio * dAvgCharHeight) {
// even consider ext h-div, it is still too narrow, it cannot be a h-div.
listMMHDivs.remove(idx1);
idx1 --;
}
}
}
// step c. find v divs.
LinkedList<Integer[]> listMMVDivs = new LinkedList<Integer[]>();
boolean bIsLastVDivLine = false, bIsVDivLine = true;
int nStartMMVDivIdx = -1, nEndMMVDivIdx = -1;
for (int idx1 = nMMLeft; idx1 < nMMRightP1; idx1 ++) {
bIsVDivLine = true;
for (int idx2 = nGoThroughModeStartIdx + 1; idx2 < idx; idx2 ++) {
StructExprRecog serMMChild = listMergeVCutChildren.get(idx2);
// serMMChild must be a single element or Hcut list. All vcut children has been merged in listMergeVCutChildren.
if (serMMChild.mnLeft <= idx1
&& idx1 < serMMChild.getRightPlus1()) {
// cut through one element.
bIsVDivLine = false;
break;
}
}
if (!bIsLastVDivLine && bIsVDivLine) { //start of vdiv
nStartMMVDivIdx = idx1;
} else if (bIsLastVDivLine && !bIsVDivLine) { // end of vdiv.
nEndMMVDivIdx = idx1 - 1;
if (nEndMMVDivIdx + 1 - nStartMMVDivIdx >= ConstantsMgr.msdMatrixMExprsVDivRatio * dAvgCharWidth) {
boolean bIsaVCut = true;
double dAvgChildGapWidth = 0;
for (int idxHCutChild = 0; idxHCutChild <= listMMHDivs.size(); idxHCutChild ++) {
int nChildTop, nChildBottom, nVChildGapLeft = Integer.MIN_VALUE, nVChildGapRight = Integer.MAX_VALUE;
if (idxHCutChild == 0) {
nChildTop = nMMTop;
nChildBottom = (listMMHDivs.size() > 0)?(listMMHDivs.getFirst()[0] - 1):(nMMBottomP1 - 1);
} else if (idxHCutChild == listMMHDivs.size()) {
// need not to worry about listMMHDivs.size() == 0 coz if listMMHDivs.size() == 0 then idxHCutChild == 0, this branch is not executed.
nChildTop = listMMHDivs.getLast()[1] + 1;;
nChildBottom = nMMBottomP1 - 1;
} else {
nChildTop = listMMHDivs.get(idxHCutChild - 1)[1] + 1;;
nChildBottom = listMMHDivs.get(idxHCutChild)[0] - 1;;
}
for (int idxMMChild = nGoThroughModeStartIdx + 1; idxMMChild < idx; idxMMChild ++) {
StructExprRecog serMMChild = listMergeVCutChildren.get(idxMMChild);
if (serMMChild.getRightPlus1() <= nStartMMVDivIdx) { // MMChild left of gap
if (serMMChild.mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
for (int idxMMGrandChild = 0; idxMMGrandChild < serMMChild.mlistChildren.size(); idxMMGrandChild ++) {
StructExprRecog serMMGrandChild = serMMChild.mlistChildren.get(idxMMGrandChild);
if (serMMGrandChild.mnTop >= nChildTop && serMMGrandChild.getBottom() <= nChildBottom
&& serMMGrandChild.getRightPlus1() > nVChildGapLeft) {
nVChildGapLeft = serMMGrandChild.getRightPlus1();
}
}
} else { // treated as a single element.
if (serMMChild.mnTop >= nChildTop && serMMChild.getBottom() <= nChildBottom
&& serMMChild.getRightPlus1() > nVChildGapLeft) {
nVChildGapLeft = serMMChild.getRightPlus1();
}
}
} else { // MMChild right of gap.
if (serMMChild.mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
for (int idxMMGrandChild = 0; idxMMGrandChild < serMMChild.mlistChildren.size(); idxMMGrandChild ++) {
StructExprRecog serMMGrandChild = serMMChild.mlistChildren.get(idxMMGrandChild);
if (serMMGrandChild.mnTop >= nChildTop && serMMGrandChild.getBottom() <= nChildBottom
&& serMMGrandChild.mnLeft <= nVChildGapRight) {
nVChildGapRight = serMMGrandChild.mnLeft - 1;
}
}
} else { // treated as a single element.
if (serMMChild.mnTop >= nChildTop && serMMChild.getBottom() <= nChildBottom
&& serMMChild.mnLeft <= nVChildGapRight) {
nVChildGapRight = serMMChild.mnLeft - 1;
}
}
}
}
int nChildGap = nVChildGapRight - nVChildGapLeft + 1;
if (nChildGap < ConstantsMgr.msdMatrixMExprsChildVDivRatio * dAvgCharWidth) {
bIsaVCut = false;
break;
}
dAvgChildGapWidth += nChildGap;
}
if (bIsaVCut) {
dAvgChildGapWidth /= (listMMHDivs.size() + 1);
if (dAvgChildGapWidth >= ConstantsMgr.msdMatrixMExprsAvgChildVDivRatio * dAvgCharWidth) {
Integer[] narrayVDivLeftRight = new Integer[2];
narrayVDivLeftRight[0] = nStartMMVDivIdx;
narrayVDivLeftRight[1] = nEndMMVDivIdx;
listMMVDivs.add(narrayVDivLeftRight);
}
}
}
}
bIsLastVDivLine = bIsVDivLine;
}
// step d. get matrix.
if (listMMHDivs.size() == 0) {
// this is not a matrix,
bGetMM = false;
} else {
bGetMM = true;
// this is a matrix.
LinkedList<StructExprRecog> listMatrixCols = new LinkedList<StructExprRecog>();
int nVChildStartIdx = nGoThroughModeStartIdx + 1;
for (int idx1 = 0; idx1 <= listMMVDivs.size(); idx1 ++) {
int nVChildEndIdx = idx - 1;
for (int idx3 = nVChildStartIdx; idx3 < idx; idx3 ++) {
if (idx1 != listMMVDivs.size()
&& listMergeVCutChildren.get(idx3).getRightPlus1() > listMMVDivs.get(idx1)[0]) {
nVChildEndIdx = idx3 - 1;
break;
}
}
StructExprRecog serMatrixCol = new StructExprRecog(listMergeVCutChildren.get(idx).mbarrayBiValues);
LinkedList<StructExprRecog> listMatrixColChildren = new LinkedList<StructExprRecog>();
int[] narrayRowStartIdices = new int[nVChildEndIdx - nVChildStartIdx + 1];
for (int idx2 = 0; idx2 <= listMMHDivs.size(); idx2 ++) {
LinkedList<StructExprRecog> listMatrixCellChildren = new LinkedList<StructExprRecog>();
for (int idx3 = nVChildStartIdx; idx3 <= nVChildEndIdx; idx3 ++) {
StructExprRecog serThisVChild = listMergeVCutChildren.get(idx3);
StructExprRecog serVChildInCell = new StructExprRecog(listMergeVCutChildren.get(idx).mbarrayBiValues);
if (serThisVChild.mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
int nRowEndIdx = serThisVChild.mlistChildren.size() - 1;
if (idx2 != listMMHDivs.size()) {
int idx4 = narrayRowStartIdices[idx3 - nVChildStartIdx];
if (idx4 >= serThisVChild.mlistChildren.size()
|| serThisVChild.mlistChildren.get(idx4).mnTop >= listMMHDivs.get(idx2)[0]) {
//narrayRowStartIdices[idx3 - nVChildStartIdx] has been beyond list children size()
// or child narrayRowStartIdices[idx3 - nVChildStartIdx] is below this H Div, continue;
continue;
} else {
for (; idx4 < serThisVChild.mlistChildren.size(); idx4 ++) {
if (serThisVChild.mlistChildren.get(idx4).mnTop >= listMMHDivs.get(idx2)[0]) {
nRowEndIdx = idx4 - 1;
break;
}
}
}
}
if (narrayRowStartIdices[idx3 - nVChildStartIdx] == nRowEndIdx) {
// single child.
serVChildInCell = serThisVChild.mlistChildren.get(nRowEndIdx);
listMatrixCellChildren.add(serVChildInCell);
} else if (narrayRowStartIdices[idx3 - nVChildStartIdx] < nRowEndIdx) {
// multiple child.
serVChildInCell = restructHDivMatrixMExprChild(serThisVChild.mlistChildren, narrayRowStartIdices[idx3 - nVChildStartIdx], nRowEndIdx);
listMatrixCellChildren.add(serVChildInCell);
}
narrayRowStartIdices[idx3 - nVChildStartIdx] = nRowEndIdx + 1;
} else { // single element.
int nRowEndIdx = -1;
if (idx2 == 0) {
if (serThisVChild.getBottomPlus1() <= listMMHDivs.get(idx2)[0]) {
nRowEndIdx = 0;
}
} else if (idx2 == listMMHDivs.size()) {
if (serThisVChild.mnTop > listMMHDivs.get(idx2 - 1)[1]) {
nRowEndIdx = 0;
}
} else if (serThisVChild.mnTop > listMMHDivs.get(idx2 - 1)[1] && serThisVChild.getBottomPlus1() <= listMMHDivs.get(idx2)[0]) {
nRowEndIdx = 0;
}
if (nRowEndIdx == 0) {
serVChildInCell = serThisVChild;
listMatrixCellChildren.add(serVChildInCell);
}
}
}
StructExprRecog serMatrixElem = new StructExprRecog(listMergeVCutChildren.get(idx).mbarrayBiValues);
if (listMatrixCellChildren.size() == 0) {
int nCellLeft = (idx1 == 0)?nMMLeft:(listMMVDivs.get(idx1 - 1)[1] + 1);
int nCellTop = (idx2 == 0)?nMMTop:(listMMHDivs.get(idx2 - 1)[1] + 1);
int nCellRightP1 = (idx1 == listMMVDivs.size())?nMMRightP1:listMMVDivs.get(idx1)[0];
int nCellBottomP1 = (idx2 == listMMHDivs.size())?nMMBottomP1:listMMHDivs.get(idx2)[0];
ImageChop imgChop = new ImageChop();
byte[][] barrayImg = new byte[nCellRightP1 - nCellLeft][nCellBottomP1 - nCellTop];
imgChop.setImageChop(barrayImg, 0, 0, nCellRightP1 - nCellLeft, nCellBottomP1 - nCellTop,
listMergeVCutChildren.get(idx).mbarrayBiValues, nCellLeft, nCellTop, ImageChop.TYPE_UNKNOWN);
serMatrixElem.setStructExprRecog(UnitProtoType.Type.TYPE_EMPTY, "",
nCellLeft, nCellTop, nCellRightP1 - nCellLeft, nCellBottomP1 - nCellTop, imgChop, 1);
} else if (listMatrixCellChildren.size() == 1) {
serMatrixElem = listMatrixCellChildren.getFirst();
} else {
serMatrixElem.setStructExprRecog(listMatrixCellChildren, EXPRRECOGTYPE_VBLANKCUT);
}
listMatrixColChildren.add(serMatrixElem);
}
serMatrixCol.setStructExprRecog(listMatrixColChildren, EXPRRECOGTYPE_HBLANKCUT);
listMatrixCols.add(serMatrixCol);
nVChildStartIdx = nVChildEndIdx + 1;
}
StructExprRecog serMatrix = new StructExprRecog(listMergeVCutChildren.get(idx).mbarrayBiValues);
serMatrix.setStructExprRecog(listMatrixCols, EXPRRECOGTYPE_VCUTMATRIX);
if (nExprGoThroughMode == 4
|| ser.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE) {
// if the matrix is surrouned by vertical line.
StructExprRecog serStart = listMergeVCutChildren.get(nGoThroughModeStartIdx).clone();
// need not to reset left top width height coz serStart's left top width height have been cloned.
// similarly, need not to reset similarity
// here serStart should be an enum type, so need not to worry about image chop.
serStart.changeSEREnumType(UnitProtoType.Type.TYPE_VERTICAL_LINE, serStart.mstrFont);
StructExprRecog serEnd = ser.clone();
// need not to reset left top width height coz serEnd's left top width height have been cloned.
// similarly, need not to reset similarity
// here serEnd should be an enum type, so need not to worry about image chop.
serEnd.changeSEREnumType(UnitProtoType.Type.TYPE_VERTICAL_LINE, serEnd.mstrFont);
listMergeMatrixMExprs.add(serStart);
listMergeMMLevel.add(listCharLevel.get(nGoThroughModeStartIdx)); //listCharLevel.get(nGoThroughModeStartIdx) should be 0
listMergeMatrixMExprs.add(serMatrix);
listMergeMMLevel.add(listCharLevel.get(idx)); // listCharLevel.get(idx) should be 0
listMergeMatrixMExprs.add(serEnd);
listMergeMMLevel.add(listCharLevel.get(idx)); // listCharLevel.get(idx) should be 0
} else {
// the {([ and ])} should not be shown.
listMergeMatrixMExprs.add(serMatrix);
listMergeMMLevel.add(listCharLevel.get(idx)); // listCharLevel.get(idx) should be 0
}
nExprGoThroughMode = 0;
nGoThroughModeStartIdx = -1;
}
}
if (bGetMM == false) { // is not Matrix or M-exprs.
// exit to normal mode, but rewind idx to idx - 1 because if it is v-line, it could be start of a matrix.
for (int idx1 = nGoThroughModeStartIdx; idx1 < idx; idx1 ++) {
//serFromGTS cannot be vertically cut. it must either be horizontally cut or a character.
StructExprRecog serFromGTS = listMergeVCutChildren.get(idx1);
listMergeMatrixMExprs.add(serFromGTS);
listMergeMMLevel.add(listCharLevel.get(idx1));
}
nExprGoThroughMode = 0;
nGoThroughModeStartIdx = -1;
idx --;
}
} else {
// in the middle of a matrix.
nMMLeft = (nMMLeft > ser.mnLeft)?ser.mnLeft:nMMLeft;
nMMRightP1 = (nMMRightP1 < ser.getRightPlus1())?ser.getRightPlus1():nMMRightP1;
nMMTop = (nMMTop > ser.mnTop)?ser.mnTop:nMMTop;
nMMBottomP1 = (nMMBottomP1 < ser.getBottomPlus1())?ser.getBottomPlus1():nMMBottomP1;
}
}
bGetMM = false;
if (nGoThroughModeStartIdx >= 0 && nGoThroughModeStartIdx < listMergeVCutChildren.size() - 1 && nExprGoThroughMode == 3) {
// ok we are following brace and brace is not the last char.
StructExprRecog serStartBrace = listMergeVCutChildren.get(nGoThroughModeStartIdx);
if ((serStartBrace.getBottomPlus1() - nMMTop) > ConstantsMgr.msdMatrixBracketHeightRatio * serStartBrace.mnHeight
&& (nMMBottomP1 - serStartBrace.mnTop) > ConstantsMgr.msdMatrixBracketHeightRatio * serStartBrace.mnHeight
&& serStartBrace.mnHeight > ConstantsMgr.msdMatrixBracketHeightRatio * (nMMBottomP1 - nMMTop) // must have similar height as the start character
&& serStartBrace.mnHeight < 1/ConstantsMgr.msdMatrixBracketHeightRatio * (nMMBottomP1 - nMMTop)) {
// step a. first calculate average char height and initialize variables.
double dAvgCharHeight = 0, dSumWeight = 0;
boolean bIsLastHDivLine = false, bIsHDivLine = true;
int nStartMMHDivIdx = -1, nEndMMHDivIdx = -1;
LinkedList<StructExprRecog> listMExprElems = new LinkedList<StructExprRecog>();
LinkedList<Integer[]> listLastCutThru = new LinkedList<Integer[]>();
LinkedList<Integer> listGapSizes = new LinkedList<Integer>();
Integer[] narrayB4LastCutThruIdx = new Integer[listMergeVCutChildren.size() - nGoThroughModeStartIdx - 1];
Integer[] narrayLastCutThroughIdx = new Integer[listMergeVCutChildren.size() - nGoThroughModeStartIdx - 1];
for (int idx2 = nGoThroughModeStartIdx + 1; idx2 < listMergeVCutChildren.size(); idx2 ++) {
narrayB4LastCutThruIdx[idx2 - nGoThroughModeStartIdx - 1] = -1;
narrayLastCutThroughIdx[idx2 - nGoThroughModeStartIdx - 1] = -1;
double[] darrayMetrics = listMergeVCutChildren.get(idx2).calcAvgCharMetrics();
dAvgCharHeight += darrayMetrics[AVG_CHAR_HEIGHT_IDX] * darrayMetrics[CHAR_CNT_IDX];
dSumWeight += darrayMetrics[CHAR_CNT_IDX];
}
if (dSumWeight > 0) {
dAvgCharHeight /= dSumWeight;
} else {
dAvgCharHeight = ConstantsMgr.msnMinCharHeightInUnit;
}
// step b. find h div
for (int idx1 = nMMTop; idx1 < nMMBottomP1; idx1 ++) {
bIsHDivLine = true;
for (int idx2 = nGoThroughModeStartIdx + 1; idx2 < listMergeVCutChildren.size(); idx2 ++) {
narrayB4LastCutThruIdx[idx2 - nGoThroughModeStartIdx - 1] = narrayLastCutThroughIdx[idx2 - nGoThroughModeStartIdx - 1];
StructExprRecog serMMChild = listMergeVCutChildren.get(idx2);
if (serMMChild.mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
for (int idx3 = 0; idx3 < serMMChild.mlistChildren.size(); idx3 ++) {
if (serMMChild.mlistChildren.get(idx3).mnTop <= idx1
&& idx1 < serMMChild.mlistChildren.get(idx3).getBottomPlus1()) {
// cut through one element.
bIsHDivLine = false;
narrayLastCutThroughIdx[idx2 - nGoThroughModeStartIdx - 1] = idx3;
break;
}
}
} else { // serMMChild is a single element.
if (serMMChild.mnTop <= idx1
&& idx1 < serMMChild.getBottomPlus1()) {
// cut through one element.
bIsHDivLine = false;
narrayLastCutThroughIdx[idx2 - nGoThroughModeStartIdx - 1] = 0;
}
}
}
if (!bIsLastHDivLine && bIsHDivLine) { //start of hdiv
nStartMMHDivIdx = idx1;
} else if (bIsLastHDivLine && !bIsHDivLine) { // end of hdiv.
nEndMMHDivIdx = idx1 - 1;
if (nEndMMHDivIdx + 1 - nStartMMHDivIdx >= ConstantsMgr.msdMatrixMExprsHDivRelaxRatio * dAvgCharHeight) {
Integer[] narrayCutThru2Store = new Integer[listMergeVCutChildren.size() - nGoThroughModeStartIdx - 1];
for (int idx2 = nGoThroughModeStartIdx + 1; idx2 < listMergeVCutChildren.size(); idx2 ++) {
int nEndChildIdx = narrayB4LastCutThruIdx[idx2 - nGoThroughModeStartIdx - 1];
narrayCutThru2Store[idx2 - nGoThroughModeStartIdx - 1] = nEndChildIdx;
}
listLastCutThru.add(narrayCutThru2Store);
listGapSizes.add(nEndMMHDivIdx + 1 - nStartMMHDivIdx);
}
}
bIsLastHDivLine = bIsHDivLine;
}
// ok, now double check if some gaps are too narrow.
for (int idx1 = 0; idx1 < listGapSizes.size(); idx1 ++) {
if (listGapSizes.get(idx1) < ConstantsMgr.msdMatrixMExprsHDivRatio * dAvgCharHeight) {
// gap size is not wide enough, we need to do double check.
int nSumGapTimesWidth = 0, nSumWidth = 0;
int nNumOfVCuts = listMergeVCutChildren.size() - nGoThroughModeStartIdx - 1;
for (int idx2 = 0; idx2 < nNumOfVCuts; idx2 ++) {
int nLastHCutIdx = listLastCutThru.get(idx1)[idx2];
int nNextHCutIdx;
StructExprRecog serThisVCutChild = listMergeVCutChildren.get(idx2 + nGoThroughModeStartIdx + 1);
if (idx1 == listGapSizes.size() - 1) { // this is the last gap
if (serThisVCutChild.mnExprRecogType != EXPRRECOGTYPE_HBLANKCUT) {
nNextHCutIdx = 0;
} else {
nNextHCutIdx = serThisVCutChild.mlistChildren.size() - 1; // last child idx.
}
} else { // this is not the last gap.
nNextHCutIdx = listLastCutThru.get(idx1 + 1)[idx2];
}
if (nNextHCutIdx > nLastHCutIdx) { // at this moment nNextHCutIdx is actually the last child in next h-cut, not the first, so adjust it to the first child.
nNextHCutIdx = nLastHCutIdx + 1;
if (nLastHCutIdx >= 0) { // it is not -1, and serThisVCutChild must be h-blank cut.
int nWidth = serThisVCutChild.mnWidth;
int nGap = serThisVCutChild.mlistChildren.get(nNextHCutIdx).mnTop - serThisVCutChild.mlistChildren.get(nLastHCutIdx).getBottomPlus1();
nSumGapTimesWidth += nGap * nWidth;
nSumWidth += nWidth;
}
}
}
double dExtGapSize = (nSumWidth == 0)?listGapSizes.get(idx1):(double)nSumGapTimesWidth / (double)nSumWidth;
if (dExtGapSize < ConstantsMgr.msdMatrixMExprsExtHDivRatio * dAvgCharHeight) {
// even consider ext-gap, the gap is still too narrow.
listGapSizes.remove(idx1);
listLastCutThru.remove(idx1);
idx1 --;
}
}
}
// now after remove all too narrow gaps, we can construct child expressions.
for (int idx1 = 0; idx1 <= listLastCutThru.size(); idx1 ++) {
StructExprRecog serMExprsElem = new StructExprRecog(listMergeVCutChildren.get(nGoThroughModeStartIdx).mbarrayBiValues);
LinkedList<StructExprRecog> listMExprsElemChildren = new LinkedList<StructExprRecog>();
for (int idx2 = nGoThroughModeStartIdx + 1; idx2 < listMergeVCutChildren.size(); idx2 ++) {
int nStartChildIdx = (idx1 == 0)?0
:(listLastCutThru.get(idx1 - 1)[idx2 - nGoThroughModeStartIdx - 1] + 1);
int nEndChildIdx;
if (idx1 < listLastCutThru.size()) {
nEndChildIdx = listLastCutThru.get(idx1)[idx2 - nGoThroughModeStartIdx - 1];
} else {
nEndChildIdx = (listMergeVCutChildren.get(idx2).mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT)
?(listMergeVCutChildren.get(idx2).mlistChildren.size() - 1):0;
}
if (nEndChildIdx == nStartChildIdx) {
if (listMergeVCutChildren.get(idx2).mnExprRecogType != EXPRRECOGTYPE_HBLANKCUT) {
// in this case nStartChildIdx and nEndChildIdx must be 0.
listMExprsElemChildren.add(listMergeVCutChildren.get(idx2));
} else {
listMExprsElemChildren.add(listMergeVCutChildren.get(idx2).mlistChildren.get(nEndChildIdx));
}
} else if (nEndChildIdx > nStartChildIdx) {
StructExprRecog serMEChild = restructHDivMatrixMExprChild(listMergeVCutChildren.get(idx2).mlistChildren, nStartChildIdx, nEndChildIdx);
listMExprsElemChildren.add(serMEChild);
}
}
if (listMExprsElemChildren.size() == 0) {
// actually this will not happen.
} else if (listMExprsElemChildren.size() == 1) {
serMExprsElem = listMExprsElemChildren.getFirst();
} else {
serMExprsElem.setStructExprRecog(listMExprsElemChildren, EXPRRECOGTYPE_VBLANKCUT);
}
listMExprElems.add(serMExprsElem);
}
// now all the children are ready, construct serMExprs.
StructExprRecog serMExprs = new StructExprRecog(listMergeVCutChildren.get(nGoThroughModeStartIdx).mbarrayBiValues);
if (listMExprElems.size() == 1) {
serMExprs = listMExprElems.getFirst();
} else if (listMExprElems.size() > 1) {
serMExprs.setStructExprRecog(listMExprElems, EXPRRECOGTYPE_MULTIEXPRS);
} else {
//actually this will not happen, if happens, means a bug.
}
// add multiexpres into return param
listMergeMatrixMExprs.add(serStartBrace);
listMergeMMLevel.add(listCharLevel.get(nGoThroughModeStartIdx));
listMergeMatrixMExprs.add(serMExprs);
listMergeMMLevel.add(listCharLevel.get(nGoThroughModeStartIdx));
bGetMM = true;
}
}
if (bGetMM == false && nExprGoThroughMode != 0) { // we are still in abnormal mode.
//add unmerged to return param
for (int idx1 = nGoThroughModeStartIdx; idx1 < listMergeVCutChildren.size(); idx1 ++) {
//serFromGTS cannot be vertically cut. it must either be horizontally cut or a character.
StructExprRecog serFromGTS = listMergeVCutChildren.get(idx1);
listMergeMatrixMExprs.add(serFromGTS);
listMergeMMLevel.add(listCharLevel.get(idx1));
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void loadTree() throws NotBoundException, MalformedURLException, RemoteException, ClassNotFoundException, SQLException, InterruptedException {\n\n List<Object> ob1 = new ArrayList<>();\n ob1.add(1);\n ob1.add(1);\n//db Access1 \n List<List<Object>> sspFindMultyResul... | [
"0.5268098",
"0.48641083",
"0.4768136",
"0.47386518",
"0.4724392",
"0.4718642",
"0.47090706",
"0.46983567",
"0.4617505",
"0.4544636",
"0.45405447",
"0.45360434",
"0.44980127",
"0.4496603",
"0.44925898",
"0.44844973",
"0.44805574",
"0.44767112",
"0.44700566",
"0.44667906",
"0.... | 0.6610569 | 0 |
assume listHDivChildren size is not 0 or 1. | public static StructExprRecog restructHDivMatrixMExprChild(LinkedList<StructExprRecog> listHDivChildren, int nStart, int nEnd) {
if (listHDivChildren.size() == 0 || nStart > nEnd) {
return null; // this should not happen.
} else if (nStart == nEnd) {
return listHDivChildren.get(nStart);
}
int mnLeft = Integer.MAX_VALUE, mnTop = Integer.MAX_VALUE, mnRightP1 = Integer.MIN_VALUE, mnBottomP1 = Integer.MIN_VALUE;
for (int idx = nStart; idx <= nEnd; idx ++) {
if (listHDivChildren.get(idx).mnLeft < mnLeft) {
mnLeft = listHDivChildren.get(idx).mnLeft;
}
if (listHDivChildren.get(idx).mnTop < mnTop) {
mnTop = listHDivChildren.get(idx).mnTop;
}
if (listHDivChildren.get(idx).getRightPlus1() > mnRightP1) {
mnRightP1 = listHDivChildren.get(idx).getRightPlus1();
}
if (listHDivChildren.get(idx).getBottomPlus1() > mnBottomP1) {
mnBottomP1 = listHDivChildren.get(idx).getBottomPlus1();
}
}
int mnWidth = mnRightP1 - mnLeft, mnHeight = mnBottomP1 - mnTop;
int nLongestHDivIdx = -1;
int mnMinLnDivLen = (int)Math.max(mnWidth * ConstantsMgr.msdWorstCaseLineDivOnLenRatio,
(mnWidth - 2.0 * ConstantsMgr.msnMinNormalCharWidthInUnit));
for (int idx = nStart; idx <= nEnd; idx ++) {
if (listHDivChildren.get(idx).mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& listHDivChildren.get(idx).mType == UnitProtoType.Type.TYPE_SUBTRACT
&& listHDivChildren.get(idx).mnWidth >= mnMinLnDivLen
&& (nLongestHDivIdx == -1
|| listHDivChildren.get(idx).mnWidth > listHDivChildren.get(nLongestHDivIdx).mnWidth)) {
nLongestHDivIdx = idx;
}
}
int nDivType = -1; // 0 means blank cut, 1 means top bar, 2 means bottom bar, 3 means line div.
// Currently assume top and bottom divs have been clearly identified in exprseperator
// so we only need to identify if it is line div.
if (nLongestHDivIdx > nStart && nLongestHDivIdx < nEnd) {
StructExprRecog serLnDiv = listHDivChildren.get(nLongestHDivIdx);
StructExprRecog serTop = listHDivChildren.get(nLongestHDivIdx - 1);
StructExprRecog serBtm = listHDivChildren.get(nLongestHDivIdx + 1);
int nGapTop = serLnDiv.mnTop - serTop.getBottomPlus1();
int nGapBtm = serBtm.mnTop - serLnDiv.getBottomPlus1();
double dLnDivGapRefHeight = ConstantsMgr.msdExpressionGap * Math.min(serTop.mnHeight, serBtm.mnHeight);
if ((serTop.mnExprRecogType != EXPRRECOGTYPE_ENUMTYPE || serTop.mType != UnitProtoType.Type.TYPE_SUBTRACT)
&& nGapTop <= dLnDivGapRefHeight
&& (serBtm.mnExprRecogType != EXPRRECOGTYPE_ENUMTYPE || serBtm.mType != UnitProtoType.Type.TYPE_SUBTRACT)
&& nGapBtm <= dLnDivGapRefHeight) {
nDivType = 3; // line div
} else {
nDivType = 0; // if gap is too narrow, it either have been merged in exprseperator or has been identified as top bottom there.
}
}
StructExprRecog serReturn = new StructExprRecog(listHDivChildren.getFirst().mbarrayBiValues);
if (nDivType == 3) {
LinkedList<StructExprRecog> listDivChildren = new LinkedList<StructExprRecog>();
StructExprRecog serNewFirst = restructHDivMatrixMExprChild(listHDivChildren, nStart, nLongestHDivIdx - 1);
StructExprRecog serNewLast = restructHDivMatrixMExprChild(listHDivChildren, nLongestHDivIdx + 1, nEnd);
listDivChildren.add(serNewFirst);
listDivChildren.add(listHDivChildren.get(nLongestHDivIdx));
listDivChildren.add(serNewLast);
serReturn.setStructExprRecog(listDivChildren, StructExprRecog.EXPRRECOGTYPE_HLINECUT);
} else {
LinkedList<StructExprRecog> listHCutChildren = new LinkedList<StructExprRecog>();
for (int idx = nStart; idx <= nEnd; idx ++) {
listHCutChildren.add(listHDivChildren.get(idx));
}
serReturn.setStructExprRecog(listHCutChildren, EXPRRECOGTYPE_HBLANKCUT);
}
return serReturn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract List<T> getChildren();",
"public int getChildCount() {return children.size();}",
"public List<RealObject> getChildren();",
"private void initChildList() {\n if (childList == null) {\n childList = new ArrayList<>();\n }\n }",
"List<UIComponent> getChildren();",... | [
"0.614584",
"0.6015187",
"0.59492296",
"0.59485245",
"0.59208095",
"0.5853816",
"0.58425057",
"0.58018124",
"0.5788579",
"0.5704668",
"0.5679706",
"0.5678553",
"0.5667127",
"0.5663888",
"0.56184846",
"0.55872023",
"0.55765",
"0.55322856",
"0.55283415",
"0.55171806",
"0.549073... | 0.61974996 | 0 |
it is possible that ser is a type like hcap, but principle is hblank cut, so this is wrong struct, the bottom hblank cuts in principle should be the top level children, the first hblank cut is the real principle for hcap. | public StructExprRecog preRestructHDivSer4MatrixMExprs(StructExprRecog ser) {
switch(ser.mnExprRecogType) {
case StructExprRecog.EXPRRECOGTYPE_HBLANKCUT: {
LinkedList<StructExprRecog> listNewSers = new LinkedList<StructExprRecog>();
for (int idx = 0; idx < ser.mlistChildren.size(); idx ++) {
StructExprRecog serNewChild = preRestructHDivSer4MatrixMExprs(ser.mlistChildren.get(idx));
if (serNewChild.mnExprRecogType == StructExprRecog.EXPRRECOGTYPE_HBLANKCUT) {
listNewSers.addAll(serNewChild.mlistChildren);
} else {
listNewSers.add(serNewChild);
}
}
StructExprRecog serReturn = new StructExprRecog(ser.mbarrayBiValues);
serReturn.setStructExprRecog(listNewSers, StructExprRecog.EXPRRECOGTYPE_HBLANKCUT); // listNewSers size should be > 1
return serReturn;
} case StructExprRecog.EXPRRECOGTYPE_HLINECUT: {
StructExprRecog serNewNumerator = preRestructHDivSer4MatrixMExprs(ser.mlistChildren.getFirst());
StructExprRecog serNewDenominator = preRestructHDivSer4MatrixMExprs(ser.mlistChildren.getLast());
if (serNewNumerator.mnExprRecogType != EXPRRECOGTYPE_HBLANKCUT
&& serNewDenominator.mnExprRecogType != EXPRRECOGTYPE_HBLANKCUT) {
return ser;
}
LinkedList<StructExprRecog> listSersAbove = new LinkedList<StructExprRecog>();
if (serNewNumerator.mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
listSersAbove.addAll(serNewNumerator.mlistChildren);
serNewNumerator = listSersAbove.removeLast();
}
LinkedList<StructExprRecog> listSersBelow = new LinkedList<StructExprRecog>();
if (serNewDenominator.mnExprRecogType == EXPRRECOGTYPE_HBLANKCUT) {
listSersBelow.addAll(serNewDenominator.mlistChildren);
serNewDenominator = listSersBelow.removeFirst();
}
StructExprRecog serNewHLnCut = new StructExprRecog(ser.mbarrayBiValues);
LinkedList<StructExprRecog> listNewHLnCut = new LinkedList<StructExprRecog>();
listNewHLnCut.add(serNewNumerator);
listNewHLnCut.add(ser.mlistChildren.get(1));
listNewHLnCut.add(serNewDenominator);
serNewHLnCut.setStructExprRecog(listNewHLnCut, EXPRRECOGTYPE_HLINECUT);
LinkedList<StructExprRecog> listNewChildren = listSersAbove;
listNewChildren.add(serNewHLnCut);
listNewChildren.addAll(listSersBelow);
StructExprRecog serReturn = new StructExprRecog(ser.mbarrayBiValues);
serReturn.setStructExprRecog(listNewChildren, EXPRRECOGTYPE_HBLANKCUT);
return serReturn;
} case StructExprRecog.EXPRRECOGTYPE_HCUTCAP:
case StructExprRecog.EXPRRECOGTYPE_HCUTCAPUNDER:
case StructExprRecog.EXPRRECOGTYPE_HCUTUNDER: {
StructExprRecog serNewPrinciple = preRestructHDivSer4MatrixMExprs(ser.getPrincipleSER(1));
if (serNewPrinciple.mnExprRecogType != EXPRRECOGTYPE_HBLANKCUT) {
return ser;
}
LinkedList<StructExprRecog> listNewBlankCuts = new LinkedList<StructExprRecog>();
listNewBlankCuts.addAll(serNewPrinciple.mlistChildren); // have to add all instead of using = because otherwise we change serNewPrinciple.
if (ser.mnExprRecogType != EXPRRECOGTYPE_HCUTUNDER) {
StructExprRecog serTop = ser.mlistChildren.getFirst();
StructExprRecog serMajor = listNewBlankCuts.removeFirst();
StructExprRecog serNew1st = new StructExprRecog(ser.mbarrayBiValues);
LinkedList<StructExprRecog> listNewChildren = new LinkedList<StructExprRecog>();
listNewChildren.add(serTop);
listNewChildren.add(serMajor);
serNew1st.setStructExprRecog(listNewChildren, EXPRRECOGTYPE_HCUTCAP);
listNewBlankCuts.addFirst(serNew1st);
}
if (ser.mnExprRecogType != EXPRRECOGTYPE_HCUTCAP) {
StructExprRecog serMajor = listNewBlankCuts.removeLast();
StructExprRecog serBottom = ser.mlistChildren.getLast();
StructExprRecog serNewLast = new StructExprRecog(ser.mbarrayBiValues);
LinkedList<StructExprRecog> listNewChildren = new LinkedList<StructExprRecog>();
listNewChildren.add(serMajor);
listNewChildren.add(serBottom);
serNewLast.setStructExprRecog(listNewChildren, EXPRRECOGTYPE_HCUTUNDER);
listNewBlankCuts.addLast(serNewLast);
}
StructExprRecog serReturn = new StructExprRecog(ser.mbarrayBiValues);
serReturn.setStructExprRecog(listNewBlankCuts, EXPRRECOGTYPE_HBLANKCUT);
return serReturn;
} default:
return ser;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic List<IPrintable> getStructureParts() {\n\t\treturn null;\r\n\t}",
"public JsonElement serialize(hv paramhv, Type paramType, JsonSerializationContext paramJsonSerializationContext)\r\n/* 82: */ {\r\n/* 83:344 */ if (paramhv.g()) {\r\n/* 84:345 */ return null;\r\n/* 85: ... | [
"0.5460533",
"0.5217154",
"0.50672907",
"0.49652794",
"0.49295375",
"0.49140453",
"0.4898232",
"0.488284",
"0.4877978",
"0.48752633",
"0.48587504",
"0.48576176",
"0.48512146",
"0.47832942",
"0.47821936",
"0.47288492",
"0.4727921",
"0.4701613",
"0.46769136",
"0.46642825",
"0.4... | 0.4839565 | 13 |
calculate average char width and height. | public double[] calcAvgCharMetrics() {
double[] darrayMetrics = new double[TOTAL_IDX_CNT];
if (!isChildListType()) {
darrayMetrics[AVG_CHAR_WIDTH_IDX] = mnWidth;
darrayMetrics[AVG_CHAR_HEIGHT_IDX] = mnHeight;
darrayMetrics[CHAR_CNT_IDX] = 1.0; // weight.
if (mType != UnitProtoType.Type.TYPE_UNKNOWN
&& mType != UnitProtoType.Type.TYPE_DOT
&& mType != UnitProtoType.Type.TYPE_ROUND_BRACKET
&& mType != UnitProtoType.Type.TYPE_SQUARE_BRACKET
&& mType != UnitProtoType.Type.TYPE_BRACE
&& mType != UnitProtoType.Type.TYPE_CLOSE_ROUND_BRACKET
&& mType != UnitProtoType.Type.TYPE_CLOSE_SQUARE_BRACKET
&& mType != UnitProtoType.Type.TYPE_CLOSE_BRACE
&& mType != UnitProtoType.Type.TYPE_VERTICAL_LINE
&& mType != UnitProtoType.Type.TYPE_SUBTRACT
&& mType != UnitProtoType.Type.TYPE_SQRT_LEFT
&& mType != UnitProtoType.Type.TYPE_SQRT_SHORT
&& mType != UnitProtoType.Type.TYPE_SQRT_MEDIUM
&& mType != UnitProtoType.Type.TYPE_SQRT_LONG
&& mType != UnitProtoType.Type.TYPE_SQRT_TALL
&& mType != UnitProtoType.Type.TYPE_SQRT_VERY_TALL) {
darrayMetrics[AVG_NORMAL_CHAR_WIDTH_IDX] = mnWidth;
darrayMetrics[AVG_NORMAL_CHAR_HEIGHT_IDX] = mnHeight;
darrayMetrics[NORMAL_CHAR_CNT_IDX] = 1.0; // weight.
} else {
darrayMetrics[AVG_NORMAL_CHAR_WIDTH_IDX] = mnWidth;
darrayMetrics[AVG_NORMAL_CHAR_HEIGHT_IDX] = mnHeight;
darrayMetrics[NORMAL_CHAR_CNT_IDX] = 0.0; // weight.
}
darrayMetrics[AVG_VGAP_IDX] = mnWidth;
darrayMetrics[VGAP_CNT_IDX] = 0.0; // weight
} else {
double dSumWidth = 0, dSumNormalCharWidth = 0;
double dSumHeight = 0, dSumNormalCharHeight = 0;
double dTotalWeight = 0, dTotalNormalCharWeight = 0;
double dVGap = 0, dTotalVGapWeight = 0;
for (int idx = 0; idx < mlistChildren.size(); idx ++) {
double[] darrayThisMetrics = mlistChildren.get(idx).calcAvgCharMetrics();
dSumWidth += darrayThisMetrics[AVG_CHAR_WIDTH_IDX] * darrayThisMetrics[CHAR_CNT_IDX];
dSumNormalCharWidth += darrayThisMetrics[AVG_NORMAL_CHAR_WIDTH_IDX] * darrayThisMetrics[NORMAL_CHAR_CNT_IDX];
dSumHeight += darrayThisMetrics[AVG_CHAR_HEIGHT_IDX] * darrayThisMetrics[CHAR_CNT_IDX];
dSumNormalCharHeight += darrayThisMetrics[AVG_NORMAL_CHAR_HEIGHT_IDX] * darrayThisMetrics[NORMAL_CHAR_CNT_IDX];
dTotalWeight += darrayThisMetrics[CHAR_CNT_IDX];
dTotalNormalCharWeight += darrayThisMetrics[NORMAL_CHAR_CNT_IDX];
dVGap += darrayThisMetrics[AVG_VGAP_IDX] * darrayThisMetrics[VGAP_CNT_IDX];
dTotalVGapWeight += darrayThisMetrics[VGAP_CNT_IDX];
if (idx > 0 && (mnExprRecogType == EXPRRECOGTYPE_VBLANKCUT || mnExprRecogType == EXPRRECOGTYPE_VCUTMATRIX)) {
double dThisVGap = mlistChildren.get(idx).mnLeft - mlistChildren.get(idx - 1).getRightPlus1();
dVGap += (dThisVGap > 0)?dThisVGap:0;
dTotalVGapWeight += (dThisVGap > 0)?1.0:0;
}
}
darrayMetrics[AVG_CHAR_WIDTH_IDX] = Math.max(ConstantsMgr.msnMinCharWidthInUnit, dSumWidth / dTotalWeight);
darrayMetrics[AVG_CHAR_HEIGHT_IDX] = Math.max(ConstantsMgr.msnMinCharHeightInUnit, dSumHeight / dTotalWeight);
darrayMetrics[CHAR_CNT_IDX] = dTotalWeight;
if (dTotalNormalCharWeight == 0) {
darrayMetrics[AVG_NORMAL_CHAR_WIDTH_IDX] = darrayMetrics[AVG_CHAR_WIDTH_IDX];
darrayMetrics[AVG_NORMAL_CHAR_HEIGHT_IDX] = darrayMetrics[AVG_CHAR_HEIGHT_IDX];
} else {
darrayMetrics[AVG_NORMAL_CHAR_WIDTH_IDX] = Math.max(ConstantsMgr.msnMinCharWidthInUnit, dSumNormalCharWidth / dTotalNormalCharWeight);
darrayMetrics[AVG_NORMAL_CHAR_HEIGHT_IDX] = Math.max(ConstantsMgr.msnMinCharHeightInUnit, dSumNormalCharHeight / dTotalNormalCharWeight);
}
darrayMetrics[NORMAL_CHAR_CNT_IDX] = dTotalNormalCharWeight;
if (dTotalVGapWeight == 0) {
darrayMetrics[AVG_VGAP_IDX] = darrayMetrics[AVG_CHAR_WIDTH_IDX];
} else {
darrayMetrics[AVG_VGAP_IDX] = Math.max(ConstantsMgr.msnMinVGapWidthInUnit, dVGap / dTotalVGapWeight);
}
darrayMetrics[VGAP_CNT_IDX] = dTotalVGapWeight;
}
return darrayMetrics;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double calcAvgSeperatedCharHeight(double dAvgStrokeWidth) {\n return calcAvgSeperatedCharHeight(getLeftInOriginalImg(), getTopInOriginalImg(), getRightP1InOriginalImg(), getBottomP1InOriginalImg(), dAvgStrokeWidth);\n }",
"private void getWidthandHeight(char[] imagenaux) {\n for (itera... | [
"0.6846072",
"0.6611755",
"0.6339975",
"0.63352203",
"0.63154787",
"0.6240101",
"0.6240101",
"0.5975866",
"0.5837522",
"0.5817236",
"0.57818085",
"0.57818085",
"0.57280535",
"0.5710388",
"0.56972694",
"0.5691607",
"0.563658",
"0.563658",
"0.56359166",
"0.56359166",
"0.5623309... | 0.67541033 | 1 |
some characters might be misrecognized, so rectify them | public void rectifyMisRecogChars1stRnd(CharLearningMgr clm) {
switch (mnExprRecogType) {
case EXPRRECOGTYPE_ENUMTYPE: {
break; // single char, do nothing.
} case EXPRRECOGTYPE_HLINECUT: {
StructExprRecog serChildNo = mlistChildren.getFirst();
StructExprRecog serChildDe = mlistChildren.getLast();
rectifyMisRecogNumLetter(clm, serChildNo);
rectifyMisRecogNumLetter(clm, serChildDe);
break;
}case EXPRRECOGTYPE_HBLANKCUT:
case EXPRRECOGTYPE_MULTIEXPRS:
case EXPRRECOGTYPE_VCUTMATRIX: {
for (int idx = 0; idx < mlistChildren.size(); idx ++) {
StructExprRecog serThisChild = mlistChildren.get(idx);
rectifyMisRecogNumLetter(clm, serThisChild);
}
break;
} case EXPRRECOGTYPE_HCUTCAP:
case EXPRRECOGTYPE_HCUTUNDER:
case EXPRRECOGTYPE_HCUTCAPUNDER: {
StructExprRecog serCap = null, serBase = null, serUnder = null;
if (mnExprRecogType == EXPRRECOGTYPE_HCUTCAP) {
serCap = mlistChildren.getFirst();
serBase = mlistChildren.getLast();
} else if (mnExprRecogType == EXPRRECOGTYPE_HCUTUNDER) {
serBase = mlistChildren.getFirst();
serUnder = mlistChildren.getLast();
} else {
serCap = mlistChildren.getFirst();
serBase = mlistChildren.get(1);
serUnder = mlistChildren.getLast();
}
if (serCap != null) {
rectifyMisRecogCapUnderNotesChar(clm, serCap);
}
rectifyMisRecogCUBaseChar(clm, serBase);
if (serUnder != null) {
rectifyMisRecogCapUnderNotesChar(clm, serUnder);
}
break;
} case EXPRRECOGTYPE_VBLANKCUT: {
for (int idx = 0; idx < mlistChildren.size(); idx ++) {
StructExprRecog serThisChild = mlistChildren.get(idx);
StructExprRecog serThisChildPrinciple = serThisChild.getPrincipleSER(4); // get principle from upper or lower notes.
if (serThisChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE && serThisChild.mType == UnitProtoType.Type.TYPE_BRACE
&& idx < (mlistChildren.size() - 1) && mlistChildren.get(idx + 1).mnExprRecogType != EXPRRECOGTYPE_HBLANKCUT
&& mlistChildren.get(idx + 1).mnExprRecogType != EXPRRECOGTYPE_MULTIEXPRS
&& mlistChildren.get(idx + 1).mnExprRecogType != EXPRRECOGTYPE_VCUTMATRIX) {
// should change { to ( if the following ser is not a mult exprs nor a matrix
serThisChild.changeSEREnumType(UnitProtoType.Type.TYPE_ROUND_BRACKET, serThisChild.mstrFont);
} else if (serThisChildPrinciple.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE && serThisChildPrinciple.mType == UnitProtoType.Type.TYPE_CLOSE_BRACE
&& idx > 0 && mlistChildren.get(idx - 1).mnExprRecogType != EXPRRECOGTYPE_HBLANKCUT
&& mlistChildren.get(idx - 1).mnExprRecogType != EXPRRECOGTYPE_MULTIEXPRS
&& mlistChildren.get(idx - 1).mnExprRecogType != EXPRRECOGTYPE_VCUTMATRIX) {
// should change } to ) if the previous ser is not a mult exprs nor a matrix
serThisChildPrinciple.changeSEREnumType(UnitProtoType.Type.TYPE_CLOSE_ROUND_BRACKET, serThisChildPrinciple.mstrFont);
} else if (idx < mlistChildren.size() - 1) {
StructExprRecog serThisChildPrincipleCapUnderUL = serThisChild.getPrincipleSER(5);
if (serThisChildPrincipleCapUnderUL.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& serThisChildPrincipleCapUnderUL.mType == UnitProtoType.Type.TYPE_SMALL_F
&& serThisChildPrincipleCapUnderUL.mstrFont.equalsIgnoreCase("cambria_italian_48_thinned") // only this font of small f can be misrecognized integrate.
&& serThisChild.mlistChildren.size() == 3) {
// implies that there are upper note and lower note. So it should be integrate.
serThisChildPrincipleCapUnderUL.changeSEREnumType(UnitProtoType.Type.TYPE_INTEGRATE, serThisChildPrinciple.mstrFont);
}
}
if (idx == 0) {
if (serThisChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& !serThisChild.isLetterChar() && !serThisChild.isNumericChar() && !serThisChild.isBoundChar()
&& !serThisChild.isIntegTypeChar() && !serThisChild.isPreUnOptChar() && !serThisChild.isPreUnitChar()
&& !serThisChild.isSIGMAPITypeChar()) {
// this letter might be miss recognized, look for another candidate.
LinkedList<CharCandidate> listCands = clm.findCharCandidates(serThisChild.mType, serThisChild.mstrFont);
for (int idx1 = 0; idx1 < listCands.size(); idx1 ++) {
if (isLetterChar(listCands.get(idx1).mType) || isNumericChar(listCands.get(idx1).mType)
|| isBoundChar(listCands.get(idx1).mType) || isIntegTypeChar(listCands.get(idx1).mType)
|| isPreUnOptChar(listCands.get(idx1).mType) || isPreUnitChar(listCands.get(idx1).mType)) {
// ok, change it to the new char
serThisChild.changeSEREnumType(listCands.get(idx1).mType,
(listCands.get(idx1).mstrFont.length() == 0)?serThisChild.mstrFont:listCands.get(idx1).mstrFont);
break;
}
}
}
} else if (idx == mlistChildren.size() - 1) {
if (serThisChildPrinciple.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& !serThisChildPrinciple.isLetterChar() && !serThisChildPrinciple.isNumberChar() && !serThisChildPrinciple.isCloseBoundChar()
&& !serThisChildPrinciple.isPostUnOptChar() && !serThisChildPrinciple.isPostUnitChar()) {
// this letter might be miss recognized, look for another candidate.
LinkedList<CharCandidate> listCands = clm.findCharCandidates(serThisChildPrinciple.mType, serThisChildPrinciple.mstrFont);
for (int idx1 = 0; idx1 < listCands.size(); idx1 ++) {
if (isLetterChar(listCands.get(idx1).mType) || isNumberChar(listCands.get(idx1).mType)
|| isCloseBoundChar(listCands.get(idx1).mType) || isPostUnOptChar(listCands.get(idx1).mType)
|| isPostUnitChar(listCands.get(idx1).mType)) {
// ok, change it to the new char
serThisChildPrinciple.changeSEREnumType(listCands.get(idx1).mType,
(listCands.get(idx1).mstrFont.length() == 0)?serThisChildPrinciple.mstrFont:listCands.get(idx1).mstrFont);
break;
}
}
}
} else {
StructExprRecog serPrevChild = mlistChildren.get(idx - 1);
StructExprRecog serNextChild = mlistChildren.get(idx + 1);
if (serPrevChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE && serThisChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& serNextChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE) {
if (!serPrevChild.isLetterChar() && !serPrevChild.isNumericChar()
&& !serPrevChild.isCloseBoundChar() && !serPrevChild.isPostUnitChar()
&& !serNextChild.isLetterChar() && !serNextChild.isNumericChar()
&& !serNextChild.isBoundChar() && !serNextChild.isPreUnitChar()
&& !serNextChild.isIntegTypeChar() && !serNextChild.isSIGMAPITypeChar()
&& (!serPrevChild.isPostUnOptChar() || !serNextChild.isPreUnOptChar())
&& !serThisChildPrinciple.isLetterChar() && !serThisChildPrinciple.isNumericChar()) {
// this letter might be miss recognized, look for another candidate.
LinkedList<CharCandidate> listCands = clm.findCharCandidates(serThisChildPrinciple.mType, serThisChildPrinciple.mstrFont);
for (int idx1 = 0; idx1 < listCands.size(); idx1 ++) {
if (isLetterChar(listCands.get(idx1).mType) || isNumericChar(listCands.get(idx1).mType)) {
// ok, change it to the new char
serThisChildPrinciple.changeSEREnumType(listCands.get(idx1).mType,
(listCands.get(idx1).mstrFont.length() == 0)?serThisChildPrinciple.mstrFont:listCands.get(idx1).mstrFont);
break;
}
}
} else if ((serThisChild.mType == UnitProtoType.Type.TYPE_SMALL_X || serThisChild.mType == UnitProtoType.Type.TYPE_BIG_X)
&& serPrevChild.isPossibleNumberChar() && serNextChild.getPrincipleSER(4).isPossibleNumberChar()
&& (serNextChild.mnExprRecogType == StructExprRecog.EXPRRECOGTYPE_ENUMTYPE
|| serNextChild.mnExprRecogType == StructExprRecog.EXPRRECOGTYPE_VCUTUPPERNOTE)
&& serPrevChild.getBottomPlus1() - serThisChild.getBottomPlus1() >= 0
&& serNextChild.getPrincipleSER(4).getBottomPlus1() - serThisChild.getBottomPlus1() >= 0
&& (serThisChild.mnTop - serPrevChild.mnTop) >= serThisChild.mnHeight * ConstantsMgr.msdCrosMultiplyLowerThanNeighbor
&& (serThisChild.mnTop - serNextChild.getPrincipleSER(4).mnTop) >= serThisChild.mnHeight * ConstantsMgr.msdCrosMultiplyLowerThanNeighbor) {
// cross multiply may be misrecognized as x or X. But corss multiply generally is shorter and lower than its left and right neighbours.
serThisChild.changeSEREnumType(UnitProtoType.Type.TYPE_MULTIPLY, serThisChild.mstrFont);
} else if (serPrevChild.isNumericChar() && serThisChild.isLetterChar() && serNextChild.isNumericChar()) {
// this letter might be miss recognized, look for another candidate. this is for the case like 3S4
LinkedList<CharCandidate> listCands = clm.findCharCandidates(serThisChild.mType, serThisChild.mstrFont);
for (int idx1 = 0; idx1 < listCands.size(); idx1 ++) {
if (isNumberChar(listCands.get(idx1).mType)) {
// ok, change it to the new char
serThisChild.changeSEREnumType(listCands.get(idx1).mType,
(listCands.get(idx1).mstrFont.length() == 0)?serThisChild.mstrFont:listCands.get(idx1).mstrFont);
break;
}
}
} else if (serPrevChild.isBiOptChar() && !serPrevChild.isPossibleNumberChar() && !serPrevChild.isPostUnOptChar() && serNextChild.isNumericChar()
&& !serThisChild.isNumberChar() && !serThisChild.isLetterChar() && !serThisChild.isBoundChar()) {
// this is for the case like +]9
LinkedList<CharCandidate> listCands = clm.findCharCandidates(serThisChild.mType, serThisChild.mstrFont);
for (int idx1 = 0; idx1 < listCands.size(); idx1 ++) {
if (isNumberChar(listCands.get(idx1).mType) || isLetterChar(listCands.get(idx1).mType) || isBoundChar(listCands.get(idx1).mType)) {
// ok, change it to the new char
serThisChild.changeSEREnumType(listCands.get(idx1).mType,
(listCands.get(idx1).mstrFont.length() == 0)?serThisChild.mstrFont:listCands.get(idx1).mstrFont);
break;
}
}
} else if (serThisChild.mType == UnitProtoType.Type.TYPE_MULTIPLY
&& ((serPrevChild.isBiOptChar() && !serPrevChild.isPossibleNumberChar() /* && !serPrevChild.isLetterChar()*/) // | can be misrecognized number 1.
|| (serNextChild.isBiOptChar() && !serNextChild.isPossibleNumberChar() /* && !serNextChild.isLetterChar()*/))) {
// convert like ...\multiply=... to ...x=....
// we specify multiply because this is very special case. No other situation when this child is operator would be like this.
// moreover, generally if we see two continous biopts, we don't know which one is misrecognized. But here we know.
serThisChild.changeSEREnumType(UnitProtoType.Type.TYPE_SMALL_X, serThisChild.mstrFont);
}
}
}
}
break;
} case EXPRRECOGTYPE_VCUTLEFTTOPNOTE:
case EXPRRECOGTYPE_VCUTUPPERNOTE:
case EXPRRECOGTYPE_VCUTLOWERNOTE:
case EXPRRECOGTYPE_VCUTLUNOTES: {
StructExprRecog serLeftTopNote = null, serUpperNote = null, serLowerNote = null, serBase = null;
if (mnExprRecogType == EXPRRECOGTYPE_VCUTLEFTTOPNOTE) {
serLeftTopNote = mlistChildren.getFirst();
serBase = mlistChildren.getLast();
} else if (mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE) {
serBase = mlistChildren.getFirst();
serUpperNote = mlistChildren.getLast();
} else if (mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE) {
serBase = mlistChildren.getFirst();
serLowerNote = mlistChildren.getLast();
} else {
serBase = mlistChildren.getFirst();
serLowerNote = mlistChildren.get(1);
serUpperNote = mlistChildren.getLast();
}
if (mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE && serBase.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& serLowerNote.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE && serLowerNote.mType == UnitProtoType.Type.TYPE_DOT
&& serBase.isLetterChar()) {
LinkedList<CharCandidate> listCands = clm.findCharCandidates(serBase.mType, serBase.mstrFont);
for (int idx1 = 0; idx1 < listCands.size(); idx1 ++) {
if (isNumberChar(listCands.get(idx1).mType)) {
// ok, change it to a number.
serBase.changeSEREnumType(listCands.get(idx1).mType,
(listCands.get(idx1).mstrFont.length() == 0)?serBase.mstrFont:listCands.get(idx1).mstrFont);
break;
}
}
} else if ((mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE || mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE) // if it is upper lower note, then it is an integrate
&& serBase.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE && serBase.isIntegTypeChar()) { // this seems to be a function.
LinkedList<CharCandidate> listCands = clm.findCharCandidates(serBase.mType, serBase.mstrFont);
for (int idx1 = 0; idx1 < listCands.size(); idx1 ++) {
if (isLetterChar(listCands.get(idx1).mType)) {
// ok, change it to a letter.
serBase.changeSEREnumType(listCands.get(idx1).mType,
(listCands.get(idx1).mstrFont.length() == 0)?serBase.mstrFont:listCands.get(idx1).mstrFont);
break;
}
}
} else {
if (serLeftTopNote != null) {
rectifyMisRecogCapUnderNotesChar(clm, serLeftTopNote);
}
if (serUpperNote != null) {
rectifyMisRecogCapUnderNotesChar(clm, serUpperNote);
}
if (serLowerNote != null) {
rectifyMisRecogCapUnderNotesChar(clm, serLowerNote);
}
rectifyMisRecogLUNotesBaseChar(clm, serBase);
}
break;
} case EXPRRECOGTYPE_GETROOT: {
StructExprRecog serRootLevel = mlistChildren.getFirst();
StructExprRecog serRootedExpr = mlistChildren.getLast();
if (serRootLevel.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE && !serRootLevel.isLetterChar() && !serRootLevel.isNumberChar()
&& !serRootLevel.isSqrtTypeChar()) {
// this letter might be miss recognized, look for another candidate.
LinkedList<CharCandidate> listCands = clm.findCharCandidates(serRootLevel.mType, serRootLevel.mstrFont);
for (int idx1 = 0; idx1 < listCands.size(); idx1 ++) {
if (isLetterChar(listCands.get(idx1).mType) || isNumberChar(listCands.get(idx1).mType)) {
// ok, change it to the new char
serRootLevel.changeSEREnumType(listCands.get(idx1).mType,
(listCands.get(idx1).mstrFont.length() == 0)?serRootLevel.mstrFont:listCands.get(idx1).mstrFont);
break;
}
}
}
rectifyMisRecogNumLetter(clm, serRootedExpr);
break;
} default: {
// EXPRRECOGTYPE_LISTCUT do nothing.
}
}
// rectify its children.
if (mnExprRecogType != EXPRRECOGTYPE_ENUMTYPE) {
for (int idx = 0; idx < mlistChildren.size(); idx ++) {
mlistChildren.get(idx).rectifyMisRecogChars1stRnd(clm);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testInvalidTextValueWithBrokenUTF8() throws Exception\n {\n final byte[] input = readResource(\"/data/clusterfuzz-cbor-35979.cbor\");\n try (JsonParser p = MAPPER.createParser(input)) {\n assertToken(JsonToken.VALUE_STRING, p.nextToken());\n p.getText();\n ... | [
"0.6648641",
"0.65119815",
"0.6498547",
"0.64666146",
"0.6452236",
"0.6448624",
"0.636827",
"0.63669217",
"0.6357663",
"0.6316839",
"0.6290393",
"0.62472016",
"0.62106425",
"0.6201179",
"0.61911386",
"0.6183416",
"0.6167677",
"0.6157569",
"0.61567414",
"0.6151393",
"0.6072405... | 0.0 | -1 |
rectify missrecognized chars in the begnning or end, process the brackets and braces. | public void rectifyMisRecogChars2ndRnd() {
if (mnExprRecogType == EXPRRECOGTYPE_VBLANKCUT) {
LinkedList<StructExprRecog> listBoundingChars = new LinkedList<StructExprRecog>();
LinkedList<Integer> listBoundingCharIndices = new LinkedList<Integer>();
LinkedList<StructExprRecog> listVLnChars = new LinkedList<StructExprRecog>();
LinkedList<Integer> listVLnCharIndices = new LinkedList<Integer>();
for (int idx = 0; idx < mlistChildren.size(); idx ++) {
StructExprRecog serThisChild = mlistChildren.get(idx).getPrincipleSER(4);
// now deal with the brackets, square brackets and braces.
if (serThisChild.isBoundChar()) {
if (serThisChild.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE) {
if (idx > 0 && idx < mlistChildren.size() - 1
&& (mlistChildren.get(idx - 1).isNumericChar() || mlistChildren.get(idx - 1).isLetterChar()) // dot is allowed here because it must be decimal point not times (times has been converted to *)
&& (mlistChildren.get(idx + 1).isNumericChar() || mlistChildren.get(idx + 1).isLetterChar() // dot is allowed here.
|| mlistChildren.get(idx + 1).mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE
|| mlistChildren.get(idx + 1).mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE
|| mlistChildren.get(idx + 1).mnExprRecogType == EXPRRECOGTYPE_VCUTLUNOTES)) {
// this must be a 1 if the left and right are both letter or numeric char
serThisChild.mType = UnitProtoType.Type.TYPE_ONE;
} else if (idx > 0 && !mlistChildren.get(idx - 1).isChildListType() && !mlistChildren.get(idx - 1).isNumberChar() && !mlistChildren.get(idx - 1).isLetterChar()
&& !mlistChildren.get(idx - 1).isPostUnOptChar() && !mlistChildren.get(idx - 1).isBiOptChar() && !mlistChildren.get(idx - 1).isCloseBoundChar()) {
serThisChild.mType = UnitProtoType.Type.TYPE_ONE; // left char is not left char of v-line
} else if (idx < mlistChildren.size() - 1 && !mlistChildren.get(idx + 1).isChildListType() && !mlistChildren.get(idx + 1).isNumberChar()
&& !mlistChildren.get(idx + 1).isLetterChar() && !mlistChildren.get(idx + 1).isPreUnOptChar() && !mlistChildren.get(idx + 1).isBiOptChar()
&& !mlistChildren.get(idx + 1).isBoundChar()) {
serThisChild.mType = UnitProtoType.Type.TYPE_ONE; // left char is not left char of v-line
} else {
listVLnChars.add(serThisChild);
listVLnCharIndices.add(idx);
}
} else if (serThisChild.mType != UnitProtoType.Type.TYPE_BRACE
|| (serThisChild.mType == UnitProtoType.Type.TYPE_BRACE && idx == mlistChildren.size() - 1)
|| (serThisChild.mType == UnitProtoType.Type.TYPE_BRACE && idx < mlistChildren.size() - 1
&& mlistChildren.getLast().mnExprRecogType != EXPRRECOGTYPE_MULTIEXPRS)) {
listBoundingChars.add(serThisChild);
listBoundingCharIndices.add(idx);
}
} else if (serThisChild.isCloseBoundChar()) {
if (serThisChild.mType != UnitProtoType.Type.TYPE_VERTICAL_LINE) {
boolean bFoundOpenBounding = false;
for (int idx1 = listBoundingChars.size() - 1; idx1 >= 0; idx1 --) {
if ((serThisChild.getBottomPlus1() - listBoundingChars.get(idx1).mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * serThisChild.mnHeight
&& (listBoundingChars.get(idx1).getBottomPlus1() - serThisChild.mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * serThisChild.mnHeight
&& serThisChild.mnHeight > ConstantsMgr.msdOpenCloseBracketHeightRatio * listBoundingChars.get(idx1).mnHeight // must have similar height as the start character
&& serThisChild.mnHeight < 1/ConstantsMgr.msdOpenCloseBracketHeightRatio * listBoundingChars.get(idx1).mnHeight) {
for (int idx2 = listBoundingChars.size() - 1; idx2 > idx1; idx2 --) {
// allow to change all the ( or [ between () or [] pairs coz here ( and [ must not have pair and must be misrecognized.
//StructExprRecog serB4BndChar = listBoundingCharIndices.get(idx2) > 0?mlistChildren.get(listBoundingCharIndices.get(idx2) - 1):null;
//StructExprRecog serAfterBndChar = listBoundingCharIndices.get(idx2) < mlistChildren.size() - 1?mlistChildren.get(listBoundingCharIndices.get(idx2) + 1):null;
if (listBoundingChars.get(idx2).mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET
&& (double)listBoundingChars.get(idx2).mnWidth/(double)listBoundingChars.get(idx2).mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {
listBoundingChars.get(idx2).mType = UnitProtoType.Type.TYPE_ONE; // change to 1, do not use b4 and after char to adjust because not accurate.
} else if (listBoundingChars.get(idx2).mType == UnitProtoType.Type.TYPE_ROUND_BRACKET
&& (double)listBoundingChars.get(idx2).mnWidth/(double)listBoundingChars.get(idx2).mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {
listBoundingChars.get(idx2).mType = UnitProtoType.Type.TYPE_ONE; // change to 1, do not use b4 and after char to adjust because not accurate.
} else {
listBoundingChars.get(idx2).mType = UnitProtoType.Type.TYPE_SMALL_T; // all the no-close-bounding chars are changed to small t.
}
listBoundingChars.removeLast();
listBoundingCharIndices.removeLast();
}
listBoundingChars.get(idx1).mType = UnitProtoType.Type.TYPE_ROUND_BRACKET;
serThisChild.mType = UnitProtoType.Type.TYPE_CLOSE_ROUND_BRACKET;
listBoundingChars.remove(idx1);
listBoundingCharIndices.remove(idx1);
bFoundOpenBounding = true;
break;
}
}
if (!bFoundOpenBounding) {
// cannot find open bounding character, change the close bounding character to 1.
//StructExprRecog serB4BndChar = idx > 0?mlistChildren.get(idx - 1):null;
//StructExprRecog serAfterBndChar = idx < mlistChildren.size() - 1?mlistChildren.get(idx + 1):null;
if (serThisChild.mType == UnitProtoType.Type.TYPE_CLOSE_SQUARE_BRACKET
&& (double)serThisChild.mnWidth/(double)serThisChild.mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {
serThisChild.mType = UnitProtoType.Type.TYPE_ONE; // change to 1. Do not use b4 after char to adjust because not accurate (considering - or [1/2]...)
} else if (serThisChild.mType == UnitProtoType.Type.TYPE_CLOSE_ROUND_BRACKET
&& (double)serThisChild.mnWidth/(double)serThisChild.mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {
serThisChild.mType = UnitProtoType.Type.TYPE_ONE;
}
}
}
} else if (serThisChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& (serThisChild.mType == UnitProtoType.Type.TYPE_SMALL_O || serThisChild.mType == UnitProtoType.Type.TYPE_BIG_O)) {
// now deal with all o or Os. do not put this in the first round because the condition to change o or O to 0 is more relax.
if (mlistChildren.get(idx).mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE
|| mlistChildren.get(idx).mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE
|| mlistChildren.get(idx).mnExprRecogType == EXPRRECOGTYPE_VCUTLUNOTES) {
// if it has upper or lower note.
serThisChild.mType = UnitProtoType.Type.TYPE_ZERO;
} else if (idx > 0 && (!mlistChildren.get(idx - 1).isLetterChar() || (mlistChildren.get(idx - 1).mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& (mlistChildren.get(idx - 1).mType == UnitProtoType.Type.TYPE_SMALL_O || mlistChildren.get(idx - 1).mType == UnitProtoType.Type.TYPE_BIG_O)))) {
// if left character is not a letter char or is o or O
serThisChild.mType = UnitProtoType.Type.TYPE_ZERO;
} else if (idx < (mlistChildren.size() - 1) && (!mlistChildren.get(idx + 1).isLetterChar() || (mlistChildren.get(idx + 1).mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE
&& (mlistChildren.get(idx + 1).mType == UnitProtoType.Type.TYPE_SMALL_O || mlistChildren.get(idx + 1).mType == UnitProtoType.Type.TYPE_BIG_O)))) {
// if right character is not a letter char or is o or O
serThisChild.mType = UnitProtoType.Type.TYPE_ZERO;
}
}
}
if (listVLnChars.size() == 1) {
listVLnChars.getFirst().mType = UnitProtoType.Type.TYPE_ONE; // all the no-paired vline chars are changed to 1.
} else {
while (listVLnChars.size() > 0) {
int nIdx1st = listVLnCharIndices.getFirst();
if (mlistChildren.get(nIdx1st).mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE
|| mlistChildren.get(nIdx1st).mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE
|| mlistChildren.get(nIdx1st).mnExprRecogType == EXPRRECOGTYPE_VCUTLUNOTES) {
listVLnChars.getFirst().mType = UnitProtoType.Type.TYPE_ONE; // 1st | cannot have upper note or low note .
listVLnCharIndices.removeFirst();
listVLnChars.removeFirst();
} else {
break;
}
}
for (int idx = listVLnChars.size() - 1; idx >= 0 ; idx --) {
StructExprRecog serOneChild = listVLnChars.get(idx);
int idx1 = listVLnChars.size() - 1;
for (; idx1 >= 0; idx1 --) {
if (idx1 == idx) {
continue;
}
StructExprRecog serTheOtherChild = listVLnChars.get(idx1);
if ((serOneChild.getBottomPlus1() - serTheOtherChild.mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * serOneChild.mnHeight
&& (serTheOtherChild.getBottomPlus1() - serOneChild.mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * serOneChild.mnHeight
&& serOneChild.mnHeight > ConstantsMgr.msdOpenCloseBracketHeightRatio * serTheOtherChild.mnHeight // must have similar height as the start character
&& serOneChild.mnHeight < 1/ConstantsMgr.msdOpenCloseBracketHeightRatio * serTheOtherChild.mnHeight) {
// has corresponding v-line.
break;
}
}
if (idx1 == -1) {
// doesn't have corresponding v-line..
serOneChild.mType = UnitProtoType.Type.TYPE_ONE; // all the no-paired vline chars are changed to 1.
}
}
// recheck the new first VLnChars.
for (int idx = 0; idx < listVLnChars.size(); idx ++) {
int nIdxInList = listVLnCharIndices.get(idx);
if (listVLnChars.get(idx).mType == UnitProtoType.Type.TYPE_ONE) {
continue;
} else if (mlistChildren.get(nIdxInList).mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE
|| mlistChildren.get(nIdxInList).mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE
|| mlistChildren.get(nIdxInList).mnExprRecogType == EXPRRECOGTYPE_VCUTLUNOTES) {
listVLnChars.get(idx).mType = UnitProtoType.Type.TYPE_ONE; // 1st | cannot have upper note or low note .
} else {
break;
}
}
}
if (listBoundingChars.size() > 0 && listBoundingChars.getLast() == mlistChildren.getLast()) {
// change the last unpaired ( or [ to t or 1 if necessary.
//StructExprRecog serB4BndChar = mlistChildren.size() > 1?mlistChildren.get(mlistChildren.size() - 2):null;
if (listBoundingChars.getLast().mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET
&& (double)listBoundingChars.getLast().mnWidth/(double)listBoundingChars.getLast().mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {
listBoundingChars.getLast().mType = UnitProtoType.Type.TYPE_ONE; // change to 1. Do not use b4 after chars to adjust [ coz not accurate.
} else if (listBoundingChars.getLast().mType == UnitProtoType.Type.TYPE_ROUND_BRACKET
&& (double)listBoundingChars.getLast().mnWidth/(double)listBoundingChars.getLast().mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {
listBoundingChars.getLast().mType = UnitProtoType.Type.TYPE_ONE; // change to 1. Do not use b4 after chars to adjust [ coz not accurate.
} else {
listBoundingChars.getLast().mType = UnitProtoType.Type.TYPE_SMALL_T; // if the last unpaired ( or [ is the last char, very likely it is a t.
}
}
for (int idx = 0; idx < listBoundingChars.size(); idx ++) {
//StructExprRecog serB4BndChar = listBoundingCharIndices.get(idx) > 0?mlistChildren.get(listBoundingCharIndices.get(idx) - 1):null;
//StructExprRecog serAfterBndChar = listBoundingCharIndices.get(idx) < mlistChildren.size() - 1?mlistChildren.get(listBoundingCharIndices.get(idx) + 1):null;
if (listBoundingChars.get(idx).mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET
&& (double)listBoundingChars.get(idx).mnWidth/(double)listBoundingChars.get(idx).mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {
listBoundingChars.get(idx).mType = UnitProtoType.Type.TYPE_ONE; // change to 1. do not use pre or next char height to adjust coz not accurate.
}else if (listBoundingChars.get(idx).mType == UnitProtoType.Type.TYPE_ROUND_BRACKET
&& (double)listBoundingChars.get(idx).mnWidth/(double)listBoundingChars.get(idx).mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {
listBoundingChars.get(idx).mType = UnitProtoType.Type.TYPE_ONE; // change to 1. do not use pre or next char height to adjust coz not accurate.
}
// do not change other unmatched ( or [ to t or 1 because this makes things worse.
}
for (int idx = 0; idx < mlistChildren.size(); idx ++) {
StructExprRecog serThisChild = mlistChildren.get(idx);
serThisChild.rectifyMisRecogChars2ndRnd();
}
} else if (isChildListType()) {
for (int idx = 0; idx < mlistChildren.size(); idx ++) {
StructExprRecog serThisChild = mlistChildren.get(idx);
if (serThisChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE) {
if (serThisChild.isBoundChar()) {
if (serThisChild.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE
&& (idx != 0 || mnExprRecogType != EXPRRECOGTYPE_VCUTUPPERNOTE)) {
serThisChild.mType = UnitProtoType.Type.TYPE_ONE; // if it is |**(something), it could still be valid for |...|**(something). But shouldn't have foot notes.
} else if (serThisChild.mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET
&& serThisChild.mnWidth/serThisChild.mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {
// if it is [ and it is very thing, very likely it is a 1.
serThisChild.mType = UnitProtoType.Type.TYPE_ONE;
} else if (serThisChild.mType == UnitProtoType.Type.TYPE_ROUND_BRACKET
&& serThisChild.mnWidth/serThisChild.mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {
// if it is ( and it is very thing, very likely it is a 1.
serThisChild.mType = UnitProtoType.Type.TYPE_ONE;
} else if (serThisChild.mType != UnitProtoType.Type.TYPE_VERTICAL_LINE) { // if child is single char, very likely it is not a ( or [ but a t.
serThisChild.mType = UnitProtoType.Type.TYPE_SMALL_T;
}
} else if (serThisChild.isCloseBoundChar() && (idx != 0
|| (mnExprRecogType != EXPRRECOGTYPE_VCUTUPPERNOTE
&& mnExprRecogType != EXPRRECOGTYPE_VCUTLOWERNOTE
&& mnExprRecogType != EXPRRECOGTYPE_VCUTLUNOTES))) {
// a close bound char can have upper and/or lower notes. but if the upper note or lower note is close bound char, still need to convert it to 1.
// here still convert to 1 because upper lower note can be mis-recognized.
serThisChild.mType = UnitProtoType.Type.TYPE_ONE;
} else if (serThisChild.mType == UnitProtoType.Type.TYPE_SMALL_O || serThisChild.mType == UnitProtoType.Type.TYPE_BIG_O) {
// still convert to 0 even if it has lower or upper notes.
serThisChild.mType = UnitProtoType.Type.TYPE_ZERO;
}
} else {
serThisChild.rectifyMisRecogChars2ndRnd();
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void skipBrackets(char openingChar, char closingChar) {\r\n int nestedLevel = 0;\r\n int length = sourceCode.length();\r\n char stringType = 0;\r\n do {\r\n char character = sourceCode.charAt(index);\r\n if (stringType != 0) {\r\n // Currentl... | [
"0.574011",
"0.5709843",
"0.5698557",
"0.5606336",
"0.5539691",
"0.5486372",
"0.5484955",
"0.5468862",
"0.54557705",
"0.5395277",
"0.53639144",
"0.53619874",
"0.5289481",
"0.5266604",
"0.5260407",
"0.5255171",
"0.5214126",
"0.5149526",
"0.5113797",
"0.51059335",
"0.51025516",... | 0.5949816 | 0 |
TODO Autogenerated method stub | @Override
public int selectDocumenCount(Documen documen) {
return indexMapper.selectDocumenCount(documen);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Returns the line number (0based where the first line is line 0) | public abstract int getLine(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getLineNum() {\n\t\treturn (parser == null) ? 0 : parser.getCurrentLocation().getLineNr();\n\t}",
"private int getLineNumber() {\n int line = 0;\n if (_locator != null)\n line = _locator.getLineNumber();\n return line;\n }",
"public final int getLineNumber()\n ... | [
"0.85880125",
"0.8353768",
"0.82849497",
"0.82841915",
"0.82697576",
"0.82484025",
"0.82037467",
"0.8134923",
"0.80883825",
"0.8085647",
"0.80373645",
"0.8034458",
"0.8030049",
"0.801244",
"0.7943567",
"0.7923022",
"0.7912253",
"0.7906902",
"0.78696316",
"0.7862139",
"0.78496... | 0.0 | -1 |
Returns the column number (where the first character on the line is 0), or 1 if unknown | public abstract int getColumn(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getColumnPosition(String path);",
"private static int getColumn(String s) {\n int i = -1;\n try {\n i = Integer.parseInt(s);\n } catch (Exception e) {\n return -1;\n }\n if (i>GameBoardMainArea.NUMCOLS) {\n return -1;\n }\n if ... | [
"0.6899116",
"0.6820886",
"0.67979187",
"0.67036325",
"0.67036325",
"0.67036325",
"0.6663562",
"0.660148",
"0.6580374",
"0.65789855",
"0.6545895",
"0.65431225",
"0.6411985",
"0.63810366",
"0.63376796",
"0.6270005",
"0.6252626",
"0.62399405",
"0.6238557",
"0.6227915",
"0.61777... | 0.56483907 | 65 |
TODO Autogenerated method stub | @Override
public BankAccount checkAccount(int accountNo) {
for (BankAccount acc : bankAccount)
{
if (acc.getAccNum() == accountNo)
return acc;
}
return null;
} | {
"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 the base ending conditions with a specified maximum number of steps. | public BaseEndingConditions(double maximumSeconds) {
this.maximumSeconds = maximumSeconds;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void init(int maxSteps) {\n }",
"int getMaximalIterationCount();",
"public void buildMaxHeap(){\n\t\tfor(int i = (n-2)/2 ; i >= 0; i--){\n\t\t\tmaxHeapfy(i);\n\t\t}\n\t}",
"public void setMaxCloseStatements(int max)\n {\n _maxCloseStatements = max;\n }",
"public RandomWalk(... | [
"0.55684537",
"0.512515",
"0.5061386",
"0.5007397",
"0.50021714",
"0.49967602",
"0.49405462",
"0.48453873",
"0.48392177",
"0.48255542",
"0.48093858",
"0.48067003",
"0.47704378",
"0.47154877",
"0.47077775",
"0.46999046",
"0.4690502",
"0.46898663",
"0.46875897",
"0.46534926",
"... | 0.58007425 | 0 |
Created by work on 28/02/15. | public interface Duck {
public void quack();
public void fly();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void func_104112_b() {\n \n }",
"protected boolean func_70814_o() { return true; }",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private void m50366E() {\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t... | [
"0.55919105",
"0.5504925",
"0.5502281",
"0.5496403",
"0.5470002",
"0.54588974",
"0.54438925",
"0.5438061",
"0.5431518",
"0.54255337",
"0.5414931",
"0.53985274",
"0.53582567",
"0.5354109",
"0.5343325",
"0.5343325",
"0.5343325",
"0.5343325",
"0.5343325",
"0.53112954",
"0.529592... | 0.0 | -1 |
SET FONT AND COLOR OF SELECTED ITEM | @RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
TextView selectedItemTV = (TextView) parent.getSelectedView();
if(selectedItemTV != null)
selectedItemTV.setTextAppearance(R.style.SpinnerSelectedItem);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void updateTextColor() {\n if (mLauncher == null) {\n return;\n }\n ItemInfo info = (ItemInfo) getTag();\n if (info == null || mSupportCard) {\n return;\n }\n int color = getDyncTitleColor(info);\n mIconTitleColor = color;\n setP... | [
"0.6715075",
"0.66598237",
"0.6586415",
"0.6526239",
"0.638774",
"0.62529963",
"0.62388027",
"0.6226735",
"0.62036854",
"0.6176928",
"0.6140664",
"0.6060008",
"0.6059654",
"0.6021309",
"0.60208744",
"0.6018666",
"0.6014883",
"0.60065544",
"0.59652394",
"0.5946481",
"0.5933934... | 0.5350982 | 84 |
Get XML String of utf8 | public static String getUTF8String(String xml) {
// A StringBuffer Object
StringBuffer sb = new StringBuffer();
sb.append(xml);
String str = "";
String strUTF8="";
try {
str = new String(sb.toString().getBytes("utf-8"));
strUTF8 = URLEncoder.encode(str, "utf-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// return to String Formed
return strUTF8;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String getUTF8XMLString(String xml) {\r\n\t\tString xmlUTF8 = \"\";\r\n\t\ttry {\r\n\t\t\txmlUTF8 = URLEncoder.encode(xml, \"utf-8\");\r\n\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn xmlUTF8;\r\n\t}",
"String toXmlString() throws IOException;",... | [
"0.7316788",
"0.7130234",
"0.6730626",
"0.6730626",
"0.6730626",
"0.66738105",
"0.6342383",
"0.62936217",
"0.6272805",
"0.62514746",
"0.61403996",
"0.6121174",
"0.6120478",
"0.6086277",
"0.59802204",
"0.59732157",
"0.5967471",
"0.59564734",
"0.5944295",
"0.5936722",
"0.592546... | 0.7178064 | 1 |
/ Beam Direction, mirror position> direction right / > up right \ > down left / > down left \ > up up / > right up \ > left down \ > right down / > left | public static void main(String[] args) {
Scanner input;
try {
input = new Scanner(new File("mirror.in"));
PrintWriter output = new PrintWriter("mirror.out");
//Read the input
n = input.nextInt();
m = input.nextInt();
mirrors = new char[n][m];
//Read Mirror Positions nxm matrix
for (int i = 0; i < n; i++) {
String temp = input.next();
for (int j = 0; j < m; j++) {
mirrors[i][j] = temp.charAt(j);
}
}
//Get Target Directions
//Left & Right boundaries
for (int i = 0; i < n; i++) {
getReflection(i,0,RIGHT);
getReflection(i,m-1,LEFT);
}
//Top & bottom boundaries
for (int i = 0; i < m; i++) {
getReflection(0,i,DOWN);
getReflection(n-1,i,UP);
}
//Write output to file
output.println(maxReflections);
output.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void flip()\r\n\t{\r\n\t\tif(heading == Direction.WEST)\r\n\t\t{\r\n\t\t\tsetDirection(Direction.EAST);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsetDirection(Direction.WEST);\r\n\t\t}\r\n\t}",
"public static void waltz() {\n //test code written by bokun: self rotation\n leftMotor.setSpeed(ROTATE_SPEE... | [
"0.64409256",
"0.6379833",
"0.6372996",
"0.63677144",
"0.63238",
"0.63182414",
"0.62849236",
"0.62222195",
"0.6190476",
"0.6149713",
"0.61367494",
"0.61102825",
"0.6083461",
"0.607268",
"0.60677046",
"0.606335",
"0.6061246",
"0.6039129",
"0.6004498",
"0.59818965",
"0.5978647"... | 0.0 | -1 |
/ Method to compute maximum possible reflections | private static void getReflection(int r, int c, int dir) {
int localCount=0;
//While Within Bounds
while(!(r < 0 || c < 0 || r>=n || c >=m))
{
//The Logic to count Reflections
localCount ++;
//Get the Mirror index
int mirrorInd = (mirrors[r][c] == '\\' ? 0 : 1);
//Update the reflection direction
//for next iteration
dir = target[dir][mirrorInd];
//Adjust the Mirror Iteration Index
if(dir == RIGHT)
c++;
else if(dir == LEFT)
c--;
else if(dir == UP)
r--;
else
r++;
}
//Update Global Max
if(maxReflections < localCount)
{
maxReflections =localCount;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final int calculateTypeConstraintMaxDiff(){\n int result=0;\n for(int i=0;i<MaximumNumberOfVerticesOfTypeZ.length;i++){\n result+=MaximumNumberOfVerticesOfTypeZ[i];\n }\n return result;\n }",
"public Factura getMaxNumeroFactura();",
"@objid (\"7bba25c1-4310-45fa-b2ce-d6cdc992be70\... | [
"0.63776535",
"0.54862756",
"0.54199564",
"0.5395377",
"0.53826755",
"0.53302044",
"0.5326964",
"0.5311566",
"0.52913094",
"0.5224967",
"0.51969576",
"0.51821285",
"0.5155885",
"0.51518303",
"0.5145523",
"0.51365215",
"0.51354665",
"0.51327145",
"0.5128773",
"0.5124939",
"0.5... | 0.58038336 | 1 |
Constructor for creating an instance that will parse a set of String arguments with respect to a set of command line options. Option switches are required to be a single character. By default switches are assumed to be boolean unless followed by a colon. example :   "cvf:" In this example "c" and "v" are boolean while "f" is nonboolean and thus assumed to take an argument. | public GetOpt(String [] sargs, String flags) throws BadOptException {
int size = sargs.length;
try {
StringReader sreader = new StringReader(flags);
for (int i = 0; i < flags.length(); i++) {
int opt = sreader.read();
if (opt == ':')
((OptPair) optlist.elementAt(optlist.size() - 1)).bool = false;
else
optlist.add(new OptPair((char) opt, true));
}
sreader.close();
} catch (IOException e) {
System.err.println("Bizarre error situation!");
throw new BadOptException("I/O problem encountered manipulating strings with a StringReader!");
}
// for (int i = 0; i < optlist.size(); i++)
// System.out.println(optlist.elementAt(i));
for (int i = 0; i < sargs.length; i++) {
if (sargs[i].startsWith("-")) {
try {
StringReader sreader = new StringReader(sargs[i].substring(1));
int opt = -1;
while ((opt = sreader.read()) != -1) {
boolean found = false;
boolean bool = true;
for (int j = 0; j < optlist.size(); j++) {
OptPair temp = (OptPair) optlist.elementAt(j);
if (temp.option == (char) opt) {
found = true;
bool = temp.bool;
break;
}
}
if (found) {
opts.add(new Character((char) opt));
if (!bool) {
args.add(sargs[++i]);
break;
}
} else {
throw new BadOptException((char) opt + ": is an invalid switch option.");
}
}
} catch (IOException e) {
System.err.println("Bizarre error situation!");
throw new BadOptException("I/O problem encountered manipulating strings with a StringReader!");
}
} else {
params.add(sargs[i]);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected P parse(String options, String[] args){\n HashMap cmdFlags = new HashMap();\n String flag;\n String nextFlag=null;\n StringBuffer errors=new StringBuffer();\n /**\n First go through options to see what should be in args\n */\n for(int which=0;which<options.length();which++){\n ... | [
"0.67060745",
"0.62072396",
"0.60881686",
"0.60657954",
"0.6015606",
"0.59667736",
"0.5927574",
"0.59195507",
"0.58658755",
"0.5774331",
"0.57738876",
"0.5769933",
"0.5671289",
"0.5663504",
"0.55977076",
"0.55948114",
"0.5582215",
"0.55779684",
"0.55583954",
"0.55446154",
"0.... | 0.66562784 | 1 |
Returns the next command line option. In the event that no more options are left the OPT_EOF value is returned. | public char getopt() {
if (opt_count >= opts.size())
return OPT_EOF;
return ((Character) (opts.elementAt(opt_count++))).charValue();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public char getOption() {\r\n\t\treturn scanner.nextLine().charAt(0);\r\n\t}",
"public String optarg() {\n\tif (arg_count >= args.size())\n\t return null;\n\treturn (String) args.elementAt(arg_count++);\n }",
"public int getIntValue(String opt) {\n return Integer.parseInt((String)m_commandLine.getValu... | [
"0.6585175",
"0.56148946",
"0.5531461",
"0.52572894",
"0.5211704",
"0.5181763",
"0.51039606",
"0.5065869",
"0.50555336",
"0.5019877",
"0.5011934",
"0.49459592",
"0.4936747",
"0.4936747",
"0.491304",
"0.49094692",
"0.48711047",
"0.4867291",
"0.48156503",
"0.4795702",
"0.476351... | 0.69263136 | 0 |
Returns the next nonboolean command line switch argument. | public String optarg() {
if (arg_count >= args.size())
return null;
return (String) args.elementAt(arg_count++);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getArg();",
"static String nextArg(int currentIndex, String[] allArgs) {\n final int nextIndex = currentIndex + 1;\n if (nextIndex < allArgs.length) {\n return allArgs[nextIndex];\n } else {\n throw new IllegalArgumentException(allArgs[currentIndex] + \... | [
"0.6174105",
"0.6146931",
"0.60813206",
"0.6012503",
"0.594149",
"0.5828156",
"0.54941976",
"0.5478937",
"0.5345524",
"0.53365326",
"0.5294894",
"0.52893573",
"0.5230396",
"0.5207295",
"0.51851285",
"0.5184277",
"0.51766586",
"0.5157172",
"0.5157172",
"0.5157172",
"0.51169324... | 0.5999158 | 4 |
Returns the next parameter passed on the command line. | public String param() {
if (param_count >= params.size())
return null;
return (String) params.elementAt(param_count++);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static String nextArg(int currentIndex, String[] allArgs) {\n final int nextIndex = currentIndex + 1;\n if (nextIndex < allArgs.length) {\n return allArgs[nextIndex];\n } else {\n throw new IllegalArgumentException(allArgs[currentIndex] + \": missing required argument\");... | [
"0.6620799",
"0.6293617",
"0.59576595",
"0.5896346",
"0.5896346",
"0.58318293",
"0.57076293",
"0.5684765",
"0.56451553",
"0.56275016",
"0.56190866",
"0.5610199",
"0.55766714",
"0.5555441",
"0.5522114",
"0.55162984",
"0.5450053",
"0.54421747",
"0.5439582",
"0.5414522",
"0.5408... | 0.6059492 | 2 |
add more describe this constructor | public Restaurant(String _name)
{
// assign default values
reviewCount = 0;
reviewScoreTotal = 0;
this.name = _name;
this.totalCustomers = 0;
starRating = 0;
location = "Not listed";
numOfMenuItems = 0;
numberOfRestraunts = 0;
cuisine = "Unknown";
typeOfFood = "";
dishOfTheDay = "Unknown";
typeOfDrink = "";
employees = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Dog ()\n {\n super (\"Dog\", \"Hi! My name is Snoop Dawg\");\n this.x = \"A bone\";\n /*\n * This dog has many features to it\n * Do not provoke it or else it will bite!\n * Otherwise, It's a nice dog so have fun!\n */\n \n \n }",
"p... | [
"0.5847378",
"0.5749528",
"0.57437",
"0.5716376",
"0.56964856",
"0.5690576",
"0.56614757",
"0.5646767",
"0.5620295",
"0.56005365",
"0.5593548",
"0.557693",
"0.55754584",
"0.5559695",
"0.55214405",
"0.5486297",
"0.547677",
"0.54505867",
"0.544807",
"0.5442693",
"0.5435113",
... | 0.0 | -1 |
accessors and mutators here Sets the number of items on the resturant's menu | public void setNumOfMenuItems(int _numOfMenuItems){
numOfMenuItems = _numOfMenuItems;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getNumOfMenuItems(){\n return numOfMenuItems;\n }",
"public int size() {\n return menuItems.size();\n }",
"@Override\n\t\t\tpublic int getCount(){\n\t\t\t\treturn menus.size();\n\t\t\t}",
"@Override\n public int getItemCount() {\n if (menu != null)\n return m... | [
"0.7804948",
"0.70072174",
"0.68257296",
"0.6821093",
"0.67480314",
"0.6675431",
"0.6615578",
"0.6566545",
"0.6566545",
"0.65341127",
"0.6496422",
"0.64692205",
"0.64602053",
"0.6441619",
"0.6417767",
"0.6397882",
"0.63959193",
"0.63585407",
"0.6348593",
"0.6312882",
"0.62962... | 0.8045973 | 0 |
Gets the number of items on the resturant's menu | public int getNumOfMenuItems(){
return numOfMenuItems;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int size() {\n return menuItems.size();\n }",
"int getNumItems();",
"int getItemsCount();",
"int getItemsCount();",
"@Override\n public int getItemCount() {\n if (menu != null)\n return menu.size();\n else return 0;\n }",
"public int getItemCount() {\n ... | [
"0.80060685",
"0.776759",
"0.77624685",
"0.77624685",
"0.7625525",
"0.74941325",
"0.73645663",
"0.7324633",
"0.7322483",
"0.72943324",
"0.7247362",
"0.72341365",
"0.72106457",
"0.72022945",
"0.7179561",
"0.7174385",
"0.7152138",
"0.71342444",
"0.71342444",
"0.7114471",
"0.710... | 0.84348977 | 0 |
Sets the number of restraunts in the chain | public void setNumberOfRestraunts(int _numberOfRestraunts){
numberOfRestraunts = _numberOfRestraunts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Builder setNumOfRetrievelRequest(int value) {\n \n numOfRetrievelRequest_ = value;\n onChanged();\n return this;\n }",
"public Builder setNumOfRetrievelRequest(int value) {\n \n numOfRetrievelRequest_ = value;\n onChanged();\n return this;\n ... | [
"0.65016085",
"0.65016085",
"0.6478591",
"0.64295596",
"0.64272344",
"0.6408367",
"0.63855004",
"0.6313875",
"0.62949514",
"0.6208281",
"0.6208281",
"0.6208281",
"0.62055343",
"0.6176179",
"0.6081703",
"0.6073571",
"0.6066062",
"0.60638237",
"0.6047404",
"0.60408545",
"0.6038... | 0.7050017 | 0 |
Gets the number of restraunts | public int getNumberOfRestraunts(){
return numberOfRestraunts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getReaultCount();",
"public int getReaultCount() {\n return reault_.size();\n }",
"public int countRess()\n {\n int nbRess = 0;\n pw.println(13);\n try\n {\n nbRess = Integer.parseInt(bis.readLine()) ;\n }\n catch (IOException e)\n {\n... | [
"0.8110663",
"0.77775323",
"0.76689684",
"0.7610208",
"0.75422704",
"0.7289958",
"0.7266131",
"0.7165154",
"0.71020323",
"0.70649254",
"0.70646566",
"0.70305276",
"0.699845",
"0.6988184",
"0.6980387",
"0.69728374",
"0.6964928",
"0.69443756",
"0.69440895",
"0.6901974",
"0.6875... | 0.74339855 | 5 |
sets the resturant's cuisine | public void setCuisine(String _cuisine){
cuisine = _cuisine;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getCuisine(){\n return cuisine;\n }",
"public void setCuota(double cuota) {\n this.cuota = cuota;\n }",
"public void setCrust(){\n this.crust = \"Thin\";\n }",
"public void setCouleur(int pCouleur) {\t\r\n\t\tif (configuration.getJeu() == 'R') {\r\n\t\t\tthis.couleur = 10;... | [
"0.64878434",
"0.6302685",
"0.62218326",
"0.6199986",
"0.5987112",
"0.58872396",
"0.5723605",
"0.56754476",
"0.56512254",
"0.56181157",
"0.56042206",
"0.5519001",
"0.5518196",
"0.54831314",
"0.54768336",
"0.5466855",
"0.53695166",
"0.534453",
"0.5334453",
"0.53165114",
"0.531... | 0.7321246 | 0 |
gets the resturant's cuisine | public String getCuisine(){
return cuisine;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getCuisineID() {\n return cuisineID;\n }",
"public void setCuisine(String _cuisine){\n cuisine = _cuisine;\n }",
"public String getCorn() {\n return corn;\n }",
"public String getCouleur() {\n\t\treturn this.couleur;\n\t}",
"public String getCouleur() {\n retur... | [
"0.67323154",
"0.67109525",
"0.66393256",
"0.66021186",
"0.65340143",
"0.65340143",
"0.6239239",
"0.6237161",
"0.6152172",
"0.6060424",
"0.60504675",
"0.6050169",
"0.60159934",
"0.5978241",
"0.59604686",
"0.5914182",
"0.5903599",
"0.5875615",
"0.58314276",
"0.5819093",
"0.580... | 0.7921759 | 0 |
Returns the type of food in the restaurant | public String getTypeOfFood()
{
return typeOfFood;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getTypeOfFood(){\n return typeOfFood;\n }",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"public String getFoodType() {\n return \"Carnivore\";\n }",
"Food getByType(String type);"... | [
"0.815083",
"0.7688354",
"0.7688354",
"0.76628274",
"0.74828964",
"0.7218194",
"0.7135717",
"0.7106273",
"0.6959938",
"0.67017204",
"0.6578558",
"0.6510657",
"0.6401746",
"0.6334331",
"0.6325096",
"0.63159144",
"0.6266518",
"0.62523884",
"0.6246465",
"0.62027436",
"0.6177865"... | 0.81714004 | 0 |
Sets the type of food in the restaurant | public void setTypeOfFood(String _typeOfFood)
{
typeOfFood = _typeOfFood;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setTypeOfFood(String foodType){\n typeOfFood = foodType;\n }",
"public void setFoodType(String food);",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"@Override\n\tpublic void setRestaura... | [
"0.84484214",
"0.81962967",
"0.6952516",
"0.6952516",
"0.67865676",
"0.6696349",
"0.66289204",
"0.65755886",
"0.6538958",
"0.65202516",
"0.65202516",
"0.65202516",
"0.64020914",
"0.6395879",
"0.6338898",
"0.6333605",
"0.63248533",
"0.6303749",
"0.628412",
"0.6260484",
"0.6246... | 0.8067113 | 2 |
Return the type of drinks available in the restaurant | public String getTypeOfDrink()
{
return typeOFDrink;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getTypeOfFood(){\n return typeOfFood;\n }",
"public String getFoodType() {\n return \"Carnivore\";\n }",
"public String getTypeOfFood()\n {\n return typeOfFood;\n }",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"@Override\n public String ge... | [
"0.65527457",
"0.6516978",
"0.6427429",
"0.6408655",
"0.6408655",
"0.6408218",
"0.63683",
"0.6343112",
"0.6251023",
"0.60780895",
"0.60153884",
"0.59831256",
"0.59194815",
"0.5755576",
"0.572391",
"0.5656866",
"0.56249696",
"0.559406",
"0.55546075",
"0.5551621",
"0.5534608",
... | 0.71643996 | 0 |
Sets the type of food in the restaurant | public void setTypeOfDRink(String _typeOfDrink)
{
typeOfDrink = _typeOfDrink;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setTypeOfFood(String foodType){\n typeOfFood = foodType;\n }",
"public void setFoodType(String food);",
"public void setTypeOfFood(String _typeOfFood)\n {\n typeOfFood = _typeOfFood;\n }",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"@Override\n ... | [
"0.84484214",
"0.81962967",
"0.8067113",
"0.6952516",
"0.6952516",
"0.67865676",
"0.6696349",
"0.66289204",
"0.65755886",
"0.6538958",
"0.65202516",
"0.65202516",
"0.65202516",
"0.64020914",
"0.6395879",
"0.6338898",
"0.6333605",
"0.63248533",
"0.6303749",
"0.628412",
"0.6260... | 0.0 | -1 |
Sets the resturant's address | public void setAddress(String _address){
address = _address;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Restaurant setRestaurantAddress(Address address);",
"public void setAddress(String adrs) {\n address = adrs;\n }",
"public void setAddress(String address);",
"public void setAddress(String address);",
"public void setAddress(String address);",
"public void setAddress(String address);",
"publi... | [
"0.7354896",
"0.7278279",
"0.7154117",
"0.7154117",
"0.7154117",
"0.7154117",
"0.70682395",
"0.7020092",
"0.6987047",
"0.6950461",
"0.6950461",
"0.6950461",
"0.69362515",
"0.6928799",
"0.6928487",
"0.6897947",
"0.6889186",
"0.6850106",
"0.6814549",
"0.6808783",
"0.6808783",
... | 0.70503 | 7 |
Returns the resturant's address | public String getAddress(){
return address;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getAddress();",
"java.lang.String getAddress();",
"java.lang.String getAddress();",
"java.lang.String getAddress();",
"java.lang.String getAddress();",
"java.lang.String getAddress();",
"public String getExternalAddress();",
"String getAddress();",
"String getAddress();",
"public... | [
"0.7736742",
"0.7736742",
"0.7736742",
"0.7736742",
"0.7736742",
"0.7736742",
"0.76696736",
"0.7641675",
"0.7641675",
"0.7566834",
"0.7566834",
"0.7491375",
"0.7457144",
"0.73368305",
"0.7318462",
"0.7237419",
"0.72211736",
"0.7215581",
"0.72107196",
"0.71481216",
"0.71161735... | 0.0 | -1 |
getTotalCustomers() Gets the total customers and returns. | public int getTotalCustomers()
{
return totalCustomers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setTotalCustomers(int _totalCustomers){\n this.totalCustomers = _totalCustomers;\n\n }",
"public int getNumOfCustomers() {\n return this.numOfCustomers;\n }",
"@Override\n\tpublic int countCustomers() {\n\t\treturn 0;\n\t}",
"public int Customers()\r\n\t{\r\n\t\treturn customers... | [
"0.72727424",
"0.6853368",
"0.6676634",
"0.6572634",
"0.64187354",
"0.6280303",
"0.6245089",
"0.6176752",
"0.6126171",
"0.60432684",
"0.60325116",
"0.60200584",
"0.6015485",
"0.5991646",
"0.5987031",
"0.5939173",
"0.59315926",
"0.59067464",
"0.5898464",
"0.5882943",
"0.585817... | 0.8064279 | 0 |
getTotalCustomers() Sets the total customers. | public void setTotalCustomers(int _totalCustomers){
this.totalCustomers = _totalCustomers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getTotalCustomers()\n {\n return totalCustomers;\n }",
"@Override\n\tpublic int countCustomers() {\n\t\treturn 0;\n\t}",
"public int getNumOfCustomers() {\n return this.numOfCustomers;\n }",
"@Test\n\tpublic void totalCustomers()\n\t{\n\t\tassertTrue(controller.getReport().get... | [
"0.7166786",
"0.6337093",
"0.6076596",
"0.59385574",
"0.5852529",
"0.5745869",
"0.5723905",
"0.57191205",
"0.57069284",
"0.5688987",
"0.5661952",
"0.5563051",
"0.55326563",
"0.55179095",
"0.5471851",
"0.540812",
"0.53917575",
"0.53631157",
"0.53537154",
"0.5340472",
"0.534040... | 0.82346845 | 0 |
return the star rating | public int getStarRating(){
return starRating;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"double getRating();",
"public int getRating();",
"public double getRating(){\n\t\treturn this.rating;\n\t}",
"@Nullable\n final public Double getStarRating() {\n return mStarRating;\n }",
"public double getRating() {\n return rating_;\n }",
"public double getRating() {\n retur... | [
"0.80911905",
"0.76963305",
"0.7644305",
"0.75799245",
"0.75624675",
"0.75537956",
"0.7544622",
"0.75310266",
"0.7529053",
"0.7529053",
"0.7498755",
"0.74899966",
"0.74377465",
"0.74377465",
"0.74018115",
"0.73661214",
"0.7359823",
"0.73545414",
"0.7345683",
"0.7250699",
"0.7... | 0.8231205 | 0 |
setDishOfTheDay(Sring _dishOfTheDay) Sets the dish of the day | public void setDishOfTheDay(String _dishOfTheDay){
dishOfTheDay = _dishOfTheDay;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setDayOrNight(int day) {\n setStat(day, dayOrNight);\n }",
"public void setDay(final short day) {\r\n\t\tthis.day = day;\r\n\t}",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day... | [
"0.67618144",
"0.66695064",
"0.66285855",
"0.66285855",
"0.66285855",
"0.66285855",
"0.66285855",
"0.6620117",
"0.66145825",
"0.6579499",
"0.6525829",
"0.649413",
"0.649413",
"0.64319247",
"0.6298245",
"0.61956996",
"0.6191729",
"0.6184659",
"0.60973215",
"0.6097066",
"0.6066... | 0.82885075 | 0 |
getDishOfTheDay() Accesses the dish of the day | public String getDishOfTheDay(){
return dishOfTheDay;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDishOfTheDay(String _dishOfTheDay){\n dishOfTheDay = _dishOfTheDay;\n }",
"private Date getdDay() {\n\t\treturn this.dDay;\r\n\t}",
"public void dayIsLike() \r\n\t{ \r\n\t\tswitch (day) \r\n\t\t{ \r\n\t\tcase MONDAY: \r\n\t\t\tSystem.out.println(\"Mondays are bad.\"); \r\n\t\t\tbreak; \r... | [
"0.74954677",
"0.67570555",
"0.6463663",
"0.6432664",
"0.6411371",
"0.64072967",
"0.6379742",
"0.636148",
"0.6345761",
"0.63438225",
"0.63415587",
"0.63415587",
"0.63415587",
"0.63061917",
"0.62950987",
"0.62838775",
"0.62811",
"0.62758297",
"0.62758297",
"0.6237851",
"0.6237... | 0.76812845 | 0 |
setTypeOfFood(String foodType) Sets the type of food that the restaurant serves | public void setTypeOfFood(String foodType){
typeOfFood = foodType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setTypeOfFood(String _typeOfFood)\n {\n typeOfFood = _typeOfFood;\n }",
"public void setFoodType(String food);",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"public void setType(Stri... | [
"0.83463824",
"0.799616",
"0.679367",
"0.679367",
"0.67109257",
"0.67109257",
"0.67109257",
"0.6661244",
"0.6625589",
"0.64727074",
"0.6418281",
"0.64098203",
"0.6407375",
"0.6398655",
"0.6385612",
"0.6344961",
"0.6341441",
"0.63407254",
"0.63375217",
"0.6335667",
"0.6335667"... | 0.86725104 | 0 |
getTypeOfFood() Accesses and returns the type of food the restaurant serves | public String getTypeOfFood(){
return typeOfFood;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getTypeOfFood()\n {\n return typeOfFood;\n }",
"public void setTypeOfFood(String _typeOfFood)\n {\n typeOfFood = _typeOfFood;\n }",
"Food getByType(String type);",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"@Override\n public String getFoo... | [
"0.83976054",
"0.77688444",
"0.77190304",
"0.7657112",
"0.7657112",
"0.7528243",
"0.75147474",
"0.73913026",
"0.73541206",
"0.65882134",
"0.65600866",
"0.647229",
"0.6450136",
"0.6419857",
"0.63423854",
"0.63305986",
"0.61786884",
"0.6157401",
"0.61387324",
"0.6103289",
"0.60... | 0.83092856 | 1 |
setEmployees(int _employees) Sets the number of employees that the restaurant has. | public void setEmployees(int _employees){
employees = _employees;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setEmployees(Employee[] employees) {\n\t\tthis.employees = employees;\n\t}",
"public void setEmployees(ArrayList<Employee> employees) { \r\n this.employees = employees;\r\n }",
"@Override\n public void setEmployees() throws EmployeeCreationException {\n\n }",
"public void setEmplo... | [
"0.70679104",
"0.6715396",
"0.6191042",
"0.61899203",
"0.6119194",
"0.6106275",
"0.60348344",
"0.58800864",
"0.58733165",
"0.5866944",
"0.57879317",
"0.57839596",
"0.57049245",
"0.56986",
"0.56504035",
"0.56312066",
"0.5607398",
"0.5600048",
"0.5550465",
"0.5403343",
"0.53798... | 0.85545045 | 0 |
getEmployees() Returns the number of employees that the restaurant has. | public String getEmployees(){
return employees;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic int getNumberOfEmployees() {\n\t\treturn template.queryForObject(\"select count(*) from employee\", Integer.class);\n\t}",
"public int size()\n\t{\n\t\treturn numOfEmployees;\n\t}",
"public int sizeOfEmployeeArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n ... | [
"0.7621645",
"0.7558214",
"0.68634915",
"0.68209344",
"0.6724211",
"0.67121875",
"0.6552877",
"0.6362333",
"0.635294",
"0.62792313",
"0.6225053",
"0.61952245",
"0.6193257",
"0.6189782",
"0.61871743",
"0.61803716",
"0.61595964",
"0.61442524",
"0.6103105",
"0.6056463",
"0.60531... | 0.6355881 | 8 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof Trainees)) {
return false;
}
Trainees other = (Trainees) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void se... | [
"0.6896886",
"0.6838461",
"0.67056817",
"0.66419715",
"0.66419715",
"0.6592331",
"0.6579151",
"0.6579151",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.65624106",
"0.65624106",
"0.65441847",
"0.65243006",
"0.65154546",
"0.6487427",
"0.64778... | 0.0 | -1 |
function to count and print currency notes | public static void countCurrency(int amount)
{
int rs;
Scanner scan=new Scanner(system.in);
rs=scan.nextInt();
int[] notes = new int[]{2000,1000,500,100,50,20,10 };
int[] noteCounter = new int[7];
if((rs%10)==0)
{
for (int i = 0; i < 7; i++)
{
if (rs >= notes[i])
{
noteCounter[i] = amount / notes[i];
amount = amount%notes[i];
}
}
// Print notes
System.out.println("Currency Count ->");
for (int i = 0; i < 7; i++)
{
if (noteCounter[i] != 0)
{
System.out.println(noteCounter[i] + "notes of" + notes[i]);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toString()\n {\n\tint c = coinCounter();\n\treturn \"$\" + c / 100 + \".\" + c % 100;\n }",
"private void displayQuantity() {\n Log.d(\"Method\", \"displayQuantity()\");\n TextView quantityTextView = (TextView) findViewById(\n R.id.quantity_text_view);\n\n ... | [
"0.6197089",
"0.60431004",
"0.5994992",
"0.58486205",
"0.57125336",
"0.5669883",
"0.5648111",
"0.56311333",
"0.5628503",
"0.56187034",
"0.56167376",
"0.5610292",
"0.56072897",
"0.55475473",
"0.5499657",
"0.5461925",
"0.54577714",
"0.5433207",
"0.54134226",
"0.5401515",
"0.539... | 0.7666838 | 0 |
super.paint(g); System.out.println("Start Paint start view"); | @Override
public void paint(Object g) {
Graphics2D graphics = (Graphics2D) g;
largeFontMetrics = graphics.getFontMetrics(largeFont);
mediumFontMetrics = graphics.getFontMetrics(mediumFont);
smallFontMetrics = graphics.getFontMetrics(smallFont);
largeHeight = largeFontMetrics.getHeight();
mediumHeight = mediumFontMetrics.getHeight();
smallHeight = smallFontMetrics.getHeight();
int firstLineYBase = largeHeight + FIRST_LINE_Y_OFFSET;
int secondLineYBase = firstLineYBase + mediumHeight;
int thirdLineYBase = secondLineYBase + smallHeight;
int fourthLineYBase = thirdLineYBase + smallHeight;
graphics.setColor(ABOUT_BACKGROUND);
graphics.fillRect(BORDER_OFFSET,BORDER_OFFSET, drawComponent.getWidth() -BORDER_OFFSET*2, OBJECT_EDITOR_HEIGHT);
graphics.setColor(ABOUT_FOREGROUND);
graphics.setFont(largeFont);
graphics.drawString(OBJECT_EDITOR_NAME, LINE_X_OFFSET, OBJECT_EDITOR_Y + firstLineYBase);
graphics.setFont(mediumFont);
// graphics.drawString("(" + objectEditorVersion + ": " + objectEditorBuildTime + ")", 90, 20);
graphics.drawString(versionDetails, LINE_X_OFFSET, OBJECT_EDITOR_Y + secondLineYBase );
graphics.setFont(smallFont);
graphics.drawString(AboutManager.getObjectEditorDescription().getCopyRight(), LINE_X_OFFSET, OBJECT_EDITOR_Y + thirdLineYBase);
graphics.drawString(AboutManager.getObjectEditorDescription().getPatent(), LINE_X_OFFSET, OBJECT_EDITOR_Y + fourthLineYBase);
graphics.setColor(STATUS_BACKGROUND);
graphics.fillRect(BORDER_OFFSET, STATUS_Y, drawComponent.getWidth() -BORDER_OFFSET*2, STATUS_HEIGHT);
// graphics.setColor(Color.DARK_GRAY);
graphics.setColor(STATUS_FOREGROUND);
// graphics.drawLine(0, 32, drawComponent.getWidth(), 33);
graphics.setFont(largeFont);
// System.out.println("Drawstring edited object:" + editedObject);
//
// System.out.println("Drawstring edited object toSTring:" + editedObject.toString());
// System.out.println("Drawstring firstLine Base:" + firstLineYBase);
// if (mainHeader != null)
// graphics.drawString( mainHeader.toString(), LINE_X_OFFSET, STATUS_Y + firstLineYBase);
// System.out.println(" Painting main header to string ");
if (mainHeaderToString != null)
graphics.drawString( mainHeaderToString, LINE_X_OFFSET, STATUS_Y + firstLineYBase); // this will deadlock
// graphics.drawString( mainHeader.toString(), LINE_X_OFFSET, STATUS_Y + firstLineYBase);
// graphics.drawString( "" + editedObject + "(" + editorGenerationMessage + ")", 5, 80);
graphics.setFont(mediumFont);
graphics.drawString( majorStepMessage, LINE_X_OFFSET, STATUS_Y + secondLineYBase);
graphics.setFont(smallFont);
graphics.drawString(statusMessage, LINE_X_OFFSET, STATUS_Y + thirdLineYBase);
String timeString = "(" + numSeconds +"s)";
graphics.drawString( timeString, LINE_X_OFFSET, STATUS_Y + fourthLineYBase);
int timeStringLength = smallFontMetrics.stringWidth(timeString);
graphics.setColor(PROGRESS_COLOR);
graphics.fillRect(LINE_X_OFFSET + timeStringLength + 3, STATUS_Y + fourthLineYBase -10, numSeconds*5, 12);
graphics.setColor(DEFINITION_BACKGROUND);
graphics.fillRect(BORDER_OFFSET, DEFINITION_Y, drawComponent.getWidth()-BORDER_OFFSET*2, drawComponent.getHeight()- DEFINITION_Y - BORDER_OFFSET);
graphics.setFont(largeFont);
graphics.setColor(DEFINITION_FOREGROUND);
if (computerDefinition != null) {
graphics.drawString(computerDefinition.getWord(), LINE_X_OFFSET, DEFINITION_Y + firstLineYBase);
graphics.setFont(mediumFont);
graphics.drawString(computerDefinition.getMeaning(), LINE_X_OFFSET, DEFINITION_Y + secondLineYBase);
graphics.setFont(smallFont);
graphics.drawString(DEFINITIONS_BEHAVIOR_MESSAGE, LINE_X_OFFSET, DEFINITION_Y + thirdLineYBase);
} else {
graphics.drawString("Missing definition file:" + ComputerDefinitionsGenerator.DICTIONARY_FILE, LINE_X_OFFSET, DEFINITION_Y + firstLineYBase);
}
if (logoImage != null) {
graphics.drawImage(logoImage, LOGO_X, LOGO_Y, LOGO_WIDTH, LOGO_HEIGHT, drawComponent);
// graphics.drawImage(logoImage, LOGO_X, LOGO_Y, drawComponent);
}
// System.out.println("End Paint start view");
// graphics.drawString(ComputerDefinitions.definitions[0], LINE_X_OFFSET, DEFINITION_Y + firstLineYBase);
// graphics.drawString(editorGenerationMessage, 10, 40);
// graphics.drawString("" + numSeconds +"s", 50, 80);
// graphics.drawString(lastTraceable, 100, 100);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void paint(Graphics g) {\n super.paint(g);\n\n }",
"@Override\r\n\t\tpublic void paint(Graphics g) {\n\t\t\tsuper.paint(g);\r\n\t\t}",
"@Override\n public void paintComponent(Graphics g) \n {\n super.paintComponent(g);\n doDrawing(g);\n }"... | [
"0.80853516",
"0.79595685",
"0.79410523",
"0.7940598",
"0.7848547",
"0.78246176",
"0.7805715",
"0.7714731",
"0.7609298",
"0.7591939",
"0.7539703",
"0.75337046",
"0.7522151",
"0.7522151",
"0.74958557",
"0.746949",
"0.74388146",
"0.74359417",
"0.7423312",
"0.74138236",
"0.74087... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void mouseClicked(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 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 |
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 keyTyped(KeyEvent 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 keyPressed(KeyEvent 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 keyReleased(KeyEvent 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 |
Start reading the file from the start | private CSVReaderHeaderAware getCSVReader(File file)
throws IOException {
FileReader fileReader;
CSVReaderHeaderAware rowReader;
try {
fileReader = new FileReader(file);
try {
rowReader = new CSVReaderHeaderAware(fileReader);
} catch (IOException exception) {
System.out.println("IO ERROR ON CSV READ");
throw exception;
}
} catch (FileNotFoundException exception) {
System.out.println("CSV FILE NOT FOUND");
throw exception;
}
return rowReader;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void start() throws IOException;",
"public void star... | [
"0.67431784",
"0.65802366",
"0.6577045",
"0.64625156",
"0.64139473",
"0.63391286",
"0.63100815",
"0.6302535",
"0.6287061",
"0.6191989",
"0.6119084",
"0.6027633",
"0.6014418",
"0.6012392",
"0.5996126",
"0.59820426",
"0.5946915",
"0.59401685",
"0.5924552",
"0.59198046",
"0.5909... | 0.0 | -1 |
Read a row into a Map with column headings as keys and row entries as values | private Map<String, String> getRow(CSVReaderHeaderAware rowReader)
throws IOException {
return rowReader.readMap();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static Map<Integer, Map<String, Object>> readTxt(BufferedReader in) throws IOException {\n\t\t\n\t\t// reads the key names (column names) and stores them\n\t\tString colString = in.readLine();\n\t\tString[] col = colString.split(\"\\t\");\n\n\t\t//instantiates the object being returned so we can add in objects\n\t... | [
"0.6537413",
"0.6490584",
"0.64349186",
"0.63174427",
"0.6234222",
"0.622434",
"0.60469985",
"0.5879434",
"0.5866978",
"0.56689394",
"0.56687677",
"0.5668398",
"0.5658922",
"0.56563103",
"0.5651165",
"0.5582928",
"0.5551616",
"0.55259174",
"0.5514595",
"0.54883033",
"0.547533... | 0.69958067 | 0 |
/ Possible exceptions? Inner org.hibernate.exception.ConstraintViolationException Outer org.springframework.dao.DataIntegrityConstraintViolationException Inner java.lang.IllegalStateException Outer org.springframework.transaction.CannotCreateTransactionException I think the parent of the ones I want is: org.springframework.dao.DataAccessException The parent of that is: org.springframework.core.NestedRuntimeException | private void processDeptsAndCollections(Map<String, String> row, Map<String, Dept> deptsAdded,
Map<String, Collection> collectionsAdded) {
String deptName = sanitizeString(row.get(departmentHeading));
String collName = sanitizeString(row.get(collectionHeading));
//if (deptName.isEmpty()) {
// // Don't add anything if the department field was empty
// return;
//}
Dept dept;
Collection coll;
if (failedDeptAttempts >= maxDeptAttempts) {
throw new RuntimeException("Aborting: too many failed attempts to add Departments");
}
if (failedCollAttempts >= maxCollAttempts) {
throw new RuntimeException("Aborting: too many failed attempts to add Collections");
}
//System.out.println(deptsAdded.get(deptName));
if (deptsAdded.get(deptName) == null) {
dept = new Dept();
// id is auto-generated
dept.setName(deptName);
try {
deptRepo.saveAndFlush(dept);
deptsAdded.put(deptName, dept);
}
catch (Exception exception) {
System.out.println("Skipped Dept: duplicate or malformed entry");
System.out.println(exception.toString());
failedDeptAttempts++;
}
}
// How to handle null deptsAdded.get(deptName)?
if (collectionsAdded.get(collName) == null) {
coll = new Collection();
// id is auto-generated
coll.setName(collName);
coll.setDept(deptsAdded.get(deptName));
try {
collectionRepo.saveAndFlush(coll);
collectionsAdded.put(collName, coll);
} catch (Exception exception) {
System.out.println("Skipped Collection: duplicate or malformed entry, or missing Dept");
System.out.println(exception.toString());
failedCollAttempts++;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n /**\n * Do not allow delete of record in parent table that will cause orphan records in child tables of the database.\n */\n void dataIntegrityViolationExceptionThrownWhenDelete() {\n }",
"@Test(expected = DataAcessException.class)\n\t public void testUpdateExcep() throws DataAcessExcep... | [
"0.6423021",
"0.62938124",
"0.62234086",
"0.6139801",
"0.60283864",
"0.60089284",
"0.59259355",
"0.5904889",
"0.5876278",
"0.58114",
"0.57645535",
"0.57476294",
"0.5747169",
"0.57072484",
"0.56808865",
"0.56562823",
"0.5646231",
"0.56364363",
"0.56345755",
"0.56304073",
"0.56... | 0.0 | -1 |
Creates an Item and adds it to the buffer (destructively) | private boolean processItems(Map<String, String> row, List<Item> itemBuffer, Integer bufSize,
Map<String, Dept> deptsAdded, Map<String, Collection> collectionsAdded,
Map<String, List<String>> allIrns, Map<String, Integer> mediaCounts) {
boolean batchAdded = false;
if (row == null) return batchAdded;
// Create list of Entities, then batch-insert using repo.saveAll(). Would be nice to be able to skip indiviual malformed
// Items, but difficult with batch saving. Instead, skip the entire batch containing the malformed entry.
// TODO: maybe handle blank lines and malformed items/dates more gracefully. Can a required Dept/Collection actually be missing?
// That shouldn't be the case unless there were some exceptions earlier on.
if (itemBuffer.size() == bufSize) {
try {
itemRepo.saveAll(itemBuffer);
}
catch (DataIntegrityViolationException exception) {
System.out.printf("Skipped batch: contained duplicate item(s), starting with the item with reference number '%s'\n",
extractDuplicateItemRef(extractUsefulErrorMessage(exception)));
//System.out.println(extractUsefulErrorMessage(exception));
}
catch (NestedRuntimeException exception) {
System.out.println("Skipped batch: contained malformed item(s), blank line, or a required Dept/Collection was missing. Details:");
System.out.println(extractUsefulErrorMessage(exception));
} finally {
itemRepo.flush();
}
itemBuffer.clear();
batchAdded = true;
}
// TODO: trim whitespace etc for all values?
Item item = new Item();
// id is auto-generated
// TODO: check for null collection and skip this individual Item (never add it to the buffer, and reduce the
// total number of items to add (i.e. fullBatches and/or lastBatchSize etc))
item.setCollection(collectionsAdded.get(sanitizeString(row.get(collectionHeading))));
item.setItemRef(row.get(itemRefHeading).trim());
if (row.get(locationHeadingArchive) != null) {
item.setLocation(row.get(locationHeadingArchive));
} else if (row.get(locationHeadingMuseum) != null) {
item.setLocation(row.get(locationHeadingMuseum));
}
if (row.get(nameHeading) != null &&
!truncateString(row.get(nameHeading), 200).isEmpty()) {
item.setName(truncateString(row.get(nameHeading), 200));
} else {
item.setName(row.get(itemRefHeading));
}
if (row.get(descriptionHeadingMuseum) != null) {
item.setDescription(row.get(descriptionHeadingMuseum));
} else if (row.get(descriptionHeadingArchive) != null) {
item.setDescription(row.get(descriptionHeadingArchive));
}
if (allIrns.get(row.get(itemRefHeading)) != null) {
item.setMediaIrns(stringifyIrns(allIrns.get(row.get(itemRefHeading))));
}
if (mediaCounts.get(row.get(itemRefHeading)) == null) {
item.setMediaCount(0);
} else {
item.setMediaCount(mediaCounts.get(row.get(itemRefHeading)));
}
if (row.get(copyrightHeading) !=null) {
item.setCopyrighted(row.get(copyrightHeading));
} else {
item.setCopyrighted("Unknown");
}
if (row.get(displayDateHeadingArchive) != null && !StringUtils.isAllBlank(row.get(displayDateHeadingArchive))) {
item.setDisplayDate(row.get(displayDateHeadingArchive));
} else if (row.get(displayDateHeadingMuseum) != null && !StringUtils.isAllBlank(row.get(displayDateHeadingMuseum))) {
item.setDisplayDate(row.get(displayDateHeadingMuseum));
}
if (item.getDisplayDate() != null) {
DateMatcher dateMatcher = new DateMatcher();
dateMatcher.matchAttempt(item.getDisplayDate());
item.setStartDate(dateMatcher.startDate);
item.setEndDate(dateMatcher.endDate);
}
if (row.get(extentHeadingArchive) != null) {
item.setExtent(row.get(extentHeadingArchive));
} else if (row.get(extentHeadingMuseum) != null) {
item.setExtent(row.get(extentHeadingMuseum));
}
// Missing/already used
//item.setPhysTechDesc();
item.setCollectionDisplayName(truncateString(sanitizeString(row.get(collectionDisplayNameHeading)), 200));
item.setThumbnailIrn();
itemBuffer.add(item);
return batchAdded;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void put(T bufferItem);",
"void add(Item item);",
"public void Add(String item) {\n byte[] bites = Utils.hexToBytes(item);\n mpBuffer += Utils.bytesToHex(bites);\n mLenght += bites.length;\n mBackOffset = mLenght;\n }",
"public void push(Object item) {\r\n\t\tdata.add(item);\r\n\r\n\t}",
... | [
"0.70924103",
"0.6496833",
"0.6445138",
"0.63183177",
"0.61984724",
"0.615943",
"0.6132817",
"0.61166424",
"0.61156297",
"0.60776603",
"0.60603535",
"0.6043947",
"0.60031635",
"0.5994582",
"0.5975167",
"0.5955627",
"0.59354967",
"0.592628",
"0.5885138",
"0.587324",
"0.5862367... | 0.0 | -1 |
The management interface for asynchronous serversockets for Coconut AIO. | public interface ServerSocketMXBean {
/**
* Returns all live server-socket IDs. Some server-socket included in the
* returned array may have been terminated when this method returns.
*
* @return an array of <tt>long</tt>, each is a server-socket ID.
* @throws java.lang.SecurityException if a security manager exists and the
* caller does not have ManagementPermission("monitor").
*/
long[] getAllServerSocketIds();
/**
* Returns the total number of server-sockets opened since the Java virtual
* machine started.
*
* @return the total number of server-sockets opened.
*/
long getTotalServerSocketsCount();
/**
* Returns the peak open server-socket count since the Java virtual machine
* started or the peak was reset.
*
* @return the peak live server-socket count.
*/
int getPeakServerSocketCount();
/**
* Returns the current number of open server-sockets.
*
* @return the current number of open server-sockets.
*/
int getServerSocketCount();
/**
* Returns the total number of sockets accepted by all server-sockets since
* the Java virtual machine started.
*
* @return the total number of server-sockets opened.
*/
long getTotalAcceptCount();
/**
* Returns the total number of sockets accepted by a server-socket with the
* specified <tt>id</tt>.
*
* @param id the ID of the server-socket. Must be positive.
* @return the total number of server-sockets opened.
*/
long getTotalAcceptCount(long id);
/**
* Returns the server-socket info for a server-socket of the specified
* <tt>id</tt>.
* <p>
* This method returns a <tt>ServerSocketInfo</tt> object representing the
* server-socket information for the server-socket of the specified ID. If a
* server-socket of the given ID is not open or does not exist, this method
* will return <tt>null</tt>.
* <p>
* <b>MBeanServer access </b>: <br>
* The mapped type of <tt>ServerSocketInfo</tt> is <tt>CompositeData</tt>
* with attributes as specified in
* {@link ServerSocketInfo#from ServerSocketInfo}.
*
* @param id the ID of the server-socket. Must be positive.
* @return a {@link ServerSocketInfo}object for the server-socket of the
* given ID; <tt>null</tt> if the server-socket of the given ID is
* not open or it does not exist.
* @throws IllegalArgumentException if <tt>id <= 0</tt>.
* @throws java.lang.SecurityException if a security manager exists and the
* caller does not have ManagementPermission("monitor").
*/
ServerSocketInfo getServerSocketInfo(long id);
/**
* Returns the server-socket info for each server-socket whose ID is in the
* input array <tt>ids</tt>.
* <p>
* This method returns an array of the <tt>ServerSocketInfo</tt> objects.
* If a server-socket of a given ID is not open or does not exist, the
* corresponding element in the returned array will contain <tt>null</tt>.
* <p>
* <b>MBeanServer access </b>: <br>
* The mapped type of <tt>ServerSocketInfo</tt> is <tt>CompositeData</tt>
* with attributes as specified in
* {@link ServerSocketInfo#from ServerSocketInfo}.
*
* @param ids an array of server-socket IDs
* @return an array of the {@link ServerSocketInfo}objects, each containing
* information about a server-socket whose ID is in the
* corresponding element of the input array of IDs.
* @throws IllegalArgumentException if any element in the input array
* <tt>ids</tt> is <tt><= 0</tt>.
* @throws java.lang.SecurityException if a security manager exists and the
* caller does not have ManagementPermission("monitor").
*/
ServerSocketInfo[] getServerSocketInfo(long[] ids);
/**
* Resets the peak server-socket count to the current number of open
* server-sockets.
*
* @throws java.lang.SecurityException if a security manager exists and the
* caller does not have ManagementPermission("control").
* @see #getPeakServerSocketCount
* @see #getServerSocketCount
*/
void resetPeakServerSocketCount();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// ... | [
"0.66657394",
"0.63091177",
"0.6223619",
"0.61692184",
"0.5959323",
"0.5939742",
"0.5923306",
"0.59222543",
"0.5884226",
"0.58799934",
"0.5846374",
"0.5833999",
"0.58022904",
"0.5783484",
"0.57734936",
"0.57262754",
"0.571495",
"0.56895864",
"0.56894416",
"0.5676077",
"0.5674... | 0.0 | -1 |
Returns all live serversocket IDs. Some serversocket included in the returned array may have been terminated when this method returns. | long[] getAllServerSocketIds(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.String[] getServerIds() {\r\n return serverIds;\r\n }",
"private Set<Session> getOpenServerSessions(){\n ClientContainer jettySocketServer = getWebSocketsContainer();\n return jettySocketServer.getOpenSessions();\n }",
"public int[] getIDs(){\r\n\t\tint[] id = new in... | [
"0.6937009",
"0.64163935",
"0.6366279",
"0.6298386",
"0.6252622",
"0.62067264",
"0.6204067",
"0.6041598",
"0.58784944",
"0.58202595",
"0.5774353",
"0.57634974",
"0.5750694",
"0.57275575",
"0.5696132",
"0.56921303",
"0.56495166",
"0.56454617",
"0.5635627",
"0.5622988",
"0.5622... | 0.7984638 | 0 |
Returns the total number of serversockets opened since the Java virtual machine started. | long getTotalServerSocketsCount(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getServerSocketCount();",
"public static long getNumberOfOpenConnections() {\n return openConnections.size();\n }",
"int getPeakServerSocketCount();",
"int getTotalCreatedConnections();",
"int getConnectionsCount();",
"public Integer serverCount() {\n return this.serverCount;\n }"... | [
"0.7649942",
"0.7049941",
"0.70026475",
"0.66757756",
"0.6656013",
"0.6612727",
"0.6566897",
"0.6558961",
"0.6396418",
"0.6365089",
"0.630364",
"0.6302125",
"0.6293953",
"0.6288076",
"0.62866133",
"0.6271091",
"0.62681663",
"0.62276495",
"0.6210644",
"0.6190455",
"0.6167532",... | 0.7772771 | 0 |
Returns the peak open serversocket count since the Java virtual machine started or the peak was reset. | int getPeakServerSocketCount(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getServerSocketCount();",
"public int getMaxOverflowConnections()\n {\n return _maxOverflowConnections;\n }",
"long getTotalServerSocketsCount();",
"public int getMaxConnections() {\n return maxConnections;\n }",
"public int getMaxConnections()\n {\n return _maxConnections;\n ... | [
"0.6820582",
"0.6590013",
"0.6548523",
"0.65256834",
"0.6524642",
"0.6421768",
"0.6270213",
"0.6253332",
"0.6181653",
"0.6179006",
"0.61532784",
"0.6121524",
"0.60628873",
"0.60268337",
"0.6022807",
"0.5994856",
"0.5992362",
"0.594969",
"0.58985305",
"0.58856624",
"0.58492756... | 0.82533044 | 0 |
Returns the current number of open serversockets. | int getServerSocketCount(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static long getNumberOfOpenConnections() {\n return openConnections.size();\n }",
"private synchronized static void incrementNumberOfOpenSockets() {\r\n\r\n\t\tnumberOfOpenSockets++;\r\n\t}",
"int getConnectionsCount();",
"int getPeakServerSocketCount();",
"long getTotalServerSocketsCount(... | [
"0.79763156",
"0.7723148",
"0.74066377",
"0.7398035",
"0.73601544",
"0.7335408",
"0.7240033",
"0.70916986",
"0.7073893",
"0.70492226",
"0.7037034",
"0.7032247",
"0.69988805",
"0.6945479",
"0.6944811",
"0.6944594",
"0.6937603",
"0.69248873",
"0.6921024",
"0.68996984",
"0.68959... | 0.8210244 | 0 |
Returns the total number of sockets accepted by all serversockets since the Java virtual machine started. | long getTotalAcceptCount(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long getTotalServerSocketsCount();",
"int getServerSocketCount();",
"int getPeakServerSocketCount();",
"int getConnectionsCount();",
"public int numIncoming() {\r\n int result = incoming.size();\r\n return result;\r\n }",
"public int manyConnections() {\n\t\tint ammound = 0;\n\t\tfor (in... | [
"0.8000313",
"0.7686085",
"0.7064491",
"0.635544",
"0.63255143",
"0.6305058",
"0.62521344",
"0.6233599",
"0.6228558",
"0.61615396",
"0.614216",
"0.6098858",
"0.6095568",
"0.6080153",
"0.60435367",
"0.6042233",
"0.60328287",
"0.60039943",
"0.5980702",
"0.5941689",
"0.59227633"... | 0.55998236 | 40 |
Returns the total number of sockets accepted by a serversocket with the specified id. | long getTotalAcceptCount(long id); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long getTotalServerSocketsCount();",
"int getServerSocketCount();",
"public void acceptedSocket(long socketId) {}",
"int getPeakServerSocketCount();",
"int getConnectionsCount();",
"int getPeersCount();",
"public int getTicketsCountService(String eventid) throws SQLException {\n\t\treturn dao.getTicket... | [
"0.70536023",
"0.6776331",
"0.63351834",
"0.60788876",
"0.5588703",
"0.5557572",
"0.5366126",
"0.53287774",
"0.5323872",
"0.5317049",
"0.5307819",
"0.5265895",
"0.524038",
"0.5227393",
"0.5215548",
"0.5213001",
"0.5208426",
"0.520575",
"0.51900935",
"0.51828593",
"0.51825917"... | 0.61773646 | 3 |
Resets the peak serversocket count to the current number of open serversockets. | void resetPeakServerSocketCount(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private synchronized static void decrementNumberOfOpenSockets() {\r\n\r\n\t\tnumberOfOpenSockets--;\r\n\t}",
"int getPeakServerSocketCount();",
"public static void resetConnectionCounts() {\n CREATED_TCP_CONNECTIONS.set(0);\n CREATED_UDP_CONNECTIONS.set(0);\n }",
"private void countSocketClo... | [
"0.69767",
"0.6936661",
"0.6615598",
"0.62604314",
"0.6232159",
"0.612451",
"0.6100719",
"0.59890133",
"0.5951702",
"0.5925814",
"0.5918558",
"0.5856856",
"0.5837175",
"0.5815057",
"0.56858224",
"0.5667542",
"0.5653225",
"0.55946314",
"0.55624324",
"0.5521375",
"0.551751",
... | 0.8705643 | 0 |
Methods to check the status of the current token | public boolean matchDelim(char d) {
return d == (char) tok.ttype;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean checkSavedToken(Context context) {\n SharedPreferences preferences = context.getSharedPreferences(token_storage, 0);\n String storage_token = preferences.getString(\"token\", \"notoken\");\n\n if (!storage_token.equals(\"notoken\")) {\n Log.d(\"Service\", \"Usi... | [
"0.6809197",
"0.6619255",
"0.6568087",
"0.6568087",
"0.6568087",
"0.6568087",
"0.6568087",
"0.6568087",
"0.6470719",
"0.64424926",
"0.6412205",
"0.6412205",
"0.6412205",
"0.6346271",
"0.63390714",
"0.6330468",
"0.6274254",
"0.6270889",
"0.62538594",
"0.62371296",
"0.6211088",... | 0.0 | -1 |
Methods to "eat" the current token | public void eatDelim(char d) {
if (!matchDelim(d))
throw new BadSyntaxException();
nextToken();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Token next();",
"private void consumeToken() {\n\t\tToken token = lexAnalyser.nextToken();\n\t\tlogMessage(functionStack.peekFirst() + \" consumed \" + token.getType()\n\t\t\t\t+ \": <lexeme>\" + token.getLexeme() + \"</lexeme>\");\n\t\tpeekToken = lexAnalyser.peekToken();\n\t}",
"Token current();",
"final v... | [
"0.70672524",
"0.677557",
"0.6752418",
"0.6692412",
"0.6400982",
"0.6335785",
"0.6304151",
"0.6250004",
"0.6142677",
"0.6067183",
"0.60454166",
"0.6034938",
"0.5985698",
"0.5960256",
"0.59371877",
"0.59301287",
"0.5913286",
"0.5871596",
"0.58667713",
"0.5863043",
"0.5852947",... | 0.0 | -1 |
Parsing String format data into JSON format | private static String jsonToString(final Object obj) throws JsonProcessingException {
String result;
try {
final ObjectMapper mapper = new ObjectMapper();
final String jsonContent = mapper.writeValueAsString(obj);
result = jsonContent;
} catch (JsonProcessingException e) {
result = "Json processing error";
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private JSONDocument parseString(String data){\n JSONDocument temp = null;\n int pointer = 0;\n boolean firstValidCharReached = false;\n do{\n char c = data.charAt(pointer ++);\n switch (c) {\n case '{':\n HashMap thm = this.parseM... | [
"0.69830793",
"0.68203795",
"0.6470702",
"0.62998444",
"0.6190998",
"0.6114909",
"0.60707086",
"0.60490584",
"0.5942266",
"0.59362847",
"0.5931497",
"0.5911688",
"0.58697903",
"0.584177",
"0.5823059",
"0.58073896",
"0.5793716",
"0.57685834",
"0.57538325",
"0.57529736",
"0.575... | 0.0 | -1 |
/ renamed from: a | public final /* synthetic */ void mo16242a(Object obj) {
C1948n.m1229a().f1421g.unsubscribe(C1744eg.this.f1003d);
C1744eg.this.runAsync(new C1738eb() {
/* renamed from: a */
public final void mo16236a() throws Exception {
Map b = C1744eg.m890b(C1744eg.this.f1002b);
C1691dd ddVar = new C1691dd();
ddVar.f897f = "https://api.login.yahoo.com/oauth2/device_session";
ddVar.f898g = C1699a.kPost;
ddVar.mo16403a("Content-Type", "application/json");
ddVar.f883b = new JSONObject(b).toString();
ddVar.f885d = new C1725dt();
ddVar.f884c = new C1725dt();
ddVar.f882a = new C1693a<String, String>() {
/* renamed from: a */
public final /* synthetic */ void mo16300a(C1691dd ddVar, Object obj) {
String str = "PrivacyManager";
String str2 = (String) obj;
try {
int i = ddVar.f904m;
if (i == 200) {
JSONObject jSONObject = new JSONObject(str2);
C1744eg.m888a(C1744eg.this, new C1477a(jSONObject.getString("device_session_id"), jSONObject.getLong("expires_in"), C1744eg.this.f1002b));
C1744eg.this.f1002b.callback.success();
return;
}
C1685cy.m769e(str, "Error in getting privacy dashboard url. Error code = ".concat(String.valueOf(i)));
C1744eg.this.f1002b.callback.failure();
} catch (JSONException e) {
C1685cy.m763b(str, "Error in getting privacy dashboard url. ", (Throwable) e);
C1744eg.this.f1002b.callback.failure();
}
}
};
C1675ct.m738a().mo16389a(C1744eg.this, ddVar);
}
});
} | {
"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 final void mo16236a() throws Exception {
Map b = C1744eg.m890b(C1744eg.this.f1002b);
C1691dd ddVar = new C1691dd();
ddVar.f897f = "https://api.login.yahoo.com/oauth2/device_session";
ddVar.f898g = C1699a.kPost;
ddVar.mo16403a("Content-Type", "application/json");
ddVar.f883b = new JSONObject(b).toString();
ddVar.f885d = new C1725dt();
ddVar.f884c = new C1725dt();
ddVar.f882a = new C1693a<String, String>() {
/* renamed from: a */
public final /* synthetic */ void mo16300a(C1691dd ddVar, Object obj) {
String str = "PrivacyManager";
String str2 = (String) obj;
try {
int i = ddVar.f904m;
if (i == 200) {
JSONObject jSONObject = new JSONObject(str2);
C1744eg.m888a(C1744eg.this, new C1477a(jSONObject.getString("device_session_id"), jSONObject.getLong("expires_in"), C1744eg.this.f1002b));
C1744eg.this.f1002b.callback.success();
return;
}
C1685cy.m769e(str, "Error in getting privacy dashboard url. Error code = ".concat(String.valueOf(i)));
C1744eg.this.f1002b.callback.failure();
} catch (JSONException e) {
C1685cy.m763b(str, "Error in getting privacy dashboard url. ", (Throwable) e);
C1744eg.this.f1002b.callback.failure();
}
}
};
C1675ct.m738a().mo16389a(C1744eg.this, ddVar);
} | {
"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 final /* synthetic */ void mo16300a(C1691dd ddVar, Object obj) {
String str = "PrivacyManager";
String str2 = (String) obj;
try {
int i = ddVar.f904m;
if (i == 200) {
JSONObject jSONObject = new JSONObject(str2);
C1744eg.m888a(C1744eg.this, new C1477a(jSONObject.getString("device_session_id"), jSONObject.getLong("expires_in"), C1744eg.this.f1002b));
C1744eg.this.f1002b.callback.success();
return;
}
C1685cy.m769e(str, "Error in getting privacy dashboard url. Error code = ".concat(String.valueOf(i)));
C1744eg.this.f1002b.callback.failure();
} catch (JSONException e) {
C1685cy.m763b(str, "Error in getting privacy dashboard url. ", (Throwable) e);
C1744eg.this.f1002b.callback.failure();
}
} | {
"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 |
/ access modifiers changed from: private / renamed from: b | public static void m891b(Context context, C1477a aVar) {
Intent intent = new Intent("android.intent.action.VIEW", aVar.f311a);
intent.setFlags(268435456);
context.startActivity(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n public void b() {\n }",
"public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }",
"@Override\n\tpublic void b() {\n\n\t}",
"public void b() {\r\n }",
"protected b(int mb) {\n/* 87 */ t... | [
"0.7224839",
"0.69518054",
"0.68448514",
"0.68045336",
"0.6729634",
"0.66892576",
"0.6667949",
"0.6666382",
"0.66440094",
"0.6614186",
"0.66016066",
"0.66016066",
"0.6589728",
"0.6487956",
"0.6466085",
"0.6466085",
"0.645071",
"0.6444203",
"0.6424545",
"0.64207315",
"0.641609... | 0.0 | -1 |
/ renamed from: a | public static void m886a(Request request) {
C1744eg egVar = f1001a;
egVar.f1002b = request;
egVar.runAsync(new C1738eb() {
/* renamed from: a */
public final void mo16236a() throws Exception {
if (C1948n.m1229a().f1421g.mo16247c()) {
C1744eg.this.runAsync(new C1738eb() {
/* renamed from: a */
public final void mo16236a() throws Exception {
Map b = C1744eg.m890b(C1744eg.this.f1002b);
C1691dd ddVar = new C1691dd();
ddVar.f897f = "https://api.login.yahoo.com/oauth2/device_session";
ddVar.f898g = C1699a.kPost;
ddVar.mo16403a("Content-Type", "application/json");
ddVar.f883b = new JSONObject(b).toString();
ddVar.f885d = new C1725dt();
ddVar.f884c = new C1725dt();
ddVar.f882a = new C1693a<String, String>() {
/* renamed from: a */
public final /* synthetic */ void mo16300a(C1691dd ddVar, Object obj) {
String str = "PrivacyManager";
String str2 = (String) obj;
try {
int i = ddVar.f904m;
if (i == 200) {
JSONObject jSONObject = new JSONObject(str2);
C1744eg.m888a(C1744eg.this, new C1477a(jSONObject.getString("device_session_id"), jSONObject.getLong("expires_in"), C1744eg.this.f1002b));
C1744eg.this.f1002b.callback.success();
return;
}
C1685cy.m769e(str, "Error in getting privacy dashboard url. Error code = ".concat(String.valueOf(i)));
C1744eg.this.f1002b.callback.failure();
} catch (JSONException e) {
C1685cy.m763b(str, "Error in getting privacy dashboard url. ", (Throwable) e);
C1744eg.this.f1002b.callback.failure();
}
}
};
C1675ct.m738a().mo16389a(C1744eg.this, ddVar);
}
});
return;
}
C1685cy.m754a(3, "PrivacyManager", "Waiting for ID provider.");
C1948n.m1229a().f1421g.subscribe(C1744eg.this.f1003d);
}
});
} | {
"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 final void mo16236a() throws Exception {
if (C1948n.m1229a().f1421g.mo16247c()) {
C1744eg.this.runAsync(new C1738eb() {
/* renamed from: a */
public final void mo16236a() throws Exception {
Map b = C1744eg.m890b(C1744eg.this.f1002b);
C1691dd ddVar = new C1691dd();
ddVar.f897f = "https://api.login.yahoo.com/oauth2/device_session";
ddVar.f898g = C1699a.kPost;
ddVar.mo16403a("Content-Type", "application/json");
ddVar.f883b = new JSONObject(b).toString();
ddVar.f885d = new C1725dt();
ddVar.f884c = new C1725dt();
ddVar.f882a = new C1693a<String, String>() {
/* renamed from: a */
public final /* synthetic */ void mo16300a(C1691dd ddVar, Object obj) {
String str = "PrivacyManager";
String str2 = (String) obj;
try {
int i = ddVar.f904m;
if (i == 200) {
JSONObject jSONObject = new JSONObject(str2);
C1744eg.m888a(C1744eg.this, new C1477a(jSONObject.getString("device_session_id"), jSONObject.getLong("expires_in"), C1744eg.this.f1002b));
C1744eg.this.f1002b.callback.success();
return;
}
C1685cy.m769e(str, "Error in getting privacy dashboard url. Error code = ".concat(String.valueOf(i)));
C1744eg.this.f1002b.callback.failure();
} catch (JSONException e) {
C1685cy.m763b(str, "Error in getting privacy dashboard url. ", (Throwable) e);
C1744eg.this.f1002b.callback.failure();
}
}
};
C1675ct.m738a().mo16389a(C1744eg.this, ddVar);
}
});
return;
}
C1685cy.m754a(3, "PrivacyManager", "Waiting for ID provider.");
C1948n.m1229a().f1421g.subscribe(C1744eg.this.f1003d);
} | {
"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 final void mo16236a() throws Exception {
Map b = C1744eg.m890b(C1744eg.this.f1002b);
C1691dd ddVar = new C1691dd();
ddVar.f897f = "https://api.login.yahoo.com/oauth2/device_session";
ddVar.f898g = C1699a.kPost;
ddVar.mo16403a("Content-Type", "application/json");
ddVar.f883b = new JSONObject(b).toString();
ddVar.f885d = new C1725dt();
ddVar.f884c = new C1725dt();
ddVar.f882a = new C1693a<String, String>() {
/* renamed from: a */
public final /* synthetic */ void mo16300a(C1691dd ddVar, Object obj) {
String str = "PrivacyManager";
String str2 = (String) obj;
try {
int i = ddVar.f904m;
if (i == 200) {
JSONObject jSONObject = new JSONObject(str2);
C1744eg.m888a(C1744eg.this, new C1477a(jSONObject.getString("device_session_id"), jSONObject.getLong("expires_in"), C1744eg.this.f1002b));
C1744eg.this.f1002b.callback.success();
return;
}
C1685cy.m769e(str, "Error in getting privacy dashboard url. Error code = ".concat(String.valueOf(i)));
C1744eg.this.f1002b.callback.failure();
} catch (JSONException e) {
C1685cy.m763b(str, "Error in getting privacy dashboard url. ", (Throwable) e);
C1744eg.this.f1002b.callback.failure();
}
}
};
C1675ct.m738a().mo16389a(C1744eg.this, ddVar);
} | {
"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 final /* synthetic */ void mo16300a(C1691dd ddVar, Object obj) {
String str = "PrivacyManager";
String str2 = (String) obj;
try {
int i = ddVar.f904m;
if (i == 200) {
JSONObject jSONObject = new JSONObject(str2);
C1744eg.m888a(C1744eg.this, new C1477a(jSONObject.getString("device_session_id"), jSONObject.getLong("expires_in"), C1744eg.this.f1002b));
C1744eg.this.f1002b.callback.success();
return;
}
C1685cy.m769e(str, "Error in getting privacy dashboard url. Error code = ".concat(String.valueOf(i)));
C1744eg.this.f1002b.callback.failure();
} catch (JSONException e) {
C1685cy.m763b(str, "Error in getting privacy dashboard url. ", (Throwable) e);
C1744eg.this.f1002b.callback.failure();
}
} | {
"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: b | static /* synthetic */ Map m890b(Request request) {
HashMap hashMap = new HashMap();
hashMap.put("device_verifier", request.verifier);
HashMap hashMap2 = new HashMap();
C1543ak a = C1948n.m1229a().f1421g.mo16243a();
String str = (String) a.mo16260a().get(C1544al.AndroidAdvertisingId);
if (str != null) {
hashMap2.put("gpaid", str);
}
String str2 = (String) a.mo16260a().get(C1544al.DeviceId);
if (str2 != null) {
hashMap2.put("andid", str2);
}
hashMap.putAll(hashMap2);
HashMap hashMap3 = new HashMap();
byte[] bytes = ((String) C1948n.m1229a().f1421g.mo16243a().mo16260a().get(C1544al.AndroidInstallationId)).getBytes();
if (bytes != null) {
hashMap3.put("flurry_guid", C1734dz.m868a(bytes));
}
hashMap3.put("flurry_project_api_key", C1948n.m1229a().f1422h.f444a);
hashMap.putAll(hashMap3);
Context context = request.context;
HashMap hashMap4 = new HashMap();
hashMap4.put("src", "flurryandroidsdk");
hashMap4.put("srcv", "12.3.0");
hashMap4.put("appsrc", context.getPackageName());
C1601bl.m537a();
hashMap4.put("appsrcv", C1601bl.m538a(context));
hashMap.putAll(hashMap4);
return hashMap;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo2508a(bxb bxb);",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n public void b() {\n }",
"public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }",
"@Override\n\tpublic void b2() {\n\t\t\n\t}",
"v... | [
"0.64558864",
"0.6283203",
"0.6252635",
"0.6250949",
"0.6244743",
"0.6216273",
"0.6194491",
"0.6193556",
"0.61641675",
"0.6140157",
"0.60993093",
"0.60974354",
"0.6077849",
"0.6001867",
"0.5997364",
"0.59737104",
"0.59737104",
"0.5905105",
"0.5904295",
"0.58908087",
"0.588663... | 0.0 | -1 |
/ renamed from: a | static /* synthetic */ void m888a(C1744eg egVar, final C1477a aVar) {
Context a = C1576b.m502a();
if (C1740ed.m881a(a)) {
C1740ed.m880a(a, new Builder().setShowTitle(true).build(), Uri.parse(aVar.f311a.toString()), new C1741a() {
/* renamed from: a */
public final void mo16453a(Context context) {
C1744eg.m891b(context, aVar);
}
});
} else {
m891b(a, aVar);
}
} | {
"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 final void mo16453a(Context context) {
C1744eg.m891b(context, aVar);
} | {
"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 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == android.R.id.home) {
// finish the activity
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ... | [
"0.7904163",
"0.7805678",
"0.7766155",
"0.77271765",
"0.7631901",
"0.76217514",
"0.75843245",
"0.7530648",
"0.74879694",
"0.74575084",
"0.74575084",
"0.7438342",
"0.742121",
"0.7402876",
"0.7391506",
"0.7386729",
"0.7379215",
"0.73702943",
"0.7361895",
"0.7355702",
"0.7345358... | 0.0 | -1 |
Gets the user selection. | public Object getSelection() {
return selection;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String selection() {\n return inputter.selection();\n }",
"Object getSelection();",
"public String getMySelection() {\n return mySelection;\n }",
"public int getSelection() {\n \tcheckWidget();\n \treturn selection;\n }",
"private int getMenuSelection() {\n return view.pri... | [
"0.7577155",
"0.7547325",
"0.75290555",
"0.73267025",
"0.72263676",
"0.717246",
"0.70799875",
"0.7015617",
"0.7007368",
"0.6991571",
"0.6960969",
"0.6904642",
"0.6891601",
"0.688782",
"0.685879",
"0.6809064",
"0.68031985",
"0.67412657",
"0.67332333",
"0.6725825",
"0.6723808",... | 0.7275104 | 4 |
Returns the number of days in the year | private static int getDaysInYear(final int year) {
return LocalDate.ofYearDay(year, 1).lengthOfYear();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static int getDaysSinceNewYear() {\n\t\tGregorianCalendar now = new GregorianCalendar();\n\n\t\treturn now.get(GregorianCalendar.DAY_OF_YEAR);\n\t}",
"public int lengthOfYear() {\n\n return this.isLeapYear() ? 366 : 365;\n\n }",
"public int absoluteNumberOfDays() {\n\t\tint thisYear, priorYea... | [
"0.80261225",
"0.74245965",
"0.72997874",
"0.72007537",
"0.7083857",
"0.70828694",
"0.69454026",
"0.69217193",
"0.69182",
"0.6909421",
"0.6894262",
"0.6882045",
"0.6796799",
"0.67583543",
"0.67087156",
"0.66571677",
"0.6621036",
"0.66028756",
"0.65878433",
"0.65794045",
"0.65... | 0.8272475 | 0 |
Generates an array of dates starting on the first day of every month in the specified year | public static LocalDate[] getFirstDayMonthly(final int year) {
LocalDate[] list = new LocalDate[12];
for (int i = 1; i <= 12; i++) {
list[i - 1] = getFirstDayOfTheMonth(i, year);
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Date getStartDateByMonth(int month, int year) {\n\n\t\tCalendar c = Calendar.getInstance();\n\t\tc.set(year, month, 1);\n\n\t\treturn c.getTime();\n\t}",
"private static LocalDate getFirstDayOfTheMonth(final int month, final int year) {\n return LocalDate.of(year, month, 1);\n }",
"publ... | [
"0.6593015",
"0.6220673",
"0.60685587",
"0.5927799",
"0.5816513",
"0.56505376",
"0.558204",
"0.55430984",
"0.55430967",
"0.5520127",
"0.54416615",
"0.5429537",
"0.5429177",
"0.54284126",
"0.54103553",
"0.54099774",
"0.5381449",
"0.53737",
"0.5349414",
"0.53473586",
"0.5294574... | 0.7630121 | 0 |
Returns a leveled date representing the first day of the month based on a specified date. | public static LocalDate getFirstDayOfTheMonth(final LocalDate date) {
return date.with(TemporalAdjusters.firstDayOfMonth());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Date firstDay(final Date date) {\n final Calendar cal = new GregorianCalendar();\n cal.setTime(date);\n cal.set(Calendar.DAY_OF_MONTH, cal.getMinimum(Calendar.DAY_OF_MONTH));\n cal.set(Calendar.HOUR_OF_DAY, 00);\n cal.set(Calendar.MINUTE, 00);\n cal.set(Calen... | [
"0.75321275",
"0.7388828",
"0.73239344",
"0.71968246",
"0.70351255",
"0.6922088",
"0.691377",
"0.67781615",
"0.6685803",
"0.6623662",
"0.6292588",
"0.6241676",
"0.620883",
"0.61861265",
"0.6147559",
"0.61369914",
"0.6119136",
"0.6025886",
"0.60064703",
"0.6003271",
"0.5981",
... | 0.81831765 | 0 |
Returns a date representing the first day of the month | private static LocalDate getFirstDayOfTheMonth(final int month, final int year) {
return LocalDate.of(year, month, 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static WithAdjuster firstDayOfMonth() {\n\n return Impl.FIRST_DAY_OF_MONTH;\n }",
"public static LocalDate getFirstDayOfTheMonth(final LocalDate date) {\n return date.with(TemporalAdjusters.firstDayOfMonth());\n }",
"public static Date firstDayMonth(){\n String rep_inicio_de_mes = ... | [
"0.80644125",
"0.8028952",
"0.79197186",
"0.77419764",
"0.7628017",
"0.7494616",
"0.74769855",
"0.6905836",
"0.6847664",
"0.67897916",
"0.6788741",
"0.67770225",
"0.6749359",
"0.6745894",
"0.64418095",
"0.6371486",
"0.6367459",
"0.6363987",
"0.6308531",
"0.62919426",
"0.61620... | 0.73173285 | 7 |
Returns an array of the starting date of each quarter in a year | public static LocalDate[] getFirstDayQuarterly(final int year) {
LocalDate[] bounds = new LocalDate[4];
bounds[0] = LocalDate.of(year, Month.JANUARY, 1);
bounds[1] = LocalDate.of(year, Month.APRIL, 1);
bounds[2] = LocalDate.of(year, Month.JULY, 1);
bounds[3] = LocalDate.of(year, Month.OCTOBER, 1);
return bounds;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ArrayList<String> createDate(String quarter, String year) {\r\n\t\tArrayList<String> date = new ArrayList<>();\r\n\t\tString startDate = \"\";\r\n\t\tString endDate = \"\";\r\n\t\tif (quarter.equals(\"January - March\")) {\r\n\t\t\tstartDate = year + \"-01-01\";\r\n\t\t\tendDate = year + \"-03-31\";\r\n\t\t... | [
"0.6837665",
"0.6440035",
"0.6115472",
"0.58956265",
"0.5787264",
"0.5681846",
"0.56300324",
"0.5595777",
"0.55634975",
"0.54175776",
"0.54152477",
"0.5396989",
"0.53451395",
"0.53233916",
"0.52697724",
"0.51749015",
"0.5148276",
"0.51449406",
"0.5132057",
"0.51147234",
"0.51... | 0.7441198 | 0 |
Returns an array of Dates starting with the first day of each week of the year. | public static LocalDate[] getFirstDayWeekly(final int year) {
final List<LocalDate> dates = new ArrayList<>();
LocalDate localDate = LocalDate.ofYearDay(year, 1).with(TemporalAdjusters.previousOrSame(DayOfWeek.SUNDAY));
final LocalDate testDate = LocalDate.ofYearDay(year, 1);
if (testDate.getDayOfWeek() == DayOfWeek.THURSDAY) {
dates.add(testDate.minusDays(4));
}
for (int i = 0; i <= 53; i++) {
if (localDate.getYear() == year) {
dates.add(localDate);
}
localDate = localDate.plusWeeks(1);
}
return dates.toArray(new LocalDate[dates.size()]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Date[] getCurrentWeekInDates(){\n\t\t Date FromDate=new Date();\n\t\t Date ToDate=new Date();\n\n\t\t int i = 1; \n\t\t while(i <= 7){\n\t\t \n\t\t Date CurDate = DateUtils.addDays(new Date(), i * (-1));\n\t\t \n\t\t Calendar cal = Calendar.getInstance();\n\t\t cal.setTime(CurDate);\n\t... | [
"0.69653964",
"0.6417955",
"0.6301556",
"0.627542",
"0.6089209",
"0.5769418",
"0.57183844",
"0.57137966",
"0.56951994",
"0.5692605",
"0.5689317",
"0.5689264",
"0.5626318",
"0.55737686",
"0.557118",
"0.55355054",
"0.5506894",
"0.54938173",
"0.5460596",
"0.5452273",
"0.53821415... | 0.8078503 | 0 |
Returns an array of every day in a given year | public static LocalDate[] getAllDays(final int year) {
final List<LocalDate> dates = new ArrayList<>();
for (int i = 1; i <= getDaysInYear(year); i++) {
dates.add(LocalDate.ofYearDay(year, i));
}
return dates.toArray(new LocalDate[dates.size()]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Integer> getByYearDay() {\n\t\treturn byYearDay;\n\t}",
"private static int getDaysInYear(final int year) {\n return LocalDate.ofYearDay(year, 1).lengthOfYear();\n }",
"public String[] getYearVals() {\n if (yearVals == null) {\n yearVals = new String[numYearVals];\n int year ... | [
"0.7129196",
"0.6579085",
"0.6375438",
"0.6236582",
"0.6206846",
"0.60708576",
"0.6044765",
"0.59897083",
"0.59715724",
"0.59027785",
"0.58806944",
"0.586765",
"0.58661616",
"0.5862424",
"0.5861253",
"0.58456093",
"0.58426785",
"0.58365154",
"0.5806588",
"0.5793836",
"0.57933... | 0.7233887 | 0 |
Returns date representing the last day of the month given a specified date. | public static LocalDate getLastDayOfTheMonth(@NotNull final LocalDate date) {
Objects.requireNonNull(date);
return date.with(TemporalAdjusters.lastDayOfMonth());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Date lastDay(final Date date) {\n final Calendar cal = new GregorianCalendar();\n cal.setTime(date);\n cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));\n cal.set(Calendar.HOUR_OF_DAY, 23);\n cal.set(Calendar.MINUTE, 59);\n cal.set(... | [
"0.72900873",
"0.72574407",
"0.7204908",
"0.7182686",
"0.705375",
"0.6819638",
"0.64489704",
"0.63886595",
"0.6388215",
"0.6295909",
"0.6248745",
"0.6210035",
"0.58960027",
"0.586873",
"0.57835925",
"0.5686672",
"0.5670623",
"0.5663281",
"0.5653665",
"0.5647529",
"0.5631189",... | 0.8381996 | 0 |
Generates an array of dates ending on the last day of every month between the start and stop dates. | public static List<LocalDate> getLastDayOfTheMonths(final LocalDate startDate, final LocalDate endDate) {
final ArrayList<LocalDate> list = new ArrayList<>();
final LocalDate end = DateUtils.getLastDayOfTheMonth(endDate);
LocalDate t = DateUtils.getLastDayOfTheMonth(startDate);
/*
* add a month at a time to the previous date until all of the months
* have been captured
*/
while (before(t, end)) {
list.add(t);
t = t.plusMonths(1);
t = t.with(TemporalAdjusters.lastDayOfMonth());
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String[] getLast30Dates() {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tString[] dates = new String[30];\n\t\tfor (int i=29; i>=0; i-- ) {\n\t\t\tdates[i] = String.valueOf(calendar.get(Calendar.MONTH)+1) + \"/\" + \n\t\t\t\t\tString.valueOf(calendar.get(Calendar.DATE)) + \"/\" + \n\t\t\t\t\tStrin... | [
"0.6190124",
"0.61498815",
"0.60751617",
"0.60448915",
"0.58002216",
"0.5728688",
"0.5722041",
"0.56976676",
"0.5677121",
"0.5539371",
"0.55242103",
"0.54745436",
"0.534904",
"0.53485554",
"0.5333677",
"0.53193575",
"0.52972174",
"0.5251373",
"0.5244991",
"0.52426267",
"0.523... | 0.6985358 | 0 |
Generates an array of dates starting on the first day of every month between the start and stop dates. | public static List<LocalDate> getFirstDayOfTheMonths(final LocalDate startDate, final LocalDate endDate) {
final ArrayList<LocalDate> list = new ArrayList<>();
final LocalDate end = DateUtils.getFirstDayOfTheMonth(endDate);
LocalDate t = DateUtils.getFirstDayOfTheMonth(startDate);
/*
* add a month at a time to the previous date until all of the months
* have been captured
*/
while (before(t, end)) {
list.add(t);
t = t.with(TemporalAdjusters.firstDayOfNextMonth());
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static LocalDate[] getFirstDayMonthly(final int year) {\n LocalDate[] list = new LocalDate[12];\n for (int i = 1; i <= 12; i++) {\n list[i - 1] = getFirstDayOfTheMonth(i, year);\n }\n return list;\n }",
"@WebMethod public Vector<Date> getEventsMonth(Date date);",
... | [
"0.61604005",
"0.5776861",
"0.57631457",
"0.5757386",
"0.5738047",
"0.57122684",
"0.57090425",
"0.56740636",
"0.5630741",
"0.5619464",
"0.55769056",
"0.5545084",
"0.55393714",
"0.54948634",
"0.5466563",
"0.54369664",
"0.5406322",
"0.5387011",
"0.5383502",
"0.53619695",
"0.534... | 0.6812282 | 0 |
Returns an array of quarter bound dates of the year based on a specified date. The order is q1s, q1e, q2s, q2e, q3s, q3e, q4s, q4e. | private static LocalDate[] getQuarterBounds(final LocalDate date) {
Objects.requireNonNull(date);
final LocalDate[] bounds = new LocalDate[8];
bounds[0] = date.with(TemporalAdjusters.firstDayOfYear());
bounds[1] = date.withMonth(Month.MARCH.getValue()).with(TemporalAdjusters.lastDayOfMonth());
bounds[2] = date.withMonth(Month.APRIL.getValue()).with(TemporalAdjusters.firstDayOfMonth());
bounds[3] = date.withMonth(Month.JUNE.getValue()).with(TemporalAdjusters.lastDayOfMonth());
bounds[4] = date.withMonth(Month.JULY.getValue()).with(TemporalAdjusters.firstDayOfMonth());
bounds[5] = date.withMonth(Month.SEPTEMBER.getValue()).with(TemporalAdjusters.lastDayOfMonth());
bounds[6] = date.withMonth(Month.OCTOBER.getValue()).with(TemporalAdjusters.firstDayOfMonth());
bounds[7] = date.with(TemporalAdjusters.lastDayOfYear());
return bounds;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static LocalDate[] getFirstDayQuarterly(final int year) {\n LocalDate[] bounds = new LocalDate[4];\n\n bounds[0] = LocalDate.of(year, Month.JANUARY, 1);\n bounds[1] = LocalDate.of(year, Month.APRIL, 1);\n bounds[2] = LocalDate.of(year, Month.JULY, 1);\n bounds[3] = LocalDa... | [
"0.70869124",
"0.7044697",
"0.6606713",
"0.64243406",
"0.6016798",
"0.5591664",
"0.526945",
"0.5184907",
"0.51356715",
"0.51328427",
"0.5050903",
"0.48951346",
"0.48737985",
"0.48504257",
"0.48465317",
"0.48403475",
"0.48376346",
"0.48227942",
"0.48046798",
"0.4803181",
"0.47... | 0.7735749 | 0 |
Returns the number of the quarter (i.e. 1, 2, 3 or 4) based on a specified date. | public static int getQuarterNumber(final LocalDate date) {
Objects.requireNonNull(date);
int result;
LocalDate[] bounds = getQuarterBounds(date);
if (date.compareTo(bounds[2]) < 0) {
result = 1;
} else if (date.compareTo(bounds[4]) < 0) {
result = 2;
} else if (date.compareTo(bounds[6]) < 0) {
result = 3;
} else {
result = 4;
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getQuarter () {\n return NQuarter;\n }",
"public String getQuarter() {\r\n return quarter;\r\n }",
"public Integer getQuarter() {\r\n return QTR;\r\n }",
"public int findNumQuarters(int numMonths) {\n setNumQuarters(0);\n double months = numMonths;\n ... | [
"0.69293314",
"0.63481504",
"0.62872094",
"0.6004151",
"0.5966898",
"0.5927141",
"0.56040406",
"0.552104",
"0.5356046",
"0.5310299",
"0.52290046",
"0.515819",
"0.50744337",
"0.50650126",
"0.50018466",
"0.49893132",
"0.49590367",
"0.4953408",
"0.49524376",
"0.49143043",
"0.488... | 0.81861544 | 0 |
Returns the numerical week of the year given a date. Minimal days of week is set to 4 to comply with ISO 8601 | public static int getWeekOfTheYear(final LocalDate dateOfYear) {
return dateOfYear.get(WeekFields.of(Locale.getDefault()).weekOfWeekBasedYear());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getWeekOfYear() {\r\n return this.weekOfYear;\r\n }",
"public int getWeekOfYear()\r\n\t{\r\n\t\tint weekdayJan1 = Utils.getFirstDayOfWeekForYear(this.year);\r\n\t\tint[] offsetsToWeek0 = { 6, 7, 8, 9, 10, 4, 5 };\r\n\t\tint offsetToWeek0 = offsetsToWeek0[weekdayJan1];\r\n\t\tint thisDoy = th... | [
"0.6734694",
"0.6676494",
"0.66315335",
"0.6577509",
"0.6489245",
"0.64587855",
"0.644769",
"0.64046",
"0.63642",
"0.631408",
"0.62582576",
"0.6182672",
"0.6091586",
"0.6069891",
"0.60261714",
"0.60077673",
"0.59880877",
"0.5969778",
"0.5967373",
"0.5956431",
"0.5946776",
"... | 0.7302948 | 0 |
Listar todos os carros do banco de dados. | public List<Carro> getCarros(){
try {
List<Carro> carros = db.getCarros();
return carros;
} catch(SQLException ex) {
ex.printStackTrace();
return new ArrayList<>();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void listaContatos() throws SQLException {\n limpaCampos();\n BdLivro d = new BdLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\");\n\n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n ... | [
"0.76904017",
"0.768048",
"0.75534886",
"0.72787327",
"0.7263193",
"0.7187612",
"0.71855",
"0.71300143",
"0.7091477",
"0.70878196",
"0.7074374",
"0.70355844",
"0.7018985",
"0.69908035",
"0.6936479",
"0.6889757",
"0.6886833",
"0.68394923",
"0.68373245",
"0.6801198",
"0.6789886... | 0.67383844 | 24 |
Buscar um carro pelo id. | public Carro getCarro(Long id){
try {
return db.getCarroById(id);
} catch(SQLException ex) {
ex.printStackTrace();
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public Assunto buscarId(int id) {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"SELECT a FROM Assunto a WHERE a.id =:id\");\r\n query.setParameter(\"id\", id);\r\n \r\n List<Assunto> assunto = query.getResultList();... | [
"0.7698142",
"0.7350386",
"0.7344988",
"0.7281977",
"0.7271279",
"0.7263124",
"0.7194341",
"0.7151999",
"0.7072825",
"0.70268136",
"0.7003178",
"0.6992024",
"0.69861853",
"0.691353",
"0.69037336",
"0.688855",
"0.6882857",
"0.6857848",
"0.68424994",
"0.6840178",
"0.68169636",
... | 0.6326987 | 100 |
Deletar um carro pelo id. | public boolean delete(Long id){
try {
return db.delete(id);
} catch(SQLException ex) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deletar(Integer id) {\n\t\t\n\t}",
"void deletar(Long id);",
"void eliminar(Long id);",
"void unsetId();",
"void deletById(Integer id);",
"@Override\n\tpublic void eliminar(Integer id) {\n\t\t\n\t}",
"@Override\n\tpublic void eliminar(Integer id) {\n\t\t\n\t}",
"@Override\r\n\tpublic void... | [
"0.7976814",
"0.7919194",
"0.7392562",
"0.72985476",
"0.7216839",
"0.7191326",
"0.7191326",
"0.7189509",
"0.7173158",
"0.71274424",
"0.7089937",
"0.7083176",
"0.70317316",
"0.70077074",
"0.70068634",
"0.699624",
"0.6991805",
"0.6983663",
"0.6959745",
"0.6959745",
"0.69495",
... | 0.0 | -1 |
Salvar ou atualizar um carro pelo id. | public boolean save(Carro carro){
try {
db.save(carro);
return true;
} catch(SQLException ex) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void salvaRisposta(Risposta risposta) {\n\t\tint lastID = getLastIDRisposte()+1;\n\t\trisposta.setId(lastID);\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"risposte\");\n\t\tlong hash = (long) risposta.getId().hashCode();\n\t\trisposte.put(hash, risposta);\n\t\tdb.co... | [
"0.6563016",
"0.65339303",
"0.6428742",
"0.63590795",
"0.63590795",
"0.63590795",
"0.63590795",
"0.63588786",
"0.6309773",
"0.6300472",
"0.62823117",
"0.62713194",
"0.6271114",
"0.62530476",
"0.6242997",
"0.6238322",
"0.6189765",
"0.6187886",
"0.616165",
"0.6126983",
"0.61251... | 0.0 | -1 |
Buscar um carro pelo nome. | public List<Carro> findByName(String name){
try {
return db.findByName(name);
} catch(SQLException ex) {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Vendedor buscarVendedorPorNome(String nome);",
"@Override\n\tpublic Contato buscaContatoNome(String nome) {\n\t\treturn null;\n\t}",
"public Assunto buscar(String nome){\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"SELECT a FROM Assunto a WH... | [
"0.7282873",
"0.70373744",
"0.6847783",
"0.6752122",
"0.65184",
"0.64735466",
"0.64669025",
"0.6419459",
"0.6403163",
"0.62834007",
"0.6257117",
"0.6243344",
"0.61714995",
"0.61595666",
"0.61472106",
"0.6146145",
"0.6131176",
"0.60974133",
"0.60959435",
"0.60735804",
"0.60652... | 0.0 | -1 |
Buscar um carro pelo nome. | public List<Carro> findByTipo(String tipo){
try {
return db.findByTipo(tipo);
} catch(SQLException ex) {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Vendedor buscarVendedorPorNome(String nome);",
"@Override\n\tpublic Contato buscaContatoNome(String nome) {\n\t\treturn null;\n\t}",
"public Assunto buscar(String nome){\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"SELECT a FROM Assunto a WH... | [
"0.7282645",
"0.7037103",
"0.6847401",
"0.6751897",
"0.6518455",
"0.64740527",
"0.64668214",
"0.641924",
"0.64037746",
"0.62834",
"0.62566227",
"0.6243067",
"0.61715096",
"0.6160264",
"0.6147388",
"0.6146255",
"0.61306095",
"0.6097603",
"0.6095744",
"0.6073725",
"0.6065939",
... | 0.0 | -1 |
Gets the modifiers for this type. | public T getModifiers()throws ClassCastException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ModifierMirror getModifiers() {\n\t\treturn modifiers;\n\t}",
"public Modifier<Document, Document>[] getModifiers() {\n\t\treturn this.modifiers;\n\t}",
"public Modifiers getModifiers() {\n return (Modifiers)getChild(0);\n }",
"public byte getModifier(){\r\n\t\treturn modifiers;\r\n\t}",
"public... | [
"0.7980577",
"0.77725804",
"0.76381284",
"0.7522628",
"0.74382555",
"0.72514427",
"0.72514427",
"0.7113728",
"0.7113728",
"0.7113728",
"0.7113728",
"0.7113728",
"0.7113728",
"0.7113728",
"0.70732975",
"0.70510536",
"0.6835619",
"0.6835619",
"0.6835619",
"0.6835619",
"0.683561... | 0.6805982 | 22 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.